Piano transcription in the browser (ONNX)
ONNX files for transcribing piano recordings to notes and MIDI entirely on the user's device, with onnxruntime-web (WebGPU, or threaded WebAssembly as a fallback). Nothing is uploaded to a server.
| File | What it is |
|---|---|
transkun-forward.onnx | Transkun V2 piano transcription: audio frames in, note scores and context out. Runs well on WebGPU. |
transkun-heads.onnx | Transkun V2 interval heads: velocity and onset/offset refinement for each detected note. |
htdemucs_6s.onnx | Demucs v4 (htdemucs_6s) core network, for pulling the piano out of a full song before transcribing. STFT and inverse STFT run outside the graph. |
How they are used
- Transkun: 44.1 kHz stereo, 16 s windows with an 8 s hop.
transkun-forwardtakesframes[1, 2, nFrame, 4096]and returnsscoreandctx; a semi-CRF Viterbi decode picks note intervals, andtranskun-headstakesattr[nIntervals, 3*D]and returnsvelocityandof. The two graphs were split from Neothesia's single Transkun ONNX export so the large part can run on the GPU. - Demucs: 7.8 s segments (343,980 samples) with 25% overlap; piano is source index 5.
Credits and licenses
- Transkun, Yujia Yan and Zhiyao Duan: https://github.com/Yujia-Yan/Transkun (MIT). The model was trained on the MAESTRO dataset, which is licensed CC BY-NC-SA 4.0 for non-commercial use.
- Transkun ONNX export from Neothesia (https://github.com/PolyMeilex/Neothesia, neothesia-ai).
- Demucs, Meta AI Research (Alexandre Défossez, Simon Rouard): https://github.com/facebookresearch/demucs (MIT).
- onnxruntime-web, Microsoft (MIT).
These files are redistributed under the licenses of their original authors. Please credit them, not this repo.