loop/recurrence.js — chroma recurrence heatmap + tempo-free lag proof (Drive Through Beat.wav)

loop.detect(buffer, {strategy:'recurrence'}) finds the loop of Drive Through Beat.wav from repetition structure alone — no beat tracking, no BPM. The page then rebuilds the EXACT matrix the strategy analyzed, using the same promoted pipeline functions with the same parameters (recurrence.computeChroma → stackMemory → recurrenceMatrix(affinity) at the effective hop reported in the result diagnostics), renders it as a frames×frames heatmap, and draws the winning lag as the off-diagonal stripe. Badges assert the detected loop duration equals the winning lag × hop / sr (to within one hop: the final bounds get sample-level refinement + zero-crossing snap), that the stripe is measurably brighter than the off-diagonal background, and that the result honors the tempo-free contract (NO bpm field, ever). Same pipeline node-verified in examples/node/loop-recurrence.mjs. Audition the detected loop to hear that the lag is the real cycle.

chroma recurrence matrix (affinity, time-delay embedded) — pink stripe = winning lag
candidatelagFramesduration (s)confidence (audio NCC)
loading + decoding WAV…