This repo accompanies this blog post. The premise is to generate high-quality presets for the Ableton Analog synthesizer in a particular style automatically using generative machine learning models.
This repo currently requires Python 3.7.9 until Tensorflow can be migrated to version 2+.
Feel free to acquire this interpreter via your preferred method. One way to do so would be
- Install pyenv
pyenv install 3.7.9
pyenv global 3.7.9
python -m venv venv
source venv/bin/activate
Pip install -r requirements.txt
To run training you can use the run_gan.py
script like this:
python run_gan.py --config-file data/configs/config_240_cgan.json
It also supports various CLI options including hyperparameter search. Run python run_gan.py --help
By default, this will output models, plots, and presets to data/generated in the project directory.
To generate presets from a model, use the generate_from_gan.py
script. Example usage:
python generate_from_gan.py --config-file data/configs/config_240_cgan.json --model-path data/configs/config_240_cgan_generator_model_e1000.h5 --dest-path . --n-samples 10
To evaluate presets, you will need Ableton. You can get a 90 day free trial here
Test coverage is currently very limited. To run the tests use python -m pytest tests/
This project uses the Keras framework (built in to Tensorflow) to construct and train the neural network.
The general flow is as follows:
- Read training data directly from the repo at
data/analog_library
(theres not much data available sadly) - Parse presets into vectors (logic in
presetml/parsing/ableton_analog.py
) - Run training (logic in
generation/gan.py
)