Skip to main content

dettato

Model on Hugging Face Hugging Face: kobimusic kobi.music Python 3.10+

KobiMusic's dettato is an audio to MIDI transcriber. You give it a recording and it writes a MIDI file, with one track for each instrument and a drum track. On nine public benchmark sets it beats MuScriptor 1.3B, which is the next best open model. It scores 59.2 composite F1 and MuScriptor scores 45.1. On the three sets that Mirelo publishes, it also scores a bit higher than Mirelo A2M v1.1 Pro, which is a closed model (60.8 to 56.1). The part I benchmarked is 20M parameters, and MuScriptor is about 65 times bigger.

dettato is four models in a chain. The transcriber (15.3M parameters) finds the notes. The evidence repairer (4.9M) fixes them using the transcriber's evidence. The grouper (2.9M) puts the notes into instrument tracks, and the drum model (5.0M) writes the drums. The code and the weights are under Apache-2.0, so commercial use is fine.

No copyrighted recordings. dettato was trained on a mix of synthetic instrument recordings and CC solo instruments from the URMP dataset. The rest of the instruments morph together around 20 soundfonts, using the soundfont babies technique I published. The vocals and the other augmentation are CC data too, and the grouper and drum model cards list the CC research datasets they use. No benchmark recording was used for training.

What to expect. It is hard to know how well it will work for your music from benchmarks alone, so I would try it first. The weakest step is putting the notes into the instrument tracks they belong in. For instance, on jazz recordings a quarter of the saxophone notes can land in the piano track. It also writes performance MIDI. This means the notes keep the timing of the recording, and they are not quantized to a beat. If you want something you can play from, like sheet music, I would recommend Songscription or Klangio. They are both great tools.

Composite F1 on all nine benchmark sets, and each system on each set it reports

The benchmark is the eight sets from Table 2 of the MuScriptor paper, plus the Slakh2100 test set. The eight sets are Bach10, Dagstuhl ChoirSet, PHENICX-Anechoic, RWC Popular, RWC Classical, RWC Genre, RWC Jazz and RWC Royalty-Free. I scored them with the rules from that paper. The composite is the mean of the note onset, note frame, note offset and drum F1.

system parameters composite onset frame offset drums
dettato transcriber + drums 20.3M 59.2 (95% 57.9-60.6) 67.2 77.9 44.8 47.1
MuScriptor 1.3B 45.1 48.6 70.2 27.8 34.0

Mirelo A2M v1.1 Pro reports three of the sets: PHENICX-Anechoic, RWC Classical and RWC Royalty-Free. On those three, dettato scores 60.8. Mirelo A2M scores 56.1 (Mirelo published that number), MuScriptor scores 47.4 and YourMT3+ scores 45.7.

The three sets Mirelo A2M reports: composite and each measure for dettato, Mirelo A2M, MuScriptor and YourMT3+

On the eight MuScriptor sets alone, dettato scores 58.4. MuScriptor scores 44.6 and YourMT3+ scores 41.1, which are the numbers from the paper. The tables for each set are on the dettato and dettato-drums cards.

The table scores the notes from the transcriber and the hits from the drum model. I measured the evidence repairer alone (+0.30 composite with the base network of the transcriber in front). The grouper was measured on my own track benchmark, and their cards have the details. I have not scored the four models as one chain yet, the way this package runs them.

Install

pip install git+https://github.com/kobimusic/dettato
dettato song.mp3 -o out/        # -> out/song.mid + out/song.json

The weights download from the Hugging Face Hub on first use (the dettato collection).

Beethoven, Symphony No. 5, i.: dettato's MIDI, one lane per instrument track plus timpani

Models

Four models, 28.1M parameters in all, collected in the dettato collection. Each has its own model card:

stage model parameters what it does
1 kobimusic/dettato 15.3M notes from audio: onset, end and pitch on 88 keys, two voices per key
2 kobimusic/dettato-evidence 4.9M repairs the notes using the transcriber's own evidence: drops wrong notes, fixes onsets and ends, adds missed notes
3 kobimusic/dettato-grouper 2.9M puts every note in an instrument track and names the instrument
4 kobimusic/dettato-drums 5.0M drum hits on General MIDI drum keys, drum kits and orchestral percussion

Use

Command line

dettato song.mp3 other.wav folder/ -o out/
  • Takes any number of files and folders. Folders are searched recursively, and the folder structure is kept under out/.
  • Writes out/<name>.mid and out/<name>.json (the tracks, note counts, the tuning estimate, which drum model ran).
  • Uses the GPU when there is one (--device cpu to force the CPU).

