Skip to content

jerryuhoo/ddsp_pytorch

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

91 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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).

This implementation is specially for generating cat voices!

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)

Data Augmentation

cat voice segmentation: (Please change paths and parameters inside the code)

python seg_cat.py

Pitch shifting:

git clone https://github.com/ederwander/PyAutoTune.git
cd PyAutoTune
pip install -e .
cd ../ddsp_pytorch
python TuneAndSaveToFile_folder.py data/cats/train/

Inference Example

file inference:

python inference_file.py --model_path export/ddsp_cats_seg_pitchshift_pretrained.ts --input_file violin_original.mp3

folder inference (for evaluation only, please change paths and parameters inside the code):

python inference_folder.py

Evaluation Example

python evaluate_f0.py [output folder] [reference folder]

Colab Example

Open In Colab

About

Implementation of Differentiable Digital Signal Processing (DDSP) in Pytorch

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 86.1%
  • Python 7.9%
  • C 5.2%
  • Other 0.8%