A basic example which allows the user to record for 15 seconds and then listen the recorded messages, without no input from the computer.
#include "../include/advancedsequencer.h"
#include "../include/recorder.h"
#include "../include/timer.h"
#include "../include/dump_tracks.h"
int main( int argc, char **argv ) {
recorder.SetEndRecTime(t);
recorder.EnableTrack(1);
recorder.SetTrackRecChannel(1,-1);
std::cout << "When the recorder starts you can play for 15 seconds (all MIDI channels will be recorded)"
<< std::endl;
recorder.Start();
std::cout << "Recorder started\n";
recorder.Stop();
std::cout << "Recorder stopped\n";
sequencer.GoToZero();
sequencer.Start();
std::cout << "Now the sequencer plays what you have recorded\n" << std::endl;
while (sequencer.IsPlaying())
std::cout << "Sequencer stopped" << std::endl;
}
An enhanced MIDISequencer, able to directly load and play MIDI files and many more.
Definition: advancedsequencer.h:93
A MIDITickComponent which can record MIDI messages incoming from a MIDI in port, putting them into an...
Definition: recorder.h:186
A MIDISequencerGUINotifier which sends text messages to a std::ostream (std::cout as default).
Definition: notifier.h:191
static void Wait(unsigned int msecs)
Stops the calling thread for the given number of milliseconds.
Definition: timer.h:105
unsigned long MIDIClockTime
The type of a variable which can hold a time in MIDI ticks.
Definition: midi.h:40