audio-classification Β· JKU Beat This! (final0) Β· CPU WASM Β· fp32 Β· 190.91 MB Β· MIT

Beat This! ONNX: Neural Beat & Downbeat Tracking

Beat This! (musetric/beat-this-onnx, upstream JKU CPJKU/beat_this final0, MIT) predicts frame-level beat and Bar-1 downbeat probabilities at 50 fps (20 ms frames) directly from log-mel spectrograms β€” without a separate HMM post-processor β€” running locally on CPU WebAssembly (bit-exact with upstream ONNX CPU and ORT 1.24.3 WebGPU).

At a glance

Beat This! ONNX model specifications and browser runtime contract
Source model musetric/beat-this-onnx (MIT Β· rev 25308706 Β· upstream CPJKU/beat_this final0, ISMIR 2024 β€” static 1500-frame rewrite with split WebGPU attention heads)
Browser ONNX weights beat_this.onnx (190.65 MB = 190,649,026 B, fp32) + mel-filterbank.bin (0.26 MB = 262,656 B, float32 [513, 128]) = 190.91 MB decimal (190.9 MB catalogue Β· 182.1 MiB binary)
Task & runtime Catalogue task: audio-classification (50 fps neural beat & downbeat frame tagging) Β· CPU WASM (executionProviders: ["wasm"]) via isolated onnxruntime-web@1.21.0 in a dedicated module Web Worker (bit-identical to ONNX CPU and within 4.4e-5 of ORT 1.24.3 WebGPU; 1.21.0 WebGPU intentionally bypassed due to measured pre-1.24 kernel logit drift of up to 11.88 logits)
Exact I/O contract 22.05 kHz arithmetic-mean downmixed mono PCM β†’ reflect-padded periodic-Hann STFT (n_fft=1024, hop=441, magnitude / 32) Γ— mel-filterbank.bin β†’ spect [1, 1500, 128] float32 log1p(1000 * mel) (30 s @ 50 fps, border=6, keep_first) β†’ outputs beat [1, 1500] and downbeat [1, 1500] raw frame logits
Web APIs WebGPU (optional accelerator), WebAssembly, Module Web Workers, Cache Storage, Web Audio / AudioContext, MediaRecorder (optional mic capture), Canvas 2D β€” Baseline widely available

Why arithmetic-mean stereo downmix matters: Unlike ffmpeg -ac 1 (which applies energy-preserving √2 gain), Beat This! expects exact (L + R) / 2 mono downmix before log1p(1000 * mel). Changing gain shifts the nonlinear log-mel compression and drifts beat phase β€” so every preset, WAV parser, and Web Audio decoder here uses exact mean downmix.

1 Β· Interactive Beat/Downbeat Timeline & Click-Track Metronome

Deterministic procedural grooves (120 BPM House, 104 BPM Funk, 110 BPM 3/4 Waltz, 116 BPM 5/4 Odd-Meter) are synthesized in-memory with zero new audio binaries; WAV probes reuse ledgered Basic Pitch piano chords and public-domain JFK speech cadence β€” or capture/upload your own recording below.

Initialise Beat This! ONNX (190.91 MB fp32 CPU WASM) above to track beats and Bar-1 downbeats locally.

Active input: 120 BPM House (4/4) Β· 22.05 kHz mono

Detected BPM–
Meter & Bars–
Bar-1 Phase–
Beats / Downbeats–
Mel Β· Infer Β· EP–
Raw Tensor Β· NaN–

2 Β· See inside: Raw [1, 1500] 50 fps Beat vs Downbeat Logits

Each 30-second window feeds spect [1, 1500, 128] into beat_this.onnx and emits two raw float32 [1, 1500] logit vectors at 50 fps (20 ms/frame). Local maxima above 0.0 (sigmoid 0.50) inside a 7-frame window (peakRadius = 3, 60 ms) become sub-frame refined beats and Bar-1 downbeats.

Output Shape[1, 1500]
Beat Logit Range–
Downbeat Range–
Positive Frames–
IBI Jitter–
Top raw 50 fps beat and downbeat logit frames from Beat This! ONNX
Frame (50 fps) Time (s) Beat Logit Beat Οƒ(x) Downbeat Logit Downbeat Οƒ(x)
Run Beat This! ONNX above to populate raw [1, 1500] frame logits.

Why Beat This! ONNX matters

Browser DAWs, DJ loop slicers, rhythm games, video beat-cut editors, and music transcription tools all need exact tempo, bar boundaries, and Bar-1 phase β€” without uploading copyrighted tracks to a remote GPU server. Beat This! brings ISMIR 2024 state-of-the-art transformer beat/downbeat tracking into a single MIT-licensed ONNX graph that runs locally on WebGPU (~200 ms per 30 s window) or CPU WASM (~3.3 s).

3 Β· Use-case ladder

4 Β· How the ONNX Runtime Web API works

import * as ort from "https://cdn.jsdelivr.net/npm/onnxruntime-web@1.21.0/dist/ort.wasm.min.mjs";
ort.env.logLevel = "error";

const session = await ort.InferenceSession.create(beatThisOnnxBytes, {
  executionProviders: ["wasm"], // bit-exact with ONNX CPU & ORT 1.24.3 WebGPU
  logSeverityLevel: 3,
});

// 1. 22.05 kHz arithmetic-mean mono -> periodic-Hann STFT (n_fft=1024, hop=441, mag/32)
// 2. Project onto mel-filterbank.bin [513, 128] -> log1p(1000 * mel) -> pad to [1, 1500, 128]
const { beat, downbeat } = await session.run({
  spect: new ort.Tensor("float32", logMelWindow1500, [1, 1500, 128]),
});
// beat.data & downbeat.data: Float32Array(1500) raw logits at 50 fps (20 ms/frame)

5 Β· Inspect worker & log-mel DSP code

Show the code Β· worker.js β€” ensureLoaded() (per-file Cache Storage progress & CPU WASM EP init)
Show the code Β· worker.js β€” analyzeAudio() (1500-frame windowing & 50 fps logit aggregation)
Show the code Β· beat-this-core.mjs β€” computeLogMelSpectrogram() (reflect-padded STFT + log1p mel)