Learning Disentangled Representations of Timbre and Pitch for Musical Instrument Sounds Using Gaussian Mixture Variational Autoencoders

Yin-Jyun Luo, Kat Agres, Dorien Herremans

Introduction

In the field of audio signal processing, achieving a clean separation between the fundamental components of sound—specifically pitch (the note being played) and timbre (the unique quality of the instrument)—remains a significant challenge. This process, known as disentanglement, is intuitive for human listeners but computationally complex because these features are deeply intertwined within raw audio data.

This paper introduces a framework utilizing Gaussian Mixture Variational Autoencoders (GMVAEs) to successfully decouple these factors. By mapping pitch and timbre into distinct, structured latent spaces, the model enables high-quality controllable sound synthesis and "timbre transfer," allowing for the re-rendering of a melody from one instrument to another while preserving the original musical intent.

The Disentanglement Challenge

Previous attempts at audio disentanglement often relied on MIDI-synthesized data, which lacks the nuance and spectral complexity of real-world recordings. Furthermore, standard Variational Autoencoders (VAEs) typically assume a unimodal Gaussian distribution for the latent space. This "single blob" approach struggles to represent the discrete, categorical nature of music, where instruments and notes exist as distinct clusters. The researchers address this by employing a more flexible probabilistic model capable of handling multimodal data.

Proposed Methodology

The core of the framework is the GMVAE architecture, which moves beyond the limitations of standard VAEs by modeling the latent space as a collection of Gaussian distributions (a mixture).

The GMVAE architecture featuring dual encoders for pitch and timbre.

Dual Encoder System

The model utilizes two separate 1D-convolutional neural networks (CNNs) as encoders:

  • Pitch Encoder ($q(z_p|X)$): Learns a latent code $z_p$ representing the musical note.
  • Timbre Encoder ($q(z_t|X)$): Learns a latent code $z_t$ representing the instrument's identity.

Semi-Supervised Learning

To ensure the latent spaces are properly organized, the model is trained using a semi-supervised approach. While pitch labels are generally easy to obtain or generate, instrument labels can be scarce. The GMVAE framework remains robust even with limited instrument labeling, using the categorical prior to naturally cluster similar sounds.

Generative Process

To reconstruct or synthesize audio, the pitch and timbre codes are concatenated and passed to a joint decoder. This decoder generates a Mel-spectrogram, which can then be converted back into a time-domain audio signal.

Experimental Setup and Datasets

The study utilized a subset of the Studio On-Line (SOL) database, consisting of 1,885 samples of isolated musical notes across 12 distinct instruments, including piano, violin, flute, and trumpet. Audio was resampled to 22,050Hz, and the initial 500ms of each note was processed into Mel-spectrograms to serve as the model input.

Key Insights: The Geometry of Sound

The researchers discovered that the resulting latent spaces were not just separated, but highly organized and interpretable.

The "Brightness" Dimension

Analysis of the timbre latent space revealed that specific dimensions correlate with physical acoustic properties. Notably, the 13th dimension ($z_t^{13}$) was found to correlate strongly with the spectral centroid, effectively acting as a "brightness knob" that can be adjusted to make a synthesized sound sharper or mellower.

Latent Vector Arithmetic

Because the timbre space is well-clustered, the model supports "vector arithmetic" for music. To transform a sound from a French Horn (Fhn) to a Piano (Pno), one can calculate the vector difference between the mean of the Piano cluster and the mean of the French Horn cluster. Applying this shift to a latent code allows for seamless timbre transfer.

Mechanism for timbre transfer using latent space vector arithmetic.

Results and Performance

The model demonstrated exceptional performance in both discriminability and synthesis:

  • High Fidelity Disentanglement: Linear classifiers trained on the latent codes achieved F-scores near 1.0 for both instrument and pitch classification, confirming that the encoders successfully isolated the intended features.
  • Controllable Synthesis: When sampling new points from the latent space to generate sounds, external classifiers recognized the intended pitch and instrument with high accuracy (F-scores > 0.9), proving the decoder's ability to interpret the disentangled codes.
  • Many-to-Many Transfer: Unlike previous models that required specific "translators" for every instrument pair, this single architecture facilitates transfers between any of the 12 instruments in the dataset.

Limitations and Future Directions

Despite its success, the model faces challenges with the wide pitch range of the piano; when attempting to transfer a high piano note to an instrument with a more limited range (like a cello), the synthesis quality can degrade. Additionally, the current focus on 500ms isolated notes does not yet capture the complex temporal dynamics of full musical performances, such as vibrato or articulation changes. Future work will aim to extend this framework to handle longer, more dynamic audio sequences and incorporate formal subjective listening tests to further validate audio quality.

Summary updated

BibTeX
@inproceedings{luo2019learning,
  author = {Yin-Jyun Luo and Kat Agres and Dorien Herremans},
  title = {{Learning Disentangled Representations of Timbre and Pitch for Musical Instrument Sounds Using Gaussian Mixture Variational Autoencoders}},
  booktitle = {ISMIR},
  year = {2019},
  url = {https://openreview.net/forum?id=YQ5HWbB2Ox},
}
Figure