Python

import dettato

result = dettato.transcribe("song.mp3")       # loads the models once, then reuses them
result.save_midi("song.mid")
for track in result.tracks:
    print(track.name, track.program, track.is_drum, len(track.notes))   # notes: (N, 4) onset s, end s, pitch, velocity

For many files, load once and keep the object:

from dettato import Dettato

model = Dettato.from_pretrained("cuda")
for path in paths:
    model.transcribe(path).save_midi(path + ".mid")

Each stage can also be used on its own (dettato.transcriber, dettato.evidence, dettato.grouper, dettato.drums). The model cards show how.

Weights offline

Set DETTATO_WEIGHTS to a folder holding the four model repos (dettato/, dettato-evidence/, dettato-grouper/, dettato-drums/, each with its config.json and model.safetensors) to load them from disk instead of the Hub.

How it works

The pipeline: transcriber, evidence repairer, grouper and drum model

  1. Transcriber. A pitch-equivariant lane network reads a harmonic log-frequency spectrogram and gives onset, frame and offset probabilities for every key, for two voices per key, at 20 ms. The song is processed in overlapping 8 s windows, and notes come from peak picking.
  2. Evidence repairer. A note-level transformer reads each note together with the transcriber's evidence for it (its probability maps around the note and its last hidden state) and decides which notes to keep, where they start and end, and which notes are missing.
  3. Grouper. The recording's tuning is estimated and corrected, the transcriber's internal features are gathered at every repaired note, and a note-level transformer gives each note an instrument and a track embedding. Notes are clustered into tracks. A track is kept only when it is clearly its own instrument, and tracks with the same instrument are merged.
  4. Drums. A small drum-kit model and an orchestral-percussion model. A router listens to the whole recording and picks one. The drum model needs audio recorded at 40 kHz or more and is skipped for lower-rate sources.

Requirements

  • Python 3.10+, PyTorch 2.2+. A CUDA GPU is recommended: on an RTX 5060 (8 GB) a 5-minute song takes about 40 s and peaks under 4 GB of GPU memory, which grows with the song's length. The CPU works but is slow (a 15 s clip took 87 s on a laptop CPU, model loading included).
  • Audio is read with soundfile. Formats it cannot read (m4a / aac, some mp3s) go through ffmpeg, which must then be on the PATH.

Limits

  • Pitched notes cover the 88 piano keys, with at most two notes on the same key at once.
  • Instrument names are only roughly right: on real jazz about a quarter of a saxophone's or lead guitar's notes can land in the piano's track, synth-heavy music is named less reliably, and a concert band gets rough names.
  • No drums for sources recorded below 40 kHz.

The example recordings in the figures are in the public domain: Beethoven's Symphony No. 5 and Grieg's Piano Concerto by Musopen (via Wikimedia Commons) and The Stars and Stripes Forever by the United States Marine Band.

Licence

Code and model weights: Apache-2.0 (see LICENSE and NOTICE). The model cards list the datasets each model was trained with and their licences. Some of the grouper's and the drum model's training datasets carry non-commercial terms.

Citation

@software{dettato2026,
  title  = {Dettato: multi-instrument audio-to-MIDI transcription},
  author = {Mills, Nathan},
  year   = {2026},
  url    = {https://github.com/kobimusic/dettato}
}

Metadata

Release files for dettato 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dettato 2.0.0
File Size Uploaded Provenance Actions
dettato-2.0.0.tar.gz 65.0 kB Without provenance Details for dettato-2.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dettato 2.0.0
File Interpreter ABI Platform Actions
dettato-2.0.0-py3-none-any.whl Python 3 none any Details for dettato-2.0.0-py3-none-any.whl

Total release size: 132.1 kB

Release files / dettato-2.0.0.tar.gz

Download URL dettato-2.0.0.tar.gz
Size 65.0 kB
Tags Source
SHA-256 checksum
How to use checksums
d202e3441047c705f4578cdb18f574e366fe15f79f08d88b36f5281e7f5af79f
BLAKE2b-256 checksum
How to use checksums
8a55c9365d0509428b69beb73b83e4d5d55a233cee7926f95c79e08f27170108
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / dettato-2.0.0-py3-none-any.whl

Download URL dettato-2.0.0-py3-none-any.whl
Size 67.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
38af5a5ba2f92dae21b12e12bf6a930d1c7638e0d7c9667b855745bac9a1dbbe
BLAKE2b-256 checksum
How to use checksums
d10cabe171fee8790a4ad5d4d0d78735add0ed99de8b5fbc5a1918355f376071
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Security for dettato 2.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page