Question

I have a midi file which was generated using MuseScore. It plays well in Windows Media Player, but causes my midi reading program to crash. I've been using the following links to help me: MIDI specification and Mobilefish MIDI Guide, the second one primarily.

4d 54 68 64 = MThd
00 00 00 06 = Header length of 6
00 01 = Track format 1
00 02 = two tracks
01 e0 = 480 delta-ticks per quarter note

4d 54 72 6b = MTrk
00 00 00 86 = length of 0x86
00 ff 58 04 04 02 18 08 = time signature
00 ff 59 02 00 00 = key signature
00 c0 00 = program change (channel 1)
02 b0 07 64 = control mode change (channel 1)
02 0a = running status
40 02 = running status
5b 1e = running status
02 5d = running status
1e ac 78 90 = Aftertouch event (channel 13, not really applicable in this context)
3e 50 = running status
83 5f 3e = delta time (83 5f) and 3e, which is not a status byte
(more bytes for context): 00 01 40 50

What exists in the MIDI standard that I've overlooked here?

Was it helpful?

Solution

This question, which I wrote, is completely flawed, and I'm sorry to those people who tried to help me; I must have copied the output from Notepad++ incorrectly. However, for those who may run into the same issues that I did, I'll write an answer to this question.

Whenever running status is used, it is always preceded by a delta time. For those who may see guides that say otherwise, such as this one, http://www.blitter.com/~russtopia/MIDI/~jglatt/tech/midispec/run.htm, know that the information on these is completely misleading.

For example:

00 90 7F 7F
7F 00
50 7F
50 00

This is wrong.

However, this is the correct version:

00 90 7F 7F
81 00 7F 00
00 50 7F
81 00 50 00

This is clearly preceded by a delta time.

OTHER TIPS

If I'm not mistaken, running status still requires a variable time delta to be specified, so even if the two events happen at the same time there would still be a 00 byte proceeding the running status. However, with that in mind the aftertouch event in your above dump would lack any time offset, so I'm stumped.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top