← Gallery DJ crate analyzer — tempo, key, similarity

DJ crate analyzer — tempo, key, similarity

scripts/dj-loop-analyzer.js

Six short loops get sized up the way a DJ reads a crate: what tempo is each one, what key does it sit in, and which loops actually sound alike. Three are A-minor grooves over a four-on-the-floor kick, three are E♭-major 16th-note arps with off-beat hats — click any cell of the similarity matrix to hear that pair back-to-back. Technically, the recipes carry exact ground truth (A1/A2/A3 at 120.19 BPM — 43 hops/beat on the tempo lag grid — with small pattern variations, and B1/B2/B3 at 147.66 BPM); DJLoopAnalyzer analyzes all six, and badges assert the similarity ranking, the block structure of the DTW similarity matrix, exact tempo recovery, Krumhansl-Schmuckler key detection with NORMALIZED confidence (post-repair), measured timbral proxies (post-repair — the old code returned constants), Camelot key compatibility, and index-based DTW k-means clustering (post-repair — the old code TypeError'd and silently fell back to tempo bins). All numbers node-verified.

DTW similarity matrix (bright = similar) — click a cell to play the pair
loopbpmkeykey confenergybrightnesswarmth
synthesizing crate…