From 87c80f57761bd705b39edae8ee9457cd9b951db6 Mon Sep 17 00:00:00 2001 From: twystd Date: Thu, 5 Sep 2024 14:24:00 -0700 Subject: [PATCH] midi: fixes for PR comments - Reworked event types as snake-case (cf. https://github.com/wader/fq/pull/1004#discussion_r1745101588) - Decoded 'alien' chunks (cf. https://github.com/wader/fq/pull/1004#discussion_r1745082089) --- format/midi/metaevents.go | 2 +- format/midi/midi.go | 12 ++- format/midi/midi.md | 3 +- format/midi/midievents.go | 2 +- format/midi/sysex.go | 14 ++-- format/midi/testdata/Makefile | 4 +- format/midi/testdata/README.md | 10 ++- format/midi/testdata/format-0.fqtest | 4 +- format/midi/testdata/format-1.fqtest | 8 +- format/midi/testdata/format-2.fqtest | 8 +- format/midi/testdata/help_midi.fqtest | 1 + format/midi/testdata/keys.fqtest | 68 ++++++++-------- format/midi/testdata/metaevents.fqtest | 36 ++++----- format/midi/testdata/midi/unknown-chunks.mid | Bin 0 -> 86 bytes format/midi/testdata/midievents.fqtest | 30 +++---- format/midi/testdata/reference.fqtest | 80 +++++++++---------- format/midi/testdata/sysex.fqtest | 20 ++--- format/midi/testdata/unknown-chunks.fqtest | 48 +++++++++++ 18 files changed, 206 insertions(+), 144 deletions(-) create mode 100644 format/midi/testdata/midi/unknown-chunks.mid create mode 100644 format/midi/testdata/unknown-chunks.fqtest diff --git a/format/midi/metaevents.go b/format/midi/metaevents.go index 3032d2ba7..38072a732 100644 --- a/format/midi/metaevents.go +++ b/format/midi/metaevents.go @@ -78,7 +78,7 @@ func decodeMetaEvent(d *decode.D, event uint8, ctx *context) { } if fn, ok := metafns[uint64(event)]; ok { - d.FieldStruct("metaevent", func(d *decode.D) { + d.FieldStruct("meta_event", func(d *decode.D) { d.FieldStruct("time", delta) d.FieldU8("status") d.FieldU8("event", metaevents) diff --git a/format/midi/midi.go b/format/midi/midi.go index 35a492da0..2f843f07e 100644 --- a/format/midi/midi.go +++ b/format/midi/midi.go @@ -42,7 +42,11 @@ func decodeMIDI(d *decode.D) any { // ... decode tracks d.FieldArray("tracks", func(d *decode.D) { for d.BitsLeft() > 0 { - d.FieldStruct("track", decodeMTrk) + if bytes.Equal(d.PeekBytes(4), []byte("MTrk")) { + d.FieldStruct("track", decodeMTrk) + } else { + d.FieldStruct("other", decodeOther) + } } }) @@ -156,6 +160,12 @@ func peekEvent(d *decode.D) (uint64, uint8, uint8) { } } +func decodeOther(d *decode.D) { + d.FieldUTF8("tag", 4) + length := d.FieldS32("length") + d.FieldRawLen("data", length*8) +} + // Big endian varint func vlq(d *decode.D) uint64 { vlq := uint64(0) diff --git a/format/midi/midi.md b/format/midi/midi.md index 88bdb6ac2..4ff6198c5 100644 --- a/format/midi/midi.md +++ b/format/midi/midi.md @@ -34,4 +34,5 @@ fq -d midi 'grep_by(.event=="note_on") | [.time.tick, .note_on.note] | join(" ") 1. [The Complete MIDI 1.0 Detailed Specification](https://www.midi.org/specifications/item/the-midi-1-0-specification) 2. [Standard MIDI Files](https://midi.org/standard-midi-files) 3. [Standard MIDI File (SMF) Format](http://midi.teragonaudio.com/tech/midifile.htm) -4. [MIDI Files Specification](http://www.somascape.org/midi/tech/mfile.html) \ No newline at end of file +4. [MIDI Files Specification](http://www.somascape.org/midi/tech/mfile.html) +5. [github: test-midi-files](https://github.com/jazz-soft/test-midi-files) diff --git a/format/midi/midievents.go b/format/midi/midievents.go index 1ace6c9ab..62c672a50 100644 --- a/format/midi/midievents.go +++ b/format/midi/midievents.go @@ -49,7 +49,7 @@ func decodeMIDIEvent(d *decode.D, status uint8, ctx *context) { } if fn, ok := midifns[uint64(status&0x00f0)]; ok { - d.FieldStruct("midievent", func(d *decode.D) { + d.FieldStruct("midi_event", func(d *decode.D) { d.FieldStruct("time", delta) b := d.PeekBytes(1) diff --git a/format/midi/sysex.go b/format/midi/sysex.go index 232fd4a7a..6f50d6ba7 100644 --- a/format/midi/sysex.go +++ b/format/midi/sysex.go @@ -26,24 +26,24 @@ func decodeSysExEvent(d *decode.D, status uint8, ctx *context) { case status == 0xf0: if ctx.casio { - d.Errorf("SysExMessage F0 start byte without terminating F7") + d.Errorf("SysEx message F0 start byte without terminating F7") } - d.FieldStruct("sysex", func(d *decode.D) { + d.FieldStruct("sysex_event", func(d *decode.D) { d.FieldStruct("time", delta) d.FieldU8("event", sysex) decodeSysExMessage(d, ctx) }) case status == 0xf7 && ctx.casio: - d.FieldStruct("sysex", func(d *decode.D) { + d.FieldStruct("sysex_event", func(d *decode.D) { d.FieldStruct("time", delta) d.FieldU8("event", sysex_extensions) decodeSysExContinuation(d, ctx) }) case status == 0xf7: - d.FieldStruct("sysex", func(d *decode.D) { + d.FieldStruct("sysex_event", func(d *decode.D) { d.FieldStruct("time", delta) d.FieldU8("event", sysex) decodeSysExEscape(d, ctx) @@ -61,7 +61,7 @@ func decodeSysExMessage(d *decode.D, ctx *context) { d.Fatalf("invalid field length") } - d.FieldStruct("sysex_message", func(d *decode.D) { + d.FieldStruct("message", func(d *decode.D) { d.FieldU8("manufacturer", manufacturers) if length < 1 { @@ -95,7 +95,7 @@ func decodeSysExContinuation(d *decode.D, ctx *context) { d.Fatalf("invalid field length") } - d.FieldStruct("sysex_continuation", func(d *decode.D) { + d.FieldStruct("continuation", func(d *decode.D) { if length > 0 { bytes := d.PeekBytes(int(length)) N := len(bytes) @@ -124,7 +124,7 @@ func decodeSysExEscape(d *decode.D, ctx *context) { d.Fatalf("invalid field length") } - d.FieldStruct("sysex_escape", func(d *decode.D) { + d.FieldStruct("escape", func(d *decode.D) { d.FieldRawLen("data", int64(8*length)) }) diff --git a/format/midi/testdata/Makefile b/format/midi/testdata/Makefile index a56e69b89..dc9945983 100644 --- a/format/midi/testdata/Makefile +++ b/format/midi/testdata/Makefile @@ -16,9 +16,7 @@ run: build go run . -d midi dv format/midi/testdata/reference.mid debug: build - go run . -d midi dv format/midi/testdata/midi/invalid-MThd-length.mid - go run . -d midi dv format/midi/testdata/midi/invalid-MTrk-length.mid - go run . -d midi dv format/midi/testdata/events/smpte-offset.mid + go run . -d midi dv format/midi/workdir/test-all-gm-percussion.mid test: build go test ./format -run TestFormats/midi diff --git a/format/midi/testdata/README.md b/format/midi/testdata/README.md index 61f7a4e4c..9fb332b37 100644 --- a/format/midi/testdata/README.md +++ b/format/midi/testdata/README.md @@ -29,15 +29,19 @@ Test file with all supported MIDI key signatures. Test file with all supported MIDI notes. -8. _invalid-MThd-length.mid_ +8. _unknown-chunks.mid_ + +Test file with 'alien' chunks interleaved with the _MTrk_ track chunks. + +9. _invalid-MThd-length.mid_ Test file with invalid _MThd_ chunk length. -9. _invalid-MTrk-length.mid_ +10. _invalid-MTrk-length.mid_ Test file with invalid _MTrk_ chunk length. -10. _twinkle.mid_ +11. _twinkle.mid_ Sample valid MIDI file for the example queries in the help. diff --git a/format/midi/testdata/format-0.fqtest b/format/midi/testdata/format-0.fqtest index 8a7a74464..cb47c7ebe 100644 --- a/format/midi/testdata/format-0.fqtest +++ b/format/midi/testdata/format-0.fqtest @@ -12,7 +12,7 @@ $ fq -d midi dv midi/format-0.mid 0x10|72 6b |rk | 0x10| 00 00 00 10 | .... | length: 16 0x12-0x16 (4) | | | events[0:2]: 0x16-0x26 (16) - | | | [0]{}: metaevent 0x16-0x22 (12) + | | | [0]{}: meta_event 0x16-0x22 (12) | | | time{}: 0x16-0x17 (1) 0x10| 00 | . | delta: 0 0x16-0x17 (1) | | | tick: 0 @@ -20,7 +20,7 @@ $ fq -d midi dv midi/format-0.mid 0x10| 03 | . | event: "track_name" (3) 0x18-0x19 (1) 0x10| 08 46 6f 72 6d 61 74| .Format| track_name: "Format 0" 0x19-0x22 (9) 0x20|20 30 | 0 | - | | | [1]{}: metaevent 0x22-0x26 (4) + | | | [1]{}: meta_event 0x22-0x26 (4) | | | time{}: 0x22-0x23 (1) 0x20| 00 | . | delta: 0 0x22-0x23 (1) | | | tick: 0 diff --git a/format/midi/testdata/format-1.fqtest b/format/midi/testdata/format-1.fqtest index 458ce6dc9..86dd8086d 100644 --- a/format/midi/testdata/format-1.fqtest +++ b/format/midi/testdata/format-1.fqtest @@ -12,7 +12,7 @@ $ fq -d midi dv midi/format-1.mid 0x10|72 6b |rk | 0x10| 00 00 00 10 | .... | length: 16 0x12-0x16 (4) | | | events[0:2]: 0x16-0x26 (16) - | | | [0]{}: metaevent 0x16-0x22 (12) + | | | [0]{}: meta_event 0x16-0x22 (12) | | | time{}: 0x16-0x17 (1) 0x10| 00 | . | delta: 0 0x16-0x17 (1) | | | tick: 0 @@ -20,7 +20,7 @@ $ fq -d midi dv midi/format-1.mid 0x10| 03 | . | event: "track_name" (3) 0x18-0x19 (1) 0x10| 08 46 6f 72 6d 61 74| .Format| track_name: "Format 1" 0x19-0x22 (9) 0x20|20 31 | 1 | - | | | [1]{}: metaevent 0x22-0x26 (4) + | | | [1]{}: meta_event 0x22-0x26 (4) | | | time{}: 0x22-0x23 (1) 0x20| 00 | . | delta: 0 0x22-0x23 (1) | | | tick: 0 @@ -31,7 +31,7 @@ $ fq -d midi dv midi/format-1.mid 0x20| 4d 54 72 6b | MTrk | tag: "MTrk" 0x26-0x2a (4) 0x20| 00 00 00 17 | .... | length: 23 0x2a-0x2e (4) | | | events[0:2]: 0x2e-0x45 (23) - | | | [0]{}: metaevent 0x2e-0x41 (19) + | | | [0]{}: meta_event 0x2e-0x41 (19) | | | time{}: 0x2e-0x2f (1) 0x20| 00 | . | delta: 0 0x2e-0x2f (1) | | | tick: 0 @@ -39,7 +39,7 @@ $ fq -d midi dv midi/format-1.mid 0x30|03 |. | event: "track_name" (3) 0x30-0x31 (1) 0x30| 0f 41 63 6f 75 73 74 69 63 20 47 75 69 74 61| .Acoustic Guita| track_name: "Acoustic Guitar" 0x31-0x41 (16) 0x40|72 |r | - | | | [1]{}: metaevent 0x41-0x45 (4) + | | | [1]{}: meta_event 0x41-0x45 (4) | | | time{}: 0x41-0x42 (1) 0x40| 00 | . | delta: 0 0x41-0x42 (1) | | | tick: 0 diff --git a/format/midi/testdata/format-2.fqtest b/format/midi/testdata/format-2.fqtest index 26f6e2aa2..b11f5f95f 100644 --- a/format/midi/testdata/format-2.fqtest +++ b/format/midi/testdata/format-2.fqtest @@ -12,7 +12,7 @@ $ fq -d midi dv midi/format-2.mid 0x10|72 6b |rk | 0x10| 00 00 00 12 | .... | length: 18 0x12-0x16 (4) | | | events[0:2]: 0x16-0x28 (18) - | | | [0]{}: metaevent 0x16-0x24 (14) + | | | [0]{}: meta_event 0x16-0x24 (14) | | | time{}: 0x16-0x17 (1) 0x10| 00 | . | delta: 0 0x16-0x17 (1) | | | tick: 0 @@ -20,7 +20,7 @@ $ fq -d midi dv midi/format-2.mid 0x10| 03 | . | event: "track_name" (3) 0x18-0x19 (1) 0x10| 0a 4c 65 66 74 20 54| .Left T| track_name: "Left Track" 0x19-0x24 (11) 0x20|72 61 63 6b |rack | - | | | [1]{}: metaevent 0x24-0x28 (4) + | | | [1]{}: meta_event 0x24-0x28 (4) | | | time{}: 0x24-0x25 (1) 0x20| 00 | . | delta: 0 0x24-0x25 (1) | | | tick: 0 @@ -31,14 +31,14 @@ $ fq -d midi dv midi/format-2.mid 0x20| 4d 54 72 6b | MTrk | tag: "MTrk" 0x28-0x2c (4) 0x20| 00 00 00 13| ....| length: 19 0x2c-0x30 (4) | | | events[0:2]: 0x30-0x43 (19) - | | | [0]{}: metaevent 0x30-0x3f (15) + | | | [0]{}: meta_event 0x30-0x3f (15) | | | time{}: 0x30-0x31 (1) 0x30|00 |. | delta: 0 0x30-0x31 (1) | | | tick: 0 0x30| ff | . | status: 255 0x31-0x32 (1) 0x30| 03 | . | event: "track_name" (3) 0x32-0x33 (1) 0x30| 0b 52 69 67 68 74 20 54 72 61 63 6b | .Right Track | track_name: "Right Track" 0x33-0x3f (12) - | | | [1]{}: metaevent 0x3f-0x43 (4) + | | | [1]{}: meta_event 0x3f-0x43 (4) | | | time{}: 0x3f-0x40 (1) 0x30| 00| .| delta: 0 0x3f-0x40 (1) | | | tick: 0 diff --git a/format/midi/testdata/help_midi.fqtest b/format/midi/testdata/help_midi.fqtest index 4f4894db8..2eb1decbc 100644 --- a/format/midi/testdata/help_midi.fqtest +++ b/format/midi/testdata/help_midi.fqtest @@ -43,3 +43,4 @@ References * Standard MIDI Files (https://midi.org/standard-midi-files) * Standard MIDI File (SMF) Format (http://midi.teragonaudio.com/tech/midifile.htm) * MIDI Files Specification (http://www.somascape.org/midi/tech/mfile.html) +* github: test-midi-files (https://github.com/jazz-soft/test-midi-files) diff --git a/format/midi/testdata/keys.fqtest b/format/midi/testdata/keys.fqtest index 36228f690..dfb00d22c 100644 --- a/format/midi/testdata/keys.fqtest +++ b/format/midi/testdata/keys.fqtest @@ -12,7 +12,7 @@ $ fq -d midi d midi/key-signatures.mid 0x010|72 6b |rk | 0x010| 00 00 00 f7 | .... | length: 247 | | | events[0:34]: - | | | [0]{}: metaevent + | | | [0]{}: meta_event | | | time{}: 0x010| 00 | . | delta: 0 | | | tick: 0 @@ -20,7 +20,7 @@ $ fq -d midi d midi/key-signatures.mid 0x010| 03 | . | event: "track_name" (3) 0x010| 0e 4b 65 79 20 53 69| .Key Si| track_name: "Key Signatures" 0x020|67 6e 61 74 75 72 65 73 |gnatures | - | | | [1]{}: metaevent + | | | [1]{}: meta_event | | | time{}: 0x020| 87 69 | .i | delta: 1001 | | | tick: 1001 @@ -28,7 +28,7 @@ $ fq -d midi d midi/key-signatures.mid 0x020| 59 | Y | event: "key_signature" (89) 0x020| 02 | . | length: 2 0x020| 00 00 | .. | key_signature: "C major" (0) - | | | [2]{}: metaevent + | | | [2]{}: meta_event | | | time{}: 0x020| 87| .| delta: 1001 0x030|69 |i | @@ -37,7 +37,7 @@ $ fq -d midi d midi/key-signatures.mid 0x030| 59 | Y | event: "key_signature" (89) 0x030| 02 | . | length: 2 0x030| 01 00 | .. | key_signature: "G major" (256) - | | | [3]{}: metaevent + | | | [3]{}: meta_event | | | time{}: 0x030| 87 69 | .i | delta: 1001 | | | tick: 3003 @@ -45,7 +45,7 @@ $ fq -d midi d midi/key-signatures.mid 0x030| 59 | Y | event: "key_signature" (89) 0x030| 02 | . | length: 2 0x030| 02 00 | .. | key_signature: "D major" (512) - | | | [4]{}: metaevent + | | | [4]{}: meta_event | | | time{}: 0x030| 87 69 | .i | delta: 1001 | | | tick: 4004 @@ -53,7 +53,7 @@ $ fq -d midi d midi/key-signatures.mid 0x040|59 |Y | event: "key_signature" (89) 0x040| 02 | . | length: 2 0x040| 03 00 | .. | key_signature: "A major" (768) - | | | [5]{}: metaevent + | | | [5]{}: meta_event | | | time{}: 0x040| 87 69 | .i | delta: 1001 | | | tick: 5005 @@ -61,7 +61,7 @@ $ fq -d midi d midi/key-signatures.mid 0x040| 59 | Y | event: "key_signature" (89) 0x040| 02 | . | length: 2 0x040| 04 00 | .. | key_signature: "E major" (1024) - | | | [6]{}: metaevent + | | | [6]{}: meta_event | | | time{}: 0x040| 87 69 | .i | delta: 1001 | | | tick: 6006 @@ -69,7 +69,7 @@ $ fq -d midi d midi/key-signatures.mid 0x040| 59 | Y | event: "key_signature" (89) 0x040| 02| .| length: 2 0x050|05 00 |.. | key_signature: "B major" (1280) - | | | [7]{}: metaevent + | | | [7]{}: meta_event | | | time{}: 0x050| 87 69 | .i | delta: 1001 | | | tick: 7007 @@ -77,7 +77,7 @@ $ fq -d midi d midi/key-signatures.mid 0x050| 59 | Y | event: "key_signature" (89) 0x050| 02 | . | length: 2 0x050| 06 00 | .. | key_signature: "F♯ major" (1536) - | | | [8]{}: metaevent + | | | [8]{}: meta_event | | | time{}: 0x050| 87 69 | .i | delta: 1001 | | | tick: 8008 @@ -85,7 +85,7 @@ $ fq -d midi d midi/key-signatures.mid 0x050| 59 | Y | event: "key_signature" (89) 0x050| 02 | . | length: 2 0x050| 07 00| ..| key_signature: "C♯ major" (1792) - | | | [9]{}: metaevent + | | | [9]{}: meta_event | | | time{}: 0x060|87 69 |.i | delta: 1001 | | | tick: 9009 @@ -93,7 +93,7 @@ $ fq -d midi d midi/key-signatures.mid 0x060| 59 | Y | event: "key_signature" (89) 0x060| 02 | . | length: 2 0x060| 00 00 | .. | key_signature: "C major" (0) - | | | [10]{}: metaevent + | | | [10]{}: meta_event | | | time{}: 0x060| 87 69 | .i | delta: 1001 | | | tick: 10010 @@ -101,7 +101,7 @@ $ fq -d midi d midi/key-signatures.mid 0x060| 59 | Y | event: "key_signature" (89) 0x060| 02 | . | length: 2 0x060| ff 00 | .. | key_signature: "F major" (65280) - | | | [11]{}: metaevent + | | | [11]{}: meta_event | | | time{}: 0x060| 87 69| .i| delta: 1001 | | | tick: 11011 @@ -109,7 +109,7 @@ $ fq -d midi d midi/key-signatures.mid 0x070| 59 | Y | event: "key_signature" (89) 0x070| 02 | . | length: 2 0x070| fe 00 | .. | key_signature: "B♭ major" (65024) - | | | [12]{}: metaevent + | | | [12]{}: meta_event | | | time{}: 0x070| 87 69 | .i | delta: 1001 | | | tick: 12012 @@ -117,7 +117,7 @@ $ fq -d midi d midi/key-signatures.mid 0x070| 59 | Y | event: "key_signature" (89) 0x070| 02 | . | length: 2 0x070| fd 00 | .. | key_signature: "E♭ major" (64768) - | | | [13]{}: metaevent + | | | [13]{}: meta_event | | | time{}: 0x070| 87 69 | .i | delta: 1001 | | | tick: 13013 @@ -125,7 +125,7 @@ $ fq -d midi d midi/key-signatures.mid 0x070| 59| Y| event: "key_signature" (89) 0x080|02 |. | length: 2 0x080| fc 00 | .. | key_signature: "A♭ major" (64512) - | | | [14]{}: metaevent + | | | [14]{}: meta_event | | | time{}: 0x080| 87 69 | .i | delta: 1001 | | | tick: 14014 @@ -133,7 +133,7 @@ $ fq -d midi d midi/key-signatures.mid 0x080| 59 | Y | event: "key_signature" (89) 0x080| 02 | . | length: 2 0x080| fb 00 | .. | key_signature: "D♭ major" (64256) - | | | [15]{}: metaevent + | | | [15]{}: meta_event | | | time{}: 0x080| 87 69 | .i | delta: 1001 | | | tick: 15015 @@ -142,7 +142,7 @@ $ fq -d midi d midi/key-signatures.mid 0x080| 02 | . | length: 2 0x080| fa| .| key_signature: "G♭ major" (64000) 0x090|00 |. | - | | | [16]{}: metaevent + | | | [16]{}: meta_event | | | time{}: 0x090| 87 69 | .i | delta: 1001 | | | tick: 16016 @@ -150,7 +150,7 @@ $ fq -d midi d midi/key-signatures.mid 0x090| 59 | Y | event: "key_signature" (89) 0x090| 02 | . | length: 2 0x090| f9 00 | .. | key_signature: "C♭ major" (63744) - | | | [17]{}: metaevent + | | | [17]{}: meta_event | | | time{}: 0x090| 87 69 | .i | delta: 1001 | | | tick: 17017 @@ -158,7 +158,7 @@ $ fq -d midi d midi/key-signatures.mid 0x090| 59 | Y | event: "key_signature" (89) 0x090| 02 | . | length: 2 0x090| 00 01 | .. | key_signature: "A minor" (1) - | | | [18]{}: metaevent + | | | [18]{}: meta_event | | | time{}: 0x090| 87| .| delta: 1001 0x0a0|69 |i | @@ -167,7 +167,7 @@ $ fq -d midi d midi/key-signatures.mid 0x0a0| 59 | Y | event: "key_signature" (89) 0x0a0| 02 | . | length: 2 0x0a0| 01 01 | .. | key_signature: "E minor" (257) - | | | [19]{}: metaevent + | | | [19]{}: meta_event | | | time{}: 0x0a0| 87 69 | .i | delta: 1001 | | | tick: 19019 @@ -175,7 +175,7 @@ $ fq -d midi d midi/key-signatures.mid 0x0a0| 59 | Y | event: "key_signature" (89) 0x0a0| 02 | . | length: 2 0x0a0| 02 01 | .. | key_signature: "B minor" (513) - | | | [20]{}: metaevent + | | | [20]{}: meta_event | | | time{}: 0x0a0| 87 69 | .i | delta: 1001 | | | tick: 20020 @@ -183,7 +183,7 @@ $ fq -d midi d midi/key-signatures.mid 0x0b0|59 |Y | event: "key_signature" (89) 0x0b0| 02 | . | length: 2 0x0b0| 03 01 | .. | key_signature: "F♯ minor" (769) - | | | [21]{}: metaevent + | | | [21]{}: meta_event | | | time{}: 0x0b0| 87 69 | .i | delta: 1001 | | | tick: 21021 @@ -191,7 +191,7 @@ $ fq -d midi d midi/key-signatures.mid 0x0b0| 59 | Y | event: "key_signature" (89) 0x0b0| 02 | . | length: 2 0x0b0| 04 01 | .. | key_signature: "C♯ minor" (1025) - | | | [22]{}: metaevent + | | | [22]{}: meta_event | | | time{}: 0x0b0| 87 69 | .i | delta: 1001 | | | tick: 22022 @@ -199,7 +199,7 @@ $ fq -d midi d midi/key-signatures.mid 0x0b0| 59 | Y | event: "key_signature" (89) 0x0b0| 02| .| length: 2 0x0c0|05 01 |.. | key_signature: "G♯ minor" (1281) - | | | [23]{}: metaevent + | | | [23]{}: meta_event | | | time{}: 0x0c0| 87 69 | .i | delta: 1001 | | | tick: 23023 @@ -207,7 +207,7 @@ $ fq -d midi d midi/key-signatures.mid 0x0c0| 59 | Y | event: "key_signature" (89) 0x0c0| 02 | . | length: 2 0x0c0| 06 01 | .. | key_signature: "D♯ minor" (1537) - | | | [24]{}: metaevent + | | | [24]{}: meta_event | | | time{}: 0x0c0| 87 69 | .i | delta: 1001 | | | tick: 24024 @@ -215,7 +215,7 @@ $ fq -d midi d midi/key-signatures.mid 0x0c0| 59 | Y | event: "key_signature" (89) 0x0c0| 02 | . | length: 2 0x0c0| 07 01| ..| key_signature: "A♯ minor" (1793) - | | | [25]{}: metaevent + | | | [25]{}: meta_event | | | time{}: 0x0d0|87 69 |.i | delta: 1001 | | | tick: 25025 @@ -223,7 +223,7 @@ $ fq -d midi d midi/key-signatures.mid 0x0d0| 59 | Y | event: "key_signature" (89) 0x0d0| 02 | . | length: 2 0x0d0| 00 01 | .. | key_signature: "A minor" (1) - | | | [26]{}: metaevent + | | | [26]{}: meta_event | | | time{}: 0x0d0| 87 69 | .i | delta: 1001 | | | tick: 26026 @@ -231,7 +231,7 @@ $ fq -d midi d midi/key-signatures.mid 0x0d0| 59 | Y | event: "key_signature" (89) 0x0d0| 02 | . | length: 2 0x0d0| ff 01 | .. | key_signature: "D minor" (65281) - | | | [27]{}: metaevent + | | | [27]{}: meta_event | | | time{}: 0x0d0| 87 69| .i| delta: 1001 | | | tick: 27027 @@ -239,7 +239,7 @@ $ fq -d midi d midi/key-signatures.mid 0x0e0| 59 | Y | event: "key_signature" (89) 0x0e0| 02 | . | length: 2 0x0e0| fe 01 | .. | key_signature: "G minor" (65025) - | | | [28]{}: metaevent + | | | [28]{}: meta_event | | | time{}: 0x0e0| 87 69 | .i | delta: 1001 | | | tick: 28028 @@ -247,7 +247,7 @@ $ fq -d midi d midi/key-signatures.mid 0x0e0| 59 | Y | event: "key_signature" (89) 0x0e0| 02 | . | length: 2 0x0e0| fd 01 | .. | key_signature: "C minor" (64769) - | | | [29]{}: metaevent + | | | [29]{}: meta_event | | | time{}: 0x0e0| 87 69 | .i | delta: 1001 | | | tick: 29029 @@ -255,7 +255,7 @@ $ fq -d midi d midi/key-signatures.mid 0x0e0| 59| Y| event: "key_signature" (89) 0x0f0|02 |. | length: 2 0x0f0| fc 01 | .. | key_signature: "F minor" (64513) - | | | [30]{}: metaevent + | | | [30]{}: meta_event | | | time{}: 0x0f0| 87 69 | .i | delta: 1001 | | | tick: 30030 @@ -263,7 +263,7 @@ $ fq -d midi d midi/key-signatures.mid 0x0f0| 59 | Y | event: "key_signature" (89) 0x0f0| 02 | . | length: 2 0x0f0| fb 01 | .. | key_signature: "B♭ minor" (64257) - | | | [31]{}: metaevent + | | | [31]{}: meta_event | | | time{}: 0x0f0| 87 69 | .i | delta: 1001 | | | tick: 31031 @@ -272,7 +272,7 @@ $ fq -d midi d midi/key-signatures.mid 0x0f0| 02 | . | length: 2 0x0f0| fa| .| key_signature: "E♭ minor" (64001) 0x100|01 |. | - | | | [32]{}: metaevent + | | | [32]{}: meta_event | | | time{}: 0x100| 87 69 | .i | delta: 1001 | | | tick: 32032 @@ -280,7 +280,7 @@ $ fq -d midi d midi/key-signatures.mid 0x100| 59 | Y | event: "key_signature" (89) 0x100| 02 | . | length: 2 0x100| f9 01 | .. | key_signature: "A♭ minor" (63745) - | | | [33]{}: metaevent + | | | [33]{}: meta_event | | | time{}: 0x100| 87 69 | .i | delta: 1001 | | | tick: 33033 diff --git a/format/midi/testdata/metaevents.fqtest b/format/midi/testdata/metaevents.fqtest index db78c422e..7806e0078 100644 --- a/format/midi/testdata/metaevents.fqtest +++ b/format/midi/testdata/metaevents.fqtest @@ -12,7 +12,7 @@ $ fq -d midi dv events/sequence-number.mid 0x10|72 6b |rk | 0x10| 00 00 00 06 | .... | length: 6 0x12-0x16 (4) | | | events[0:1]: 0x16-0x1c (6) - | | | [0]{}: metaevent 0x16-0x1c (6) + | | | [0]{}: meta_event 0x16-0x1c (6) | | | time{}: 0x16-0x17 (1) 0x10| 00 | . | delta: 0 0x16-0x17 (1) | | | tick: 0 @@ -34,7 +34,7 @@ $ fq -d midi dv events/text.mid 0x10|72 6b |rk | 0x10| 00 00 00 11 | .... | length: 17 0x12-0x16 (4) | | | events[0:1]: 0x16-0x27 (17) - | | | [0]{}: metaevent 0x16-0x27 (17) + | | | [0]{}: meta_event 0x16-0x27 (17) | | | time{}: 0x16-0x17 (1) 0x10| 00 | . | delta: 0 0x16-0x17 (1) | | | tick: 0 @@ -56,7 +56,7 @@ $ fq -d midi dv events/copyright.mid 0x10|72 6b |rk | 0x10| 00 00 00 08 | .... | length: 8 0x12-0x16 (4) | | | events[0:1]: 0x16-0x1e (8) - | | | [0]{}: metaevent 0x16-0x1e (8) + | | | [0]{}: meta_event 0x16-0x1e (8) | | | time{}: 0x16-0x17 (1) 0x10| 00 | . | delta: 0 0x16-0x17 (1) | | | tick: 0 @@ -77,7 +77,7 @@ $ fq -d midi dv events/track-name.mid 0x10|72 6b |rk | 0x10| 00 00 00 13 | .... | length: 19 0x12-0x16 (4) | | | events[0:1]: 0x16-0x29 (19) - | | | [0]{}: metaevent 0x16-0x29 (19) + | | | [0]{}: meta_event 0x16-0x29 (19) | | | time{}: 0x16-0x17 (1) 0x10| 00 | . | delta: 0 0x16-0x17 (1) | | | tick: 0 @@ -99,7 +99,7 @@ $ fq -d midi dv events/instrument-name.mid 0x10|72 6b |rk | 0x10| 00 00 00 0e | .... | length: 14 0x12-0x16 (4) | | | events[0:1]: 0x16-0x24 (14) - | | | [0]{}: metaevent 0x16-0x24 (14) + | | | [0]{}: meta_event 0x16-0x24 (14) | | | time{}: 0x16-0x17 (1) 0x10| 00 | . | delta: 0 0x16-0x17 (1) | | | tick: 0 @@ -121,7 +121,7 @@ $ fq -d midi dv events/lyric.mid 0x10|72 6b |rk | 0x10| 00 00 00 0c | .... | length: 12 0x12-0x16 (4) | | | events[0:1]: 0x16-0x22 (12) - | | | [0]{}: metaevent 0x16-0x22 (12) + | | | [0]{}: meta_event 0x16-0x22 (12) | | | time{}: 0x16-0x17 (1) 0x10| 00 | . | delta: 0 0x16-0x17 (1) | | | tick: 0 @@ -143,7 +143,7 @@ $ fq -d midi dv events/marker.mid 0x10|72 6b |rk | 0x10| 00 00 00 13 | .... | length: 19 0x12-0x16 (4) | | | events[0:1]: 0x16-0x29 (19) - | | | [0]{}: metaevent 0x16-0x29 (19) + | | | [0]{}: meta_event 0x16-0x29 (19) | | | time{}: 0x16-0x17 (1) 0x10| 00 | . | delta: 0 0x16-0x17 (1) | | | tick: 0 @@ -165,7 +165,7 @@ $ fq -d midi dv events/cuepoint.mid 0x10|72 6b |rk | 0x10| 00 00 00 10 | .... | length: 16 0x12-0x16 (4) | | | events[0:1]: 0x16-0x26 (16) - | | | [0]{}: metaevent 0x16-0x26 (16) + | | | [0]{}: meta_event 0x16-0x26 (16) | | | time{}: 0x16-0x17 (1) 0x10| 00 | . | delta: 0 0x16-0x17 (1) | | | tick: 0 @@ -187,7 +187,7 @@ $ fq -d midi dv events/program-name.mid 0x10|72 6b |rk | 0x10| 00 00 00 0a | .... | length: 10 0x12-0x16 (4) | | | events[0:1]: 0x16-0x20 (10) - | | | [0]{}: metaevent 0x16-0x20 (10) + | | | [0]{}: meta_event 0x16-0x20 (10) | | | time{}: 0x16-0x17 (1) 0x10| 00 | . | delta: 0 0x16-0x17 (1) | | | tick: 0 @@ -208,7 +208,7 @@ $ fq -d midi dv events/device-name.mid 0x10|72 6b |rk | 0x10| 00 00 00 0c | .... | length: 12 0x12-0x16 (4) | | | events[0:1]: 0x16-0x22 (12) - | | | [0]{}: metaevent 0x16-0x22 (12) + | | | [0]{}: meta_event 0x16-0x22 (12) | | | time{}: 0x16-0x17 (1) 0x10| 00 | . | delta: 0 0x16-0x17 (1) | | | tick: 0 @@ -230,7 +230,7 @@ $ fq -d midi dv events/midi-channel-prefix.mid 0x10|72 6b |rk | 0x10| 00 00 00 05 | .... | length: 5 0x12-0x16 (4) | | | events[0:1]: 0x16-0x1b (5) - | | | [0]{}: metaevent 0x16-0x1b (5) + | | | [0]{}: meta_event 0x16-0x1b (5) | | | time{}: 0x16-0x17 (1) 0x10| 00 | . | delta: 0 0x16-0x17 (1) | | | tick: 0 @@ -252,7 +252,7 @@ $ fq -d midi dv events/midi-port.mid 0x10|72 6b |rk | 0x10| 00 00 00 05 | .... | length: 5 0x12-0x16 (4) | | | events[0:1]: 0x16-0x1b (5) - | | | [0]{}: metaevent 0x16-0x1b (5) + | | | [0]{}: meta_event 0x16-0x1b (5) | | | time{}: 0x16-0x17 (1) 0x10| 00 | . | delta: 0 0x16-0x17 (1) | | | tick: 0 @@ -274,7 +274,7 @@ $ fq -d midi dv events/tempo.mid 0x10|72 6b |rk | 0x10| 00 00 00 07 | .... | length: 7 0x12-0x16 (4) | | | events[0:1]: 0x16-0x1d (7) - | | | [0]{}: metaevent 0x16-0x1d (7) + | | | [0]{}: meta_event 0x16-0x1d (7) | | | time{}: 0x16-0x17 (1) 0x10| 00 | . | delta: 0 0x16-0x17 (1) | | | tick: 0 @@ -296,7 +296,7 @@ $ fq -d midi dv events/smpte-offset.mid 0x10|72 6b |rk | 0x10| 00 00 00 09 | .... | length: 9 0x12-0x16 (4) | | | events[0:1]: 0x16-0x1f (9) - | | | [0]{}: metaevent 0x16-0x1f (9) + | | | [0]{}: meta_event 0x16-0x1f (9) | | | time{}: 0x16-0x17 (1) 0x10| 00 | . | delta: 0 0x16-0x17 (1) | | | tick: 0 @@ -324,7 +324,7 @@ $ fq -d midi dv events/time-signature.mid 0x10|72 6b |rk | 0x10| 00 00 00 08 | .... | length: 8 0x12-0x16 (4) | | | events[0:1]: 0x16-0x1e (8) - | | | [0]{}: metaevent 0x16-0x1e (8) + | | | [0]{}: meta_event 0x16-0x1e (8) | | | time{}: 0x16-0x17 (1) 0x10| 00 | . | delta: 0 0x16-0x17 (1) | | | tick: 0 @@ -350,7 +350,7 @@ $ fq -d midi dv events/key-signature.mid 0x10|72 6b |rk | 0x10| 00 00 00 06 | .... | length: 6 0x12-0x16 (4) | | | events[0:1]: 0x16-0x1c (6) - | | | [0]{}: metaevent 0x16-0x1c (6) + | | | [0]{}: meta_event 0x16-0x1c (6) | | | time{}: 0x16-0x17 (1) 0x10| 00 | . | delta: 0 0x16-0x17 (1) | | | tick: 0 @@ -372,7 +372,7 @@ $ fq -d midi dv events/end-of-track.mid 0x10|72 6b |rk | 0x10| 00 00 00 04 | .... | length: 4 0x12-0x16 (4) | | | events[0:1]: 0x16-0x1a (4) - | | | [0]{}: metaevent 0x16-0x1a (4) + | | | [0]{}: meta_event 0x16-0x1a (4) | | | time{}: 0x16-0x17 (1) 0x10| 00 | . | delta: 0 0x16-0x17 (1) | | | tick: 0 @@ -393,7 +393,7 @@ $ fq -d midi dv events/sequencer-specific-event.mid 0x10|72 6b |rk | 0x10| 00 00 00 0a | .... | length: 10 0x12-0x16 (4) | | | events[0:1]: 0x16-0x20 (10) - | | | [0]{}: metaevent 0x16-0x20 (10) + | | | [0]{}: meta_event 0x16-0x20 (10) | | | time{}: 0x16-0x17 (1) 0x10| 00 | . | delta: 0 0x16-0x17 (1) | | | tick: 0 diff --git a/format/midi/testdata/midi/unknown-chunks.mid b/format/midi/testdata/midi/unknown-chunks.mid new file mode 100644 index 0000000000000000000000000000000000000000..99a91ae2ad1326f55aaae8d394ebe52886acaf84 GIT binary patch literal 86 zcmeYb$w*;fU|?flWME=^;2Tm@0pxKoD!Zn4u0H!7$j=7ySs4E7Gr;8j-PtvxEW}6v In;c9Z0Kq^QDF6Tf literal 0 HcmV?d00001 diff --git a/format/midi/testdata/midievents.fqtest b/format/midi/testdata/midievents.fqtest index fb52f9233..185d9b80e 100644 --- a/format/midi/testdata/midievents.fqtest +++ b/format/midi/testdata/midievents.fqtest @@ -12,7 +12,7 @@ $ fq -d midi dv events/note-off.mid 0x10|72 6b |rk | 0x10| 00 00 00 07 | .... | length: 7 0x12-0x16 (4) | | | events[0:2]: 0x16-0x1d (7) - | | | [0]{}: midievent 0x16-0x1a (4) + | | | [0]{}: midi_event 0x16-0x1a (4) | | | time{}: 0x16-0x17 (1) 0x10| 00 | . | delta: 0 0x16-0x17 (1) | | | tick: 0 @@ -21,7 +21,7 @@ $ fq -d midi dv events/note-off.mid | | | note_off{}: 0x18-0x1a (2) 0x10| 70 | p | note: "E8" (112) 0x18-0x19 (1) 0x10| 60 | ` | velocity: 96 0x19-0x1a (1) - | | | [1]{}: midievent 0x1a-0x1d (3) + | | | [1]{}: midi_event 0x1a-0x1d (3) | | | time{}: 0x1a-0x1b (1) 0x10| 64 | d | delta: 100 0x1a-0x1b (1) | | | tick: 100 @@ -44,7 +44,7 @@ $ fq -d midi dv events/note-on.mid 0x10|72 6b |rk | 0x10| 00 00 00 07 | .... | length: 7 0x12-0x16 (4) | | | events[0:2]: 0x16-0x1d (7) - | | | [0]{}: midievent 0x16-0x1a (4) + | | | [0]{}: midi_event 0x16-0x1a (4) | | | time{}: 0x16-0x17 (1) 0x10| 00 | . | delta: 0 0x16-0x17 (1) | | | tick: 0 @@ -53,7 +53,7 @@ $ fq -d midi dv events/note-on.mid | | | note_on{}: 0x18-0x1a (2) 0x10| 30 | 0 | note: "C3" (48) 0x18-0x19 (1) 0x10| 48 | H | velocity: 72 0x19-0x1a (1) - | | | [1]{}: midievent 0x1a-0x1d (3) + | | | [1]{}: midi_event 0x1a-0x1d (3) | | | time{}: 0x1a-0x1b (1) 0x10| 40 | @ | delta: 64 0x1a-0x1b (1) | | | tick: 64 @@ -76,14 +76,14 @@ $ fq -d midi dv events/polyphonic-pressure.mid 0x10|72 6b |rk | 0x10| 00 00 00 05 | .... | length: 5 0x12-0x16 (4) | | | events[0:2]: 0x16-0x1b (5) - | | | [0]{}: midievent 0x16-0x19 (3) + | | | [0]{}: midi_event 0x16-0x19 (3) | | | time{}: 0x16-0x17 (1) 0x10| 00 | . | delta: 0 0x16-0x17 (1) | | | tick: 0 0x10| a0 | . | event: "polyphonic_pressure" (160) 0x17-0x17.4 (0.4) 0x10| a0 | . | channel: 0 0x17.4-0x18 (0.4) 0x10| 64 | d | polyphonic_pressure: 100 0x18-0x19 (1) - | | | [1]{}: midievent 0x19-0x1b (2) + | | | [1]{}: midi_event 0x19-0x1b (2) | | | time{}: 0x19-0x1a (1) 0x10| 40 | @ | delta: 64 0x19-0x1a (1) | | | tick: 64 @@ -104,7 +104,7 @@ $ fq -d midi dv events/controller.mid 0x10|72 6b |rk | 0x10| 00 00 00 07 | .... | length: 7 0x12-0x16 (4) | | | events[0:2]: 0x16-0x1d (7) - | | | [0]{}: midievent 0x16-0x1a (4) + | | | [0]{}: midi_event 0x16-0x1a (4) | | | time{}: 0x16-0x17 (1) 0x10| 00 | . | delta: 0 0x16-0x17 (1) | | | tick: 0 @@ -113,7 +113,7 @@ $ fq -d midi dv events/controller.mid | | | controller{}: 0x18-0x1a (2) 0x10| 20 | | controller: "Bank Select (LSB)" (32) 0x18-0x19 (1) 0x10| 21 | ! | value: 33 0x19-0x1a (1) - | | | [1]{}: midievent 0x1a-0x1d (3) + | | | [1]{}: midi_event 0x1a-0x1d (3) | | | time{}: 0x1a-0x1b (1) 0x10| 40 | @ | delta: 64 0x1a-0x1b (1) | | | tick: 64 @@ -136,14 +136,14 @@ $ fq -d midi dv events/program-change.mid 0x10|72 6b |rk | 0x10| 00 00 00 05 | .... | length: 5 0x12-0x16 (4) | | | events[0:2]: 0x16-0x1b (5) - | | | [0]{}: midievent 0x16-0x19 (3) + | | | [0]{}: midi_event 0x16-0x19 (3) | | | time{}: 0x16-0x17 (1) 0x10| 00 | . | delta: 0 0x16-0x17 (1) | | | tick: 0 0x10| c0 | . | event: "program_change" (192) 0x17-0x17.4 (0.4) 0x10| c0 | . | channel: 0 0x17.4-0x18 (0.4) 0x10| 19 | . | program_change: 25 0x18-0x19 (1) - | | | [1]{}: midievent 0x19-0x1b (2) + | | | [1]{}: midi_event 0x19-0x1b (2) | | | time{}: 0x19-0x1a (1) 0x10| 40 | @ | delta: 64 0x19-0x1a (1) | | | tick: 64 @@ -164,14 +164,14 @@ $ fq -d midi dv events/channel-pressure.mid 0x10|72 6b |rk | 0x10| 00 00 00 05 | .... | length: 5 0x12-0x16 (4) | | | events[0:2]: 0x16-0x1b (5) - | | | [0]{}: midievent 0x16-0x19 (3) + | | | [0]{}: midi_event 0x16-0x19 (3) | | | time{}: 0x16-0x17 (1) 0x10| 00 | . | delta: 0 0x16-0x17 (1) | | | tick: 0 0x10| d0 | . | event: "channel_pressure" (208) 0x17-0x17.4 (0.4) 0x10| d0 | . | channel: 0 0x17.4-0x18 (0.4) 0x10| 07 | . | channel_pressure: 7 0x18-0x19 (1) - | | | [1]{}: midievent 0x19-0x1b (2) + | | | [1]{}: midi_event 0x19-0x1b (2) | | | time{}: 0x19-0x1a (1) 0x10| 40 | @ | delta: 64 0x19-0x1a (1) | | | tick: 64 @@ -192,21 +192,21 @@ $ fq -d midi dv events/pitch-bend.mid 0x10|72 6b |rk | 0x10| 00 00 00 0a | .... | length: 10 0x12-0x16 (4) | | | events[0:3]: 0x16-0x20 (10) - | | | [0]{}: midievent 0x16-0x1a (4) + | | | [0]{}: midi_event 0x16-0x1a (4) | | | time{}: 0x16-0x17 (1) 0x10| 00 | . | delta: 0 0x16-0x17 (1) | | | tick: 0 0x10| e5 | . | event: "pitch_bend" (224) 0x17-0x17.4 (0.4) 0x10| e5 | . | channel: 5 0x17.4-0x18 (0.4) 0x10| 40 00 | @. | pitch_bend: 0 0x18-0x1a (2) - | | | [1]{}: midievent 0x1a-0x1d (3) + | | | [1]{}: midi_event 0x1a-0x1d (3) | | | time{}: 0x1a-0x1b (1) 0x10| 20 | | delta: 32 0x1a-0x1b (1) | | | tick: 32 | | | event: "pitch_bend" (224) | | | channel: 5 0x10| 60 00 | `. | pitch_bend: 4096 0x1b-0x1d (2) - | | | [2]{}: midievent 0x1d-0x20 (3) + | | | [2]{}: midi_event 0x1d-0x20 (3) | | | time{}: 0x1d-0x1e (1) 0x10| 40 | @ | delta: 64 0x1d-0x1e (1) | | | tick: 96 diff --git a/format/midi/testdata/reference.fqtest b/format/midi/testdata/reference.fqtest index b43409849..39a3910d2 100644 --- a/format/midi/testdata/reference.fqtest +++ b/format/midi/testdata/reference.fqtest @@ -12,7 +12,7 @@ $ fq -d midi dv reference.mid 0x010|72 6b |rk | 0x010| 00 00 00 04 | .... | length: 4 0x12-0x16 (4) | | | events[0:1]: 0x16-0x1a (4) - | | | [0]{}: metaevent 0x16-0x1a (4) + | | | [0]{}: meta_event 0x16-0x1a (4) | | | time{}: 0x16-0x17 (1) 0x010| 00 | . | delta: 0 0x16-0x17 (1) | | | tick: 0 @@ -24,7 +24,7 @@ $ fq -d midi dv reference.mid 0x010| 00 00| ..| length: 265 0x1e-0x22 (4) 0x020|01 09 |.. | | | | events[0:34]: 0x22-0x12b (265) - | | | [0]{}: metaevent 0x22-0x28 (6) + | | | [0]{}: meta_event 0x22-0x28 (6) | | | time{}: 0x22-0x23 (1) 0x020| 00 | . | delta: 0 0x22-0x23 (1) | | | tick: 0 @@ -32,7 +32,7 @@ $ fq -d midi dv reference.mid 0x020| 00 | . | event: "sequence_number" (0) 0x24-0x25 (1) 0x020| 02 | . | length: 2 0x25-0x26 (1) 0x020| 00 17 | .. | sequence_number: 23 0x26-0x28 (2) - | | | [1]{}: metaevent 0x28-0x39 (17) + | | | [1]{}: meta_event 0x28-0x39 (17) | | | time{}: 0x28-0x29 (1) 0x020| 00 | . | delta: 0 0x28-0x29 (1) | | | tick: 0 @@ -40,7 +40,7 @@ $ fq -d midi dv reference.mid 0x020| 01 | . | event: "text" (1) 0x2a-0x2b (1) 0x020| 0d 54 68 69 73| .This| text: "This and That" 0x2b-0x39 (14) 0x030|20 61 6e 64 20 54 68 61 74 | and That | - | | | [2]{}: metaevent 0x39-0x41 (8) + | | | [2]{}: meta_event 0x39-0x41 (8) | | | time{}: 0x39-0x3a (1) 0x030| 00 | . | delta: 0 0x39-0x3a (1) | | | tick: 0 @@ -48,7 +48,7 @@ $ fq -d midi dv reference.mid 0x030| 02 | . | event: "copyright" (2) 0x3b-0x3c (1) 0x030| 04 54 68 65| .The| copyright: "Them" 0x3c-0x41 (5) 0x040|6d |m | - | | | [3]{}: metaevent 0x41-0x54 (19) + | | | [3]{}: meta_event 0x41-0x54 (19) | | | time{}: 0x41-0x42 (1) 0x040| 00 | . | delta: 0 0x41-0x42 (1) | | | tick: 0 @@ -56,7 +56,7 @@ $ fq -d midi dv reference.mid 0x040| 03 | . | event: "track_name" (3) 0x43-0x44 (1) 0x040| 0f 41 63 6f 75 73 74 69 63 20 47 75| .Acoustic Gu| track_name: "Acoustic Guitar" 0x44-0x54 (16) 0x050|69 74 61 72 |itar | - | | | [4]{}: metaevent 0x54-0x62 (14) + | | | [4]{}: meta_event 0x54-0x62 (14) | | | time{}: 0x54-0x55 (1) 0x050| 00 | . | delta: 0 0x54-0x55 (1) | | | tick: 0 @@ -64,14 +64,14 @@ $ fq -d midi dv reference.mid 0x050| 04 | . | event: "instrument_name" (4) 0x56-0x57 (1) 0x050| 0a 44 69 64 67 65 72 69 64| .Didgerid| instrument_name: "Didgeridoo" 0x57-0x62 (11) 0x060|6f 6f |oo | - | | | [5]{}: metaevent 0x62-0x6e (12) + | | | [5]{}: meta_event 0x62-0x6e (12) | | | time{}: 0x62-0x63 (1) 0x060| 00 | . | delta: 0 0x62-0x63 (1) | | | tick: 0 0x060| ff | . | status: 255 0x63-0x64 (1) 0x060| 05 | . | event: "lyric" (5) 0x64-0x65 (1) 0x060| 08 4c 61 2d 6c 61 2d 6c 61 | .La-la-la | lyric: "La-la-la" 0x65-0x6e (9) - | | | [6]{}: metaevent 0x6e-0x81 (19) + | | | [6]{}: meta_event 0x6e-0x81 (19) | | | time{}: 0x6e-0x6f (1) 0x060| 00 | . | delta: 0 0x6e-0x6f (1) | | | tick: 0 @@ -79,7 +79,7 @@ $ fq -d midi dv reference.mid 0x070|06 |. | event: "marker" (6) 0x70-0x71 (1) 0x070| 0f 48 65 72 65 20 42 65 20 44 72 61 67 6f 6e| .Here Be Dragon| marker: "Here Be Dragons" 0x71-0x81 (16) 0x080|73 |s | - | | | [7]{}: metaevent 0x81-0x91 (16) + | | | [7]{}: meta_event 0x81-0x91 (16) | | | time{}: 0x81-0x82 (1) 0x080| 00 | . | delta: 0 0x81-0x82 (1) | | | tick: 0 @@ -87,14 +87,14 @@ $ fq -d midi dv reference.mid 0x080| 07 | . | event: "cue_point" (7) 0x83-0x84 (1) 0x080| 0c 4d 6f 72 65 20 63 6f 77 62 65 6c| .More cowbel| cue_point: "More cowbell" 0x84-0x91 (13) 0x090|6c |l | - | | | [8]{}: metaevent 0x91-0x9b (10) + | | | [8]{}: meta_event 0x91-0x9b (10) | | | time{}: 0x91-0x92 (1) 0x090| 00 | . | delta: 0 0x91-0x92 (1) | | | tick: 0 0x090| ff | . | status: 255 0x92-0x93 (1) 0x090| 08 | . | event: "program_name" (8) 0x93-0x94 (1) 0x090| 06 45 73 63 61 70 65 | .Escape | program_name: "Escape" 0x94-0x9b (7) - | | | [9]{}: metaevent 0x9b-0xa7 (12) + | | | [9]{}: meta_event 0x9b-0xa7 (12) | | | time{}: 0x9b-0x9c (1) 0x090| 00 | . | delta: 0 0x9b-0x9c (1) | | | tick: 0 @@ -102,7 +102,7 @@ $ fq -d midi dv reference.mid 0x090| 09 | . | event: "device_name" (9) 0x9d-0x9e (1) 0x090| 08 54| .T| device_name: "TheThing" 0x9e-0xa7 (9) 0x0a0|68 65 54 68 69 6e 67 |heThing | - | | | [10]{}: metaevent 0xa7-0xac (5) + | | | [10]{}: meta_event 0xa7-0xac (5) | | | time{}: 0xa7-0xa8 (1) 0x0a0| 00 | . | delta: 0 0xa7-0xa8 (1) | | | tick: 0 @@ -110,7 +110,7 @@ $ fq -d midi dv reference.mid 0x0a0| 20 | | event: "midi_channel_prefix" (32) 0xa9-0xaa (1) 0x0a0| 01 | . | length: 1 0xaa-0xab (1) 0x0a0| 0d | . | midi_channel_prefix: 13 0xab-0xac (1) - | | | [11]{}: metaevent 0xac-0xb1 (5) + | | | [11]{}: meta_event 0xac-0xb1 (5) | | | time{}: 0xac-0xad (1) 0x0a0| 00 | . | delta: 0 0xac-0xad (1) | | | tick: 0 @@ -118,14 +118,14 @@ $ fq -d midi dv reference.mid 0x0a0| 21 | ! | event: "midi_port" (33) 0xae-0xaf (1) 0x0a0| 01| .| length: 1 0xaf-0xb0 (1) 0x0b0|70 |p | midi_port: 112 0xb0-0xb1 (1) - | | | [12]{}: metaevent 0xb1-0xb5 (4) + | | | [12]{}: meta_event 0xb1-0xb5 (4) | | | time{}: 0xb1-0xb2 (1) 0x0b0| 00 | . | delta: 0 0xb1-0xb2 (1) | | | tick: 0 0x0b0| ff | . | status: 255 0xb2-0xb3 (1) 0x0b0| 2f | / | event: "end_of_track" (47) 0xb3-0xb4 (1) 0x0b0| 00 | . | length: 0 0xb4-0xb5 (1) - | | | [13]{}: metaevent 0xb5-0xbc (7) + | | | [13]{}: meta_event 0xb5-0xbc (7) | | | time{}: 0xb5-0xb6 (1) 0x0b0| 00 | . | delta: 0 0xb5-0xb6 (1) | | | tick: 0 @@ -133,7 +133,7 @@ $ fq -d midi dv reference.mid 0x0b0| 51 | Q | event: "tempo" (81) 0xb7-0xb8 (1) 0x0b0| 03 | . | length: 3 0xb8-0xb9 (1) 0x0b0| 07 a1 20 | .. | tempo: 500000 0xb9-0xbc (3) - | | | [14]{}: metaevent 0xbc-0xc5 (9) + | | | [14]{}: meta_event 0xbc-0xc5 (9) | | | time{}: 0xbc-0xbd (1) 0x0b0| 00 | . | delta: 0 0xbc-0xbd (1) | | | tick: 0 @@ -147,7 +147,7 @@ $ fq -d midi dv reference.mid 0x0c0| 3b | ; | second: 59 0xc2-0xc3 (1) 0x0c0| 07 | . | frames: 7 0xc3-0xc4 (1) 0x0c0| 27 | ' | fractions: 39 0xc4-0xc5 (1) - | | | [15]{}: metaevent 0xc5-0xcd (8) + | | | [15]{}: meta_event 0xc5-0xcd (8) | | | time{}: 0xc5-0xc6 (1) 0x0c0| 00 | . | delta: 0 0xc5-0xc6 (1) | | | tick: 0 @@ -159,7 +159,7 @@ $ fq -d midi dv reference.mid 0x0c0| 02 | . | denominator: 4 0xca-0xcb (1) 0x0c0| 18 | . | ticks_per_click: 24 0xcb-0xcc (1) 0x0c0| 08 | . | thirty_seconds_per_quarter: 8 0xcc-0xcd (1) - | | | [16]{}: metaevent 0xcd-0xd3 (6) + | | | [16]{}: meta_event 0xcd-0xd3 (6) | | | time{}: 0xcd-0xce (1) 0x0c0| 00 | . | delta: 0 0xcd-0xce (1) | | | tick: 0 @@ -167,7 +167,7 @@ $ fq -d midi dv reference.mid 0x0c0| 59| Y| event: "key_signature" (89) 0xcf-0xd0 (1) 0x0d0|02 |. | length: 2 0xd0-0xd1 (1) 0x0d0| 00 01 | .. | key_signature: "A minor" (1) 0xd1-0xd3 (2) - | | | [17]{}: metaevent 0xd3-0xdd (10) + | | | [17]{}: meta_event 0xd3-0xdd (10) | | | time{}: 0xd3-0xd4 (1) 0x0d0| 00 | . | delta: 0 0xd3-0xd4 (1) | | | tick: 0 @@ -177,7 +177,7 @@ $ fq -d midi dv reference.mid | | | sequencer_specific_event{}: 0xd7-0xdd (6) 0x0d0| 00 00 3b | ..; | manufacturer: "Mark Of The Unicorn (MOTU)" (59) 0xd7-0xda (3) 0x0d0| 3a 4c 5e | :L^ | data: raw bits 0xda-0xdd (3) - | | | [18]{}: midievent 0xdd-0xe2 (5) + | | | [18]{}: midi_event 0xdd-0xe2 (5) | | | time{}: 0xdd-0xdf (2) 0x0d0| 83 60 | .` | delta: 480 0xdd-0xdf (2) | | | tick: 480 @@ -186,7 +186,7 @@ $ fq -d midi dv reference.mid | | | note_off{}: 0xe0-0xe2 (2) 0x0e0|30 |0 | note: "C3" (48) 0xe0-0xe1 (1) 0x0e0| 40 | @ | velocity: 64 0xe1-0xe2 (1) - | | | [19]{}: midievent 0xe2-0xe6 (4) + | | | [19]{}: midi_event 0xe2-0xe6 (4) | | | time{}: 0xe2-0xe3 (1) 0x0e0| 00 | . | delta: 0 0xe2-0xe3 (1) | | | tick: 480 @@ -195,7 +195,7 @@ $ fq -d midi dv reference.mid | | | note_on{}: 0xe4-0xe6 (2) 0x0e0| 30 | 0 | note: "C3" (48) 0xe4-0xe5 (1) 0x0e0| 48 | H | velocity: 72 0xe5-0xe6 (1) - | | | [20]{}: midievent 0xe6-0xea (4) + | | | [20]{}: midi_event 0xe6-0xea (4) | | | time{}: 0xe6-0xe7 (1) 0x0e0| 00 | . | delta: 0 0xe6-0xe7 (1) | | | tick: 480 @@ -204,7 +204,7 @@ $ fq -d midi dv reference.mid | | | note_on{}: 0xe8-0xea (2) 0x0e0| 31 | 1 | note: "C♯3/D♭3" (49) 0xe8-0xe9 (1) 0x0e0| 48 | H | velocity: 72 0xe9-0xea (1) - | | | [21]{}: midievent 0xea-0xed (3) + | | | [21]{}: midi_event 0xea-0xed (3) | | | time{}: 0xea-0xeb (1) 0x0e0| 00 | . | delta: 0 0xea-0xeb (1) | | | tick: 480 @@ -213,14 +213,14 @@ $ fq -d midi dv reference.mid | | | note_on{}: 0xeb-0xed (2) 0x0e0| 30 | 0 | note: "C3" (48) 0xeb-0xec (1) 0x0e0| 64 | d | velocity: 100 0xec-0xed (1) - | | | [22]{}: midievent 0xed-0xf0 (3) + | | | [22]{}: midi_event 0xed-0xf0 (3) | | | time{}: 0xed-0xee (1) 0x0e0| 00 | . | delta: 0 0xed-0xee (1) | | | tick: 480 0x0e0| a0 | . | event: "polyphonic_pressure" (160) 0xee-0xee.4 (0.4) 0x0e0| a0 | . | channel: 0 0xee.4-0xef (0.4) 0x0e0| 64| d| polyphonic_pressure: 100 0xef-0xf0 (1) - | | | [23]{}: midievent 0xf0-0xf4 (4) + | | | [23]{}: midi_event 0xf0-0xf4 (4) | | | time{}: 0xf0-0xf1 (1) 0x0f0|00 |. | delta: 0 0xf0-0xf1 (1) | | | tick: 480 @@ -229,7 +229,7 @@ $ fq -d midi dv reference.mid | | | controller{}: 0xf2-0xf4 (2) 0x0f0| 00 | . | controller: "Bank Select (MSB)" (0) 0xf2-0xf3 (1) 0x0f0| 05 | . | value: 5 0xf3-0xf4 (1) - | | | [24]{}: midievent 0xf4-0xf8 (4) + | | | [24]{}: midi_event 0xf4-0xf8 (4) | | | time{}: 0xf4-0xf5 (1) 0x0f0| 00 | . | delta: 0 0xf4-0xf5 (1) | | | tick: 480 @@ -238,7 +238,7 @@ $ fq -d midi dv reference.mid | | | controller{}: 0xf6-0xf8 (2) 0x0f0| 20 | | controller: "Bank Select (LSB)" (32) 0xf6-0xf7 (1) 0x0f0| 21 | ! | value: 33 0xf7-0xf8 (1) - | | | [25]{}: midievent 0xf8-0xfc (4) + | | | [25]{}: midi_event 0xf8-0xfc (4) | | | time{}: 0xf8-0xf9 (1) 0x0f0| 00 | . | delta: 0 0xf8-0xf9 (1) | | | tick: 480 @@ -247,70 +247,70 @@ $ fq -d midi dv reference.mid | | | controller{}: 0xfa-0xfc (2) 0x0f0| 65 | e | controller: "Registered Parameter Number (MSB)" (101) 0xfa-0xfb (1) 0x0f0| 00 | . | value: 0 0xfb-0xfc (1) - | | | [26]{}: midievent 0xfc-0xff (3) + | | | [26]{}: midi_event 0xfc-0xff (3) | | | time{}: 0xfc-0xfd (1) 0x0f0| 00 | . | delta: 0 0xfc-0xfd (1) | | | tick: 480 0x0f0| c0 | . | event: "program_change" (192) 0xfd-0xfd.4 (0.4) 0x0f0| c0 | . | channel: 0 0xfd.4-0xfe (0.4) 0x0f0| 19 | . | program_change: 25 0xfe-0xff (1) - | | | [27]{}: midievent 0xff-0x102 (3) + | | | [27]{}: midi_event 0xff-0x102 (3) | | | time{}: 0xff-0x100 (1) 0x0f0| 00| .| delta: 0 0xff-0x100 (1) | | | tick: 480 0x100|d0 |. | event: "channel_pressure" (208) 0x100-0x100.4 (0.4) 0x100|d0 |. | channel: 0 0x100.4-0x101 (0.4) 0x100| 07 | . | channel_pressure: 7 0x101-0x102 (1) - | | | [28]{}: midievent 0x102-0x107 (5) + | | | [28]{}: midi_event 0x102-0x107 (5) | | | time{}: 0x102-0x104 (2) 0x100| 81 70 | .p | delta: 240 0x102-0x104 (2) | | | tick: 720 0x100| e0 | . | event: "pitch_bend" (224) 0x104-0x104.4 (0.4) 0x100| e0 | . | channel: 0 0x104.4-0x105 (0.4) 0x100| 00 08 | .. | pitch_bend: -8184 0x105-0x107 (2) - | | | [29]{}: sysex 0x107-0x10f (8) + | | | [29]{}: sysex_event 0x107-0x10f (8) | | | time{}: 0x107-0x108 (1) 0x100| 00 | . | delta: 0 0x107-0x108 (1) | | | tick: 720 0x100| f0 | . | event: "sysex_message" (240) 0x108-0x109 (1) 0x100| 05 | . | length: 5 0x109-0x10a (1) - | | | sysex_message{}: 0x10a-0x10f (5) + | | | message{}: 0x10a-0x10f (5) 0x100| 7e | ~ | manufacturer: "Non-RealTime Extensions" (126) 0x10a-0x10b (1) 0x100| 00 09 01 | ... | data: raw bits 0x10b-0x10e (3) 0x100| f7 | . | end_of_message: 247 0x10e-0x10f (1) - | | | [30]{}: sysex 0x10f-0x115 (6) + | | | [30]{}: sysex_event 0x10f-0x115 (6) | | | time{}: 0x10f-0x110 (1) 0x100| 00| .| delta: 0 0x10f-0x110 (1) | | | tick: 720 0x110|f0 |. | event: "sysex_message" (240) 0x110-0x111 (1) 0x110| 03 | . | length: 3 0x111-0x112 (1) - | | | sysex_message{}: 0x112-0x115 (3) + | | | message{}: 0x112-0x115 (3) 0x110| 43 | C | manufacturer: "Yamaha" (67) 0x112-0x113 (1) 0x110| 12 00 | .. | data: raw bits 0x113-0x115 (2) | | | continued: true - | | | [31]{}: sysex 0x115-0x11f (10) + | | | [31]{}: sysex_event 0x115-0x11f (10) | | | time{}: 0x115-0x117 (2) 0x110| 81 48 | .H | delta: 200 0x115-0x117 (2) | | | tick: 920 0x110| f7 | . | event: "sysex_continuation" (247) 0x117-0x118 (1) 0x110| 06 | . | length: 6 0x118-0x119 (1) - | | | sysex_continuation{}: 0x119-0x11f (6) + | | | continuation{}: 0x119-0x11f (6) 0x110| 43 12 00 43 12 00 | C..C.. | data: raw bits 0x119-0x11f (6) | | | continued: true - | | | [32]{}: sysex 0x11f-0x126 (7) + | | | [32]{}: sysex_event 0x11f-0x126 (7) | | | time{}: 0x11f-0x120 (1) 0x110| 64| d| delta: 100 0x11f-0x120 (1) | | | tick: 1020 0x120|f7 |. | event: "sysex_continuation" (247) 0x120-0x121 (1) 0x120| 04 | . | length: 4 0x121-0x122 (1) - | | | sysex_continuation{}: 0x122-0x126 (4) + | | | continuation{}: 0x122-0x126 (4) 0x120| 43 12 00 | C.. | data: raw bits 0x122-0x125 (3) 0x120| f7 | . | end_of_message: 247 0x125-0x126 (1) - | | | [33]{}: sysex 0x126-0x12b (5) + | | | [33]{}: sysex_event 0x126-0x12b (5) | | | time{}: 0x126-0x127 (1) 0x120| 00 | . | delta: 0 0x126-0x127 (1) | | | tick: 1020 0x120| f7 | . | event: "sysex_escape" (247) 0x127-0x128 (1) 0x120| 02 | . | length: 2 0x128-0x129 (1) - | | | sysex_escape{}: 0x129-0x12b (2) + | | | escape{}: 0x129-0x12b (2) 0x120| f3 01| | ..| | data: raw bits 0x129-0x12b (2) diff --git a/format/midi/testdata/sysex.fqtest b/format/midi/testdata/sysex.fqtest index 721f599a5..0d598db3a 100644 --- a/format/midi/testdata/sysex.fqtest +++ b/format/midi/testdata/sysex.fqtest @@ -12,13 +12,13 @@ $ fq -d midi dv events/sysex-message.mid 0x10|72 6b |rk | 0x10| 00 00 00 08 | .... | length: 8 0x12-0x16 (4) | | | events[0:1]: 0x16-0x1e (8) - | | | [0]{}: sysex 0x16-0x1e (8) + | | | [0]{}: sysex_event 0x16-0x1e (8) | | | time{}: 0x16-0x17 (1) 0x10| 00 | . | delta: 0 0x16-0x17 (1) | | | tick: 0 0x10| f0 | . | event: "sysex_message" (240) 0x17-0x18 (1) 0x10| 05 | . | length: 5 0x18-0x19 (1) - | | | sysex_message{}: 0x19-0x1e (5) + | | | message{}: 0x19-0x1e (5) 0x10| 7e | ~ | manufacturer: "Non-RealTime Extensions" (126) 0x19-0x1a (1) 0x10| 00 09 01 | ... | data: raw bits 0x1a-0x1d (3) 0x10| f7| | .| | end_of_message: 247 0x1d-0x1e (1) @@ -36,33 +36,33 @@ $ fq -d midi dv events/sysex-continuation.mid 0x10|72 6b |rk | 0x10| 00 00 00 16 | .... | length: 22 0x12-0x16 (4) | | | events[0:3]: 0x16-0x2c (22) - | | | [0]{}: sysex 0x16-0x1c (6) + | | | [0]{}: sysex_event 0x16-0x1c (6) | | | time{}: 0x16-0x17 (1) 0x10| 00 | . | delta: 0 0x16-0x17 (1) | | | tick: 0 0x10| f0 | . | event: "sysex_message" (240) 0x17-0x18 (1) 0x10| 03 | . | length: 3 0x18-0x19 (1) - | | | sysex_message{}: 0x19-0x1c (3) + | | | message{}: 0x19-0x1c (3) 0x10| 43 | C | manufacturer: "Yamaha" (67) 0x19-0x1a (1) 0x10| 01 23 | .# | data: raw bits 0x1a-0x1c (2) | | | continued: true - | | | [1]{}: sysex 0x1c-0x25 (9) + | | | [1]{}: sysex_event 0x1c-0x25 (9) | | | time{}: 0x1c-0x1d (1) 0x10| 00 | . | delta: 0 0x1c-0x1d (1) | | | tick: 0 0x10| f7 | . | event: "sysex_continuation" (247) 0x1d-0x1e (1) 0x10| 06 | . | length: 6 0x1e-0x1f (1) - | | | sysex_continuation{}: 0x1f-0x25 (6) + | | | continuation{}: 0x1f-0x25 (6) 0x10| 45| E| data: raw bits 0x1f-0x25 (6) 0x20|67 89 ab cd ef |g.... | | | | continued: true - | | | [2]{}: sysex 0x25-0x2c (7) + | | | [2]{}: sysex_event 0x25-0x2c (7) | | | time{}: 0x25-0x26 (1) 0x20| 00 | . | delta: 0 0x25-0x26 (1) | | | tick: 0 0x20| f7 | . | event: "sysex_continuation" (247) 0x26-0x27 (1) 0x20| 04 | . | length: 4 0x27-0x28 (1) - | | | sysex_continuation{}: 0x28-0x2c (4) + | | | continuation{}: 0x28-0x2c (4) 0x20| 01 23 45 | .#E | data: raw bits 0x28-0x2b (3) 0x20| f7| | .| | end_of_message: 247 0x2b-0x2c (1) $ fq -d midi dv events/sysex-escape.mid @@ -79,11 +79,11 @@ $ fq -d midi dv events/sysex-escape.mid 0x10|72 6b |rk | 0x10| 00 00 00 05 | .... | length: 5 0x12-0x16 (4) | | | events[0:1]: 0x16-0x1b (5) - | | | [0]{}: sysex 0x16-0x1b (5) + | | | [0]{}: sysex_event 0x16-0x1b (5) | | | time{}: 0x16-0x17 (1) 0x10| 00 | . | delta: 0 0x16-0x17 (1) | | | tick: 0 0x10| f7 | . | event: "sysex_escape" (247) 0x17-0x18 (1) 0x10| 02 | . | length: 2 0x18-0x19 (1) - | | | sysex_escape{}: 0x19-0x1b (2) + | | | escape{}: 0x19-0x1b (2) 0x10| f3 01| | ..| | data: raw bits 0x19-0x1b (2) diff --git a/format/midi/testdata/unknown-chunks.fqtest b/format/midi/testdata/unknown-chunks.fqtest new file mode 100644 index 000000000..e4c5646f1 --- /dev/null +++ b/format/midi/testdata/unknown-chunks.fqtest @@ -0,0 +1,48 @@ +$ fq -d midi dv midi/unknown-chunks.mid + |00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.{}: midi/unknown-chunks.mid (midi) 0x0-0x56 (86) + | | | header{}: 0x0-0xe (14) +0x00|4d 54 68 64 |MThd | tag: "MThd" 0x0-0x4 (4) +0x00| 00 00 00 06 | .... | length: 6 0x4-0x8 (4) +0x00| 00 01 | .. | format: 1 0x8-0xa (2) +0x00| 00 02 | .. | tracks: 2 0xa-0xc (2) +0x00| 01 e0 | .. | divisions: 480 0xc-0xe (2) + | | | tracks[0:5]: 0xe-0x56 (72) + | | | [0]{}: other 0xe-0x1e (16) +0x00| 4d 54| MT| tag: "MTrx" 0xe-0x12 (4) +0x10|72 78 |rx | +0x10| 00 00 00 08 | .... | length: 8 0x12-0x16 (4) +0x10| 01 23 45 67 89 ab cd ef | .#Eg.... | data: raw bits 0x16-0x1e (8) + | | | [1]{}: track 0x1e-0x2a (12) +0x10| 4d 54| MT| tag: "MTrk" 0x1e-0x22 (4) +0x20|72 6b |rk | +0x20| 00 00 00 04 | .... | length: 4 0x22-0x26 (4) + | | | events[0:1]: 0x26-0x2a (4) + | | | [0]{}: meta_event 0x26-0x2a (4) + | | | time{}: 0x26-0x27 (1) +0x20| 00 | . | delta: 0 0x26-0x27 (1) + | | | tick: 0 +0x20| ff | . | status: 255 0x27-0x28 (1) +0x20| 2f | / | event: "end_of_track" (47) 0x28-0x29 (1) +0x20| 00 | . | length: 0 0x29-0x2a (1) + | | | [2]{}: other 0x2a-0x3a (16) +0x20| 4d 54 72 78 | MTrx | tag: "MTrx" 0x2a-0x2e (4) +0x20| 00 00| ..| length: 8 0x2e-0x32 (4) +0x30|00 08 |.. | +0x30| fe dc ba 98 76 54 32 10 | ....vT2. | data: raw bits 0x32-0x3a (8) + | | | [3]{}: track 0x3a-0x46 (12) +0x30| 4d 54 72 6b | MTrk | tag: "MTrk" 0x3a-0x3e (4) +0x30| 00 00| ..| length: 4 0x3e-0x42 (4) +0x40|00 04 |.. | + | | | events[0:1]: 0x42-0x46 (4) + | | | [0]{}: meta_event 0x42-0x46 (4) + | | | time{}: 0x42-0x43 (1) +0x40| 00 | . | delta: 0 0x42-0x43 (1) + | | | tick: 0 +0x40| ff | . | status: 255 0x43-0x44 (1) +0x40| 2f | / | event: "end_of_track" (47) 0x44-0x45 (1) +0x40| 00 | . | length: 0 0x45-0x46 (1) + | | | [4]{}: other 0x46-0x56 (16) +0x40| 4d 54 72 78 | MTrx | tag: "MTrx" 0x46-0x4a (4) +0x40| 00 00 00 08 | .... | length: 8 0x4a-0x4e (4) +0x40| 01 23| .#| data: raw bits 0x4e-0x56 (8) +0x50|45 67 89 ab cd ef| |Eg....| |