FA-81404 / MIDI event timing / Member archive
Standard MIDI File header chunk reader: zero ticks per quarter accepted · case 04
A header with division 0 is returned as ppq 0, which later divides by zero in timing code.
Case contract
Input the bytes of a header chunk: "MThd", a 32-bit big-endian length (>= 6; extra bytes ignored but must be present), 16-bit format (0, 1, 2), 16-bit track count (nonzero; exactly 1 for format 0) and 16-bit division. If bit 15 of division is set, the high byte is a negative two's-complement frame rate (24, 25, 29, 30) and the low byte ticks per frame; otherwise division is ticks per quarter note (nonzero). Return a dict or None.
Why this case matters
MIDI sequencers, file readers and synth drivers depend on exact event ordering and tick/time arithmetic.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| oracle 5 | {"format": 1, "ppq": 0, "tracks": 2} | null | Failed |
MEMBER ARCHIVE
The complete case is available to members.
This record includes three runnable implementations, regression fixtures, execution results, and source hashes.
Member access is invitation-based. Sign in with your invited account to inspect the sources.
Sign in to the archive ↗