Resilient Accompanist

A machine accompanist that survives your mistakes — wrong notes, skips, hesitations — and gracefully finds its place again instead of derailing. Two followers run in parallel (smooth DTW + error-aware HMM); a confidence supervisor hands control to whichever is trustworthy.

DTW confidenceCCGGAAGFFEEDDCDTWHMM
in control: DTW (smooth)
Mode
Idle
DTW pos
1 / 14
HMM pos
1 / 14
Harmony
—
DTW confidence
100%
Soloist dynamics
50%
Articulation
—

Play it yourself — and fumble

Home-row keys play the C-major scale. Play “Twinkle Twinkle” (C C G G A A G…) — then deliberately hit a wrong key, skip ahead, or pause and repeat a note. Watch the supervisor hand control to the HMM and the accompaniment hold its place instead of derailing.

aC
sD
dE
fF
gG
hA
jB
kC'

MIDI: not requested

The dual DTW ⇄ HMM supervisor

DTW (smooth)
Online DTW (Dixon's MATCH, 2005): bounded-window path growth, D(i,j)=cost+min(↑,←,↖). Fast and steady when you play correctly.
HMM (robust)
Left-to-right HMM with explicit error transitions (self / skip / back), after Nakamura et al. A wrong note only dents a state's likelihood, so belief mass survives and snaps back.
Supervisor
Watches DTW confidence with hysteresis: drops to the HMM when it collapses on a wrong-note run, returns to DTW once it clearly recovers.

The baked demo deliberately fumbles in order — clean phrase, a wrong-note run, recovery, a skip-ahead, a hesitation/repeat, then a clean resolution — so you can hear and see each catch. Full design notes and references: src/app/dream/391-resilient-accompanist/README.md

The dream lab — Karel Barnoski