A node js midi data parser that blissfully ignores all hardware and networking.
npm install midi-parser
The midi-parser library is a node event emitter. You write midi commands in buffers and it emits midi and sysex commands as events. We avoid releasing zalgo by always emitting events immediately.
The SysEx commands are unwrapped of their header and footer bytes and provided on the sysex event with the command, and data. Since any multibyte data (eg strings) or values over 127 need to be "14 bit encoded". The class methods decodeString and encodeString are available to assist.
The Midi command are emitted on the midi event with command, channel (or null if N/A), and an array of data bytes.
system realtime commands are handled.Channel Voice Commands are handled.SysEx commands are handled.Running status is currently not implemented.SysEx realtime commands are not handled specially - I'm not clear if they can occur at anytime. If they occur during normal message flow (eg, not in the middle of something else) they'll work fine.