NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Learning Interpretable Representation for Controllable Polyphonic Music Generation

Ziyu Wang, Dingsu Wang, Yixiao Zhang, Gus Xia

Abstract

Deep generative models for music are powerful but often operate as "black boxes," making it difficult to control specific musical attributes. This paper introduces a novel Variational Autoencoder (VAE) architecture that successfully disentangles polyphonic music into two interpretable latent factors: chord (content) and texture (style). By leveraging specific inductive biases in the encoder design, the model enables intuitive control over music generation, facilitating applications such as compositional style transfer and automated accompaniment arrangement.

Introduction

While deep learning models like RNNs and Transformers have advanced the state of music generation, they suffer from a lack of interpretability. Their internal latent variables do not map to recognizable musical concepts, preventing users from guiding the generation process effectively—for instance, maintaining a specific melody while altering the accompaniment style. This research addresses the problem by framing controlled music generation as a representation learning task, explicitly disentangling the latent space into the underlying harmonic progression (chord) and the rhythmic/melodic arrangement (texture).

Methods

The proposed architecture is a VAE designed to process 8-beat piano composition segments. The core innovation lies in the dual-encoder structure, which forces the separation of chord and texture through distinct inductive biases.

The proposed VAE architecture featuring specialized encoders for chord and texture disentanglement.
  • Chord Encoder: A rule-based algorithm extracts a discrete chord progression from the input. This progression is processed by a bi-directional GRU to learn the latent chord representation ($z_{chd}$).
  • Texture Encoder: The music segment is treated as a 2D piano-roll "image." A chord-invariant Convolutional Neural Network (CNN) with heavy max-pooling creates a "blurry sketch" of the music. This blurring removes specific pitch information while preserving structural rhythm and contour. A bi-directional GRU then processes this sketch into the latent texture representation ($z_{txt}$).
  • Decoder: A hierarchical PianoTree VAE decoder reconstructs the polyphonic music note-by-note from the concatenated $z_{chd}$ and $z_{txt}$ vectors.

Results and Discussion

The model was trained on the POP909 Dataset, containing approximately 1,000 MIDI files of pop songs. Data augmentation through transposition was used to ensure the model learned key-invariant representations.

Disentanglement Verification

Objective metrics confirmed successful disentanglement. Pitch transpositions significantly altered the chord vector ($z_{chd}$) while leaving the texture vector ($z_{txt}$) largely unchanged. Conversely, rhythmic alterations (e.g., halving note durations) affected $z_{txt}$ but had zero impact on $z_{chd}$.

Qualitative Style Transfer

The clean separation of latent factors allows for zero-shot style transfer by swapping latent vectors between different pieces. For example, combining the chords of one piece with the texture of another results in a hybrid composition that maintains the harmonic structure of the former and the stylistic arrangement of the latter.

Qualitative comparison of real pieces and generated pieces created by combining latent factors from different sources.

Human Evaluation

In a blind survey of 36 subjects, the "best" out of five random texture transfers was rated significantly higher than the original human-composed piece ($p < 0.005$) in terms of creativity and musicality. While the average transfer result was rated slightly lower than the original, the results demonstrate the high potential for high-quality, controllable generation.

Conclusion

This work demonstrates that architectural inductive bias is a powerful tool for disentangling musical factors without the need for complex adversarial training. While the current model focuses on foundational elements like chord and texture in short segments, it provides a robust framework for more controllable music AI. Future research will focus on longer-range dependencies and more abstract layers of musical expression, such as dynamics and phrasing.

Summary updated

BibTeX
@inproceedings{wang2020learning,
  author = {Ziyu Wang and Dingsu Wang and Yixiao Zhang and Gus Xia},
  title = {{Learning Interpretable Representation for Controllable Polyphonic Music Generation}},
  booktitle = {ISMIR},
  year = {2020},
  url = {https://openreview.net/forum?id=pWw0dj5CTF},
}
Figure