PedalNet-RealTime trains guitar effect/amp neural network models for use with the SmartGuitarPedal, SmartGuitarAmp, and WaveNetVA plugins. You can train a model using this repository, then convert it to a .json model that can be loaded into the VST plugin. Effective for modeling distortion style effects or tube amplifiers.
Video walkthrough of model training and usage on YouTube
The following repositories are compatible with the converted .json model, for use with real time guitar playing through a DAW plugin or stand alone app:
Email your best json models to smartguitarml@gmail.com and they may be included in the next plugin release.
Re-creation of model from Real-Time Guitar Amplifier Emulation with Deep Learning
Notice:
This project is a modified version of the original Pedalnet, from which
the model, data preparation, training, and predition scripts were obtained. 9/25/2020
For a great explanation of how it works, check out this blog post.
Jupyter Notebooks for Google Colab are available in notebooks
Create and enter virtual environment
python -m venv .
. bin/activate
git clone https://github.com/GuitarML/PedalNetRT.git src/
Enter the directory and install the dependencies using pip
package manager
cd src
python -m pip install -r requirements.txt
(Optional development dependencies)
python -m pip install -r requirements-dev.txt
Install (Nvidia) GPU drivers (from pytorch-lightning manual)
# Add the package repositories
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list
sudo apt-get update && sudo apt-get install -y nvidia-container-toolkit
sudo systemctl restart docker
data/
and models/
directoriesdata/
directoryRun the docker image with desired training parameters
docker run --rm -it \
-v "$(pwd)"/data:/data \
-v "$(pwd)"/models:/models \
--gpus all \
ghcr.io/guitarml/pedalnetrt data/ts9_test1_in_FP32.wav data/ts9_test1_out_FP32.wav
/models
directorydata/ts9_test1_in_FP32.wav
- Playing from a Fender Telecaster, bridge pickup, max tone and volume
data/ts9_test1_out_FP32.wav
- Split with JHS Buffer Splitter to Ibanez TS9 Tube Screamer
(max drive, mid tone and volume).
models/pedalnet/pedalnet.ckpt
- Pretrained model weights
Run effect on .wav file: Must be single channel, 44.1 kHz, FP32 wav data (not int16)
python train.py data/ts9_test1_in_FP32.wav data/ts9_test1_out_FP32.wav
# specify input file and desired output file
python predict.py my_input_guitar.wav my_output.wav
# if you trained your own model you can pass --model flag
# with path to .ckpt
# For example:
--model=models/your_model_name/your_model_name.ckpt
Train:
python train.py data/ts9_test1_in_FP32.wav data/ts9_test1_out_FP32.wav
# When training your own model add this flag:
--model=models/your_model_name/your_model_name.ckpt
python train.py --resume # to resume training
python train.py --gpus "0,1" # for multiple gpus
python train.py --cpu # for cpu training
python train.py -h # help (see for other hyperparameters)
# The data preparation is included in train.py, but you can run prepare.py separately before training if desired:
python prepare.py data/ts9_test1_in_FP32.wav data/ts9_test1_out_FP32.wav --model=models/your_model_name/your_model_name.ckpt
Test:
python test.py # test pretrained model
python test.py --model=your_trained_model.ckpt # test trained model
Creates files y_test.wav
, y_pred.wav
, and x_test.wav
, for the ground truth
output, predicted output, and input signal respectively.
Model Conversion:
The .ckpt model must be converted to a .json model to run in the plugin. Usage:
python export.py --model=your_trained_model.ckpt
Generates a file named "converted_model.json" that can be loaded into the VST plugin.
Analysis:
You can also use "plot.py" to evaluate the trained PedalNet model. By default, this will analyze the three .wav files from the test.py output. It will output analysis plots and calculate the error to signal ratio.
Usage (after running "python test.py --model=your_trained_model.ckpt"):
python plot.py
Differences from the original PedalNet (to make compatible with WaveNet plugin):
Helpful tips on training models: