FA-81809 / MIDI event timing / Member archive
MIDI Time Code quarter-frame assembly: rate bits leak into the hour · case 04
At 25 fps the rate-code bits are folded into the hours field, so 01:02:03 decodes with hour 9 after wrapping.
Case contract
Input the data bytes of received quarter-frame messages. The last eight must carry piece numbers 0..7 (high nibble) in order; low nibbles give frames (pieces 0,1 as low/high nibble), seconds (2,3), minutes (4,5) and hours (6 low nibble, piece 7 bit 0 as hours bit 4); piece 7 bits 1-2 give the rate code (0: 24, 1: 25, 2: 30 drop, 3: 30 fps). The reported time is the decoded time plus 2 frames, carried into seconds, minutes and hours (mod 24). Return [h, m, s, f, rate_code] 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 0 | [9, 30, 15, 12, 2] | [17, 30, 15, 12, 2] | 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 ↗