Query-based Deep Improvisation

Shlomo DubnovarXiv 2019

Abstract

In this paper we explore techniques for generating new music using a Variational Autoencoder (VAE) neural network that was trained on a corpus of specific style. Instead of randomly sampling the latent states of the network to produce free improvisation, we generate new music by querying the network with musical input in a style different from the training corpus. This allows us to produce new musical output with longer-term structure that blends aspects of the query to the style of the network. In order to control the level of this blending we add a noisy channel between the VAE encoder and decoder using bit-allocation algorithm from communication rate-distortion theory. Our experiments provide new insight into relations between the representational and structural information of latent states and the query signal, suggesting their possible use for composition purposes.

Introduction

Deep learning-based music generation typically follows two paths: free improvisation via random sampling of a latent space, or direct style transfer. While free improvisation often lacks long-term structural coherence, standard style transfer can be difficult to control dynamically. This paper introduces query-based deep improvisation, a method that treats a musical input (the query) as a structural guide that is filtered through a learned stylistic prior. By inserting a controllable "noisy channel" between the encoder and decoder, we can mathematically dial in the balance between the query's original intent and the model's learned stylistic nuances.

Methodology

The core architecture utilizes a standard Variational Autoencoder (VAE), but introduces a novel intervention during the inference phase.

The Noisy Channel and Bit-Allocation

We treat the latent path between the encoder and decoder as a communication channel. By applying Shannon’s rate-distortion theory, specifically a reverse water-filling algorithm, we can limit the "bitrate" of the latent variables. This effectively blurs the query's specific details, forcing the decoder to rely more on the statistical prior (the learned style) to reconstruct the musical frame.

The VAE architecture with an integrated Gaussian channel for rate control.

Unlike $\beta$-VAE models that fix the information bottleneck during training, this approach allows for dynamic, inference-time control. A user can adjust the bitrate to decide how much of the original query should survive the transformation.

Experimental Setup

  • Training Set: 126 Pop Music MIDI clips (chorus and verse sections), with the VAE trained on 16th-note resolution frames.
  • Query Input: A MIDI file from the Naruto Shippuden anime soundtrack, chosen for its stylistic divergence from the Pop training corpus.

Results and Analysis

Qualitative Blending

At high bitrates, the output closely mirrors the harmony and melody of the Naruto query. As the bitrate is reduced (e.g., to 256 bits per frame), the improvisation begins to deviate, converging toward the tonality of the training set (C Major) while maintaining rhythmic echoes of the query. We measured harmonic similarity using a 6-dimensional "Tonnetz" projection, which provides a musically meaningful distance metric.

Structural Analysis

To evaluate structural unity, we employed a Variable Markov Oracle (VMO) to measure the Information Rate (IR)—a metric of predictability versus novelty.

Visualization of motifs found in the generated improvisation at a rate of 256 bits.

The VMO analysis visualized how motifs from the query were preserved or transformed. Lower bitrates generally resulted in simpler, more predictable musical structures that aligned more closely with the training style's motifs. This suggests a direct mathematical relationship between latent representation complexity and perceived structural unity.

Conclusion

Query-based deep improvisation offers a controllable framework for computer-assisted composition. By treating style as a statistical prior and the query as a structural guide, we can navigate the space between reconstruction and free improvisation. Future work will focus on extending the model's short-term memory to capture longer-form musical narratives and developing real-time interfaces for live performance interaction.

Summary updated

BibTeX
@misc{dubnov2019query,
  author = {Shlomo Dubnov},
  title = {{Query-based Deep Improvisation}},
  year = {2019},
  eprint = {1906.09155},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1906.09155},
}
Figure