← All models

music transcription · audio · WASM · ~0.3 MB

Music transcription (audio → notes)

The built pitch detection demo tracks one note at a time. Real music is polyphonic — many notes at once. Basic Pitch, Spotify's tiny (~0.3 MB) audio-to-MIDI model, listens to a whole mix and lights up every key it hears as a piano roll. Play a sample, drop in an audio clip, or record from your mic — the model runs entirely on your device; nothing is uploaded.

At a glance

ModelSpotify Basic Pitch (nmp) — a lightweight audio-to-MIDI network
Taskmusic-transcription / audio-to-MIDI (polyphonic note detection) — run via raw ONNX Runtime Web (see note below)
Runtimeonnxruntime-web 1.21 (transformers.js has no music-transcription task)
Input[1, 43844, 1] float32 — one ~1.99 s window of mono audio at 22050 Hz (raw waveform; the harmonic-CQT frontend is inside the graph)
Outputper window: note [1, 172, 88] + onset [1, 172, 88] (MIDI 21–108) + fine contour [1, 172, 264]
Quantizationfp32 ONNX — runs on the plain WASM execution provider, no WebGPU needed
BackendWebAssembly (single-threaded on GitHub Pages) — ~60 ms per ~2 s window
Download~0.3 MB, cached after first load (auto-inits on return)
LicenseApache-2.0 (Spotify) — the weights stay Apache-2.0 wherever mirrored
Web APIsWebAssembly, Web Workers, Web Audio (decode + mic), Canvas — all Baseline widely available

Transcribe

Drop an audio file here, or click to choose

Pick a sample, upload a clip, or record to transcribe.

Detected notes

A simple peak-pick over the model's note + onset heads (not Basic Pitch's full note-creation algorithm).

Why raw ONNX Runtime Web?

Transformers.js has no music-transcription task, so we run Basic Pitch's ONNX graph directly with onnxruntime-web: resample audio to 22050 Hz mono, feed it in ~2 s windows, and read the model's note, onset, and contour heads. The piano roll above is the model's raw note output — every lit cell is a pitch the network heard at that moment. It's polyphonic by design, so chords and two-hand playing show many keys at once. Everything runs on your device.

Use-case ladder

Basics · Piano Roll & Threshold Lab

Tune onset/frame thresholds live over procedural presets, inspect exact MIDI note tables, and play back the transcribed notes via Web Audio.

Practical · Hum-to-MIDI & .mid Exporter

Quantize hummed or played audio to 1/4, 1/8, or 1/16 beat grids, detect key & BPM, and download a real binary Standard MIDI File (.mid) for your DAW.

Wild · Guitar TAB, Chords & Synth Remix

Map transcribed notes onto a 6-string guitar TAB with measure-by-measure chord detection, pitch accuracy metrics, and a live Piano / Chiptune / Pad remix engine.

Multi-model · Two-Stage Music Intelligence

Combine Basic Pitch polyphonic MIDI transcription (~0.3 MB) with DistilHuBERT 10-genre classification (~24 MB) in separate Web Workers on the same clip.