Wiki

Clone wiki

qnTools / QuNeo SysEx Format

General Message Format

Header

All sysex messages begin with the same header as follows

F0  SYSEX START
00  MFG_ID byte 0
01  MFG_ID byte 1
5F  MFG_ID byte 2
7A  MFG_ID byte 3
1e  PRODUCT_ID
00  FORMAT

Note that this block is NOT 8 bit to 7 bit encoded as described below

Message Body

Encoding

The body of the sysex message consists of one or more message sections. Each section consists of 8 bit data encoded into 7 bit values. This is achieved by adding an extra byte after every 7 bytes of message into which the previous 7 bytes high bits are encoded. The high bits are stripped from the data values and encoded in the 8th value as bit 0-7 (low-hi)

Example:

7 Bytes unencoded	8 bytes encoded
----------------        ----------------
0xB5	10110101	0x35	00110101
0x35	00110101	0x35	00110101
0xFF	11111111	0x7F	01111111
0x00	00000000	0x00	00000000
0x23	00100011	0x23	00100011
0xA5	10100101	0x25	00100101
0x21	00100001	0x21	00100001
			0x25    00100101

Each encoded section of the sysex message will be padded with null values (0x00) to the next complete 7 byte block before encoding.

Message descriptions in this document will be described in their unencoded form.

Content

The message itself will consist of a preamble describing the message and optionally data sections providing data for the particular message.

Preamble

The first section of the SysEx body is a Preamble as follows. Explainations of each piece below.

01    SX_PACKET_START 
00    TYPE_MSB
02    TYPE_LSB
XX    ID_MSB
XX    ID_LSB
XX    CRC_MSB
XX    CRC_LSB
  • SX_PACKET_START - Marks the beginning of the message body and announces the preamble
  • TYPE_[MSB|LSB] - always 0x0002?
  • ID_[MSB|LSB] - An ID value indicating the type of message to follow. This is a 16 bit integer value.
    • 0x1110 - firmware
    • 0x2220 - preset data
    • 0x3000 & [preset id] - change preset request. Preset id is 0x00 - 0x0F (0-15)
  • CRC_MSB, CRC_LSB - a 16 bit integer CRC calculated against the messages TYPE and ID. CRC calculation will be documented seperately.

The Preamble IS encoded.

Body Data

Each type of SysEx message has its own data format.

End of Message

Each SysEx message is concluded with the standard SysEx end of message byte

0xF7 SYSEX_END

Updated