Style-based Drum Synthesis with GAN Inversion Demo
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.
Code
Dependencies
Python
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
Checkpoints
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".
Usage
The code is contained within the ads_demo.py
script, which enables conditional synthesises of drum sounds using a pretrained generator.
The following control parameters are available:
- Condition: which type of drum to generation (kick, snare or hat)
- Direction: "features", which principal direction to move in
- 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 ads_demo/input_audio
Generations are saved in the ads_demo/generations folder. Pretrained model weights are saved in the ads_demo/checkpoints folder.
train.py arguments
-c CONDITION, --condition CONDITION
0: kick, 1: snare, 2:hat
-d DIRECTION, --direction DIRECTION
synthesis controls [0:4]
-ds DIRECTION_SLIDER, --direction_slider DIRECTION_SLIDER
how much to move in a particular direction
-n NUM_GENERATIONS, --num_generations NUM_GENERATIONS
number of examples to generate
-v STOCASTIC_VARIATION, --stocastic_variation STOCASTIC_VARIATION
amount of inconsequential noise injected
-r RANDOMIZE, --randomize RANDOMIZE
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
References
[1] | Drysdale, J., M. Tomczak, J. Hockman, Adversarial Synthesis of Drum Sounds. Proceedings of the 23rd International Conference on Digital Audio Effects (DAFX), 2020. |
---|
@inproceedings{drysdale2020ads,
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)},
year={2020}
}
Help
Any questions please feel free to contact me on [email protected]