How we chop & keep timing tight
Chop: We compute spectral flux (positive spectrum change frame-to-frame) over the soundtrack, pick the top 16 peaks with a minimum spacing, center short slices on them, and label by band energy:
low→Downbeat, mid→Backbeat, high→Offbeat, mixed/overall flux→Fill. Rows are intensity quantiles (1/3/5/8).
Timing: We pre-render each slice into an AudioBuffer with micro fade & light normalization. Loops are scheduled on the Web Audio clock with a small look-ahead and a fixed, simple groove (4-on-the-floor kick, backbeat snare, offbeat hats, sparse fills). UI only mirrors visuals—audio never depends on UI timers. On browsers that can’t decode to buffers, we fall back to a pool of pre-warmed media elements so at least taps/loops still work.