midi-parser-js icon indicating copy to clipboard operation
midi-parser-js copied to clipboard

Please checke tempo meta event description - there may be a fault

Open DF9TS opened this issue 6 years ago • 2 comments

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

DF9TS avatar Jan 06 '20 15:01 DF9TS

Sorry for the delay, i've been very busy lately. I'll try to take a look

colxi avatar Apr 27 '20 17:04 colxi

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.

masi avatar May 07 '20 20:05 masi