Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parsing tempo event results in invalid microsecondsPerBeat #15

Open
Tails opened this issue Jul 1, 2015 · 0 comments
Open

Parsing tempo event results in invalid microsecondsPerBeat #15

Tails opened this issue Jul 1, 2015 · 0 comments

Comments

@Tails
Copy link

Tails commented Jul 1, 2015

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

Tails referenced this issue in Tails/jasmid Jul 1, 2015
Throw parse error when the tempo parsing does not generate a valid microsecondsPerBeat value.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant