At a glance
| 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
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.
| 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).
- Zero-HMM frame-accurate downbeats β crisp 50 fps logits require only a 7-frame local-maximum peak picker.
- Adreno/WebGPU-safe static 1500-frame graph β split head attention fits inside 128 MiB storage buffers and falls back seamlessly to CPU WASM.
- Downstream MIDI & DAW clock β export bar-aligned
.MIDbeat grids or chain straight into Basic Pitch polyphonic MIDI quantization.
3 Β· Use-case ladder
Basics Β· 3/4 vs 4/4 vs 5/4 & Peak-Picking Lab
Compare Triple 3/4 Waltz, 4/4 Groove, and 5/4 Odd-Meter downbeat grouping and ablate peak-picking threshold and refractory-window width live.
Practical Β· Multi-Loop DJ Stem BPM & .MID Indexer
Index a DJ stem crate with Pause, Resume, and Cancel controls mid-batch, plus 1-click quantized .MID beat-grids and OWASP CSV/JSON cue exports.
Wild Β· 5-Perturbation Rhythm Stress Suite
Stress-test 1.4Γ double-time, 0.65Γ half-time, Β±30 ms micro-swing jitter, -12 dB kick suppression, and +6 dB crowd ambience with exact MIR F-measure & octave-error scoring.
Multi-model Β· 191.2 MB Beat This! β Basic Pitch MIDI
Chain Beat This! (190.9 MB downbeat clock) with reused Spotify Basic Pitch (0.3 MB) to compare unquantized raw notes against bar-aligned quantized MIDI.
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)