Harmonic Recomposition using Conditional Autoregressive Modeling

Kyle Kastner, Rithesh Kumar, Tim Cooijmans, Aaron C. CourvillearXiv 2018

Abstract

Generating polyphonic music requires maintaining coherence across both local harmonic interactions and global structural progressions. We present a two-stage generative pipeline developed by researchers at MILA that addresses this challenge through "harmonic recomposition." The system utilizes a Vector Quantized Variational Autoencoder (VQ-VAE) to compress musical measures into a discrete latent space, capturing local voice relationships. Subsequently, a conditional PixelCNN is trained to predict these latent codes based on high-level chord sequences. Our results demonstrate that this approach efficiently generates diverse, musically coherent 4-part polyphonic sequences in the style of Renaissance masters.

Introduction

Music generation is a complex task due to the necessity of maintaining structure at multiple scales. Notes must harmonize vertically (local agreement) while the melody must remain consistent horizontally over time (global structure). Traditional models often struggle to balance these two requirements or suffer from slow training and generation speeds.

This research focuses on harmonic recomposition—the process of generating specific note realizations based on an existing harmonic framework, such as a chord progression. By separating the learning of local textures from global progressions, the authors explore whether a "compression-then-prediction" approach can improve both efficiency and musicality in symbolic music generation.

Methodology

The proposed architecture adapts a two-stage pipeline originally designed for image generation to the domain of symbolic music.

Stage 1: Local Texture Compression (VQ-VAE)

The first stage involves a VQ-VAE that learns to compress "piano roll" representations of individual musical measures into a spatially reduced, discrete latent space ($Z$). This stage is trained unconditionally, allowing the model to focus exclusively on the "shorthand" of musical textures—specifically, how the four voices within a single measure relate to one another.

Stage 2: Global Sequence Prediction (Conditional PixelCNN)

Once the latent representation is established, a gated conditional PixelCNN is trained to predict the sequence of these latent codes. Unlike the first stage, this model is conditional, guided by "chord triplets" consisting of the chords for the previous, current, and next measures. This separation allows the VQ-VAE to handle local voice agreement while the PixelCNN ensures the generated sequence follows the intended global harmonic path.

Dataset and Preprocessing

The model was trained on the Josquin Project, a specialized dataset of scores by the Renaissance composer Josquin des Prez. The researchers focused on 4-part polyphonic pieces, resulting in a dataset of 103 pieces (5,568 measures). Each measure was converted into a piano roll image with 16 timesteps and 49 possible tones, distributed across four channels representing individual voices.

Key Results and Insights

The model demonstrates qualitative success in generating 8-bar musical sequences that adhere to provided chord prompts.

Figure 1: A generated 8-bar polyphonic sequence realization based on a specific chord progression.

Directed Trajectories and Diversity

When conditioned on specific chord sequences (e.g., (III), III, v, iv, iv, v, i, iv, III, (III)), the model generates note-level realizations that accurately reflect the harmonic "vibe" of the prompt. Furthermore, the use of different random seeds with the same chord conditioning produces diverse musical outputs, demonstrating the model's ability to explore the creative space within a fixed harmonic structure.

Figure 2: An alternative realization of a harmonic sequence, illustrating the model's capacity for diverse output.

Efficiency and Contextual Challenges

By operating within the compressed latent space of the VQ-VAE, the model significantly improves training and generation speed compared to models working with raw, high-resolution piano rolls.

However, the researchers noted a "spatial conditioning trap." When providing the model with more explicit information, such as a spatial map of the previous measure, performance often degraded, leading to dissonant intervals or silences. This suggests that high-level chord information is often a more effective guide for global consistency than raw local context.

Conclusion and Future Work

The two-stage pipeline successfully separates local harmony from global structure, capturing the stylistic essence of Renaissance polyphony. While the model produces coherent trajectories, future work will focus on refining the integration of local note-level data with high-level annotations to further reduce dissonance. Potential directions include more sophisticated temporal modeling and the incorporation of additional musical metadata to better capture the fluid nature of musical phrasing.

Summary updated

BibTeX
@misc{kastner2018harmonic,
  author = {Kyle Kastner and Rithesh Kumar and Tim Cooijmans and Aaron C. Courville},
  title = {{Harmonic Recomposition using Conditional Autoregressive Modeling}},
  year = {2018},
  eprint = {1811.07426},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1811.07426},
}
Figure