This is a description and layout of sequencer data as used in Ensoniq ESQ-1 (and probably SQ-80 as well, haven't tested it). This is the 'data' part of a sequence dump as transmitted in One Sequence Dump Packet MIDI message (page A-9 in ESQ-1 Musician's Manual). Margus Kliimask, 2005 (I don't claim any copyright on this information!) Sequence Header Sequence header starts at offset 0. +--------+----------------------------------------------+ | Offset | Description | +--------+----------------------------------------------+ | 0..1 | b0 * 256 + b1: Length of sequence data | +--------+----------------------------------------------+ | 2..3 | b2 * 256 + b3: Number of bars | +--------+----------------------------------------------+ | 4 | b + 1: Sequence number | +--------+----------------------------------------------+ | 5..6 | Byte counter for multi-packet(*) data parts. | | | b[5..6] = 0 -> single-packet sequence | | | b[5..6] > 0 -> number of bytes till next | | | packet marker ($F1). | +--------+----------------------------------------------+ | 7 | b[0..4]: Time Signature mapping -> | | | 0 -> 1/8 | | | 1 -> 1/4 | | | 2 -> 2/8 | | | 3 -> 3/8 | | | 4 -> 2/4 | | | 5 -> 4/8 | | | 6 -> 5/8 | | | 7 -> 3/4 | | | 8 -> 6/8 | | | 9 -> 7/8 | | | 10 -> 4/4 | | | 11 -> 8/8 | | | 12 -> 9/8 | | | 13 -> 5/4 | | | 14 -> 10/8 | | | 15 -> 11/8 | | | 16 -> 6/4 | | | 17 -> 12/8 | | | 18 -> 13/8 | | | 19 -> 7/4 | | | 20 -> 14/8 | | | 21 -> 15/8 | | | 22 -> 8/4 | | | 23 -> 16/8 | | | 24 -> 17/18 | | | 25 -> 9/4 | | | 26 -> 18/8 | | | 27 -> 19/8 | | | 28 -> 10/4 | | | 29 -> 20/8 | | | 30 -> 21/8 | | | b[7]: Looped -> | | | 0: Is looped | | | 1: Not looped | +--------+----------------------------------------------+ | 8 | b: Sequence tempo | +--------+----------------------------------------------+ Notes: (*) ESQ-1 seems to split longer sequences into packets ab 19.2 seconds each. Track Header Track headers start at offset 09 relative to start of sequencer data block. There are 8 sets of 3 bytes each, one per sequencer track. +--------+----------------------------------------------+ | Offset | Description | +--------+----------------------------------------------+ | 0 | (b + 1) & $7F: Program # (1..120) | +--------+----------------------------------------------+ | 1 | b[0..3] + 1: MIDI Channel # | | | b[4]: Track activity -> | | | 0: Track not in use | | | 1: Track in use | | | b[6..7]: track status -> | | | 0: SEQ | | | 1: LOCAL | | | 2: MIDI | | | 3: BOTH | +--------+----------------------------------------------+ | 2 | b >> 1: Mix Volume | +--------+----------------------------------------------+ Track Events +--------+---------------+-----------------------------------------------------+ | Id | Event | Format | Description | +--------+---------------+----------------+------------------------------------+ | 00..57 | Note On | b1 b2 b3 [b4] | b1 + $15H MIDI Note # | | | | | b2[0..2] + 1: Track # | | | | | (b2[3..7] >> 1) + 2: Note Velocity | | | | | b3 & $7F: Note Length | | | | | (b3 >> 7) = 0 -> | | | | | b4: Next Event Offset(*) | +--------+---------------+----------------+------------------------------------+ | 58..AF | Note Off | b1 b2 | (b2 >> 7) = 0 -> | | | | | b1 + $15 - $58: MIDI Note # | | | | | b2[0..2] + 1: Track # | +--------+---------------+----------------+------------------------------------+ | 58..AF | Aftertouch | b1 b2 b3 | (b2 >> 7) = 1 -> | | | | | b1 + $15 - $58: MIDI Note # | | | | | b2[0..2] + 1: Track # | | | | | b3: Pressure amount | +--------+---------------+----------------+------------------------------------+ | B0..EF | Controller | b1 b2 | b1[0..2] + 1: Track # | | | | | (b1 >> 3) - $16: Int. event type | | | | | Int. to MIDI ctrl mappings: | | | | | 0 -> (pitch bend) | | | | | 1 -> $40 (sustain) | | | | | 2 -> $01 (mod wheel) | | | | | 3 -> $04 (foot controller) | | | | | 4 -> (xctrl) | | | | | 5 -> (channel pressure) | | | | | 6 -> $07 (volume) | | | | | 7 -> $06 (data slider) | | | | | (b2 & $7F): Controller amount | +--------+---------------+----------------+------------------------------------+ | F1 | Packet marker | b1 b2 b3 | b1: $F1 | | | | | b2 * 256 + b3: Length of the next | | | | | packet (**) | +--------+---------------+----------------+------------------------------------+ | F3 | Sequence End | b1 b2 | b1: $F3 | | | | | b2: 0 | +--------+---------------+----------------+------------------------------------+ | F4 | 2-byte offset | b1 b2 b3 | b1: $F4 | | | | | b2 * 256 + b3: Relative Offset(*) | +--------+---------------+----------------+------------------------------------+ | F5 | Sync | b1 b2 | b1: $F5 | | | | | b2: Event Offset Adjustment(*) | +--------+---------------+----------------+------------------------------------+ Notes: (*) All offsets are relative to previous or current event, not to sequence start! (**) F1 marker has the length (in bytes) of the next packet. Last (usually shorter) packet has its length bytes set to 0. In case of short notes there is no Note Off event - note off is determined by Note Length byte. In case of longer notes Note Length byte is zero and there is a separate Note Off event. Also, sometimes there are 'dummy' Note Offs without a corresponding Note On. System events F0, F2 and F6..FF are not known - do they exist at all? While sending out MIDI events sequencer internal tracks are converted to MIDI channels according to information in Track Header.