Open DF9TS opened 4 years ago
Sorry for the delay, i've been very busy lately. I'll try to take a look
I cannot see a fault in the docs provided by colxi. For "set tempo" it says "length: 3" followed by the tempo. Perhaps you are missing that any mentioned length is represented by a byte value in the file. All meta events have a length byte following the type:
These events are defined by an event type value of 0xFF and have a variable size of parameter data which is defined after the event type.
In https://github.com/colxi/midi-parser-js/wiki/MIDI-File-Format-Specifications the tempo meta event says: 0xFF 0x51 then 3 bytes for tempo value
When you check in other docs you will find it's 0xFF 0x51 0x03 then 3 bytes for tempo value e.g. here https://www.cs.cmu.edu/~music/cmsip/readings/Standard-MIDI-file-format-updated.pdf
.. and my MIDI player crashes if I generate a MIDI file without the 03 in set tempo