NiCMidi 1.1.0
A MIDI library derived from J.D.Koftinoff jdksmidi
|
An enhanced MIDISequencer, able to directly load and play MIDI files and many more. More...
#include <advancedsequencer.h>
Public Member Functions | |
AdvancedSequencer (MIDISequencerGUINotifier *n=0) | |
Creates an AdvancedSequencer with 17 tracks (one for each channel plus the master track). More... | |
AdvancedSequencer (MIDIMultiTrack *mlt, MIDISequencerGUINotifier *n=0) | |
Creates an AdvancedSequencer from a given MIDIMultiTrack. More... | |
virtual | ~AdvancedSequencer () |
The destructor. More... | |
virtual void | Reset () |
Resets the status of the sequencer (does not empty the MIDIMultiTrack). More... | |
virtual bool | Load (const char *fname) |
Loads a MIDIFile into the internal MIDIMultiTrack. More... | |
virtual bool | Load (const MIDIMultiTrack *tracks) |
Copies the content of an external MIDIMultiTrack into the sequencer. More... | |
virtual void | UnLoad () |
Clears the contents of the internal MIDIMultiTrack. More... | |
bool | IsLoaded () const |
Returns true if the internal MIDIMultiTrack is not empty. More... | |
std::string | GetFileName () |
Returns the name of the loaded file (or an empty string if it is not yet defined). More... | |
const MIDIFileHeader & | GetFileHeader () |
Returns the header of the loaded file. More... | |
MIDIThru * | GetMIDIThru () |
Returns the address of the MIDIThru tick component. More... | |
const MIDIThru * | GetMIDIThru () const |
Returns a pointer to the MIDIThru tick component. More... | |
bool | GetMIDIThruEnable () const |
Returns true if MIDIThru is enabled (always false if the thru is not present). More... | |
int | GetMIDIThruChannel () const |
Returns the output channel of the MIDIThru, -1 if the thru is not present. More... | |
int | GetMIDIThruTranspose () const |
Returns the transpose amount of the MIDIThru, 0 if the thru is not present. More... | |
bool | GetSoloMode () const |
Returns true if any track is soloed. More... | |
bool | GetTrackSolo (unsigned int trk_num) const |
Returns true if a specific track is soloed. More... | |
bool | GetTrackMute (unsigned int trk_num) const |
Returns true if a specific track is muted. More... | |
int | GetNumMeasures () const |
Returns the number of measures of the loaded song. More... | |
unsigned int | GetCurrentMeasure () const |
Returns the current measure number (first is 0). See Numbering conventions. More... | |
unsigned int | GetCurrentBeat () const |
Returns the number of current beat (first is 0). See Numbering conventions. More... | |
MIDIClockTime | GetCurrentBeatOffset () const |
Returns the current MIDI time offset respect current beat. More... | |
int | GetTimeSigNumerator () const |
Returns the numerator of current time signature. More... | |
int | GetTimeSigDenominator () const |
Returns the denominator of current time signature. More... | |
int | GetKeySigSharpsFlats () const |
Return the number of sharps or flats of the current key signature. More... | |
int | GetKeySigMode () const |
Returns the mode (major/minor) of the he current key signature. More... | |
std::string | GetCurrentMarker () const |
Returns the current marker text. More... | |
std::string | GetTrackName (unsigned int trk_num) const |
Returns the name of the given track. More... | |
int | GetTrackVolume (unsigned int trk_num) const |
Returns the current MIDI volume for the given track (-1 if volume wasn't set at time 0). More... | |
int | GetTrackProgram (unsigned int trk_num) const |
Returns the current MIDI program (patch) for the given track (-1 if the program wasn't set at time 0). More... | |
int | GetTrackNoteCount (unsigned int trk_num) const |
Returns the number of notes currently sounding on the given track (0 if the sequencer is not playing). More... | |
unsigned int | GetTrackVelocityScale (unsigned int trk_num) const |
Returns the velocity scale percentage for the given track. More... | |
int | GetTrackRechannelize (unsigned int trk_num) const |
Returns the rechannelized channel for the given track (-1 if the track is not rechannelized). More... | |
int | GetTrackChannel (unsigned int trk_num) |
If the track has channel messages all with same channel returns the channel, otherwise -1. More... | |
int | GetTrackTranspose (unsigned int trk_num) const |
Returns the transposing amount in semitones for the given track. More... | |
int | GetTrackTimeShift (unsigned int trk_num) const |
Returns the time offset (in MIDI ticks) assigned to the given track. More... | |
MIDISequencerTrackProcessor * | GetTrackProcessor (unsigned int trk_num) |
Returns a pointer to the MIDISequencerTrackProcessor for the given track. More... | |
const MIDISequencerTrackProcessor * | GetTrackProcessor (unsigned int trk_num) const |
Returns a pointer to the MIDISequencerTrackProcessor for the given track. More... | |
void | SetFileName (std::string &fname) |
Sets a name for the content of sequencer. More... | |
bool | SetMIDIThruEnable (bool on_off) |
Enables or disables the embedded MIDIthru. More... | |
bool | SetMIDIThruChannel (int chan) |
Sets the out channel for MIDIthru. More... | |
bool | SetMIDIThruTranspose (int amt) |
Sets a transpose amount in semitones for the messages coming from the MIDIThru. More... | |
bool | SetTrackSolo (unsigned int trk_num) |
Soloes the given track muting all others. More... | |
void | UnSoloTrack () |
Unsoloes the soloed track unmuting all others. More... | |
bool | SetTrackMute (unsigned int trk_num, bool f) |
Mutes/unmutes the given track (it has no effect on others). More... | |
void | UnmuteAllTracks () |
Unmutes all muted tracks (this has no effect on tracks muted by SoloTrack()). More... | |
bool | SetTrackVelocityScale (unsigned int trk_num, unsigned int scale) |
Sets a track velocity scale in percentage for the given track. More... | |
bool | SetTrackRechannelize (unsigned int trk_num, int chan) |
Redirects all channel messages in the track on the given channel. More... | |
bool | SetTrackTranspose (unsigned int trk_num, int amt) |
Sets a transpose amount in semitones for the given track. More... | |
virtual void | GoToZero () |
Sets the current time to the beginning of the song. More... | |
virtual bool | GoToTime (MIDIClockTime time_clk) |
Sets the current time to the given MIDI time. More... | |
virtual bool | GoToTimeMs (float time_ms) |
Same as GoToTime(), but the time is given in milliseconds. More... | |
virtual bool | GoToMeasure (int measure, int beat=0) |
Sets the current time to the given measure and beat. More... | |
virtual void | Start () |
Starts the sequencer playing from the current time. More... | |
virtual void | Stop () |
Stops the sequencer playing. More... | |
void | OutputMessage (MIDITimedMessage &msg, unsigned int port) |
Sends a given MIDI message to an hardware port. More... | |
bool | SetSMPTE (SMPTE *s) |
Sets the parameters of the given SMPTE according to the loaded content. More... | |
virtual void | UpdateStatus () |
This should be used to update the sequencer internal parameters after editing the multitrack. More... | |
![]() | |
MIDISequencer (MIDIMultiTrack *m, MIDISequencerGUINotifier *n=0) | |
The constructor. More... | |
virtual | ~MIDISequencer () |
The destructor. More... | |
MIDIClockTime | GetCurrentMIDIClockTime () const |
Returns current MIDIClockTime in MIDI ticks; it is effective even during playback. More... | |
float | GetCurrentTimeMs () const |
Returns current time in milliseconds; it is effective even during playback. More... | |
unsigned int | GetCurrentMeasure () const |
Returns current measure (1st measure is 0). More... | |
unsigned int | GetCurrentBeat () const |
Returns current beat in the measure (1st beat is 0). More... | |
MIDIClockTime | GetCurrentBeatOffset () const |
Returns the current MIDI time offset respect to current beat. More... | |
unsigned int | GetClksPerBeat () const |
Returns the base MIDI ticks per beat ratio of the internal MIDIMultiTrack. More... | |
MIDIMultiTrack * | GetMultiTrack () |
Returns a pointer to the internal MIDIMultiTrack. More... | |
const MIDIMultiTrack * | GetMultiTrack () const |
Returns a pointer to the internal MIDIMultiTrack. More... | |
MIDITrack * | GetTrack (unsigned int trk_num) |
Returns a pointer to the given track, or 0 if _num_trk is not a valid number. More... | |
unsigned int | GetNumTracks () const |
Returns the number of tracks of the multitrack. More... | |
unsigned int | GetTempoScale () const |
Returns current tempo scale in percentage (100 = no scaling, 200 = twice faster, etc.). More... | |
float | GetTempoWithoutScale () const |
Returns current tempo (BPM) without scaling. More... | |
float | GetTempoWithScale () const |
Returns current tempo (BPM) taking into account scaling (this is the true actual tempo). More... | |
bool | GetRepeatPlay () const |
Returns the repeat play (loop) status on/off. More... | |
unsigned int | GetRepeatPlayStart () const |
Returns the repeat play (loop) start measure. More... | |
unsigned int | GetRepeatPlayEnd () const |
Returns the repeat play (loop) end measure. More... | |
bool | GetCountInEnable () const |
Returns true if the count in is enabled. More... | |
bool | GetCountInPending () const |
Returns true if the count in is pending (the sequencer is counting in). More... | |
bool | GetTimeShiftMode () const |
Returns the time shift mode (on or off). More... | |
MIDISequencerState * | GetState () |
Returns a pointer to the current MIDISequencerState (i.e. More... | |
const MIDISequencerState * | GetState () const |
Returns a pointer to the current MIDISequencerState (i.e. More... | |
bool | GetPlayMode () |
Returns the play mode state (see SetPlayMode()). More... | |
MIDISequencerTrackState * | GetTrackState (unsigned int trk_num) |
Returns a pointer to the MIDISequencerTrackState for a track. More... | |
const MIDISequencerTrackState * | GetTrackState (unsigned int trk_num) const |
Returns a pointer to the MIDISequencerTrackState for a track. More... | |
unsigned int | GetTrackOutPort (unsigned int trk_num) const |
Returns the number of the out port assigned to a track. More... | |
MIDIProcessor * | GetTrackProcessor (unsigned int trk_num) |
Returns a pointer to the MIDISequencerTrackProcessor for a track. More... | |
const MIDIProcessor * | GetTrackProcessor (unsigned int trk_num) const |
Returns a pointer to the MIDISequencerTrackProcessor for a track. More... | |
int | GetTrackTimeShift (unsigned int trk_num) const |
Returns the time offset (in MIDI ticks) assigned to a track. More... | |
virtual bool | SetRepeatPlay (int on_off, int start_meas=-1, int end_meas=-1) |
Sets the repeat play (loop) parameters: you can set the repeat play status on/off, the start and the end measure. More... | |
virtual void | SetCountIn (bool on_off) |
Sets the count in enable or disable. More... | |
virtual bool | SetTempoScale (unsigned int scale) |
Sets the global tempo scale. More... | |
virtual void | SetTimeShiftMode (bool f) |
Sets the time shifting of events on and off. More... | |
virtual void | SetState (MIDISequencerState *s) |
Copies a given MIDISequencerState into the internal sequencer state. More... | |
virtual void | SetPlayMode (int mode) |
Sets the play mode. More... | |
virtual bool | SetTrackOutPort (unsigned int trk_num, unsigned int port) |
Sets the MIDI out port for a track. More... | |
virtual bool | SetTrackProcessor (unsigned int trk_num, MIDIProcessor *p) |
Sets a MIDIProcessor for the given track. More... | |
virtual bool | SetTrackTimeShift (unsigned int trk_num, int offset) |
Sets the time shift offset (in MIDI ticks) for a track. More... | |
virtual bool | InsertTrack (int trk_num=-1) |
Inserts into the internal MIDIMultiTrack a new empty track with default track parameters (transpose, time offset, etc.). More... | |
virtual bool | DeleteTrack (int trk_num=-1) |
Deletes a track and all its events from the internal MIDIMultiTrack. More... | |
virtual bool | MoveTrack (int from, int to) |
Moves a track from one position to another in the internal MIDIMultiTrack. More... | |
virtual bool | GoToMeasure (unsigned int measure, unsigned int beat=0) |
Sets the current time to the given measure and beat, updating the internal status. More... | |
virtual bool | GetNextEvent (int *trk_num, MIDITimedMessage *msg) |
Gets the next event (respect current position). More... | |
virtual bool | GetNextEventTime (MIDIClockTime *time_clk) |
Gets the time of the next event (it can be different from current time if at current time there are not events). More... | |
virtual bool | GetNextEventTimeMs (float *time_ms) |
Same of GetNextEventTime(), but time is returned in milliseconds from the beginning. More... | |
float | MIDItoMs (MIDIClockTime time_clk) |
Converts a time from MIDI ticks into milliseconds, taking into account all tempo changes from the beginning of the song to the given time. More... | |
MIDIClockTime | MeasToMIDI (unsigned int meas, unsigned int beat=0, unsigned int offset=0) |
TODO. More... | |
virtual void | Play () |
This is an alias of Start(). More... | |
![]() | |
MIDITickComponent (tPriority pr, MIDITick func) | |
The constructor. More... | |
virtual | ~MIDITickComponent () |
The destructor. More... | |
MIDITick * | GetFunc () const |
Returns the address of the StaticTickProc() method, which will be called by the MIDIManager at every clock tick. More... | |
tPriority | GetPriority () const |
Returns the priority. More... | |
tMsecs | GetDevOffset () const |
Returns the user time offset parameter (see SetDevOffset()). More... | |
bool | IsPlaying () const |
Returns true if the callback procedure is active. More... | |
void | SetDevOffset (tMsecs dev_offs) |
Sets an user defined time offset, which will be added to every time calculation. More... | |
Protected Member Functions | |
void | ExtractWarpPositions () |
Internal use. More... | |
void | CatchEventsBefore () |
Internal use. More... | |
void | CatchEventsBefore (int trk_num) |
Internal use. More... | |
![]() | |
virtual void | TickProc (tMsecs sys_time) |
Implements the pure virtual method inherited from MIDITickComponent (you must not call it directly). More... | |
Additional Inherited Members | |
![]() | |
enum | { FOLLOW_MIDI_TIMESIG_MESSAGE , FOLLOW_TIMESIG_DENOMINATOR , FOLLOW_THEORETIC_VALUE } |
Values for the SetMetronomeMode() method. More... | |
enum | { PLAY_BOUNDED , PLAY_UNBOUNDED } |
Values for the play mode. More... | |
enum | { COUNT_IN_ENABLED = 1 , COUNT_IN_PENDING = 2 , AUTO_STOP_PENDING = 4 } |
Values for count_in_status. More... | |
![]() | |
static void | SetMetronomeMode (int mode) |
Selects the way the sequencer calculates metronome beat. More... | |
![]() | |
static void | StaticTickProc (tMsecs sys_time, void *pt) |
Implements the static method inherited by MIDITickComponent and called at every timer tick. More... | |
static void | StaticStopProc (MIDISequencer *p) |
Internal use for auto stop. More... | |
![]() | |
static void | StaticTickProc (tMsecs sys_time, void *pt) |
This is the static callback procedure which the MIDIManager will call at every MIDITimer tick. More... | |
![]() | |
const MIDITick * | tick_proc |
The pointer to the static callback (set by the constructor to StaticTickProc()). More... | |
tMsecs | dev_time_offset |
A time offset set by the user and which you can use for your calculations. More... | |
tMsecs | sys_time_offset |
The system time of the last call of Start(). More... | |
std::recursive_mutex | proc_lock |
A mutex you can use for implementing thread safe methods. More... | |
An enhanced MIDISequencer, able to directly load and play MIDI files and many more.
These are the improvements:
AdvancedSequencer::AdvancedSequencer | ( | MIDISequencerGUINotifier * | n = 0 | ) |
Creates an AdvancedSequencer with 17 tracks (one for each channel plus the master track).
Adds the sequencer to the MIDIManager queue of tick components, so you can immediately start to edit the MIDIMultiTrack or load MIDI files and play. It raises an exception if in your system there are no MIDI out ports; if in the system there are no MIDI in ports the embedded MIDIThru is not created and its features are disabled.
n | a pointer to a MIDISequencerGUINotifier. If you leave 0 the sequencer will not notify the GUI. |
RtMidiError::INVALID_DEVICE | if in the system are not present MIDI out ports. |
AdvancedSequencer::AdvancedSequencer | ( | MIDIMultiTrack * | mlt, |
MIDISequencerGUINotifier * | n = 0 |
||
) |
Creates an AdvancedSequencer from a given MIDIMultiTrack.
Adds the sequencer to the MIDIManager queue of tick components, so you can immediately start to play. It raises an exception if in your system there are no MIDI out ports; if in the system there are no MIDI in ports the embedded MIDIThru is not created and its features are disabled.
mlt | the MIDIMultiTrack supplied by the user |
n | a pointer to a MIDISequencerGUINotifier. If you leave 0 the sequencer will not notify the GUI. |
RtMidiError::INVALID_DEVICE | if in the system are not present MIDI out ports. |
|
virtual |
The destructor.
|
virtual |
Resets the status of the sequencer (does not empty the MIDIMultiTrack).
Use this if you have modified the MIDIMultiTrack adding, moving or deleting tracks; this moves the time to 0 and resets all the processors.
Reimplemented from MIDISequencer.
|
virtual |
Loads a MIDIFile into the internal MIDIMultiTrack.
It can change the MIDIMultiTrack::clks_per_beat parameter according to the file signature. You can then play the MIDI content with the Play() method.
fname | the file name. |
|
virtual |
Copies the content of an external MIDIMultiTrack into the sequencer.
It can change the MIDIMultiTrack::clks_per_beat parameter according to the multitrack signature. You can then play the MIDI content with the Play() method.
tracks | the MIDIMultiTrack to be copied. |
|
virtual |
Clears the contents of the internal MIDIMultiTrack.
Moreover it resets its MIDIMultiTrack::clks_per_beat parameter to DEFAULT_CLKS_PER_BEAT.
|
inline |
Returns true if the internal MIDIMultiTrack is not empty.
|
inline |
Returns the name of the loaded file (or an empty string if it is not yet defined).
|
inline |
Returns the header of the loaded file.
|
inline |
Returns the address of the MIDIThru tick component.
This is NULL if in the system there are no MIDI in ports and the thru is disabled.
|
inline |
Returns a pointer to the MIDIThru tick component.
This is NULL if in the system there are no MIDI in ports and the thru is disabled.
|
inline |
Returns true if MIDIThru is enabled (always false if the thru is not present).
|
inline |
Returns the output channel of the MIDIThru, -1 if the thru is not present.
|
inline |
Returns the transpose amount of the MIDIThru, 0 if the thru is not present.
bool AdvancedSequencer::GetSoloMode | ( | ) | const |
Returns true if any track is soloed.
|
inline |
Returns true if a specific track is soloed.
trk_num | the number of the track |
|
inline |
Returns true if a specific track is muted.
trk_num | the number of the track |
|
inline |
Returns the number of measures of the loaded song.
unsigned int AdvancedSequencer::GetCurrentMeasure | ( | ) | const |
Returns the current measure number (first is 0). See Numbering conventions.
unsigned int AdvancedSequencer::GetCurrentBeat | ( | ) | const |
Returns the number of current beat (first is 0). See Numbering conventions.
MIDIClockTime AdvancedSequencer::GetCurrentBeatOffset | ( | ) | const |
Returns the current MIDI time offset respect current beat.
int AdvancedSequencer::GetTimeSigNumerator | ( | ) | const |
Returns the numerator of current time signature.
int AdvancedSequencer::GetTimeSigDenominator | ( | ) | const |
Returns the denominator of current time signature.
int AdvancedSequencer::GetKeySigSharpsFlats | ( | ) | const |
Return the number of sharps or flats of the current key signature.
See MIDIMessage::GetKeySigSharpsFlats().
int AdvancedSequencer::GetKeySigMode | ( | ) | const |
Returns the mode (major/minor) of the he current key signature.
See MIDIMessage::GetKeySigMode().
std::string AdvancedSequencer::GetCurrentMarker | ( | ) | const |
Returns the current marker text.
std::string AdvancedSequencer::GetTrackName | ( | unsigned int | trk_num | ) | const |
Returns the name of the given track.
int AdvancedSequencer::GetTrackVolume | ( | unsigned int | trk_num | ) | const |
Returns the current MIDI volume for the given track (-1 if volume wasn't set at time 0).
int AdvancedSequencer::GetTrackProgram | ( | unsigned int | trk_num | ) | const |
Returns the current MIDI program (patch) for the given track (-1 if the program wasn't set at time 0).
int AdvancedSequencer::GetTrackNoteCount | ( | unsigned int | trk_num | ) | const |
Returns the number of notes currently sounding on the given track (0 if the sequencer is not playing).
unsigned int AdvancedSequencer::GetTrackVelocityScale | ( | unsigned int | trk_num | ) | const |
Returns the velocity scale percentage for the given track.
int AdvancedSequencer::GetTrackRechannelize | ( | unsigned int | trk_num | ) | const |
Returns the rechannelized channel for the given track (-1 if the track is not rechannelized).
int AdvancedSequencer::GetTrackChannel | ( | unsigned int | trk_num | ) |
If the track has channel messages all with same channel returns the channel, otherwise -1.
int AdvancedSequencer::GetTrackTranspose | ( | unsigned int | trk_num | ) | const |
Returns the transposing amount in semitones for the given track.
int AdvancedSequencer::GetTrackTimeShift | ( | unsigned int | trk_num | ) | const |
Returns the time offset (in MIDI ticks) assigned to the given track.
|
inline |
Returns a pointer to the MIDISequencerTrackProcessor for the given track.
|
inline |
Returns a pointer to the MIDISequencerTrackProcessor for the given track.
|
inline |
Sets a name for the content of sequencer.
bool AdvancedSequencer::SetMIDIThruEnable | ( | bool | on_off | ) |
Enables or disables the embedded MIDIthru.
This has no effect if the thru is not present.
bool AdvancedSequencer::SetMIDIThruChannel | ( | int | chan | ) |
Sets the out channel for MIDIthru.
You can set -1 as parameter for leaving the channel of incoming messages unchanged. This has no effect if the thru is not present. See Numbering conventions.
bool AdvancedSequencer::SetMIDIThruTranspose | ( | int | amt | ) |
Sets a transpose amount in semitones for the messages coming from the MIDIThru.
This has no effect if the thru is not present. See MIDIProcessorTransposer.
bool AdvancedSequencer::SetTrackSolo | ( | unsigned int | trk_num | ) |
Soloes the given track muting all others.
void AdvancedSequencer::UnSoloTrack | ( | ) |
Unsoloes the soloed track unmuting all others.
bool AdvancedSequencer::SetTrackMute | ( | unsigned int | trk_num, |
bool | f | ||
) |
Mutes/unmutes the given track (it has no effect on others).
void AdvancedSequencer::UnmuteAllTracks | ( | ) |
Unmutes all muted tracks (this has no effect on tracks muted by SoloTrack()).
bool AdvancedSequencer::SetTrackVelocityScale | ( | unsigned int | trk_num, |
unsigned int | scale | ||
) |
Sets a track velocity scale in percentage for the given track.
bool AdvancedSequencer::SetTrackRechannelize | ( | unsigned int | trk_num, |
int | chan | ||
) |
Redirects all channel messages in the track on the given channel.
This is done during playback by mean of a TrackProcessor, without changing original messages. Calling this with chan = -1 disables the rechannelizing. See Numbering conventions
bool AdvancedSequencer::SetTrackTranspose | ( | unsigned int | trk_num, |
int | amt | ||
) |
Sets a transpose amount in semitones for the given track.
|
inlinevirtual |
Sets the current time to the beginning of the song.
This method is thread-safe and can be called during playback. Notifies the GUI a GROUP_ALL event to signify a full GUI reset.
Reimplemented from MIDISequencer.
|
virtual |
Sets the current time to the given MIDI time.
This is as MIDISequencer::GoToTime() but uses a faster algorithm and sends to the MIDI out ports all the appropriate sysex, patch, pitch bend and control change messages. Notifies the GUI a GROUP_ALL event to signify a full GUI reset.
Reimplemented from MIDISequencer.
|
virtual |
Same as GoToTime(), but the time is given in milliseconds.
Reimplemented from MIDISequencer.
|
virtual |
Sets the current time to the given measure and beat.
This is as MIDISequencer::GoToMeasure() but uses a faster algorithm and sends to the MIDI out ports all the appropriate sysex, patch, pitch bend and control change messages. Notifies the GUI a GROUP_ALL event to signify a full GUI reset. See Numbering conventions.
|
virtual |
Starts the sequencer playing from the current time.
Reimplemented from MIDISequencer.
|
virtual |
Stops the sequencer playing.
Reimplemented from MIDISequencer.
void AdvancedSequencer::OutputMessage | ( | MIDITimedMessage & | msg, |
unsigned int | port | ||
) |
Sends a given MIDI message to an hardware port.
This is thread-safe and can be called while playing.
msg | the MIDI message |
port | the port id |
bool AdvancedSequencer::SetSMPTE | ( | SMPTE * | s | ) |
Sets the parameters of the given SMPTE according to the loaded content.
If the loaded file contains a MIDI SMPTE offset message, sets the parameters according to the offset and the frame rate of the message, otherwise sets it to standard values (offset=0, frame=30FPS).
|
virtual |
This should be used to update the sequencer internal parameters after editing the multitrack.
If you have added, deleted or edited events call this before moving time, getting events or playing. For changes in the track structure see InsertTrack(), DeleteTrack() and MoveTrack()).
Reimplemented from MIDISequencer.
|
protected |
Internal use.
It registers the state of the sequencer every MEASURES_PER_WARP measures, and creates a std::vector of MIDISequencerState for a quicker jump from a time to another.
|
protected |
Internal use.
When jumping from a time to another while the sequencer is playing, it examines all events between old and new time (or between start and new time, if lesser then old), sending to the ports the appropriate control, program, pitch bend and sysex messages in order to exactly reproduce the sequencer setting at the new time.
|
protected |
Internal use.
As above, but only on the given track (this is useful when a formerly muted track is unmuted, and needs to be set with appropriate controls, program etc.