• Stars
    star
    445
  • Rank 98,085 (Top 2 %)
  • Language
    C
  • License
    Apache License 2.0
  • Created about 5 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Implementation of Differentiable Digital Signal Processing (DDSP) in Pytorch

Differentiable Digital Signal Processing

ddsp_tilde_screenshot

Implementation of the DDSP model using PyTorch. This implementation can be exported to a torchscript model, ready to be used inside a realtime environment (see this video).

Pretrained models

instrument realtime preprocessing sampling rate link
saxophone true sigmund~ 48kHz download
violin true sigmund~ 48kHz download

Usage

Edit the config.yaml file to fit your needs (audio location, preprocess folder, sampling rate, model parameters...), then preprocess your data using

python preprocess.py

You can then train your model using

python train.py --name mytraining --steps 10000000 --batch 16 --lr .001

Once trained, export it using

python export.py --run runs/mytraining/

It will produce a file named ddsp_pretrained_mytraining.ts, that you can use inside a python environment like that

import torch

model = torch.jit.load("ddsp_pretrained_mytraining.ts")

pitch = torch.randn(1, 200, 1)
loudness = torch.randn(1, 200, 1)

audio = model(pitch, loudness)

Realtime usage

Be sure that the block_size defined in config.yaml is a power of 2 if you want to use the model in realtime!

If you want to use DDSP in realtime (yeah), we provide a pure data external wrapping everything. Export your trained model using

python export.py --run runs/mytraining/ --realtime true

This will disable the reverb and enable the use of the model in realtime. For now the external works on CPU, but you can enable GPU accelerated inference by changing realtime/ddsp_tilde/ddsp_model.h DEVICE to torch::kCUDA. Inside Pd, simply send load your_model.ts to the ddsp~ object. The first inlet must be a pitch signal, the second a loudness signal. It can be directly plugged to the sigmund~ object for real-time timbre transfer.

You can then apply the exported impulse response using a convolution reverb (such as partconv~ from the bsaylor library).

Compilation

You will need cmake, a C++ compiler, and libtorch somewhere on your computer. Then, run

cd realtime
mkdir build
cd build
cmake ../ -DCMAKE_PREFIX_PATH=/path/to/libtorch -DCMAKE_BUILD_TYPE=Release
make install

If you already have pytorch installed via pip inside a virtual environment, you can use the following PREFIX_PATH:

cmake ../ -DCMAKE_PREFIX_PATH=~/miniconda3/lib/python3.X/site-packages/torch -DCMAKE_BUILD_TYPE=Release
make install

By default, it will install the external in ~/Documents/Pd/externals.

More Repositories

1

RAVE

Official implementation of the RAVE model: a Realtime Audio Variational autoEncoder
Python
1,283
star
2

diffusion_models

A series of tutorial notebooks on denoising diffusion probabilistic models in PyTorch
Jupyter Notebook
607
star
3

nn_tilde

Max
310
star
4

creative_ml

Creative Machine Learning course and notebook tutorials in JAX, PyTorch and Numpy
Jupyter Notebook
206
star
5

rave_vst

C++
186
star
6

pytorch_flows

Implementation and tutorials of normalizing flows with the novel distributions module
Jupyter Notebook
158
star
7

flow_synthesizer

Universal audio synthesizer control learning with normalizing flows
Max
132
star
8

neurorack

Python
108
star
9

variational-timbre

Generative timbre spaces by perceptually regularizing variational auto-encoders
Python
56
star
10

vschaos2

vintage neural synthesis with spectral auto-encoders
Python
48
star
11

cached_conv

Python
44
star
12

wavae

Realtime Variational Autoencoder built on top of libtorch and PureData
Python
36
star
13

timbre_exploration

Additional materials for "TIMBRE LATENT SPACE: EXPLORATION AND CREATIVE ASPECTS"
SCSS
20
star
14

lottery_mir

Ultra-light MIR models with a structured lottery ticket hypothesis approach
Python
13
star
15

lottery_generative

Lottery ticket hypothesis for deep generative models
Python
11
star
16

Expressive_WAE_FADER

companion repository to the DAFx-19 paper "Assisted Sound Sample Generation with Musical Conditioning in Adversarial Auto-Encoders" by Adrien Bitton, Philippe Esling et al.
9
star
17

Timbre_MoVE

Modulated Variational Auto-Encoders for Many-to-Many Musical Timbre Transfer
8
star
18

cml

Library for the Creative Machine Learning course
Python
6
star
19

projective_orchestration

Automatic projective orchestration using neural networks.
Python
5
star
20

PianoTranscriptionTransposition

Automatic Music Transcription and Instrument Transposition with Differentiable Rendering @ The 2020 Joint Conference on AI Music Creativity
SCSS
3
star
21

waveflow

Python
3
star
22

acids-ircam.github.io

HTML
3
star
23

live_orchestral_piano

Max/MSP patch for live projective orchestration
2
star