Skip to main content

Style-based Drum Synthesis with GAN Inversion Demo

TensorFlow implementation of a style-based version of the adversarial drum synth

4 min read

TensorFlow implementation of a style-based version of the adversarial drum synth (ADS) from the paper Adversarial Synthesis of Drum Sounds @ The 2020 DAFx Conference.

Overview of proposed style-based drum synthesis system

Audio examples

Music created using generated drum sounds

Transforming input audio

This drum sound does not exist

Check out some randomly generated drum sound waveforms here




Code has been developed with Python 3.6.13. It should work with other versions of Python 3, but has not been tested. Moreover, we rely on several third-party libraries, listed in requirements.txt. They can be installed with

$ pip install -r requirements.txt


The tensorflow checkpoints for loading pre-trained network weights can be download here. Unzip the folder and save it into this projects directory: "style-drumsynth/checkpoints".


The code is contained within the script, which enables conditional synthesises of drum sounds using a pretrained generator.

The following control parameters are available:

  • Condition: which type of drum to generate (kick, snare or hat)
  • Direction: "timbral features", which principal direction to move in [0:4]
  • Direction slider: How far to move in a particular direction
  • Number of generations: How many drums to generate
  • Stocastic Variation: Amount of inconsequential noise to inject into the generator
  • Randomize: Generate by randomly sampling the latent space, or generate from a fixed, pre-computed latent vectors for a kick, snare and hat
  • Encode: regenerate drum sounds stored in the style-drumsynth/input_audio

Generations are saved in the style-drumsynth/generations folder. To experiment encoding your own drums sounds, save your audio files in the "style-drumsynth/input_audio" directory. arguments

  -c CONDITION,           --condition CONDITION
0: kick, 1: snare, 2:hat
synthesis controls [0:4]
how much to move in a particular direction
number of examples to generate
amount of inconsequential noise injected
if set to False, a fixed latent vector is used to generate a drum sound from each condition
-e ENCODE, --encode ENCODE
regenerates drum sounds from encoder folder

Supporting webpage

For more information, please visit the corresponding supporting website.

It contains the following:

  • Audio examples
  • Training data
  • Generations
  • Example usage within loop-based electronic music compositions
  • Generating Drum Loops
  • Interpolation demonstration
  • Supplementary figures
  • A link to the DAFx 2020 paper and presentation


[1]Drysdale, J., M. Tomczak, J. Hockman, Adversarial Synthesis of Drum Sounds. Proceedings of the 23rd International Conference on Digital Audio Effects (DAFX), 2020.
title={Adversarial synthesis of drum sounds},
author={Drysdale, Jake and Tomczak, Maciek and Hockman, Jason},
booktitle = {Proceedings of the International Conference on Digital Audio Effects (DAFx)},


Any questions please feel free to contact me on

Find more applications