π Paper | π Website | πΉ Live Demo | π€ Model
Decomposer decompiles symbolic music (MIDI) into executable, editable Strudel programs. This repo contains the inference code for our post-trained model.
Requires uv A GPU with 24GB+ VRAM and CUDA 12.4+ is recommended
uv sync # transformers backend
uv sync --extra vllm # vLLM backend
We provide two inference backends with the same command-line interface:
generate_transformers.pyβ simpler setup, slower generationgenerate_vllm.pyβ faster generation, heavier setup
| Parameter | Default | Description |
|---|---|---|
--midi_path |
(required) | input MIDI file ( .mid ) |
--model |
haiyewon/Decomposer-Qwen3-8B |
HF model id or local path |
--n_outputs |
5 |
number of Strudel programs to sample |
--start_sec |
file start | start of the time window to decompile (seconds) |
--duration_sec |
whole file | length of the time window (seconds) |
--instruments |
all | comma-separated instruments to keep: GM program numbers (0β127), GM names (e.g. acoustic_bass ), ordrum |
--list_instruments |
None |
print the instruments found in --midi_path and exit |
--bpm |
from file | tempo override |
--meter |
from file | beats-per-measure override |
--temperature |
1.0 |
sampling temperature |
--max_new_tokens |
4096 |
generation length cap |
--output_root |
outputs/ |
directory for generation sessions |
--log_prefix |
None |
session directory prefix: outputs/<log_prefix>_<midi_name>/ ; defaults to timestamp ifNone |
uv run generate_transformers.py --midi_path assets/examples/1.mid --n_outputs 5
uv run generate_vllm.py --midi_path song.mid --start_sec 30 --duration_sec 15
uv run generate_transformers.py --midi_path song.mid --list_instruments
uv run generate_vllm.py --midi_path song.mid --instruments drum,acoustic_bass,4
Each run writes a session directory:
outputs/20260719_123456_song/
βββ input_repr.txt # the serialized MIDI the model saw
βββ output_1.js # generated Strudel programs β¦
βββ β¦
βββ args.json
Paste any output_*.js into the Strudel REPL to play and
edit it.
- The model is mostly trained on clips under 30 seconds; a range of 15β30 seconds would work best.
- Very dense selections (many notes / many instruments) can exceed the model's input limit; shorten the window or filter instruments.
- Sampling uses temperature 1.0 (the paper's evaluation setting); we recommend sampling multiple outputs (--n_outputs 5) and picking your favorite.
@article{kim2026decomposer,
title = {Decomposer: Learning to Decompile Symbolic Music to Programs},
author = {Kim, Yewon and Gandhi, Apurva and Chung, David and Neubig, Graham and Donahue, Chris},
journal = {arXiv preprint arXiv:2607.01849},
year = {2026}
}