Neural Audio Synthesis of Musical Notes with WaveNet Autoencoders

Jesse H. Engel, Cinjon Resnick, Adam Roberts, Sander Dieleman, Mohammad Norouzi, Douglas Eck, Karen Simonyan

Generative models in computer vision have flourished thanks to massive, high-quality datasets like ImageNet, but audio synthesis has historically lagged behind. While autoregressive models like the original WaveNet can produce incredibly realistic speech or music, they predict the next sample based solely on previous ones. Without external conditioning—like text-to-speech transcripts or MIDI files—these models lose their structural way, resulting in incoherent "babbling" rather than structured music. They struggle to capture the long-term shape of a note while simultaneously handling the fine-grained texture of the sound.

To bridge this gap, researchers from Google Brain and DeepMind have developed a WaveNet-based autoencoder that learns to compress raw audio into semantically meaningful "temporal codes." By training on a massive new dataset of musical notes, the model can not only reconstruct sounds with high fidelity but also "morph" between instruments to create entirely new, realistic timbres.

Architecture: The WaveNet Autoencoder

The authors introduce a WaveNet Autoencoder. Unlike a standard WaveNet, which functions purely as a decoder, this new architecture incorporates an encoder to learn its own high-level control signals directly from the raw waveform.

  1. The Temporal Encoder: A 30-layer convolutional neural network takes raw audio and compresses it by a factor of roughly 32x into a sequence of distributed "hidden codes" (embeddings) distributed in time.
  2. The WaveNet Decoder: A WaveNet-style model takes these temporal codes and uses them to guide the sample-by-sample reconstruction of the original audio.

To evaluate this approach, the researchers compared it against a Baseline Spectral Autoencoder, which attempts a similar compression and reconstruction using spectrograms (visual representations of sound) rather than raw waveforms.

Comparison of the Baseline Spectral Autoencoder and the proposed WaveNet Autoencoder architectures.

The NSynth Dataset

A major contribution of this paper is the introduction of the NSynth (Neural Synthesis) Dataset. Before NSynth, public audio datasets were often too small or lacked the clean, labeled consistency needed to train deep generative models effectively.

NSynth provides the necessary scale and detail:

  • Scale: 306,043 musical notes.
  • Diversity: Approximately 1,000 different harmonic instruments, spanning acoustic, electronic, and synthetic sources.
  • Detail: Each note is 4 seconds long, sampled at 16kHz, and meticulously annotated with pitch, velocity, and instrument family.

Key Insights and Results

By operating on raw audio and learning a compressed representation, the WaveNet Autoencoder unlocked several key capabilities:

  • Learning the "Manifold" of Sound: Because the model learns a compressed, continuous representation, the mathematical space between points in that representation is semantically meaningful. Users can take the embedding for a "Bass" and a "Flute," find the midpoint, and the decoder will synthesize a "Flute-Bass"—a sound that has the characteristics of both but exists as a unique, realistic instrument, rather than just two sounds playing simultaneously.
  • Phase Matters: Traditional spectral methods often struggle with "phase" (the timing of the sound waves), leading to blurry or "buzzing" audio. Because WaveNet works directly on raw waveforms, it learns to model phase naturally. It captures the "punchy" attack of a piano or the synchronized oscillations of a flugelhorn's vibrato much better than the spectral baseline.
  • Decoupling Pitch and Timbre: The authors found that if they didn't explicitly provide pitch information, the model would "hide" pitch data inside the embeddings. By providing a "one-hot" pitch signal during training, they encouraged the model to use the embeddings strictly for timbre (the quality of the sound). This allows the model to play the same learned "instrument" across different notes.

Quantitative Superiority: To measure quality objectively, the researchers trained a separate classifier to identify the pitch and quality of the reconstructed sounds. The WaveNet Autoencoder achieved 79.6% pitch accuracy, vastly outperforming the spectral baseline's 46.9%.

Limitations and Future Work

Despite these breakthroughs, the authors note a few remaining hurdles:

  • Temporal Context: The model is currently limited to the "chunk-size" of the training data (4-second notes). It cannot yet capture the global structure of a complete song.
  • Computational Cost: WaveNet is notoriously slow because it generates audio one sample at a time (16,000 samples per second of audio).
  • Mu-law Distortion: The model uses 8-bit quantization to simplify the output distribution, which introduces a slight "hiss" or distortion, especially noticeable in lower-frequency sounds.

Future work will likely focus on scaling these embeddings to longer time scales and finding ways to further disentangle the various components of sound for even finer creative control.

Summary updated

BibTeX
@inproceedings{engel2017neural,
  author = {Jesse H. Engel and Cinjon Resnick and Adam Roberts and Sander Dieleman and Mohammad Norouzi and Douglas Eck and Karen Simonyan},
  title = {{Neural Audio Synthesis of Musical Notes with WaveNet Autoencoders}},
  booktitle = {International Conference on Machine Learning},
  year = {2017},
  url = {https://openreview.net/forum?id=QxrKaQhNDan},
}
Figure