Research note 03 · Deterministic practice matching

When should wait-for-me advance?

A note can arrive early, stay held, repeat, overlap a chord, or survive only through pedal. A practice matcher needs a physical contract—not a nearest-pitch guess.

Published 18 July 2026 · Current production behavior

The transport can wait; the matcher still has to decide

In wait-for-me practice, playback stops at the next target until the player supplies the required pitch or chord. The apparently simple rule—“advance when the right note is played”—breaks down as soon as real MIDI input arrives.

Should a note played early count when the target reaches it? Does a short tap count after the finger has lifted? Can one held key satisfy three repeated notes? Does sustain make a released key eligible? The answers determine whether practice feels forgiving, predictable, or mysteriously wrong.

Keyfire treats this as a small state machine with an explicit behavioral contract. The contract is implemented, covered by focused tests, and checked against repeated black-box observations.

Five rules define the current matcher

  1. The key must still be physically down.A matching Note On can wait for an approaching target, but a Note Off withdraws it. Sustain affects sound, not eligibility.
  2. An early candidate is valid for at most 401 ms.At 402 ms before the target, the same held note is too old.
  3. One candidate passes one target.A continuous hold cannot flow through repeated notes.
  4. Every Note On creates a fresh candidate.A retrigger can pass the next repeated target even if the device omitted an intervening Note Off.
  5. Grouped pitches must overlap physically.For a chord to pass, all required pitches have to be down together.
Keyfire-specific grouping

Note starts within 35 ms form one release-sensitive checkpoint. Duplicate pitches at that checkpoint—for example, the same note in layered tracks—require one physical key press, not one press per track.

Why the boundary is 401 ms

The number is not a claim about a universal limit of human timing. It is a compatibility boundary measured from a reference wait-for-me implementation and then encoded as a production rule.

Adjacent boundary tests: a held Note On 401 ms early passed; the same input 402 ms early failed.

Both boundary points were repeated three times from fresh reference processes. The scheduled sends landed 12 μs and 11 μs late respectively, far smaller than the 1 ms gap between the cases. The MIDI loopback path measured a 0.53 ms median round trip.

Encoding the boundary makes behavior explainable and regression-testable. It can still be versioned if future product research supports a different experience.

Chords require overlap; repeated notes require intent

A two-note target passed when the notes overlapped for 50 ms and failed when a 50 ms gap separated them. Holding the first note with the sustain pedal did not turn the gap into a chord. Inside Keyfire, releasing a partially matched pitch before the checkpoint completes removes that partial match; the player must press it again.

Repeated pitches expose a different ambiguity. Holding one key across three targets advanced only the first. Three fresh Note Ons advanced all three—even without Note Off messages—and ordinary release-and-repress input did the same. This handles both physical repeats and MIDI devices that retrigger imperfectly while preventing a passive hold from playing the passage.

A differential probe turns feel into evidence

The practice probe keeps one target song unchanged and generates deterministic performed MIDI around it. Its catalog covers early and late attacks, released taps, chord spreads, wrong notes, retriggers, held-note sweeps, repeated pitches, velocity extremes, sustain, missing notes, All Notes Off, and Reset All Controllers.

For each scenario, the probe records planned and actual send times, output lateness, MIDI endpoint, marker events, independent loopback capture, and whether the target advanced. The evaluator uses three outcomes: advanced, partial, and not advanced. The reference observations were collected under a documented clean-room boundary.

Reference run

Synthesia 10.9.5903 · 12 July 2026 · canonical song SHA-256 5CEE4370…5AEFD1 · every reported boundary and repeated-note result restarted from a fresh process.

The production matcher agrees on all 38 comparisons

ProbeObserved contractKeyfire
Held 401 ms earlyAdvancesMatch
Held 402 ms earlyDoes not advanceMatch
20 ms tap released before targetDoes not advanceMatch
One hold across three repeatsAdvances one targetMatch
Three Note Ons without releaseAdvances three targetsMatch
Chord with 50 ms overlapAdvancesMatch
Chord with 50 ms gapDoes not advanceMatch
Released key sounding under pedalDoes not advanceMatch

The stored comparison contains 38 repeated reference observations. Keyfire matches the disposition and exact number of targets advanced in all 38. The broader generated catalog contains 99 deterministic regression scenarios, including controller and live-note-state cleanup cases.

What this result does—and does not—establish

  • It establishes a bounded, reproducible contract for current wait-for-me matching.
  • It does not prove that 401 ms is the ideal pedagogical window for every player.
  • It does not score articulation, pedal technique, dynamics, fingering, or expressive timing.
  • It does not infer hands or fingers from MIDI input.
  • It does not turn a compatible reference behavior into ground truth.
A practice rule is ready to ship when the player can predict it and the test harness can reproduce it.