Midi Hexa-Code Notation Different in one fie

88 views Asked by At

I have those 3 Events in a Midi file:

00 FF 51 03 0E 15 C3 86 A6

20 FF 51 03 15 20 A5 83

5C FF 51 03 0E 15 C3

But what is, in this case, important is, that FF 51 stands for a Tempo Change and the 03 for the number of following Byte-Pairs describing the tempo. As it is "3 Byte Pairs" in Each Event Why are there 5 Byte Pairs describing the first Event, 4 describing the second, and 3 describing the third? (I hope the image helps)

How does the encoding program know, when a new Event starts? The File can be played without any Problems.

enter image description here

1

There are 1 answers

1
CL. On BEST ANSWER

All three events have three data bytes.

The delta times between the events are encoded as variable-length quantities, so you have to continue to read bytes until the most significant bit is clear. The three times before each event are 00, 86 A6 20, and 83 5C, resulting in the decoded delta times of 0, 109344, and 476.