Music SketchNet: Controllable Music Generation via Factorized Representations of Pitch and Rhythm

Ke Chen, Cheng-i Wang, Taylor Berg-Kirkpatrick, Shlomo Dubnov

Abstract

Music SketchNet is a neural framework designed to facilitate a "sketching" workflow for music composition, similar to digital art. By explicitly decoupling pitch and rhythm into separate latent representations, the model allows users to guide music generation through partial specifications—such as a specific rhythm or pitch contour—while the system intelligently fills in missing measures based on the surrounding musical context. This approach addresses the limitations of "all-or-nothing" generation models by providing fine-grained, intuitive control over the creative process.

Introduction

While AI-driven music generation has advanced significantly, providing users with intuitive, fine-grained control remains a major challenge. Most existing models either generate a full piece from scratch or require a complete track as a constraint, leaving little room for iterative human-AI collaboration. Music SketchNet addresses the task of "music inpainting"—filling in missing measures—by allowing composers to provide partial "sketches." For instance, a composer might have a specific rhythm in mind for a bridge but wants the AI to handle the melody. By factorizing musical components, Music SketchNet enables this level of controllable inpainting.

The Music SketchNet workflow: from user specification to latent space completion and back to music.

Methods

The Music SketchNet framework consists of three primary neural components that work together to integrate user constraints with musical context.

The overall architecture of Music SketchNet, showing the interaction between SketchVAE, SketchInpainter, and SketchConnector.

1. SketchVAE

SketchVAE is a novel Variational Autoencoder (VAE) that utilizes a factorized inference network. Unlike standard VAEs that compress all information into a single vector, SketchVAE employs two separate encoders to produce independent latent variables for pitch ($z_{pitch}$) and rhythm ($z_{rhythm}$). A hierarchical decoder then recombines these factorized representations to reconstruct the music. This factorization is key to control, as it allows users to modify one element (e.g., rhythm) without unintentionally altering the other (e.g., pitch).

2. SketchInpainter

The SketchInpainter module handles the contextual aspect of the inpainting task. Using stacked Recurrent Neural Networks (GRUs), it analyzes the "past" and "future" measures surrounding a gap to predict the most likely latent variables for the missing "middle" measures.

3. SketchConnector

The SketchConnector serves as the refinement layer, integrating the initial predictions from the Inpainter with optional user-provided sketches. It utilizes a Transformer-based architecture with a "Random Unmasking" strategy—inspired by BERT—to learn how to smoothly blend user constraints with predicted content. During training, the model is exposed to both ground truth data and its own predictions, teaching it to treat user "sketches" as anchors for the overall generation.

Datasets

The model was trained and evaluated on a standard dataset of approximately 18,000 Irish and Scottish monophonic folk melodies. The data was filtered for 4/4 time signatures and quantized into 24 frames per measure to accommodate complex rhythms like eighth-note triplets. To evaluate the model's creative capacity versus simple copying, the authors created two test subsets: Irish-Test-R (repetitive patterns) and Irish-Test-NR (non-repetitive patterns).

Key Results

Music SketchNet demonstrated superior performance in both objective and subjective evaluations.

  • Objective Metrics: SketchNet achieved significantly higher pitch and rhythm accuracy than the previous state-of-the-art, Music InpaintNet. On the challenging non-repetition (NR) test set, SketchNet's pitch accuracy reached 46.1%, compared to InpaintNet's 35.4%.
  • Subjective Listening Tests: In blind evaluations, human listeners rated SketchNet higher than the baseline in terms of Structure (3.29 vs 3.01) and Musicality (3.26 vs 3.09) on a 5-point scale.
  • Control Effectiveness: In a virtual control experiment, the model followed user-provided rhythms with 97.3% accuracy, confirming that the factorization and sketching mechanism are highly effective for steering generation.

Conclusion and Future Work

Music SketchNet successfully brings a "sketching" paradigm to music composition by factorizing pitch and rhythm. While currently limited to monophonic melodies, future work aims to extend this framework to polyphonic music involving chords and multiple voices. Additionally, the authors suggest incorporating other controllable dimensions such as dynamics, timbre, and articulation to further enhance the expressive capabilities of the sketching workflow.

Summary updated

BibTeX
@inproceedings{chen2020music,
  author = {Ke Chen and Cheng-i Wang and Taylor Berg-Kirkpatrick and Shlomo Dubnov},
  title = {{Music SketchNet: Controllable Music Generation via Factorized Representations of Pitch and Rhythm}},
  booktitle = {ISMIR},
  year = {2020},
  url = {https://openreview.net/forum?id=yUd_uCg4GD},
}
Figure