30#ifndef _NICMIDI_ADVANCEDSEQUENCER_H
31#define _NICMIDI_ADVANCEDSEQUENCER_H
77 enum { NO_SOLO, SOLOED, NOT_SOLOED };
129 virtual bool Load(
const char *fname);
165 MIDISequencerTrackProcessor::SOLOED); }
304 static const int MEASURES_PER_WARP = 4;
311 std::vector<MIDISequencerState> warp_positions;
An enhanced MIDISequencer, able to directly load and play MIDI files and many more.
Definition: advancedsequencer.h:93
AdvancedSequencer(MIDISequencerGUINotifier *n=0)
Creates an AdvancedSequencer with 17 tracks (one for each channel plus the master track).
virtual bool GoToTimeMs(float time_ms)
Same as GoToTime(), but the time is given in milliseconds.
bool SetTrackMute(unsigned int trk_num, bool f)
Mutes/unmutes the given track (it has no effect on others).
std::string GetTrackName(unsigned int trk_num) const
Returns the name of the given track.
virtual void Stop()
Stops the sequencer playing.
virtual void GoToZero()
Sets the current time to the beginning of the song.
Definition: advancedsequencer.h:255
bool SetTrackSolo(unsigned int trk_num)
Soloes the given track muting all others.
void CatchEventsBefore(int trk_num)
Internal use.
MIDISequencerTrackProcessor * GetTrackProcessor(unsigned int trk_num)
Returns a pointer to the MIDISequencerTrackProcessor for the given track.
Definition: advancedsequencer.h:212
MIDIClockTime GetCurrentBeatOffset() const
Returns the current MIDI time offset respect current beat.
const MIDIFileHeader & GetFileHeader()
Returns the header of the loaded file.
Definition: advancedsequencer.h:145
virtual void Reset()
Resets the status of the sequencer (does not empty the MIDIMultiTrack).
int GetKeySigSharpsFlats() const
Return the number of sharps or flats of the current key signature.
void CatchEventsBefore()
Internal use.
int GetTrackTranspose(unsigned int trk_num) const
Returns the transposing amount in semitones for the given track.
unsigned int GetTrackVelocityScale(unsigned int trk_num) const
Returns the velocity scale percentage for the given track.
void ExtractWarpPositions()
Internal use.
virtual bool Load(const char *fname)
Loads a MIDIFile into the internal MIDIMultiTrack.
bool SetTrackVelocityScale(unsigned int trk_num, unsigned int scale)
Sets a track velocity scale in percentage for the given track.
unsigned int GetCurrentBeat() const
Returns the number of current beat (first is 0). See Numbering conventions.
bool SetMIDIThruEnable(bool on_off)
Enables or disables the embedded MIDIthru.
virtual bool Load(const MIDIMultiTrack *tracks)
Copies the content of an external MIDIMultiTrack into the sequencer.
virtual void Start()
Starts the sequencer playing from the current time.
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)...
bool IsLoaded() const
Returns true if the internal MIDIMultiTrack is not empty.
Definition: advancedsequencer.h:141
bool SetMIDIThruChannel(int chan)
Sets the out channel for MIDIthru.
int GetTrackRechannelize(unsigned int trk_num) const
Returns the rechannelized channel for the given track (-1 if the track is not rechannelized).
bool GetTrackMute(unsigned int trk_num) const
Returns true if a specific track is muted.
Definition: advancedsequencer.h:168
int GetNumMeasures() const
Returns the number of measures of the loaded song.
Definition: advancedsequencer.h:171
virtual bool GoToMeasure(int measure, int beat=0)
Sets the current time to the given measure and beat.
std::string GetCurrentMarker() const
Returns the current marker text.
int GetTimeSigDenominator() const
Returns the denominator of current time signature.
int GetMIDIThruTranspose() const
Returns the transpose amount of the MIDIThru, 0 if the thru is not present.
Definition: advancedsequencer.h:158
virtual void UnLoad()
Clears the contents of the internal MIDIMultiTrack.
bool SetTrackTranspose(unsigned int trk_num, int amt)
Sets a transpose amount in semitones for the given track.
void OutputMessage(MIDITimedMessage &msg, unsigned int port)
Sends a given MIDI message to an hardware port.
int GetTrackTimeShift(unsigned int trk_num) const
Returns the time offset (in MIDI ticks) assigned to the given track.
int GetTimeSigNumerator() const
Returns the numerator of current time signature.
unsigned int GetCurrentMeasure() const
Returns the current measure number (first is 0). See Numbering conventions.
void SetFileName(std::string &fname)
Sets a name for the content of sequencer.
Definition: advancedsequencer.h:218
int GetKeySigMode() const
Returns the mode (major/minor) of the he current key signature.
virtual void UpdateStatus()
This should be used to update the sequencer internal parameters after editing the multitrack.
virtual bool GoToTime(MIDIClockTime time_clk)
Sets the current time to the given MIDI time.
AdvancedSequencer(MIDIMultiTrack *mlt, MIDISequencerGUINotifier *n=0)
Creates an AdvancedSequencer from a given MIDIMultiTrack.
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).
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)...
bool GetTrackSolo(unsigned int trk_num) const
Returns true if a specific track is soloed.
Definition: advancedsequencer.h:163
bool SetMIDIThruTranspose(int amt)
Sets a transpose amount in semitones for the messages coming from the MIDIThru.
int GetMIDIThruChannel() const
Returns the output channel of the MIDIThru, -1 if the thru is not present.
Definition: advancedsequencer.h:156
bool GetSoloMode() const
Returns true if any track is soloed.
void UnmuteAllTracks()
Unmutes all muted tracks (this has no effect on tracks muted by SoloTrack()).
std::string GetFileName()
Returns the name of the loaded file (or an empty string if it is not yet defined).
Definition: advancedsequencer.h:143
const MIDIThru * GetMIDIThru() const
Returns a pointer to the MIDIThru tick component.
Definition: advancedsequencer.h:151
const MIDISequencerTrackProcessor * GetTrackProcessor(unsigned int trk_num) const
Returns a pointer to the MIDISequencerTrackProcessor for the given track.
Definition: advancedsequencer.h:215
int GetTrackChannel(unsigned int trk_num)
If the track has channel messages all with same channel returns the channel, otherwise -1.
bool SetSMPTE(SMPTE *s)
Sets the parameters of the given SMPTE according to the loaded content.
virtual ~AdvancedSequencer()
The destructor.
void UnSoloTrack()
Unsoloes the soloed track unmuting all others.
bool SetTrackRechannelize(unsigned int trk_num, int chan)
Redirects all channel messages in the track on the given channel.
MIDIThru * GetMIDIThru()
Returns the address of the MIDIThru tick component.
Definition: advancedsequencer.h:148
bool GetMIDIThruEnable() const
Returns true if MIDIThru is enabled (always false if the thru is not present).
Definition: advancedsequencer.h:153
Holds an array of pointers to MIDITrack objects to be played simultaneously.
Definition: multitrack.h:50
A pure virtual class implementing an object that can manipulate a MIDI message, inspecting or changin...
Definition: processor.h:47
A MIDIProcessor which shifts the pitch of MIDI note and polyphonic pressure messages by a given amoun...
Definition: processor.h:118
A pure virtual class implementing a device that can send MIDISequencerGUIEvent messages to a GUI.
Definition: notifier.h:162
A MIDITickComponent which implements a basic sequencer, able to play the MIDI events contained in a M...
Definition: sequencer.h:193
A multipurpose MIDIProcessor implementing muting, soloing, rechannelizing, velocity scaling and trans...
Definition: advancedsequencer.h:51
MIDIProcessor * extra_proc
extra midi processing for this track
Definition: advancedsequencer.h:75
virtual bool Process(MIDITimedMessage *msg)
Processes message msg, changing its parameters according to the state of the processor.
unsigned int velocity_scale
current velocity scale value for note ons, 100=normal
Definition: advancedsequencer.h:72
int transpose
amount to transpose note values
Definition: advancedsequencer.h:74
bool mute
track is muted
Definition: advancedsequencer.h:70
virtual ~MIDISequencerTrackProcessor()
The destructor does nothing.
Definition: advancedsequencer.h:56
void SetExternalProcessor(MIDIProcessor *proc)
Sets the extra processor for the track.
Definition: advancedsequencer.h:65
MIDISequencerTrackProcessor()
The constructor. Default is no processing (MIDI messages leave the processor unchanged).
virtual void Reset()
Resets all values to default state (no processing at all).
int rechannel
rechannelization value, or -1 for none
Definition: advancedsequencer.h:73
int solo
NO_SOLO, SOLOED, NOT_SOLOED.
Definition: advancedsequencer.h:71
A MIDITickComponent which immediately echoes to an out MIDI port all messages incoming from an in MID...
Definition: thru.h:44
The MIDITimedMessage class inherits from the MIDIMessage and represents a message associated with a s...
Definition: msg.h:382
Performs conversions between number of samples, milliseconds and smpte format (hours::minutes::second...
Definition: smpte.h:69
Contains the definition of the class MIDIFileReadMultiTrack, used for loading MIDI files,...
unsigned long MIDIClockTime
The type of a variable which can hold a time in MIDI ticks.
Definition: midi.h:40
Contains the definition of the classes MIDIMultiTrack, MIDIMultiTrackIteratorState,...
Contains the definitions of the classes MIDISequencerTrackState, MIDISequencerState and MIDISequencer...
Contains the definition of the class SMPTE, plus some related enum.
Contains the definition of the class MIDIThru.