Music sync — DTW aligns a performance with its 1.25× time-stretched twin

The music-sync recipe aligns a slow and a fast recording of the same lick and eyeballs the warping path. Here the warp factor is known, so the alignment is self-verifying: the first 8 s of orphans-mix.wav (mono 22050) is stretched by exactly 1.25× with the validated phase vocoder (effects.time_stretch), both takes are chroma-featurized (feature.chroma_stft), and the two chroma sequences are aligned with sequence.dtw (cosine metric). A uniform 1.25× stretch must yield a warping path that is a straight line of slope 1.25 in (X-frame, Y-frame) space; the badges assert exactly that (slope ±10%, R² > 0.99), plus monotonicity, pinned endpoints, and that the aligned frames are far more similar than random pairs. Same asserts as examples/node/plot-music-sync.mjs (node-verified against dist).

loading audio…

Chroma of X — original (12 × Nx frames), y bottom→top: C C# D D# E F F# G G# A A# B
Chroma of Y — stretched 1.25× (12 × Ny frames), same pitch-class axis
Accumulated cost matrix D with warping path (cyan)
x = Y-frame (stretched), y = X-frame (original)