MIDI Processors are objects which can manipulate the content of a MIDIMessage.
The abstract class MIDIProcessor defines basically an object which has a bool MIDIProcessor::Process(MIDITimedMessage* msg) method, which takes a pointer to a MIDITimedMessage as argument: it can change or inspect the message and returns an answer yes/no. Some subclasses are already built in the library:
Many classes (see MIDIInDriver, MIDIOutDriver, MIDIThru, MIDISequencer) have a SetProcessor() method that allows the user to "plug in" a processor in their flow of incoming-outcoming messages. This is an example which could be useful for debugging purposes: plugging a MIDIProcessorPrinter to a MIDIInDriver will print all incoming messages.
int main() {
return 0;
}
Receives MIDI messages from an hardware MIDI in port.
Definition: driver.h:224
virtual void ClosePort()
Closes the hardware out port.
virtual void SetProcessor(MIDIProcessor *proc)
Sets the in processor, which can manipulate all incoming messages (see MIDIProcessor).
virtual void OpenPort()
Opens the hardware in port.
static MIDIInDriver * GetInDriver(unsigned int n)
Returns a pointer to the MIDIInDriver with given port id.
A MIDIProcessor which prints a human-readable description of the processed messages to a std::ostream...
Definition: processor.h:184
static void Wait(unsigned int msecs)
Stops the calling thread for the given number of milliseconds.
Definition: timer.h:105
Contains the definition of the static class MIDIManager.
Contains the definition of the pure virtual MIDIProcessor class and its specializations MIDIMultiProc...
This is another example using the MIDIThru class.
int main() {
return 0;
}
static void AddMIDITick(MIDITickComponent *tick)
Inserts a MIDITickComponent object into the queue.
A MIDIProcessor which shifts the pitch of MIDI note and polyphonic pressure messages by a given amoun...
Definition: processor.h:118
void SetAllTranspose(int trans)
Sets the same transposing amount (in semitones) for all the channels.
A MIDITickComponent which immediately echoes to an out MIDI port all messages incoming from an in MID...
Definition: thru.h:44
virtual void Stop()
Stops the MIDI thru.
virtual void SetProcessor(MIDIProcessor *proc)
Sets the out processor, which can manipulate messages arrived to the in port before they are sent to ...
virtual void Start()
Starts the MIDI thru.
Contains the definition of the class MIDIThru.
A similar use of the MIDIProcessorPrinter is done in the test_thru.cpp example file.