GETMusic: Generating Any Music Tracks with a Unified Representation and Diffusion Framework

Ang Lv, Xu Tan, Peiling Lu, Wei Ye, Shikun Zhang, Jiang Bian, Rui Yan

TL;DR

GETMusic is a novel symbolic music generation framework capable of generating any combination of target instrument tracks conditioned on arbitrary source tracks. By combining a compact, 2D track-aligned music representation (GETScore) with a non-autoregressive discrete diffusion model (GETDiff), it breaks free from the rigid source-target constraints of prior music generation systems.

What Problem Does This Paper Address?

AI-assisted music composition often requires generating specific instrument tracks based on existing ones (e.g., creating a piano accompaniment for a given melody). However, current symbolic music generation models struggle with flexibility. They are typically locked into specific, predefined source-target combinations.

This limitation stems from how music is represented:

  • Sequence-based representations flatten multi-track music into a single chronological stream of tokens. This causes notes from different instruments to interleave, making it difficult for standard autoregressive models to isolate and precisely generate specific target tracks.
  • Image-based representations (like pianorolls) explicitly separate tracks but span the entire pitch range of every instrument. This results in massive, sparse, high-resolution matrices that are computationally expensive and difficult for models to generate effectively.

GETMusic addresses this gap by introducing a unified framework that can handle any arbitrary combination of source and target tracks (665 possible combinations for a 6-instrument ensemble) within a single model.

Methods

GETMusic achieves its versatility through the co-design of its representation and its generative model:

1. GETScore (The Representation)

Inspired by traditional sheet music, GETScore organizes music in a 2D structure where instrument tracks are stacked vertically and time progresses horizontally (quantized into 16th-note units). To keep the representation compact without losing harmony, it uses a smart note tokenization strategy:

  • Simultaneous notes within a single track are merged into a single compound pitch token.
  • Each track requires only two rows: one for pitch tokens and one for duration tokens.
  • Unoccupied time steps are filled with padding tokens.
Figure 1: The overview of GETMusic, involving a novel music representation “GETScore” and a discrete diffusion model “GETDiff.” Given a predefined ensemble of instrument tracks, GETDiff takes GETScores as inputs and can generate any desired target tracks conditioning on any source tracks ( 1⃝, 2⃝, and 3⃝). This flexibility extends beyond track-wise generation, as it can perform zero-shot generation for any masked parts ( 4⃝).

2. GETDiff (The Model)

GETDiff is a discrete diffusion model based on the Roformer architecture (a Transformer variant utilizing rotary position embeddings for better length extrapolation).

  • Forward Process: During training, tracks are randomly assigned as either source or target. Target tracks are iteratively corrupted by replacing their tokens with a special [MASK] token, while source tracks remain untouched as ground truth. Uninvolved tracks are filled with an [EMPTY] token to prevent interference.
  • Denoising Process: GETDiff learns to predict all masked target tokens simultaneously (non-autoregressively) conditioned on the source tracks. Learnable condition flags are added to the embeddings to help the model distinguish trustworthy source tokens from target tokens undergoing denoising.

Datasets

The authors crawled a massive dataset of 1,569,469 MIDI files from Musescore. After rigorous cleansing and filtering (removing files with too few notes, multiple tempos, or missing melodies), they retained 137,812 GETScores (approximately 2,800 hours of music).

The dataset features six instrument tracks: bass, drum, guitar, piano, string, and melody. Additionally, they used the Viterbi algorithm to infer a chord progression track for each piece, providing extra compositional guidance during generation.

Key Insights and Ideas

  • Decoupling Time and Track: By aligning tracks horizontally over a shared timeline, GETMusic eliminates track interleaving. This allows the model to easily mask and predict specific tracks without losing temporal alignment.
  • Compound Tokens for Harmony: Merging simultaneous notes into a single compound token drastically reduces data sparsity compared to pianorolls, while inherently preserving chordal harmony derived from real-world data.
  • Non-Autoregressive Power: Because diffusion models predict all tokens at once rather than left-to-right, GETMusic can perform zero-shot infilling. For example, users can mask a section in the middle of a track to generate a harmonious musical bridge between two distinct sections.

Key Results

The authors evaluated GETMusic across three tasks: accompaniment generation, lead melody generation, and generation from scratch.

  • Superior Quality: In accompaniment and melody generation, GETMusic consistently outperformed PopMAG across objective metrics like Chord Accuracy (CA) and KL-divergence for pitch and duration distributions.
  • Human Preference: In blind listening tests, evaluators gave GETMusic significantly higher Human Ratings (HR) than the baselines (e.g., 3.35 vs. 2.88 for accompaniment generation on a 5-point scale).
  • Inference Speedup: Thanks to its non-autoregressive design, GETMusic generated a musical piece in just 4.80 seconds, vastly outperforming PopMAG (23.32 seconds) and an autoregressive variant of GETMusic (17.13 seconds).

Limitations and Future Work

While highly versatile, GETMusic currently focuses exclusively on note pitch and duration. It leaves out dynamic musical factors such as velocity (how hard a note is struck) and subtle tempo variations, which are vital for expressive, human-like performances.

For future work, the authors plan to expand the framework by incorporating lyrics as an additional track, paving the way for direct lyric-to-melody generation.

Summary updated

Abstract

Symbolic music generation aims to create musical notes, which can help users compose music, such as generating target instrument tracks based on provided source tracks. In practical scenarios where there's a predefined ensemble of tracks and various composition needs, an efficient and effective generative model that can generate any target tracks based on the other tracks becomes crucial. However, previous efforts have fallen short in addressing this necessity due to limitations in their music representations and models. In this paper, we introduce a framework known as GETMusic, with ``GET'' standing for ``GEnerate music Tracks.'' This framework encompasses a novel music representation ``GETScore'' and a diffusion model ``GETDiff.'' GETScore represents musical notes as tokens and organizes tokens in a 2D structure, with tracks stacked vertically and progressing horizontally over time. At a training step, each track of a music piece is randomly selected as either the target or source. The training involves two processes: In the forward process, target tracks are corrupted by masking their tokens, while source tracks remain as the ground truth; in the denoising process, GETDiff is trained to predict the masked target tokens conditioning on the source tracks. Our proposed representation, coupled with the non-autoregressive generative model, empowers GETMusic to generate music with any arbitrary source-target track combinations. Our experiments demonstrate that the versatile GETMusic outperforms prior works proposed for certain specific composition tasks.
BibTeX
@inproceedings{lv2025getmusic,
  author = {Ang Lv and Xu Tan and Peiling Lu and Wei Ye and Shikun Zhang and Jiang Bian and Rui Yan},
  title = {{GETMusic: Generating Any Music Tracks with a Unified Representation and Diffusion Framework}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2025},
  doi = {10.24963/ijcai.2025/1127},
}
Figure