FA-81654 / MIDI event timing / Member archive
14-bit pitch bend to cents: cents truncated · case 04
A bend worth 12.5 cents reports 12 and fractional values always shrink toward zero.
Case contract
Input [lsb, msb, range_semitones] with 7-bit data bytes. value = msb*128 + lsb, offset = value - 8192. Positive offsets scale to +range by dividing by 8191, negative ones by 8192. cents = offset * range * 100 / divisor, rounded half away from zero. Invalid bytes or negative range return 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 | -12 | -13 | 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 ↗