Everything placed in time is an event in a
qSvE record.
An event starts with a four-byte marker saying its type. Offsets are from the start of
the event. Positions include the origin.
Unless stated, other bytes are zero.
Tempo
Each tempo event is 32 bytes, in a sequence with role 3.
| Offset | Size | Value | Meaning |
|---|---|---|---|
0x00 | 4 | 60 00 00 00 | Marker |
0x04 | 8 | Position: 38,400 + tick | |
0x0C | 4 | 7F 00 00 then a flag | Flag: 0x00 initial, 0x01 explicit, with 0x80 added when selected in the interface |
0x10 | 4 | Tempo: BPM × 10,000 | |
0x14 | 4 | 00 00 40 88 | |
0x18 | 4 | 7,200,000 + cumulative seconds × 2,000 | |
0x1C | 4 |
Time signature
The signature sequence (role 1) is the one sequence with a header: 80 bytes, holding the
first signature, then one 48-byte record per change, then the usual tail. In the header,
the first signature’s denominator exponent is at 0x0B, its numerator at
0x0C and a flag at 0x0F.
| Offset | Size | Meaning |
|---|---|---|
0x00 | 4 | Marker 30 00 00 00 |
0x04 | 4 | Position: 38,400 + tick |
0x0B | 1 | Denominator exponent: the denominator is 2value |
0x0C | 1 | Numerator |
0x0F | 1 | 0x80 on the last change |
0x10 | 4 | 30 00 00 00 |
0x17 | 1 | 0x88 |
0x18 | 1 | An index: 1, 3, 5 and so on when the map has only signatures |
0x1C | 4 | Position again |
0x27 | 1 | 0x88 |
Markers
Marker events are 48 bytes, in a sequence with role 0x16. A marker’s name is
in a separate qSxT record, as RTF. That record’s header offset
0x0A holds the same link number.
| Offset | Size | Meaning |
|---|---|---|
0x00 | 4 | Marker 12 00 00 00 |
0x04 | 4 | Position: 38,400 + tick |
0x10 | 4 | Link number: (index + 1) × 4 |
0x17 | 1 | 0x88 |
0x1C | 1 | 0x01 |
0x27 | 1 | 0x88 |
MIDI notes
Each note is 32 bytes, in the region’s paired qSvE with role
0x17. The payload size is 32 × notes + 16.
| Offset | Size | Meaning |
|---|---|---|
0x00 | 4 | Marker 90 00 00 00; 0x90 is MIDI note-on |
0x04 | 4 | Position: 38,400 + tick, relative to the region |
0x0A | 1 | Velocity fraction; 0 for an exact whole velocity |
0x0B | 1 | Velocity, 1 to 127 |
0x0C | 1 | Pitch: MIDI note number |
0x0F | 1 | 0x01, with 0x80 added on the last note |
0x10 | 1 | 0x40 |
0x17 | 1 | 0x89 |
0x1C | 4 | Length in ticks |
MIDI regions
A MIDI region is a qeSM record with no gRuA. Offsets are from
the start of the record. Fields marked ? have widths assumed from context.
| Offset | Size | Meaning |
|---|---|---|
+0x2C | 4 ? | Region number, renumbered on save |
+0x34 | 2 + n | Name: 16-bit length, then ASCII. A track’s name is at the same offset in its qeSM. |
+0x78 | 4 ? | Region length in ticks. Moves when the name changes size. |
+0x108 | Probably the link to a placement event | |
+0x11C | 4 ? | Start position in ticks, from zero |
The name field is variable length, so a record must resize when the name changes.
Placements
A region is placed on a track by an 80-byte event in that track’s arrangement
qSvE.
| Offset | Size | Meaning |
|---|---|---|
0x00 | 4 | Marker: 24 00 00 00 audio or 20 00 00 00 MIDI |
0x04 | 4 | Position: 34,560 + tick |
0x0C | 4 | A flag, changing by 0x100 per bar in MIDI placements (the study is uncertain) |
0x10 | 4 | Identifier: 0x58 + event index × 4 |
0x14 | 1 | Track number, from 1 |
0x17 | 1 | 0x89 on audio placements |
0x2C | 4 | Link to the region |
Audio regions
The gRuA record is the audio region. Offsets are in the payload.
| Offset | Size | Meaning |
|---|---|---|
+0x16 | 4 | Length, in frames |
+0x20 | Link to the audio file | |
+0x4A | 2 + n | Name: 16-bit length, ASCII, padded to an even size |
+0xA6 | 16 | Region UUID. Sources in the same study give other offsets near this one. |
Audio file references
The lFuA record names an audio file. Because the name’s size moves the rest
of the record, later fields are located by finding the four-character tag
EVAW (WAVE, reversed) and counting from it. The same tag is
FFIA for AIFF and ffac for CAF.
| Position | Size | Meaning |
|---|---|---|
Payload +0x00, +0x04 | 4 each | 0x370 in both |
Payload +0x08 | 2 | Name length, in characters |
Payload +0x0A | 2 × n | Name, UTF-16LE |
EVAW−0x1C3 | 1 | Type flags; 0x10 marks compression |
EVAW−0x142 | 4 | Codec tag: 0 PCM, 3 float WAV, PMOC ALAC |
EVAW−0x13E | Path, null-terminated: Audio Files | |
EVAW−0x3D | 1 | 2 on float records |
EVAW−0x38 | 1 | Channel count |
EVAW−0x32 | 4 | File size on disk (decoded size for ALAC) |
EVAW+0x00 | 4 | Container tag |
EVAW+0x08 | 4 | Byte offset of the first sample |
EVAW+0x0C | 4 | Frames |
EVAW+0x14 | 4 | Sample rate |
EVAW+0x18 | 2 | Channels |
EVAW+0x1A | 2 | Bits |
Not confirmed
- Exact field widths marked ?, the UUID offset, and the position-shift field in MIDI placements, on which the study’s own sections disagree.
- Other event types, automation lanes and sysex events.