4 #include "MidiStreamOut.h"
30 case MIDI_PARSER_TRACK_MIDI: {
31 switch (state.midi.status) {
32 case MIDI_STATUS_NOTE_OFF:
33 p_out->noteOff(state.midi.param1, state.midi.param2,
36 case MIDI_STATUS_NOTE_ON:
37 p_out->noteOn(state.midi.param1, state.midi.param2, state.midi.channel);
39 case MIDI_STATUS_NOTE_AT:
40 p_out->polyPressure(state.midi.param1, state.midi.channel);
43 p_out->controlChange(state.midi.param1,
44 state.midi.param2, state.midi.channel);
46 case MIDI_STATUS_PGM_CHANGE:
47 p_out->programChange(state.midi.param1, state.midi.channel);
49 case MIDI_STATUS_CHANNEL_AT:
50 p_out->channelPressure(state.midi.param1, state.midi.channel);
52 case MIDI_STATUS_PITCH_BEND:
53 p_out->pitchBend(state.midi.param1, state.midi.channel);
56 log(
"Unknown MIDI Event");
61 case MIDI_PARSER_ERROR:
75 MidiStreamOut *p_out =
nullptr;
78 void log(
const char *msg) {
A simple midi parser based on the following project https://github.com/abique/midi-parser.
Parse the MidiFileParser sending the output to MidiStreamOut. This class requires https://github....
Definition: MidiFileParserOut.h:14
bool parse()
Parses the midi message and forwards it to MidiStreamp_out-> Returns false when we are at the end.
Definition: MidiFileParserOut.h:24
MidiFileParserOut(MidiFileParser &file, MidiStreamOut &out)
Default Constructor.
Definition: MidiFileParserOut.h:17
Midi File parser. Provide the data via write: You should try to keep the buffer as full as possible w...
Definition: MidiFileParser.h:61
midi_parser_state & parseTimed()
Definition: MidiFileParser.h:112