Simple MIDI is a library for parsing byte streams of MIDI and emit MIDI events.
- Simple event based interface
- Handles running status
- Handles system real-time messages
The example program reads MIDI data on stdin and outputs a textual representation of some MIDI events. Pipe a MIDI stream into it to use as a simple MIDI monitor.
./example </dev/midi1
System exclusive messages was not made a special case in the parser and system exclusive data works as though it was a single-data byte status; MIDI_SYSEX will not be emitted until the first following data byte (vendor ID) appears, and each following data byte will appear as a MIDI_SYSEX event, until interrupted by another status (normally EOX, end of SysEx).
This library makes no effort to hide the fact that some vendors use note-on events with velocity 0 instead of note-off. This is allowed by the MIDI 1.0 specification.
make
to build the librarymake example
to build the example program