jasmid
jasmid copied to clipboard
Parsing tempo event results in invalid microsecondsPerBeat
This code
case 0x51:
event.subtype = 'setTempo';
if (length != 3) throw "Expected length for setTempo event is 3, got " + length;
event.microsecondsPerBeat = (
(stream.readInt8() << 16)
+ (stream.readInt8() << 8)
+ stream.readInt8()
)
return event;
will sometimes result in a microsecondsPerBeat
of zero which results in a beatsPerMinute
of Infinity
, and a secondsToGenerate
of 0, resulting in a perceived MIDI file length of 0.
See mudcube/MIDI.js#134