NiCMidi 1.1.0
A MIDI library derived from J.D.Koftinoff jdksmidi
Recording MIDI events

The library has a class MIDIRecorder which can record MIDI events incoming from a MIDI in port.

The recorder has no playing ability so you must use it together with a sequencer. Its constructor

A MIDITickComponent which can record MIDI messages incoming from a MIDI in port, putting them into an...
Definition: recorder.h:186
A MIDITickComponent which implements a basic sequencer, able to play the MIDI events contained in a M...
Definition: sequencer.h:193

binds the sequencer with the recorder: you must use the sequencer methods for playing or moving from a time to another. In particular the MIDISequencer::Start() method only starts the playback, while the MIDIRecorder::Start() starts playback and recording. These are the main MIDIRecorder class features:

  • It allows you to select one or more sequencer tracks for recording;
  • For everyone of them you can select the MIDI in port and the MIDI in channel to record from (or decide to accept messages from all channels);
  • You can set the recording start and end time (independent from the sequencer start and stop times);
  • You can choose between two recording modes: REC_MERGE (new content is merged with old) or REC_OVER (old content is erased and replaced with new);
  • You can undo the recording, restoring old content (actually old content is pushed in a C++ stack, without memory limitations).
  • When you start recording a count in measure is played before the sequencer start.

When you add ot remove tracks to the sequencer you must be careful to call the corresponding recorder method to keep the sequencer and recorder tracks syncronized. See the note to the MIDIRecorder::InsertTrack() method.

You can see an example of the use of the MIDIRecorder class in the file test_recorder.cpp.