MIDI events parser/encoder.