1
1
mirror of https://github.com/wader/fq.git synced 2024-12-01 19:12:34 +03:00
fq/format/midi/testdata/reference.fqtest
twystd a7d0cde9f6 midi: cleaned up and simplied event decoding logic
- delineated NoteOn and NoteOff events
- simplified MIDI event decoding with function map
- decoded MIDI event and channel as nibbles
- reworked system exclusive event decoding
- fixed peekEvent to correctly decode end of file events
2024-09-01 16:41:38 -07:00

324 lines
34 KiB
Plaintext

$ fq -d midi dv reference.mid
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.{}: reference.mid (midi) 0x0-0x13a (314)
| | | header{}: 0x0-0xe (14)
| | | header[0:5]: 0x0-0xe (14)
0x000|4d 54 68 64 |MThd | [0]: "MThd" tag 0x0-0x4 (4)
0x000| 00 00 00 06 | .... | [1]: 6 length 0x4-0x8 (4)
0x000| 00 01 | .. | [2]: 1 format 0x8-0xa (2)
0x000| 00 02 | .. | [3]: 2 tracks 0xa-0xc (2)
0x000| 01 e0 | .. | [4]: 480 divisions 0xc-0xe (2)
| | | tracks[0:2]: 0xe-0x13a (300)
| | | [0]{}: track 0xe-0x41 (51)
0x000| 4d 54| MT| tag: "MTrk" 0xe-0x12 (4)
0x010|72 6b |rk |
0x010| 00 00 00 2b | ...+ | length: 43 0x12-0x16 (4)
| | | events[0:5]: 0x16-0x41 (43)
| | | [0]{}: metaevent 0x16-0x25 (15)
| | | time{}: 0x16-0x17 (1)
0x010| 00 | . | delta: 0 0x16-0x17 (1)
| | | tick: 0
0x010| ff | . | status: 255 0x17-0x18 (1)
0x010| 03 | . | event: "track_name" (3) 0x18-0x19 (1)
0x010| 0b 52 65 66 65 72 65| .Refere| track_name: "Reference-1" 0x19-0x25 (12)
0x020|6e 63 65 2d 31 |nce-1 |
| | | [1]{}: metaevent 0x25-0x2c (7)
| | | time{}: 0x25-0x26 (1)
0x020| 00 | . | delta: 0 0x25-0x26 (1)
| | | tick: 0
0x020| ff | . | status: 255 0x26-0x27 (1)
0x020| 51 | Q | event: "tempo" (81) 0x27-0x28 (1)
0x020| 03 | . | length: 3 0x28-0x29 (1)
0x020| 07 a1 20 | .. | tempo: 500000 0x29-0x2c (3)
| | | [2]{}: metaevent 0x2c-0x34 (8)
| | | time{}: 0x2c-0x2d (1)
0x020| 00 | . | delta: 0 0x2c-0x2d (1)
| | | tick: 0
0x020| ff | . | status: 255 0x2d-0x2e (1)
0x020| 58 | X | event: "time_signature" (88) 0x2e-0x2f (1)
0x020| 04| .| length: 4 0x2f-0x30 (1)
| | | time_signature{}: 0x30-0x34 (4)
0x030|04 |. | numerator: 4 0x30-0x31 (1)
0x030| 02 | . | denominator: 4 0x31-0x32 (1)
0x030| 18 | . | ticks_per_click: 24 0x32-0x33 (1)
0x030| 08 | . | thirty_seconds_per_quarter: 8 0x33-0x34 (1)
| | | [3]{}: metaevent 0x34-0x3d (9)
| | | time{}: 0x34-0x35 (1)
0x030| 00 | . | delta: 0 0x34-0x35 (1)
| | | tick: 0
0x030| ff | . | status: 255 0x35-0x36 (1)
0x030| 54 | T | event: "smpte_offset" (84) 0x36-0x37 (1)
0x030| 05 | . | length: 5 0x37-0x38 (1)
| | | smpte_offset{}: 0x38-0x3d (5)
0x030| 4d | M | framerate: 25 (1) 0x38-0x38.2 (0.2)
0x030| 4d | M | hour: 13 0x38.2-0x39 (0.6)
0x030| 2d | - | minute: 45 0x39-0x3a (1)
0x030| 3b | ; | second: 59 0x3a-0x3b (1)
0x030| 07 | . | frames: 7 0x3b-0x3c (1)
0x030| 27 | ' | fractions: 39 0x3c-0x3d (1)
| | | [4]{}: metaevent 0x3d-0x41 (4)
| | | time{}: 0x3d-0x3e (1)
0x030| 00 | . | delta: 0 0x3d-0x3e (1)
| | | tick: 0
0x030| ff | . | status: 255 0x3e-0x3f (1)
0x030| 2f| /| event: "end_of_track" (47) 0x3f-0x40 (1)
0x040|00 |. | length: 0 0x40-0x41 (1)
| | | [1]{}: track 0x41-0x13a (249)
0x040| 4d 54 72 6b | MTrk | tag: "MTrk" 0x41-0x45 (4)
0x040| 00 00 00 f1 | .... | length: 241 0x45-0x49 (4)
| | | events[0:31]: 0x49-0x13a (241)
| | | [0]{}: metaevent 0x49-0x4f (6)
| | | time{}: 0x49-0x4a (1)
0x040| 00 | . | delta: 0 0x49-0x4a (1)
| | | tick: 0
0x040| ff | . | status: 255 0x4a-0x4b (1)
0x040| 00 | . | event: "sequence_number" (0) 0x4b-0x4c (1)
0x040| 02 | . | length: 2 0x4c-0x4d (1)
0x040| 00 17 | .. | sequence_number: 23 0x4d-0x4f (2)
| | | [1]{}: metaevent 0x4f-0x60 (17)
| | | time{}: 0x4f-0x50 (1)
0x040| 00| .| delta: 0 0x4f-0x50 (1)
| | | tick: 0
0x050|ff |. | status: 255 0x50-0x51 (1)
0x050| 01 | . | event: "text" (1) 0x51-0x52 (1)
0x050| 0d 54 68 69 73 20 61 6e 64 20 54 68 61 74| .This and That| text: "This and That" 0x52-0x60 (14)
| | | [2]{}: metaevent 0x60-0x68 (8)
| | | time{}: 0x60-0x61 (1)
0x060|00 |. | delta: 0 0x60-0x61 (1)
| | | tick: 0
0x060| ff | . | status: 255 0x61-0x62 (1)
0x060| 02 | . | event: "copyright" (2) 0x62-0x63 (1)
0x060| 04 54 68 65 6d | .Them | copyright: "Them" 0x63-0x68 (5)
| | | [3]{}: metaevent 0x68-0x7b (19)
| | | time{}: 0x68-0x69 (1)
0x060| 00 | . | delta: 0 0x68-0x69 (1)
| | | tick: 0
0x060| ff | . | status: 255 0x69-0x6a (1)
0x060| 03 | . | event: "track_name" (3) 0x6a-0x6b (1)
0x060| 0f 41 63 6f 75| .Acou| track_name: "Acoustic Guitar" 0x6b-0x7b (16)
0x070|73 74 69 63 20 47 75 69 74 61 72 |stic Guitar |
| | | [4]{}: metaevent 0x7b-0x89 (14)
| | | time{}: 0x7b-0x7c (1)
0x070| 00 | . | delta: 0 0x7b-0x7c (1)
| | | tick: 0
0x070| ff | . | status: 255 0x7c-0x7d (1)
0x070| 04 | . | event: "instrument_name" (4) 0x7d-0x7e (1)
0x070| 0a 44| .D| instrument_name: "Didgeridoo" 0x7e-0x89 (11)
0x080|69 64 67 65 72 69 64 6f 6f |idgeridoo |
| | | [5]{}: metaevent 0x89-0x95 (12)
| | | time{}: 0x89-0x8a (1)
0x080| 00 | . | delta: 0 0x89-0x8a (1)
| | | tick: 0
0x080| ff | . | status: 255 0x8a-0x8b (1)
0x080| 05 | . | event: "lyric" (5) 0x8b-0x8c (1)
0x080| 08 4c 61 2d| .La-| lyric: "La-la-la" 0x8c-0x95 (9)
0x090|6c 61 2d 6c 61 |la-la |
| | | [6]{}: metaevent 0x95-0xa8 (19)
| | | time{}: 0x95-0x96 (1)
0x090| 00 | . | delta: 0 0x95-0x96 (1)
| | | tick: 0
0x090| ff | . | status: 255 0x96-0x97 (1)
0x090| 06 | . | event: "marker" (6) 0x97-0x98 (1)
0x090| 0f 48 65 72 65 20 42 65| .Here Be| marker: "Here Be Dragons" 0x98-0xa8 (16)
0x0a0|20 44 72 61 67 6f 6e 73 | Dragons |
| | | [7]{}: metaevent 0xa8-0xb8 (16)
| | | time{}: 0xa8-0xa9 (1)
0x0a0| 00 | . | delta: 0 0xa8-0xa9 (1)
| | | tick: 0
0x0a0| ff | . | status: 255 0xa9-0xaa (1)
0x0a0| 07 | . | event: "cue_point" (7) 0xaa-0xab (1)
0x0a0| 0c 4d 6f 72 65| .More| cue_point: "More cowbell" 0xab-0xb8 (13)
0x0b0|20 63 6f 77 62 65 6c 6c | cowbell |
| | | [8]{}: metaevent 0xb8-0xc2 (10)
| | | time{}: 0xb8-0xb9 (1)
0x0b0| 00 | . | delta: 0 0xb8-0xb9 (1)
| | | tick: 0
0x0b0| ff | . | status: 255 0xb9-0xba (1)
0x0b0| 08 | . | event: "program_name" (8) 0xba-0xbb (1)
0x0b0| 06 45 73 63 61| .Esca| program_name: "Escape" 0xbb-0xc2 (7)
0x0c0|70 65 |pe |
| | | [9]{}: metaevent 0xc2-0xce (12)
| | | time{}: 0xc2-0xc3 (1)
0x0c0| 00 | . | delta: 0 0xc2-0xc3 (1)
| | | tick: 0
0x0c0| ff | . | status: 255 0xc3-0xc4 (1)
0x0c0| 09 | . | event: "device_name" (9) 0xc4-0xc5 (1)
0x0c0| 08 54 68 65 54 68 69 6e 67 | .TheThing | device_name: "TheThing" 0xc5-0xce (9)
| | | [10]{}: metaevent 0xce-0xd3 (5)
| | | time{}: 0xce-0xcf (1)
0x0c0| 00 | . | delta: 0 0xce-0xcf (1)
| | | tick: 0
0x0c0| ff| .| status: 255 0xcf-0xd0 (1)
0x0d0|20 | | event: "midi_channel_prefix" (32) 0xd0-0xd1 (1)
0x0d0| 01 | . | length: 1 0xd1-0xd2 (1)
0x0d0| 0d | . | midi_channel_prefix: 13 0xd2-0xd3 (1)
| | | [11]{}: metaevent 0xd3-0xd8 (5)
| | | time{}: 0xd3-0xd4 (1)
0x0d0| 00 | . | delta: 0 0xd3-0xd4 (1)
| | | tick: 0
0x0d0| ff | . | status: 255 0xd4-0xd5 (1)
0x0d0| 21 | ! | event: "midi_port" (33) 0xd5-0xd6 (1)
0x0d0| 01 | . | length: 1 0xd6-0xd7 (1)
0x0d0| 70 | p | midi_port: 112 0xd7-0xd8 (1)
| | | [12]{}: metaevent 0xd8-0xde (6)
| | | time{}: 0xd8-0xd9 (1)
0x0d0| 00 | . | delta: 0 0xd8-0xd9 (1)
| | | tick: 0
0x0d0| ff | . | status: 255 0xd9-0xda (1)
0x0d0| 59 | Y | event: "key_signature" (89) 0xda-0xdb (1)
0x0d0| 02 | . | length: 2 0xdb-0xdc (1)
0x0d0| 00 01 | .. | key_signature: "A minor" (1) 0xdc-0xde (2)
| | | [13]{}: metaevent 0xde-0xe8 (10)
| | | time{}: 0xde-0xdf (1)
0x0d0| 00 | . | delta: 0 0xde-0xdf (1)
| | | tick: 0
0x0d0| ff| .| status: 255 0xdf-0xe0 (1)
0x0e0|7f |. | event: "sequencer_specific_event" (127) 0xe0-0xe1 (1)
0x0e0| 06 | . | length: 6 0xe1-0xe2 (1)
| | | sequencer_specific_event{}: 0xe2-0xe8 (6)
0x0e0| 00 00 3b | ..; | manufacturer: "Mark Of The Unicorn (MOTU)" (59) 0xe2-0xe5 (3)
0x0e0| 3a 4c 5e | :L^ | data: raw bits 0xe5-0xe8 (3)
| | | [14]{}: midievent 0xe8-0xec (4)
| | | time{}: 0xe8-0xe9 (1)
0x0e0| 00 | . | delta: 0 0xe8-0xe9 (1)
| | | tick: 0
0x0e0| b0 | . | event: "controller" (176) 0xe9-0xe9.4 (0.4)
0x0e0| b0 | . | channel: 0 0xe9.4-0xea (0.4)
| | | controller{}: 0xea-0xec (2)
0x0e0| 00 | . | controller: "Bank Select (MSB)" (0) 0xea-0xeb (1)
0x0e0| 05 | . | value: 5 0xeb-0xec (1)
| | | [15]{}: midievent 0xec-0xf0 (4)
| | | time{}: 0xec-0xed (1)
0x0e0| 00 | . | delta: 0 0xec-0xed (1)
| | | tick: 0
0x0e0| b0 | . | event: "controller" (176) 0xed-0xed.4 (0.4)
0x0e0| b0 | . | channel: 0 0xed.4-0xee (0.4)
| | | controller{}: 0xee-0xf0 (2)
0x0e0| 20 | | controller: "Bank Select (LSB)" (32) 0xee-0xef (1)
0x0e0| 21| !| value: 33 0xef-0xf0 (1)
| | | [16]{}: midievent 0xf0-0xf3 (3)
| | | time{}: 0xf0-0xf1 (1)
0x0f0|00 |. | delta: 0 0xf0-0xf1 (1)
| | | tick: 0
0x0f0| c0 | . | event: "program_change" (192) 0xf1-0xf1.4 (0.4)
0x0f0| c0 | . | channel: 0 0xf1.4-0xf2 (0.4)
0x0f0| 19 | . | program_change: 25 0xf2-0xf3 (1)
| | | [17]{}: midievent 0xf3-0xf7 (4)
| | | time{}: 0xf3-0xf4 (1)
0x0f0| 00 | . | delta: 0 0xf3-0xf4 (1)
| | | tick: 0
0x0f0| b0 | . | event: "controller" (176) 0xf4-0xf4.4 (0.4)
0x0f0| b0 | . | channel: 0 0xf4.4-0xf5 (0.4)
| | | controller{}: 0xf5-0xf7 (2)
0x0f0| 65 | e | controller: "Registered Parameter Number (MSB)" (101) 0xf5-0xf6 (1)
0x0f0| 00 | . | value: 0 0xf6-0xf7 (1)
| | | [18]{}: midievent 0xf7-0xfa (3)
| | | time{}: 0xf7-0xf8 (1)
0x0f0| 00 | . | delta: 0 0xf7-0xf8 (1)
| | | tick: 0
0x0f0| a0 | . | event: "polyphonic_pressure" (160) 0xf8-0xf8.4 (0.4)
0x0f0| a0 | . | channel: 0 0xf8.4-0xf9 (0.4)
0x0f0| 64 | d | polyphonic_pressure: 100 0xf9-0xfa (1)
| | | [19]{}: midievent 0xfa-0xfd (3)
| | | time{}: 0xfa-0xfb (1)
0x0f0| 00 | . | delta: 0 0xfa-0xfb (1)
| | | tick: 0
0x0f0| d0 | . | event: "channel_pressure" (208) 0xfb-0xfb.4 (0.4)
0x0f0| d0 | . | channel: 0 0xfb.4-0xfc (0.4)
0x0f0| 07 | . | channel_pressure: 7 0xfc-0xfd (1)
| | | [20]{}: midievent 0xfd-0x101 (4)
| | | time{}: 0xfd-0xfe (1)
0x0f0| 00 | . | delta: 0 0xfd-0xfe (1)
| | | tick: 0
0x0f0| 90 | . | event: "note_on" (144) 0xfe-0xfe.4 (0.4)
0x0f0| 90 | . | channel: 0 0xfe.4-0xff (0.4)
| | | note_on{}: 0xff-0x101 (2)
0x0f0| 30| 0| note: "C3" (48) 0xff-0x100 (1)
0x100|48 |H | velocity: 72 0x100-0x101 (1)
| | | [21]{}: midievent 0x101-0x105 (4)
| | | time{}: 0x101-0x102 (1)
0x100| 00 | . | delta: 0 0x101-0x102 (1)
| | | tick: 0
0x100| 92 | . | event: "note_on" (144) 0x102-0x102.4 (0.4)
0x100| 92 | . | channel: 2 0x102.4-0x103 (0.4)
| | | note_on{}: 0x103-0x105 (2)
0x100| 31 | 1 | note: "C♯3/D♭3" (49) 0x103-0x104 (1)
0x100| 48 | H | velocity: 72 0x104-0x105 (1)
| | | [22]{}: midievent 0x105-0x108 (3)
| | | time{}: 0x105-0x106 (1)
0x100| 00 | . | delta: 0 0x105-0x106 (1)
| | | tick: 0
| | | event: "note_on" (144)
| | | channel: 2
| | | note_on{}: 0x106-0x108 (2)
0x100| 30 | 0 | note: "C3" (48) 0x106-0x107 (1)
0x100| 64 | d | velocity: 100 0x107-0x108 (1)
| | | [23]{}: midievent 0x108-0x10d (5)
| | | time{}: 0x108-0x10a (2)
0x100| 81 70 | .p | delta: 240 0x108-0x10a (2)
| | | tick: 240
0x100| e0 | . | event: "pitch_bend" (224) 0x10a-0x10a.4 (0.4)
0x100| e0 | . | channel: 0 0x10a.4-0x10b (0.4)
0x100| 00 08 | .. | pitch_bend: -8184 0x10b-0x10d (2)
| | | [24]{}: midievent 0x10d-0x112 (5)
| | | time{}: 0x10d-0x10f (2)
0x100| 83 60 | .` | delta: 480 0x10d-0x10f (2)
| | | tick: 720
0x100| 80| .| event: "note_off" (128) 0x10f-0x10f.4 (0.4)
0x100| 80| .| channel: 0 0x10f.4-0x110 (0.4)
| | | note_off{}: 0x110-0x112 (2)
0x110|30 |0 | note: "C3" (48) 0x110-0x111 (1)
0x110| 40 | @ | velocity: 64 0x111-0x112 (1)
| | | [25]{}: sysex 0x112-0x11a (8)
| | | time{}: 0x112-0x113 (1)
0x110| 00 | . | delta: 0 0x112-0x113 (1)
| | | tick: 720
0x110| f0 | . | event: "sysex_message" (240) 0x113-0x114 (1)
0x110| 05 | . | length: 5 0x114-0x115 (1)
| | | sysex_message{}: 0x115-0x11a (5)
0x110| 7e | ~ | manufacturer: "Non-RealTime Extensions" (126) 0x115-0x116 (1)
0x110| 00 09 01 | ... | data: raw bits 0x116-0x119 (3)
0x110| f7 | . | end_of_message: 247 0x119-0x11a (1)
| | | [26]{}: sysex 0x11a-0x120 (6)
| | | time{}: 0x11a-0x11b (1)
0x110| 00 | . | delta: 0 0x11a-0x11b (1)
| | | tick: 720
0x110| f0 | . | event: "sysex_message" (240) 0x11b-0x11c (1)
0x110| 03 | . | length: 3 0x11c-0x11d (1)
| | | sysex_message{}: 0x11d-0x120 (3)
0x110| 43 | C | manufacturer: "Yamaha" (67) 0x11d-0x11e (1)
0x110| 12 00| ..| data: raw bits 0x11e-0x120 (2)
| | | continued: true
| | | [27]{}: sysex 0x120-0x12a (10)
| | | time{}: 0x120-0x122 (2)
0x120|81 48 |.H | delta: 200 0x120-0x122 (2)
| | | tick: 920
0x120| f7 | . | event: "sysex_continuation" (247) 0x122-0x123 (1)
0x120| 06 | . | length: 6 0x123-0x124 (1)
| | | sysex_continuation{}: 0x124-0x12a (6)
0x120| 43 12 00 43 12 00 | C..C.. | data: raw bits 0x124-0x12a (6)
| | | continued: true
| | | [28]{}: sysex 0x12a-0x131 (7)
| | | time{}: 0x12a-0x12b (1)
0x120| 64 | d | delta: 100 0x12a-0x12b (1)
| | | tick: 1020
0x120| f7 | . | event: "sysex_continuation" (247) 0x12b-0x12c (1)
0x120| 04 | . | length: 4 0x12c-0x12d (1)
| | | sysex_continuation{}: 0x12d-0x131 (4)
0x120| 43 12 00| C..| data: raw bits 0x12d-0x130 (3)
0x130|f7 |. | end_of_message: 247 0x130-0x131 (1)
| | | [29]{}: sysex 0x131-0x136 (5)
| | | time{}: 0x131-0x132 (1)
0x130| 00 | . | delta: 0 0x131-0x132 (1)
| | | tick: 1020
0x130| f7 | . | event: "sysex_escape" (247) 0x132-0x133 (1)
0x130| 02 | . | length: 2 0x133-0x134 (1)
| | | sysex_escape{}: 0x134-0x136 (2)
0x130| f3 01 | .. | data: raw bits 0x134-0x136 (2)
| | | [30]{}: metaevent 0x136-0x13a (4)
| | | time{}: 0x136-0x137 (1)
0x130| 00 | . | delta: 0 0x136-0x137 (1)
| | | tick: 1020
0x130| ff | . | status: 255 0x137-0x138 (1)
0x130| 2f | / | event: "end_of_track" (47) 0x138-0x139 (1)
0x130| 00| | .| | length: 0 0x139-0x13a (1)