47 unsigned outLength = 0;
51 for (
unsigned i = 0; i < inLength; ++i)
53 const byte data = inData[i];
54 const byte msb = data >> 7;
55 const byte body = data & 0x7f;
57 outSysEx[0] |= (msb << (6 - count));
58 outSysEx[1 + count] = body;
68 return outLength + count + (count != 0 ? 1 : 0);
88 for (
unsigned i = 0; i < inLength; ++i)
92 msbStorage = inSysEx[i];
97 const byte body = inSysEx[i];
98 const byte msb = ((msbStorage >> byteIndex--) & 1) << 7;
99 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.