The trainer now saves trainer_state.pt next to each checkpoint, so resume restores optimizer state, scheduler state, and RNG state instead of only loading weights.
Each run writes the prompt snapshot, generated MIDI files, token arrays, metadata JSON, and a pipeline_manifest.json.
This model is prompt-conditioned by MIDI or token prefixes, not by text. In practice the best prompts are short, clear piano snippets: one track, a few bars, obvious rhythm, and a stable texture.
That bundle is a simple GarageBand arrangement built from one of the generated results. It is useful if you want to hear the output inside a fuller session instead of opening a raw MIDI file by itself.
If you want to reshape a phrase from that material instead of just continuing it, you can lift a short passage or an extracted melody from the arrangement and run it through the melody-intensity experiment in experiments/melody_intensity_editor.
Side Experiment
This repo also includes a smaller downstream experiment in experiments/melody_intensity_editor. It reuses the 12k augmented piano corpus and reframes the task as:
input: a short melody or piano phrase
control: a scalar intensity value from 0.0 to 1.0
output: a newly rendered piano phrase intended to sound softer/sparser or louder/denser
It is still phrase-level and experimental. It is useful for controllable symbolic-MIDI prototyping, but it is not a true note-preserving live editor.
The smoke test builds a tiny MIDI clip, tokenizes it, and runs a small forward pass through the model stack.
Notes
The data split is a shuffled file-level split. scripts/prepare_12k_split.py writes data/splits/split_manifest.json with the seed, ratios, and counts. If your source folder contains alternate takes, duplicates, or closely related arrangements, group those before splitting or you can leak material across train and validation.
Large local outputs stay out of Git:
data/
artifacts/
checkpoints/
exports/
logs/
.onnx_export_vendor/
Minimal push flow:
bash
1git remote -v
2git push -u origin main
Related work
This repo is in the same general symbolic-music transformer line as MMM, but this run does not use MMM tokenization. The 12k setup here uses Miditok REMI.