Skip to content

Parsing tempo event results in invalid microsecondsPerBeat #15

@Tails

Description

@Tails

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions