midiviz

01 — Audio → MIDI / MusicXML transcription for the browser: models, real-time options, runtimes

Research brief, 17 Oct 2026. Scope: what can turn audio (a file or a live microphone) into notes inside a midiviz page, how good each option is, how close to real time it gets, and what it takes to run it client-side. Companion to fingering/research/02_algorithms.md and strings/research/02_algorithms.md (the consumers of the notes).

Tags:

Contents

  1. Short answer
  2. Taxonomy
  3. General-purpose / multi-instrument models (Basic Pitch, MT3 family, MuScriptor)
  4. Piano models (offline)
  5. Streaming and low-latency piano
  6. Monophonic pitch (voice, violin, winds)
  7. Source separation as a front end
  8. Performance MIDI → score (MusicXML)
  9. MuScriptor vs Transkun
  10. Browser runtimes: onnxruntime-web, Transformers.js, tfjs, ggml
  11. Commercial reference points
  12. Recommended plan for midiviz
  13. References

1. Short answer

2. Taxonomy

Family Output stage Examples Browser cost
Frame / onset roll + post-processing per-frame pitch activations, thresholds Onsets and Frames, Basic Pitch, Kong et al., hFT-Transformer, Mobile-AMT one forward pass per window, cheap to stream
Structured decoding intervals decoded by dynamic programming Transkun (semi-CRF) one forward pass + Viterbi in JS
Seq2seq token decoding MIDI-like tokens, autoregressive MT3, MR-MT3, YourMT3+, Aria-AMT, MuScriptor hundreds of decoder steps per segment, needs a KV cache
Monophonic F0 one pitch per frame CREPE, SPICE, PESTO, SwiftF0, pYIN tiny
Audio → score end-to-end notation tokens (**Kern, MusicXML-like) piano-a2s, Rubato seq2seq cost, research code

3. General-purpose / multi-instrument models

Basic Pitch (Spotify, ICASSP 2022)

MT3 family

MuScriptor (Kyutai + Mirelo, with IRCAM; released 9 July 2026)

4. Piano models (offline)

Model Year Notes Licence
Onsets and Frames 2018 in @magenta/music (tfjs), runs in a browser today; older accuracy [T] Apache-2.0 [T]
Kong et al. (ByteDance) high-resolution 2021 regression onsets/offsets, pedals; community ONNX ports [T] MIT [T]
Transkun v1 (semi-CRF) NeurIPS 2021 intervals scored and decoded by Viterbi, then velocity and refined onset/offset [V] MIT [V]
Transkun v2 ISMIR 2024 encoder-only non-hierarchical transformer on a low-time-resolution feature map, inner-product interval scoring; “state of the art across all subtasks” on MAESTRO v3 [V, abstract] MIT [V]
hFT-Transformer (Sony) 2023 hierarchical frequency-time transformer [T] [?]
Aria-AMT (EleutherAI) 2024 seq2seq, built for robustness on real recordings; transcribed the Aria-MIDI dataset (1.19M files, ~100K hours) [V] [?]
Fernandez, “onsets and velocities” 2023 ~3.1M params, onset F1 96.78 on MAESTRO, real-time on commodity hardware [V, abstract]; its latency is 4–9 s per Hu et al. [V] [?]

Transkun’s pip checkpoint is trained without extending notes by the sustain pedal and with augmentation; papers usually report the pedal-extended convention, so compare like with like [V].

5. Streaming and low-latency piano

Latency budget from Hu et al.: digital instruments want ~10 ms, networked ensemble playing tolerates ~30 ms; earlier online systems sit at 128–320 ms [V].

6. Monophonic pitch

7. Source separation as a front end

8. Performance MIDI → score

9. MuScriptor vs Transkun

  MuScriptor Transkun v2
Task any instruments, full mixes, 36 instrument groups solo piano only
Architecture decoder-only transformer, audio prefix, autoregressive tokens encoder-only transformer, interval scores, semi-CRF Viterbi
Output onset, offset, pitch, instrument; no velocity, no pedal; drums onset-only onset, offset, pitch, velocity, sustain/soft pedal
Piano accuracy not reported on MAESTRO in the model card [?] state of the art on MAESTRO v3 (authors)
Inference 5 s chunks, hundreds of sequential decode steps, KV cache one parallel forward pass per segment + DP decode
Size 100M – 1.3B much smaller [?]; exact count not checked
Speed small 1.9× RT on M1 Pro CPU natively not measured here [?]
Licence weights CC BY-NC 4.0 (+ rights condition) MIT
Browser route port muscriptor.cpp/ggml to WASM (+ ggml WebGPU), or ONNX export with a custom decode loop ONNX export, onnxruntime-web, Viterbi in JS

For midiviz, velocity and pedal drive the synth, the key animation and the hammers, so Transkun is the better fit for piano material. MuScriptor is the choice for anything that is not solo piano, if the non-commercial licence is acceptable. A combined pipeline is possible: MuScriptor for instrument assignment, Transkun for the piano part.

10. Browser runtimes

onnxruntime-web

Transformers.js

TensorFlow.js

ggml / llama.cpp style

11. Commercial reference points

Klangio Transcription Studio, Songscription (reportedly built on Beyer & Dai’s model [V, via EverybodyWiki]), AnthemScore, ScoreCloud, Melodyne, Ivory, song2notation. Pianolyze transcribes piano entirely in the browser (MP3/WAV/FLAC/M4A → piano roll, sheet view, MIDI) [V, search snippet]; its engine was not checked [?].

  1. Baseline page: Basic Pitch (tfjs, or its ONNX model on onnxruntime-web) for files and a sliding-window microphone mode; output through the existing player and webmscore for MusicXML. Add SwiftF0 or PESTO in an AudioWorklet for live monophonic input.
  2. Piano quality: export Transkun v2 to ONNX, run on onnxruntime-web WebGPU with WASM fallback, Viterbi decode in JS (or a worker). Compare against Basic Pitch on MAESTRO clips with mir_eval-style onset / offset / velocity F1, the way #031 scored against RoboPianist.
  3. Live piano: port the Hu et al. 2025 causal baseline (or Kwon 2024) and measure mic → note latency end to end in an AudioWorklet.
  4. Full mixes: MuScriptor-small via an Emscripten build of muscriptor.cpp if the NC licence is acceptable; otherwise BS-RoFormer separation + per-stem models.
  5. Score: start with MuseScore’s MIDI import; try MIDI2ScoreTransformer later and judge it with both notation and playback similarity, as the Dual Evaluation paper recommends.

Open checks before shipping: licences of hFT-Transformer, Aria-AMT, SwiftF0, PESTO and Kong checkpoints; Transkun parameter count and speed; whether MuScriptor reports MAESTRO numbers in its paper.

13. References