1
1
mirror of https://github.com/wader/fq.git synced 2024-10-03 23:17:50 +03:00

midi: fixes for PR comments:

- Renamed 'tracks' section to 'content' (cf. https://github.com/wader/fq/pull/1004#discussion_r1746651234)
- Removed 'validation only' errors (cf. https://github.com/wader/fq/pull/1004#issuecomment-2333464662)
- Decoded MThd divisions field with SMPTE timecode
This commit is contained in:
twystd 2024-09-06 13:34:56 -07:00
parent 87c80f5776
commit 9c7f7f961a
21 changed files with 218 additions and 154 deletions

View File

@ -367,3 +367,10 @@ var framerates = scalar.UintMapSymUint{
2: 29,
3: 30,
}
var fps = scalar.UintMapSymUint{
0xe8: 24,
0xe7: 25,
0xe6: 29,
0xe5: 30,
}

View File

@ -39,8 +39,8 @@ func decodeMIDI(d *decode.D) any {
// ... decode header
d.FieldStruct("header", decodeMThd)
// ... decode tracks
d.FieldArray("tracks", func(d *decode.D) {
// ... decode tracks (and other chunks)
d.FieldArray("content", func(d *decode.D) {
for d.BitsLeft() > 0 {
if bytes.Equal(d.PeekBytes(4), []byte("MTrk")) {
d.FieldStruct("track", decodeMTrk)
@ -55,36 +55,30 @@ func decodeMIDI(d *decode.D) any {
func decodeMThd(d *decode.D) {
if !bytes.Equal(d.PeekBytes(4), []byte("MThd")) {
d.Errorf("no MThd marker")
d.Errorf("missing MThd tag")
}
d.FieldUTF8("tag", 4)
length := d.FieldS32("length")
d.FramedFn(length*8, func(d *decode.D) {
format := d.FieldU16("format")
if format != 0 && format != 1 && format != 2 {
d.Errorf("invalid MThd format %v (expected 0,1 or 2)", format)
}
d.FieldU16("format")
d.FieldU16("tracks")
tracks := d.FieldU16("tracks")
if format == 0 && tracks > 1 {
d.Errorf("MIDI format 0 expects 1 track (got %v)", tracks)
}
division := d.FieldU16("divisions")
if division&0x8000 == 0x8000 {
SMPTE := (division & 0xff00) >> 8
if SMPTE != 0xe8 && SMPTE != 0xe7 && SMPTE != 0xe6 && SMPTE != 0xe5 {
d.Errorf("invalid MThd division SMPTE timecode type %02X (expected E8,E7, E6 or E5)", SMPTE)
d.FieldStruct("division", func(d *decode.D) {
if division := d.PeekUintBits(16); division&0x8000 == 0x8000 {
d.FieldU8("fps", fps)
d.FieldU8("resolution")
} else {
d.FieldU16("ppqn")
}
}
})
})
}
func decodeMTrk(d *decode.D) {
if !bytes.Equal(d.PeekBytes(4), []byte("MTrk")) {
d.Errorf("no MTrk marker")
d.Errorf("missing MTrk tag")
}
d.FieldUTF8("tag", 4)

View File

@ -35,4 +35,3 @@ fq -d midi 'grep_by(.event=="note_on") | [.time.tick, .note_on.note] | join(" ")
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)
5. [github: test-midi-files](https://github.com/jazz-soft/test-midi-files)

View File

@ -25,10 +25,6 @@ func decodeSysExEvent(d *decode.D, status uint8, ctx *context) {
switch {
case status == 0xf0:
if ctx.casio {
d.Errorf("SysEx message F0 start byte without terminating F7")
}
d.FieldStruct("sysex_event", func(d *decode.D) {
d.FieldStruct("time", delta)
d.FieldU8("event", sysex)

View File

@ -16,7 +16,8 @@ run: build
go run . -d midi dv format/midi/testdata/reference.mid
debug: build
go run . -d midi dv format/midi/workdir/test-all-gm-percussion.mid
go run . -d midi dv format/midi/testdata/midi/smpte-timecode.mid
go run . -d midi dv format/midi/testdata/midi/format-0.mid
test: build
go test ./format -run TestFormats/midi

View File

@ -18,30 +18,33 @@ Basic MIDI format 1 test file. Contains two tracks, each with only a _track name
4. _format-2.mid_
Basic MIDI format 2 test file. Contains two tracks, each with only a _track name_ and _end-of-track_ events.
5. _empty.mid_
5. _smpte-timecode.mid_
MIDI format 0 test file with an SMPTE timecode for the divisions field.
6. _empty.mid_
Empty MIDI file to verify MIDI decoder handles empty files.
6. _key_signatures.mid_
7. _key_signatures.mid_
Test file with all supported MIDI key signatures.
7. _notes.mid_
8. _notes.mid_
Test file with all supported MIDI notes.
8. _unknown-chunks.mid_
9. _unknown-chunks.mid_
Test file with 'alien' chunks interleaved with the _MTrk_ track chunks.
9. _invalid-MThd-length.mid_
10. _invalid-MThd-length.mid_
Test file with invalid _MThd_ chunk length.
10. _invalid-MTrk-length.mid_
11. _invalid-MTrk-length.mid_
Test file with invalid _MTrk_ chunk length.
11. _twinkle.mid_
12. _twinkle.mid_
Sample valid MIDI file for the example queries in the help.

View File

@ -5,8 +5,9 @@ $ fq -d midi dv midi/format-0.mid
0x00| 00 00 00 06 | .... | length: 6 0x4-0x8 (4)
0x00| 00 00 | .. | format: 0 0x8-0xa (2)
0x00| 00 01 | .. | tracks: 1 0xa-0xc (2)
0x00| 01 e0 | .. | divisions: 480 0xc-0xe (2)
| | | tracks[0:1]: 0xe-0x26 (24)
| | | division{}: 0xc-0xe (2)
0x00| 01 e0 | .. | ppqn: 480 0xc-0xe (2)
| | | content[0:1]: 0xe-0x26 (24)
| | | [0]{}: track 0xe-0x26 (24)
0x00| 4d 54| MT| tag: "MTrk" 0xe-0x12 (4)
0x10|72 6b |rk |

View File

@ -5,8 +5,9 @@ $ fq -d midi dv midi/format-1.mid
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:2]: 0xe-0x45 (55)
| | | division{}: 0xc-0xe (2)
0x00| 01 e0 | .. | ppqn: 480 0xc-0xe (2)
| | | content[0:2]: 0xe-0x45 (55)
| | | [0]{}: track 0xe-0x26 (24)
0x00| 4d 54| MT| tag: "MTrk" 0xe-0x12 (4)
0x10|72 6b |rk |

View File

@ -5,8 +5,9 @@ $ fq -d midi dv midi/format-2.mid
0x00| 00 00 00 06 | .... | length: 6 0x4-0x8 (4)
0x00| 00 02 | .. | format: 2 0x8-0xa (2)
0x00| 00 02 | .. | tracks: 2 0xa-0xc (2)
0x00| 01 e0 | .. | divisions: 480 0xc-0xe (2)
| | | tracks[0:2]: 0xe-0x43 (53)
| | | division{}: 0xc-0xe (2)
0x00| 01 e0 | .. | ppqn: 480 0xc-0xe (2)
| | | content[0:2]: 0xe-0x43 (53)
| | | [0]{}: track 0xe-0x28 (26)
0x00| 4d 54| MT| tag: "MTrk" 0xe-0x12 (4)
0x10|72 6b |rk |

View File

@ -43,4 +43,3 @@ 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)

View File

@ -1,30 +1,30 @@
$ fq -d midi '.. | select(.event=="key_signature")?.key_signature' midi/twinkle.mid
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0xf0| 00 01 | .. |.tracks[1].events[2].key_signature: "A minor" (1)
0xf0| 00 01 | .. |.content[1].events[2].key_signature: "A minor" (1)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x390| 00 01| ..|.tracks[2].events[2].key_signature: "A minor" (1)
0x390| 00 01| ..|.content[2].events[2].key_signature: "A minor" (1)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x3d0| 00 01 | .. |.tracks[3].events[2].key_signature: "A minor" (1)
0x3d0| 00 01 | .. |.content[3].events[2].key_signature: "A minor" (1)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x550| 00 01 | .. |.tracks[4].events[2].key_signature: "A minor" (1)
0x550| 00 01 | .. |.content[4].events[2].key_signature: "A minor" (1)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x6d0|00 01 |.. |.tracks[5].events[2].key_signature: "A minor" (1)
0x6d0|00 01 |.. |.content[5].events[2].key_signature: "A minor" (1)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x9f0| 00 01 | .. |.tracks[6].events[2].key_signature: "A minor" (1)
0x9f0| 00 01 | .. |.content[6].events[2].key_signature: "A minor" (1)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0xeb0| 00 01 | .. |.tracks[7].events[2].key_signature: "A minor" (1)
0xeb0| 00 01 | .. |.content[7].events[2].key_signature: "A minor" (1)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0xfa0| 00 01 | .. |.tracks[8].events[2].key_signature: "A minor" (1)
0xfa0| 00 01 | .. |.content[8].events[2].key_signature: "A minor" (1)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x1700| 00 01 | .. |.tracks[9].events[2].key_signature: "A minor" (1)
0x1700| 00 01 | .. |.content[9].events[2].key_signature: "A minor" (1)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x2080| 00 01 | .. |.tracks[10].events[2].key_signature: "A minor" (1)
0x2080| 00 01 | .. |.content[10].events[2].key_signature: "A minor" (1)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x2280| 00| .|.tracks[11].events[2].key_signature: "A minor" (1)
0x2280| 00| .|.content[11].events[2].key_signature: "A minor" (1)
0x2290|01 |. |
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x2460| 00 01 | .. |.tracks[12].events[2].key_signature: "A minor" (1)
0x2460| 00 01 | .. |.content[12].events[2].key_signature: "A minor" (1)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x25f0| 00 01 | .. |.tracks[13].events[2].key_signature: "A minor" (1)
0x25f0| 00 01 | .. |.content[13].events[2].key_signature: "A minor" (1)
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x2860| 00 01 | .. |.tracks[14].events[2].key_signature: "A minor" (1)
0x2860| 00 01 | .. |.content[14].events[2].key_signature: "A minor" (1)

View File

@ -5,8 +5,9 @@ $ fq -d midi d midi/key-signatures.mid
0x000| 00 00 00 06 | .... | length: 6
0x000| 00 00 | .. | format: 0
0x000| 00 01 | .. | tracks: 1
0x000| 01 e0 | .. | divisions: 480
| | | tracks[0:1]:
| | | division{}:
0x000| 01 e0 | .. | ppqn: 480
| | | content[0:1]:
| | | [0]{}: track
0x000| 4d 54| MT| tag: "MTrk"
0x010|72 6b |rk |

View File

@ -5,8 +5,9 @@ $ fq -d midi dv events/sequence-number.mid
0x00| 00 00 00 06 | .... | length: 6 0x4-0x8 (4)
0x00| 00 01 | .. | format: 1 0x8-0xa (2)
0x00| 00 01 | .. | tracks: 1 0xa-0xc (2)
0x00| 01 e0 | .. | divisions: 480 0xc-0xe (2)
| | | tracks[0:1]: 0xe-0x1c (14)
| | | division{}: 0xc-0xe (2)
0x00| 01 e0 | .. | ppqn: 480 0xc-0xe (2)
| | | content[0:1]: 0xe-0x1c (14)
| | | [0]{}: track 0xe-0x1c (14)
0x00| 4d 54| MT| tag: "MTrk" 0xe-0x12 (4)
0x10|72 6b |rk |
@ -27,8 +28,9 @@ $ fq -d midi dv events/text.mid
0x00| 00 00 00 06 | .... | length: 6 0x4-0x8 (4)
0x00| 00 01 | .. | format: 1 0x8-0xa (2)
0x00| 00 01 | .. | tracks: 1 0xa-0xc (2)
0x00| 01 e0 | .. | divisions: 480 0xc-0xe (2)
| | | tracks[0:1]: 0xe-0x27 (25)
| | | division{}: 0xc-0xe (2)
0x00| 01 e0 | .. | ppqn: 480 0xc-0xe (2)
| | | content[0:1]: 0xe-0x27 (25)
| | | [0]{}: track 0xe-0x27 (25)
0x00| 4d 54| MT| tag: "MTrk" 0xe-0x12 (4)
0x10|72 6b |rk |
@ -49,8 +51,9 @@ $ fq -d midi dv events/copyright.mid
0x00| 00 00 00 06 | .... | length: 6 0x4-0x8 (4)
0x00| 00 01 | .. | format: 1 0x8-0xa (2)
0x00| 00 01 | .. | tracks: 1 0xa-0xc (2)
0x00| 01 e0 | .. | divisions: 480 0xc-0xe (2)
| | | tracks[0:1]: 0xe-0x1e (16)
| | | division{}: 0xc-0xe (2)
0x00| 01 e0 | .. | ppqn: 480 0xc-0xe (2)
| | | content[0:1]: 0xe-0x1e (16)
| | | [0]{}: track 0xe-0x1e (16)
0x00| 4d 54| MT| tag: "MTrk" 0xe-0x12 (4)
0x10|72 6b |rk |
@ -70,8 +73,9 @@ $ fq -d midi dv events/track-name.mid
0x00| 00 00 00 06 | .... | length: 6 0x4-0x8 (4)
0x00| 00 01 | .. | format: 1 0x8-0xa (2)
0x00| 00 01 | .. | tracks: 1 0xa-0xc (2)
0x00| 01 e0 | .. | divisions: 480 0xc-0xe (2)
| | | tracks[0:1]: 0xe-0x29 (27)
| | | division{}: 0xc-0xe (2)
0x00| 01 e0 | .. | ppqn: 480 0xc-0xe (2)
| | | content[0:1]: 0xe-0x29 (27)
| | | [0]{}: track 0xe-0x29 (27)
0x00| 4d 54| MT| tag: "MTrk" 0xe-0x12 (4)
0x10|72 6b |rk |
@ -92,8 +96,9 @@ $ fq -d midi dv events/instrument-name.mid
0x00| 00 00 00 06 | .... | length: 6 0x4-0x8 (4)
0x00| 00 01 | .. | format: 1 0x8-0xa (2)
0x00| 00 01 | .. | tracks: 1 0xa-0xc (2)
0x00| 01 e0 | .. | divisions: 480 0xc-0xe (2)
| | | tracks[0:1]: 0xe-0x24 (22)
| | | division{}: 0xc-0xe (2)
0x00| 01 e0 | .. | ppqn: 480 0xc-0xe (2)
| | | content[0:1]: 0xe-0x24 (22)
| | | [0]{}: track 0xe-0x24 (22)
0x00| 4d 54| MT| tag: "MTrk" 0xe-0x12 (4)
0x10|72 6b |rk |
@ -114,8 +119,9 @@ $ fq -d midi dv events/lyric.mid
0x00| 00 00 00 06 | .... | length: 6 0x4-0x8 (4)
0x00| 00 01 | .. | format: 1 0x8-0xa (2)
0x00| 00 01 | .. | tracks: 1 0xa-0xc (2)
0x00| 01 e0 | .. | divisions: 480 0xc-0xe (2)
| | | tracks[0:1]: 0xe-0x22 (20)
| | | division{}: 0xc-0xe (2)
0x00| 01 e0 | .. | ppqn: 480 0xc-0xe (2)
| | | content[0:1]: 0xe-0x22 (20)
| | | [0]{}: track 0xe-0x22 (20)
0x00| 4d 54| MT| tag: "MTrk" 0xe-0x12 (4)
0x10|72 6b |rk |
@ -136,8 +142,9 @@ $ fq -d midi dv events/marker.mid
0x00| 00 00 00 06 | .... | length: 6 0x4-0x8 (4)
0x00| 00 01 | .. | format: 1 0x8-0xa (2)
0x00| 00 01 | .. | tracks: 1 0xa-0xc (2)
0x00| 01 e0 | .. | divisions: 480 0xc-0xe (2)
| | | tracks[0:1]: 0xe-0x29 (27)
| | | division{}: 0xc-0xe (2)
0x00| 01 e0 | .. | ppqn: 480 0xc-0xe (2)
| | | content[0:1]: 0xe-0x29 (27)
| | | [0]{}: track 0xe-0x29 (27)
0x00| 4d 54| MT| tag: "MTrk" 0xe-0x12 (4)
0x10|72 6b |rk |
@ -158,8 +165,9 @@ $ fq -d midi dv events/cuepoint.mid
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:1]: 0xe-0x26 (24)
| | | division{}: 0xc-0xe (2)
0x00| 01 e0 | .. | ppqn: 480 0xc-0xe (2)
| | | content[0:1]: 0xe-0x26 (24)
| | | [0]{}: track 0xe-0x26 (24)
0x00| 4d 54| MT| tag: "MTrk" 0xe-0x12 (4)
0x10|72 6b |rk |
@ -180,8 +188,9 @@ $ fq -d midi dv events/program-name.mid
0x00| 00 00 00 06 | .... | length: 6 0x4-0x8 (4)
0x00| 00 01 | .. | format: 1 0x8-0xa (2)
0x00| 00 01 | .. | tracks: 1 0xa-0xc (2)
0x00| 01 e0 | .. | divisions: 480 0xc-0xe (2)
| | | tracks[0:1]: 0xe-0x20 (18)
| | | division{}: 0xc-0xe (2)
0x00| 01 e0 | .. | ppqn: 480 0xc-0xe (2)
| | | content[0:1]: 0xe-0x20 (18)
| | | [0]{}: track 0xe-0x20 (18)
0x00| 4d 54| MT| tag: "MTrk" 0xe-0x12 (4)
0x10|72 6b |rk |
@ -201,8 +210,9 @@ $ fq -d midi dv events/device-name.mid
0x00| 00 00 00 06 | .... | length: 6 0x4-0x8 (4)
0x00| 00 01 | .. | format: 1 0x8-0xa (2)
0x00| 00 01 | .. | tracks: 1 0xa-0xc (2)
0x00| 01 e0 | .. | divisions: 480 0xc-0xe (2)
| | | tracks[0:1]: 0xe-0x22 (20)
| | | division{}: 0xc-0xe (2)
0x00| 01 e0 | .. | ppqn: 480 0xc-0xe (2)
| | | content[0:1]: 0xe-0x22 (20)
| | | [0]{}: track 0xe-0x22 (20)
0x00| 4d 54| MT| tag: "MTrk" 0xe-0x12 (4)
0x10|72 6b |rk |
@ -223,8 +233,9 @@ $ fq -d midi dv events/midi-channel-prefix.mid
0x00| 00 00 00 06 | .... | length: 6 0x4-0x8 (4)
0x00| 00 01 | .. | format: 1 0x8-0xa (2)
0x00| 00 01 | .. | tracks: 1 0xa-0xc (2)
0x00| 01 e0 | .. | divisions: 480 0xc-0xe (2)
| | | tracks[0:1]: 0xe-0x1b (13)
| | | division{}: 0xc-0xe (2)
0x00| 01 e0 | .. | ppqn: 480 0xc-0xe (2)
| | | content[0:1]: 0xe-0x1b (13)
| | | [0]{}: track 0xe-0x1b (13)
0x00| 4d 54| MT| tag: "MTrk" 0xe-0x12 (4)
0x10|72 6b |rk |
@ -245,8 +256,9 @@ $ fq -d midi dv events/midi-port.mid
0x00| 00 00 00 06 | .... | length: 6 0x4-0x8 (4)
0x00| 00 01 | .. | format: 1 0x8-0xa (2)
0x00| 00 01 | .. | tracks: 1 0xa-0xc (2)
0x00| 01 e0 | .. | divisions: 480 0xc-0xe (2)
| | | tracks[0:1]: 0xe-0x1b (13)
| | | division{}: 0xc-0xe (2)
0x00| 01 e0 | .. | ppqn: 480 0xc-0xe (2)
| | | content[0:1]: 0xe-0x1b (13)
| | | [0]{}: track 0xe-0x1b (13)
0x00| 4d 54| MT| tag: "MTrk" 0xe-0x12 (4)
0x10|72 6b |rk |
@ -267,8 +279,9 @@ $ fq -d midi dv events/tempo.mid
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:1]: 0xe-0x1d (15)
| | | division{}: 0xc-0xe (2)
0x00| 01 e0 | .. | ppqn: 480 0xc-0xe (2)
| | | content[0:1]: 0xe-0x1d (15)
| | | [0]{}: track 0xe-0x1d (15)
0x00| 4d 54| MT| tag: "MTrk" 0xe-0x12 (4)
0x10|72 6b |rk |
@ -289,8 +302,9 @@ $ fq -d midi dv events/smpte-offset.mid
0x00| 00 00 00 06 | .... | length: 6 0x4-0x8 (4)
0x00| 00 01 | .. | format: 1 0x8-0xa (2)
0x00| 00 01 | .. | tracks: 1 0xa-0xc (2)
0x00| 01 e0 | .. | divisions: 480 0xc-0xe (2)
| | | tracks[0:1]: 0xe-0x1f (17)
| | | division{}: 0xc-0xe (2)
0x00| 01 e0 | .. | ppqn: 480 0xc-0xe (2)
| | | content[0:1]: 0xe-0x1f (17)
| | | [0]{}: track 0xe-0x1f (17)
0x00| 4d 54| MT| tag: "MTrk" 0xe-0x12 (4)
0x10|72 6b |rk |
@ -317,8 +331,9 @@ $ fq -d midi dv events/time-signature.mid
0x00| 00 00 00 06 | .... | length: 6 0x4-0x8 (4)
0x00| 00 01 | .. | format: 1 0x8-0xa (2)
0x00| 00 01 | .. | tracks: 1 0xa-0xc (2)
0x00| 01 e0 | .. | divisions: 480 0xc-0xe (2)
| | | tracks[0:1]: 0xe-0x1e (16)
| | | division{}: 0xc-0xe (2)
0x00| 01 e0 | .. | ppqn: 480 0xc-0xe (2)
| | | content[0:1]: 0xe-0x1e (16)
| | | [0]{}: track 0xe-0x1e (16)
0x00| 4d 54| MT| tag: "MTrk" 0xe-0x12 (4)
0x10|72 6b |rk |
@ -343,8 +358,9 @@ $ fq -d midi dv events/key-signature.mid
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:1]: 0xe-0x1c (14)
| | | division{}: 0xc-0xe (2)
0x00| 01 e0 | .. | ppqn: 480 0xc-0xe (2)
| | | content[0:1]: 0xe-0x1c (14)
| | | [0]{}: track 0xe-0x1c (14)
0x00| 4d 54| MT| tag: "MTrk" 0xe-0x12 (4)
0x10|72 6b |rk |
@ -365,8 +381,9 @@ $ fq -d midi dv events/end-of-track.mid
0x00| 00 00 00 06 | .... | length: 6 0x4-0x8 (4)
0x00| 00 01 | .. | format: 1 0x8-0xa (2)
0x00| 00 01 | .. | tracks: 1 0xa-0xc (2)
0x00| 01 e0 | .. | divisions: 480 0xc-0xe (2)
| | | tracks[0:1]: 0xe-0x1a (12)
| | | division{}: 0xc-0xe (2)
0x00| 01 e0 | .. | ppqn: 480 0xc-0xe (2)
| | | content[0:1]: 0xe-0x1a (12)
| | | [0]{}: track 0xe-0x1a (12)
0x00| 4d 54| MT| tag: "MTrk" 0xe-0x12 (4)
0x10|72 6b |rk |
@ -386,8 +403,9 @@ $ fq -d midi dv events/sequencer-specific-event.mid
0x00| 00 00 00 06 | .... | length: 6 0x4-0x8 (4)
0x00| 00 01 | .. | format: 1 0x8-0xa (2)
0x00| 00 01 | .. | tracks: 1 0xa-0xc (2)
0x00| 01 e0 | .. | divisions: 480 0xc-0xe (2)
| | | tracks[0:1]: 0xe-0x20 (18)
| | | division{}: 0xc-0xe (2)
0x00| 01 e0 | .. | ppqn: 480 0xc-0xe (2)
| | | content[0:1]: 0xe-0x20 (18)
| | | [0]{}: track 0xe-0x20 (18)
0x00| 4d 54| MT| tag: "MTrk" 0xe-0x12 (4)
0x10|72 6b |rk |

Binary file not shown.

View File

@ -5,8 +5,9 @@ $ fq -d midi dv events/note-off.mid
0x00| 00 00 00 06 | .... | length: 6 0x4-0x8 (4)
0x00| 00 01 | .. | format: 1 0x8-0xa (2)
0x00| 00 01 | .. | tracks: 1 0xa-0xc (2)
0x00| 01 e0 | .. | divisions: 480 0xc-0xe (2)
| | | tracks[0:1]: 0xe-0x1d (15)
| | | division{}: 0xc-0xe (2)
0x00| 01 e0 | .. | ppqn: 480 0xc-0xe (2)
| | | content[0:1]: 0xe-0x1d (15)
| | | [0]{}: track 0xe-0x1d (15)
0x00| 4d 54| MT| tag: "MTrk" 0xe-0x12 (4)
0x10|72 6b |rk |
@ -37,8 +38,9 @@ $ fq -d midi dv events/note-on.mid
0x00| 00 00 00 06 | .... | length: 6 0x4-0x8 (4)
0x00| 00 01 | .. | format: 1 0x8-0xa (2)
0x00| 00 01 | .. | tracks: 1 0xa-0xc (2)
0x00| 01 e0 | .. | divisions: 480 0xc-0xe (2)
| | | tracks[0:1]: 0xe-0x1d (15)
| | | division{}: 0xc-0xe (2)
0x00| 01 e0 | .. | ppqn: 480 0xc-0xe (2)
| | | content[0:1]: 0xe-0x1d (15)
| | | [0]{}: track 0xe-0x1d (15)
0x00| 4d 54| MT| tag: "MTrk" 0xe-0x12 (4)
0x10|72 6b |rk |
@ -69,8 +71,9 @@ $ fq -d midi dv events/polyphonic-pressure.mid
0x00| 00 00 00 06 | .... | length: 6 0x4-0x8 (4)
0x00| 00 01 | .. | format: 1 0x8-0xa (2)
0x00| 00 01 | .. | tracks: 1 0xa-0xc (2)
0x00| 01 e0 | .. | divisions: 480 0xc-0xe (2)
| | | tracks[0:1]: 0xe-0x1b (13)
| | | division{}: 0xc-0xe (2)
0x00| 01 e0 | .. | ppqn: 480 0xc-0xe (2)
| | | content[0:1]: 0xe-0x1b (13)
| | | [0]{}: track 0xe-0x1b (13)
0x00| 4d 54| MT| tag: "MTrk" 0xe-0x12 (4)
0x10|72 6b |rk |
@ -97,8 +100,9 @@ $ fq -d midi dv events/controller.mid
0x00| 00 00 00 06 | .... | length: 6 0x4-0x8 (4)
0x00| 00 01 | .. | format: 1 0x8-0xa (2)
0x00| 00 01 | .. | tracks: 1 0xa-0xc (2)
0x00| 01 e0 | .. | divisions: 480 0xc-0xe (2)
| | | tracks[0:1]: 0xe-0x1d (15)
| | | division{}: 0xc-0xe (2)
0x00| 01 e0 | .. | ppqn: 480 0xc-0xe (2)
| | | content[0:1]: 0xe-0x1d (15)
| | | [0]{}: track 0xe-0x1d (15)
0x00| 4d 54| MT| tag: "MTrk" 0xe-0x12 (4)
0x10|72 6b |rk |
@ -129,8 +133,9 @@ $ fq -d midi dv events/program-change.mid
0x00| 00 00 00 06 | .... | length: 6 0x4-0x8 (4)
0x00| 00 01 | .. | format: 1 0x8-0xa (2)
0x00| 00 01 | .. | tracks: 1 0xa-0xc (2)
0x00| 01 e0 | .. | divisions: 480 0xc-0xe (2)
| | | tracks[0:1]: 0xe-0x1b (13)
| | | division{}: 0xc-0xe (2)
0x00| 01 e0 | .. | ppqn: 480 0xc-0xe (2)
| | | content[0:1]: 0xe-0x1b (13)
| | | [0]{}: track 0xe-0x1b (13)
0x00| 4d 54| MT| tag: "MTrk" 0xe-0x12 (4)
0x10|72 6b |rk |
@ -157,8 +162,9 @@ $ fq -d midi dv events/channel-pressure.mid
0x00| 00 00 00 06 | .... | length: 6 0x4-0x8 (4)
0x00| 00 01 | .. | format: 1 0x8-0xa (2)
0x00| 00 01 | .. | tracks: 1 0xa-0xc (2)
0x00| 01 e0 | .. | divisions: 480 0xc-0xe (2)
| | | tracks[0:1]: 0xe-0x1b (13)
| | | division{}: 0xc-0xe (2)
0x00| 01 e0 | .. | ppqn: 480 0xc-0xe (2)
| | | content[0:1]: 0xe-0x1b (13)
| | | [0]{}: track 0xe-0x1b (13)
0x00| 4d 54| MT| tag: "MTrk" 0xe-0x12 (4)
0x10|72 6b |rk |
@ -185,8 +191,9 @@ $ fq -d midi dv events/pitch-bend.mid
0x00| 00 00 00 06 | .... | length: 6 0x4-0x8 (4)
0x00| 00 01 | .. | format: 1 0x8-0xa (2)
0x00| 00 01 | .. | tracks: 1 0xa-0xc (2)
0x00| 01 e0 | .. | divisions: 480 0xc-0xe (2)
| | | tracks[0:1]: 0xe-0x20 (18)
| | | division{}: 0xc-0xe (2)
0x00| 01 e0 | .. | ppqn: 480 0xc-0xe (2)
| | | content[0:1]: 0xe-0x20 (18)
| | | [0]{}: track 0xe-0x20 (18)
0x00| 4d 54| MT| tag: "MTrk" 0xe-0x12 (4)
0x10|72 6b |rk |

View File

@ -5,8 +5,9 @@ $ fq -d midi dv reference.mid
0x000| 00 00 00 06 | .... | length: 6 0x4-0x8 (4)
0x000| 00 01 | .. | format: 1 0x8-0xa (2)
0x000| 00 02 | .. | tracks: 2 0xa-0xc (2)
0x000| 01 e0 | .. | divisions: 480 0xc-0xe (2)
| | | tracks[0:2]: 0xe-0x12b (285)
| | | division{}: 0xc-0xe (2)
0x000| 01 e0 | .. | ppqn: 480 0xc-0xe (2)
| | | content[0:2]: 0xe-0x12b (285)
| | | [0]{}: track 0xe-0x1a (12)
0x000| 4d 54| MT| tag: "MTrk" 0xe-0x12 (4)
0x010|72 6b |rk |

View File

@ -0,0 +1,31 @@
$ fq -d midi dv midi/smpte-timecode.mid
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.{}: midi/smpte-timecode.mid (midi) 0x0-0x26 (38)
| | | 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 00 | .. | format: 0 0x8-0xa (2)
0x00| 00 01 | .. | tracks: 1 0xa-0xc (2)
| | | division{}: 0xc-0xe (2)
0x00| e6 | . | fps: 29 (230) 0xc-0xd (1)
0x00| 04 | . | resolution: 4 0xd-0xe (1)
| | | content[0:1]: 0xe-0x26 (24)
| | | [0]{}: track 0xe-0x26 (24)
0x00| 4d 54| MT| tag: "MTrk" 0xe-0x12 (4)
0x10|72 6b |rk |
0x10| 00 00 00 10 | .... | length: 16 0x12-0x16 (4)
| | | events[0:2]: 0x16-0x26 (16)
| | | [0]{}: meta_event 0x16-0x22 (12)
| | | time{}: 0x16-0x17 (1)
0x10| 00 | . | delta: 0 0x16-0x17 (1)
| | | tick: 0
0x10| ff | . | status: 255 0x17-0x18 (1)
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]{}: meta_event 0x22-0x26 (4)
| | | time{}: 0x22-0x23 (1)
0x20| 00 | . | delta: 0 0x22-0x23 (1)
| | | tick: 0
0x20| ff | . | status: 255 0x23-0x24 (1)
0x20| 2f | / | event: "end_of_track" (47) 0x24-0x25 (1)
0x20| 00| | .| | length: 0 0x25-0x26 (1)

View File

@ -5,8 +5,9 @@ $ fq -d midi dv events/sysex-message.mid
0x00| 00 00 00 06 | .... | length: 6 0x4-0x8 (4)
0x00| 00 01 | .. | format: 1 0x8-0xa (2)
0x00| 00 01 | .. | tracks: 1 0xa-0xc (2)
0x00| 01 e0 | .. | divisions: 480 0xc-0xe (2)
| | | tracks[0:1]: 0xe-0x1e (16)
| | | division{}: 0xc-0xe (2)
0x00| 01 e0 | .. | ppqn: 480 0xc-0xe (2)
| | | content[0:1]: 0xe-0x1e (16)
| | | [0]{}: track 0xe-0x1e (16)
0x00| 4d 54| MT| tag: "MTrk" 0xe-0x12 (4)
0x10|72 6b |rk |
@ -29,8 +30,9 @@ $ fq -d midi dv events/sysex-continuation.mid
0x00| 00 00 00 06 | .... | length: 6 0x4-0x8 (4)
0x00| 00 01 | .. | format: 1 0x8-0xa (2)
0x00| 00 01 | .. | tracks: 1 0xa-0xc (2)
0x00| 01 e0 | .. | divisions: 480 0xc-0xe (2)
| | | tracks[0:1]: 0xe-0x2c (30)
| | | division{}: 0xc-0xe (2)
0x00| 01 e0 | .. | ppqn: 480 0xc-0xe (2)
| | | content[0:1]: 0xe-0x2c (30)
| | | [0]{}: track 0xe-0x2c (30)
0x00| 4d 54| MT| tag: "MTrk" 0xe-0x12 (4)
0x10|72 6b |rk |
@ -72,8 +74,9 @@ $ fq -d midi dv events/sysex-escape.mid
0x00| 00 00 00 06 | .... | length: 6 0x4-0x8 (4)
0x00| 00 01 | .. | format: 1 0x8-0xa (2)
0x00| 00 01 | .. | tracks: 1 0xa-0xc (2)
0x00| 01 e0 | .. | divisions: 480 0xc-0xe (2)
| | | tracks[0:1]: 0xe-0x1b (13)
| | | division{}: 0xc-0xe (2)
0x00| 01 e0 | .. | ppqn: 480 0xc-0xe (2)
| | | content[0:1]: 0xe-0x1b (13)
| | | [0]{}: track 0xe-0x1b (13)
0x00| 4d 54| MT| tag: "MTrk" 0xe-0x12 (4)
0x10|72 6b |rk |

View File

@ -1,51 +1,51 @@
$ fq -d midi '.. | select(.event=="tempo")?.tempo' midi/twinkle.mid
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x10| 0a 2c 2a | .,* |.tracks[0].events[0].tempo: 666666
0x10| 0a 2c 2a | .,* |.content[0].events[0].tempo: 666666
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x30| 0a 83 a4 | ... |.tracks[0].events[3].tempo: 689060
0x30| 0a 83 a4 | ... |.content[0].events[3].tempo: 689060
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x30| 0a b9 67| ..g|.tracks[0].events[4].tempo: 702823
0x30| 0a b9 67| ..g|.content[0].events[4].tempo: 702823
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x40| 0a f3 dd | ... |.tracks[0].events[5].tempo: 717789
0x40| 0a f3 dd | ... |.content[0].events[5].tempo: 717789
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x40| 0b 30 df | .0. |.tracks[0].events[6].tempo: 733407
0x40| 0b 30 df | .0. |.content[0].events[6].tempo: 733407
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x50| 0b 70 97 | .p. |.tracks[0].events[7].tempo: 749719
0x50| 0b 70 97 | .p. |.content[0].events[7].tempo: 749719
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x50| 0b b2 d3 | ... |.tracks[0].events[8].tempo: 766675
0x50| 0b b2 d3 | ... |.content[0].events[8].tempo: 766675
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x60|0b f8 87 |... |.tracks[0].events[9].tempo: 784519
0x60|0b f8 87 |... |.content[0].events[9].tempo: 784519
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x60| 0c 41 8c | .A. |.tracks[0].events[10].tempo: 803212
0x60| 0c 41 8c | .A. |.content[0].events[10].tempo: 803212
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x60| 0c 8e| ..|.tracks[0].events[11].tempo: 822819
0x60| 0c 8e| ..|.content[0].events[11].tempo: 822819
0x70|23 |# |
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x70| 0c de 8f | ... |.tracks[0].events[12].tempo: 843407
0x70| 0c de 8f | ... |.content[0].events[12].tempo: 843407
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x70| 0d 33 1d | .3. |.tracks[0].events[13].tempo: 865053
0x70| 0d 33 1d | .3. |.content[0].events[13].tempo: 865053
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x80| 0d 8c 1c | ... |.tracks[0].events[14].tempo: 887836
0x80| 0d 8c 1c | ... |.content[0].events[14].tempo: 887836
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x80| 0d e9 64 | ..d |.tracks[0].events[15].tempo: 911716
0x80| 0d e9 64 | ..d |.content[0].events[15].tempo: 911716
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x90| 0e 4c 65 | .Le |.tracks[0].events[16].tempo: 937061
0x90| 0e 4c 65 | .Le |.content[0].events[16].tempo: 937061
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x90| 0e b5 0f | ... |.tracks[0].events[17].tempo: 963855
0x90| 0e b5 0f | ... |.content[0].events[17].tempo: 963855
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x90| 0f| .|.tracks[0].events[18].tempo: 992227
0x90| 0f| .|.content[0].events[18].tempo: 992227
0xa0|23 e3 |#. |
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0xa0| 0f 99 71 | ..q |.tracks[0].events[19].tempo: 1022321
0xa0| 0f 99 71 | ..q |.content[0].events[19].tempo: 1022321
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0xa0| 10 16 58| ..X|.tracks[0].events[20].tempo: 1054296
0xa0| 10 16 58| ..X|.content[0].events[20].tempo: 1054296
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0xb0| 10 9b 52 | ..R |.tracks[0].events[21].tempo: 1088338
0xb0| 10 9b 52 | ..R |.content[0].events[21].tempo: 1088338
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0xb0| 11 29 28 | .)( |.tracks[0].events[22].tempo: 1124648
0xb0| 11 29 28 | .)( |.content[0].events[22].tempo: 1124648
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0xc0| 11 bf ea | ... |.tracks[0].events[23].tempo: 1163242
0xc0| 11 bf ea | ... |.content[0].events[23].tempo: 1163242
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0xc0| 12 62 53 | .bS |.tracks[0].events[24].tempo: 1204819
0xc0| 12 62 53 | .bS |.content[0].events[24].tempo: 1204819
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0xd0|13 10 c7 |... |.tracks[0].events[25].tempo: 1249479
0xd0|13 10 c7 |... |.content[0].events[25].tempo: 1249479

View File

@ -1,39 +1,39 @@
$ fq -d midi '.. | select(.event=="track_name")?.track_name' midi/twinkle.mid
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x20| 07 30 35 37 4b 69 72 61| .057Kira|.tracks[0].events[2].track_name: "057Kira"
0x20| 07 30 35 37 4b 69 72 61| .057Kira|.content[0].events[2].track_name: "057Kira"
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0xe0| 0e 41 63 6f 75 73 74 69 63 20 50 69 61 6e| .Acoustic Pian|.tracks[1].events[0].track_name: "Acoustic Piano"
0xe0| 0e 41 63 6f 75 73 74 69 63 20 50 69 61 6e| .Acoustic Pian|.content[1].events[0].track_name: "Acoustic Piano"
0xf0|6f |o |
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x380| 0e 41 63 6f 75 73 74 69| .Acousti|.tracks[2].events[0].track_name: "Acoustic Piano"
0x380| 0e 41 63 6f 75 73 74 69| .Acousti|.content[2].events[0].track_name: "Acoustic Piano"
0x390|63 20 50 69 61 6e 6f |c Piano |
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x3b0| 0e 41 63 6f 75| .Acou|.tracks[3].events[0].track_name: "Acoustic Piano"
0x3b0| 0e 41 63 6f 75| .Acou|.content[3].events[0].track_name: "Acoustic Piano"
0x3c0|73 74 69 63 20 50 69 61 6e 6f |stic Piano |
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x530| 0e 41 63 6f| .Aco|.tracks[4].events[0].track_name: "Acoustic Piano"
0x530| 0e 41 63 6f| .Aco|.content[4].events[0].track_name: "Acoustic Piano"
0x540|75 73 74 69 63 20 50 69 61 6e 6f |ustic Piano |
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x6b0| 0d 45 6c 65 63| .Elec|.tracks[5].events[0].track_name: "Electric Bass"
0x6b0| 0d 45 6c 65 63| .Elec|.content[5].events[0].track_name: "Electric Bass"
0x6c0|74 72 69 63 20 42 61 73 73 |tric Bass |
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x9e0| 06 56 69 6f 6c 69 6e | .Violin |.tracks[6].events[0].track_name: "Violin"
0x9e0| 06 56 69 6f 6c 69 6e | .Violin |.content[6].events[0].track_name: "Violin"
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0xea0| 06 56 69 6f 6c 69 6e | .Violin |.tracks[7].events[0].track_name: "Violin"
0xea0| 06 56 69 6f 6c 69 6e | .Violin |.content[7].events[0].track_name: "Violin"
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0xf90|0c 53 74 65 65 6c 20 47 75 69 74 61 72 |.Steel Guitar |.tracks[8].events[0].track_name: "Steel Guitar"
0xf90|0c 53 74 65 65 6c 20 47 75 69 74 61 72 |.Steel Guitar |.content[8].events[0].track_name: "Steel Guitar"
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x16f0| 07 44 72 75 6d 6b 69| .Drumki|.tracks[9].events[0].track_name: "Drumkit"
0x16f0| 07 44 72 75 6d 6b 69| .Drumki|.content[9].events[0].track_name: "Drumkit"
0x1700|74 |t |
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x2070| 05 46 6c| .Fl|.tracks[10].events[0].track_name: "Flute"
0x2070| 05 46 6c| .Fl|.content[10].events[0].track_name: "Flute"
0x2080|75 74 65 |ute |
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x2280| 04 4f 62 6f 65 | .Oboe |.tracks[11].events[0].track_name: "Oboe"
0x2280| 04 4f 62 6f 65 | .Oboe |.content[11].events[0].track_name: "Oboe"
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x2440| 12 53 6f 70 72 61| .Sopra|.tracks[12].events[0].track_name: "Soprano Clarinet C"
0x2440| 12 53 6f 70 72 61| .Sopra|.content[12].events[0].track_name: "Soprano Clarinet C"
0x2450|6e 6f 20 43 6c 61 72 69 6e 65 74 20 43 |no Clarinet C |
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x25e0| 0b 46 72 65 6e 63 68 20 48 6f 72 6e | .French Horn |.tracks[13].events[0].track_name: "French Horn"
0x25e0| 0b 46 72 65 6e 63 68 20 48 6f 72 6e | .French Horn |.content[13].events[0].track_name: "French Horn"
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|
0x2850| 0c 47 6c 6f 63 6b 65 6e 73 70 69 65 6c | .Glockenspiel |.tracks[14].events[0].track_name: "Glockenspiel"
0x2850| 0c 47 6c 6f 63 6b 65 6e 73 70 69 65 6c | .Glockenspiel |.content[14].events[0].track_name: "Glockenspiel"

View File

@ -5,8 +5,9 @@ $ fq -d midi dv midi/unknown-chunks.mid
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)
| | | division{}: 0xc-0xe (2)
0x00| 01 e0 | .. | ppqn: 480 0xc-0xe (2)
| | | content[0:5]: 0xe-0x56 (72)
| | | [0]{}: other 0xe-0x1e (16)
0x00| 4d 54| MT| tag: "MTrx" 0xe-0x12 (4)
0x10|72 78 |rx |