FAILURE MAP
← Case archive

FA-81438 / MIDI event timing / Member archive

Note-on and note-off pairing into durations: overlapping same-pitch notes matched last-in first-out · case 03

With two overlapping C4 notes, the first note-off ends the later note, swapping the two durations.

Member previewVariant 3 · 3 implementations · 8 checks per implementation

Case contract

Input time-ordered events [tick, kind, channel, note, velocity] with kind on or off. A note-on with velocity 0 acts as a note-off. Each off ends the earliest still-open note with the same channel and note (FIFO); unmatched offs are ignored. Notes still open at the end end at the last event tick. Return [start, end, channel, note, on-velocity] sorted by start, note, channel, end.

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 fixture

This sample comes from the broken implementation of a controlled reproducer.

Boundary fixtureActualExpectedOutcome
oracle 0[[0, 9, 2, 60, 100], [4, 8, 2, 60, 90]][[0, 8, 2, 60, 100], [4, 9, 2, 60, 90]]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 ↗