48 unsigned outLength = 0;
52 for (
unsigned i = 0; i < inLength; ++i)
54 const byte data = inData[i];
55 const byte msb = data >> 7;
56 const byte body = data & 0x7f;
58 outSysEx[0] |= (msb << (6 - count));
59 outSysEx[1 + count] = body;
69 return outLength + count + (count != 0 ? 1 : 0);
89 for (
unsigned i = 0; i < inLength; ++i)
93 msbStorage = inSysEx[i];
98 const byte body = inSysEx[i];
99 const byte msb = ((msbStorage >> byteIndex--) & 1) << 7;
100 outData[count++] = msb | body;
#define BEGIN_MIDI_NAMESPACE
#define END_MIDI_NAMESPACE
unsigned decodeSysEx(const byte *inSysEx, byte *outData, unsigned inLength)
Decode System Exclusive messages. SysEx messages are encoded to guarantee transmission of data bytes ...
BEGIN_MIDI_NAMESPACE unsigned encodeSysEx(const byte *inData, byte *outSysEx, unsigned inLength)
Encode System Exclusive messages. SysEx messages are encoded to guarantee transmission of data bytes ...
MIDI Library for the Arduino.