1) Active Sensing:
Once an ActiveSensing message is received, the system checks for timeouts: if no message is received within the specified 300ms (see in _Defs), an error is set and the checks for timeout stop.
2) added a callback for errors. 2 errors are defined: parse error and ActiveSensing timeout
Splitting larger incoming messages into smaller SysEx packets - using an RrtpMidi trick:
// first: 0xF0 .... 0xF0
// midlle: 0xF7 .... 0xF0
// last: 0xF7 .... 0xF7
see: https://tools.ietf.org/html/rfc4695#section-3.2
(Understanding this is not part of the original MIDI spec, but does allow for receiving very very large SysEx messages on a small footprint (does require some 'handy' parsing))
SysExMaxSize in Settings can be reduced significatly (16bytes works fine - pending use case)
- send: pass the message as a const ref, to avoid copies
- add mSerial.begin (with Baudrate - added Settings)
- ThruActivated defaults to true
- class name serialMIDI => SerialMIDI
added send(MidiMessage) for Bridge application (that convert MIDI transport x into MIDI transport y), avoiding parsing entry a stream, setting up all callback - whilst this allows for passing the content, without to much processing/parsing.
Had to move mPendingMessageExpectedLenght into MidiMessage to avoid parsing the data again, just to know the size
Added Bridge example (untested)
Gives more control over the bool value. Typical value is 300 (ms) - an Active Sensing command is send every 300ms; or 0 (zero) to disable sending ActiveSensing
Very long SysEx mesaages are cut in to multiple command segments
Where a normal SysEx starts with F0 and ends with F7, the first segment will start with F0 and end with F0, the middle section (optional) start with F7 and ends with F7 - the last segments starts with F7 and ends with F0
From: https://www.midi.org/specifications/item/table-1-summary-of-midi-message
Active Sensing. This message is intended to be sent repeatedly to tell the receiver that a connection is alive. Use of this message is optional. When initially received, the receiver will expect to receive another Active Sensing message each 300ms (max), and if it does not then it will assume that the connection has been terminated. At termination, the receiver will turn off all voices and return to normal (non- active sensing) operation.