TL;DR
The authors introduce SpanSynth-Edit, a conditional flow-matching model designed for precise, MIDI-guided synthesis and editing of multi-instrument music audio. By leveraging low-frame-rate scalar-quantised audio latents alongside a novel note representation called MIDI Span, the model achieves highly efficient generation while maintaining sub-frame timing control and instrument-specific timbre consistency.
What Problem Does This Paper Address?
While text-to-audio models have made massive strides in generating music from natural language prompts, real-world music production requires a much finer scalpel. Producers frequently need to refine existing audio mixtures by adding, removing, or adjusting individual notes while keeping the rest of the performance intact.
Using MIDI to guide these edits is an intuitive solution, but doing so directly in multi-instrument audio mixtures presents major hurdles:
- Acoustic Overlap: Overlapping notes from different instruments must be separated or modified without bleeding into or altering concurrent sounds.
- The Efficiency vs. Precision Trade-off: Generating high-fidelity audio efficiently usually requires low-frame-rate representations. However, standard frame-based note representations (like piano rolls) lose timing precision when the frame rate drops, causing notes to awkwardly snap to a coarse grid.
Methods
SpanSynth-Edit tackles these challenges through three core architectural choices:
- Scalar-Quantised (SQ) Audio Latents: Instead of operating on raw spectrograms or high-frame-rate tokens, the model uses a frozen neural audio codec (HeartCodec) to compress 48 kHz audio into 128-dimensional latents at a highly efficient 25 Hz (40 ms frames).
- MIDI Span Representation: To prevent the loss of timing precision at 25 Hz, the authors reject standard piano rolls. Instead, they introduce MIDI Span, which represents notes as frame-aligned event sets containing continuous, real-valued attributes. Crucially, a
x_boundaryattribute maps the exact onset/offset time linearly within the frame, preserving sub-frame timing. A permutation-invariant encoder (based on Deep Sets) pools these variable-sized event sets into a single conditioning vector per frame. - Conditional Flow Matching & DiT: The core generative model is a 480.8M parameter Diffusion Transformer (DiT) trained using conditional flow matching. It takes noisy latents and generates the target audio region, conditioned on the MIDI Span features, binary region masks, and clean contextual audio from the preceding and succeeding segments to guide the timbre.
For editing tasks, the model can optionally integrate with FlowEdit, a training-free, content-preserving inversion method adapted from the image generation domain, to ensure unedited notes remain perfectly untouched.
Datasets
The model was trained on a massive, aggregated dataset comprising 660 hours of performance MIDI paired with audio across 17 public instrumental dataset families, including:
- Multi-instrument mixtures: Slakh, AAM, URMP, BSD/BSED.
- Single-instrument/Solo performances: MAESTRO, PianoVAM, GuitarSet, MusicNetEM, IDMT-SMT-Bass, KRAISLER, ChoraleBricks, FiloBass, MDB Drums, EGSet12, ENST-Drums, STAR Drums.
- Evaluation-specific edits: POP909 (paired with Salamander piano SoundFont renders) was used specifically to benchmark fine-grained AI note edits.
Key Insights and Ideas
- The Sub-Frame Timing "Aha" Moment: By encoding the continuous offset of an onset within a 40 ms window, the model breaks free from the temporal grid. Acoustic analysis proves that the model actually responds to sub-frame MIDI shifts (from 10–40 ms), rendering the physical onsets precisely where requested.
- The Evaluation Bottleneck: The authors highlight a systemic issue in evaluating MIDI-to-audio models. Typically, researchers use Automatic Music Transcription (AMT) models to check if the generated audio matches the input MIDI. However, the authors show that the AMT models themselves introduce massive baseline errors (dropping F-scores by up to 28 percentage points even on ground-truth audio), meaning prior models might perform better than their transcription metrics suggest.
- Context is King for Timbre: Ablation studies revealed that conditioning on clean, un-noised contextual audio from the surrounding frames is absolutely vital. Removing this context completely tanks both audio quality and note adherence.
Key Results
SpanSynth-Edit was evaluated against prominent baselines like SpecDiff, U-MusT, TokenSynth, and CTD.
- Synthesis Quality: On multi-instrument benchmarks like Slakh and URMP, SpanSynth-Edit consistently achieved the highest audio quality (MuQeval and Production Quality scores) and lowest spectral error (MSS).
- Note Adherence: It outperformed baselines in instrument-agnostic note onset F1-scores ($F_{On}$) across almost all datasets, demonstrating superior control.
- Editing Performance: When adding new instruments or performing note insertions/deletions, combining SpanSynth-Edit with FlowEdit yielded the best audio similarity metrics, proving it can successfully modify target notes while preserving the original track's background and timbre.
Limitations and Future Work
- Micro-timing Insensitivity: While the model tracks shifts above 10 ms well, it is relatively insensitive to tiny micro-timing adjustments in the 1–5 ms range, likely due to human annotation noise in the training datasets.
- Codec Artifacts: Because the model relies on a frozen audio codec, any reconstruction errors inherent to HeartCodec cap the final audio fidelity. The authors suggest that future work involving joint fine-tuning of the audio decoder alongside the generative model could resolve these minor acoustic limitations.
Summary updated