Closed frederickk closed 4 years ago
This library has a MIDI serializer which produces midi_event_t structures which are easy to differentiate between different types of messages.
See Midimon source code where it prints appropriate message based on message type.
To parse the incoming data, essentially you do this:
// Global var
MidiToUsb g_parser;
// ...
// In main loop:
while(USBMIDI.available()) {
u8 b = USBMIDI.read();
midi_event_t event;
if (g_parser.process(b, event)) {
// a full event was received, access its data through 'event' variable and process as necessary.
}
}
@gtrainavicius perfect! thank you.
🙏 firstly, thank you for this great library!
I'm looking to get the clock data from USB (Ableton vis USB and Norns via USB, FWIW), but my efforts to read any of the timing messages
CLOCK (0xF8)
,START (0xFA)
,CONTINUE (0xFB)
, orSTOP (0xFC)
have not worked.Here's the main part of my body, with debugging
Serial
calls. Any tips or guidance on how to get the timing would be much appreciated!