MuseMorphose: Full-Song and Fine-Grained Piano Music Style Transfer With One Transformer VAE

Shih-Lun Wu, Yi-Hsuan Yang

TL;DR

MuseMorphose is a novel Transformer-based Variational Autoencoder (VAE) that achieves the "best of both worlds" in music AI: the long-range coherence of Transformers and the fine-grained control of VAEs. It allows users to perform style transfer on full piano songs by specifying bar-by-bar targets for rhythmic intensity and polyphony while preserving the original musical "content."

What Problem Does This Paper Address?

In symbolic music generation (MIDI), researchers have traditionally faced a trade-off between length and control.

Recurrent Neural Network (RNN) based VAEs, like the famous MusicVAE, offer excellent control via latent spaces—allowing users to "morph" between melodies—but they struggle to maintain coherence beyond a few bars. Conversely, Transformers excel at modeling long-range dependencies (composing 3–5 minute pieces), but they usually act as "black boxes" that are difficult to steer at a granular level.

The authors address this gap: How can we give a Transformer-based model the ability to accept time-varying, bar-level controls (like "make this bar busier" or "make this bar harmonically thinner") without sacrificing the structural integrity of a full-length song?

Methods

The core innovation of MuseMorphose is the in-attention conditioning mechanism. The authors experimented with three ways to inject segment-level conditions into a Transformer decoder:

  1. Pre-attention: Adding conditions only at the input layer.
  2. Post-attention: Blending conditions into the final output.
  3. In-attention: Summing the condition embedding into the hidden states before every single self-attention layer.

The "in-attention" approach proved superior because it repeatedly "reminds" the model of the user's constraints throughout its hierarchical processing.

The Architecture: * Encoder: A bar-wise Transformer that compresses each musical bar into a latent vector ($z_k$). * Latent Space: A VAE bottleneck that separates "content" (stored in $z$) from "style" (represented by attribute embeddings). * Decoder: A full-sequence Transformer that takes the latent vectors and user-defined attributes (rhythmic intensity and polyphony) to reconstruct or transform the music.

To prevent the common VAE problem of "posterior collapse" (where the model ignores the latent space), they employed cyclical KL annealing and free bits—techniques that force the model to use the information provided in the latent bottleneck.

Datasets

The study utilized two primary datasets:

  • LPD-17-cleansed: A subset of the Lakh MIDI Dataset containing over 10,000 multi-track pop songs. This was used to validate the effectiveness of the different conditioning mechanisms.
  • AILabs.tw-Pop1K7: A collection of 1,747 high-quality, expressive pop piano performances transcribed from audio. This served as the primary dataset for the fine-grained style transfer experiments.

Key Insights and Ideas

  • The "Blueprint" Strategy: By partitioning a song into bars and providing a condition for each, the authors treat style transfer as a "filling-in-the-blanks" task. The conditions act as a high-level structural blueprint, while the Transformer handles the low-level note transitions.
  • In-attention is Indispensable: The paper demonstrates that for long sequences, simply "priming" a Transformer at the start isn't enough. The model needs constant reinforcement of the target attributes at every layer to maintain control.
  • Disentanglement without Adversaries: Surprisingly, the authors achieved independent control over rhythm and polyphony without using complex adversarial training. By simply tuning the VAE's $\beta$ parameter and using attribute embeddings, they forced the model to separate these features from the underlying musical identity.

Key Results

MuseMorphose significantly outperformed RNN-based baselines (like MIDI-VAE) across several metrics:

  • Control Strength: It achieved a Spearman correlation of 0.95 for rhythmic intensity and 0.88 for polyphony, meaning the model follows user instructions very precisely.
  • Fidelity: It preserved the original "soul" of the music (measured by Chroma similarity) much better than previous models, especially when pushing attributes to extremes.
  • Fluency: The generations had significantly lower Perplexity (PPL), indicating that the resulting music sounds more like natural, human-composed pop piano than the output of RNN-based systems.
  • Independence: Changing the rhythm had almost no unintended effect on the polyphony (and vice versa), proving the attributes were successfully disentangled.

Limitations and Future Work

While MuseMorphose is a major step forward, the authors note a few areas for growth:

  • Attribute Scope: The current model only controls two attributes (rhythm and polyphony). Future versions could include tonality, instrumentation, or even emotional "arousal" levels.
  • Motivic Development: While the model is coherent, it doesn't explicitly track "motifs" (recurring melodic themes). The authors suggest exploring vector-quantized (VQ) latent spaces to help the model learn and repeat specific musical ideas over long durations.
  • Generalization: The framework is potentially applicable to Natural Language Processing (NLP), such as controlling the "difficulty" or "sentiment" of specific sentences within a long article.

Summary updated

BibTeX
@article{wu2023musemorphose,
  author = {Shih-Lun Wu and Yi-Hsuan Yang},
  title = {{MuseMorphose: Full-Song and Fine-Grained Piano Music Style Transfer With One Transformer VAE}},
  journal = {IEEE ACM Trans. Audio Speech Lang. Process.},
  year = {2023},
  url = {https://openreview.net/forum?id=qVsb1gecEy},
}

Loading related content...

Figure