TackleboxModeling.jl

Introduction

This software is in part inspired by Jim Lil’s excellent “where does the tone come from…” series of videos. Especially his video titled “Tested: Where Does The Tone Come From In A Guitar Amplifier?” which you can watch here:

https://www.youtube.com/watch?v=wcBEOcPtlYk

In this video Jim makes the point that most common guitar amplifiers can be broken down into three tone shaping stages (or layers), each possibly followed by a non-linearity:

We can take this description and cast it into a very simple “neural-network” form:

Here the 1D-convolutions take on the role of the tone shaping stages and the dist_aa2 activation functions perform the non-linearity/distortion. dist_aa2 is the non-linearity x / sqrt(1+x^2) cast into the “transparent” antiderivative antialiasing form described in “Note on Alias Suppression in Digital Distortion” by Martin Vicanek (2024.) See equation 10 in that paper.

Note that this is a “neural network” in a very loose sense. There is only one channel throughout the whole thing. It does have the property of being affine transformations followed by non-linearities and that it is trainable by gradient descent, but that’s pretty much where the similarities end.

This architecture allows an efficient implementation in a plugin using partitioned convolution (about 1/4 of the processing load compared to standard NAMs). Since the number of non-linearities is quite limited it is possible to implement oversampling for only those relatively efficiently (ca. 50 % cpu load increase over the non-oversampling variant).

The code is flexible enough to add additional stages (layers) which can be useful for higher gain models.

Caveat Emptor

This model is kept simple deliberately. It is not and will never be able to model non-linear effects that go beyond the architecture of “EQ followed by distortion followed by EQ followed by distortion…”. In that sense the architecture of e.g. Neural Amp Modeler is strictly more powerful. What we gain by this choice of simplicity is efficiency…

Overview

The two main parts of this software are:

Some implementation details

Examples

The models which are included with the plugin have been trained on input/output pairs produced by neural amp modeller (NAM) models. So they are “2nd-generation models” ;) To my ears they sound quite similar on my little test snippet. You can find them in the examples/ folder in the respective model subdirectory (the prefix “nam_” denotes the audio files rendered by NAM. the “test_” prefix denotes the audio files rendered by the tacklebox). You should get playable links below if you visit the github pages version of this repository: https://fps.github.io/TackleboxModeling.jl.

To reproduce these models you will have to download the corresponding .nam files from https://tone3000.com. These are their md5 hashes:

e0619b10bd08354d4e1953fc1d0bc104  data/Fender Deluxe Reverb/model.nam
bef7ef275c9a9a8c33cd097004b7549f  data/BrianMay/model.nam
15e51e9fd7742b575fd2d212e7ee6b23  data/marshall bluesbreaker 1962/model.nam
9eb7e7d50ccac9f6765a62499613fcf7  data/EVH 5150/model.nam

You will also need to download the nam_training_input.wav file from the neural-amp-modeler docs site https://neural-amp-modeler.readthedocs.io/en/latest/. The file might be called differently originally or there might be a newer version, but the version I used has this hash:

36cd1af62985c2fac3e654333e36431e  data/nam_training_input.wav

After downloading them you’ll have to:

Fender Deluxe Reverb

NAM

Tacklebox

Marshal Bluesbreaker 1962

NAM

Tacklebox

BrianMay

NAM

Tacklebox

EVH 5150

NAM

Tacklebox

Aliasing comparison (EVH 5150)

The interesting stuff happens after ca. 25 secs. or so…

NAM

Tacklebox 2x oversampling

This code is just a proof of concept. Improvements welcome :)

Building the plugin

Linux

Install libfftw3f and libsamplerate (required for resampling the IRs (weights) to a samplerate other than 48000) if you so wish.

meson setup build -Dbuildtype=release
meson compile -vC build

On some platforms (notably raspberry os) you might want to disable the use of FFTW(f) by adding -Dfftw=disabled to avoid long startup times (at the price if slightly higher cpu usage.)

Windows

I only tested building the plugin with mingw64 as it is shipped in cygwin as mingw64-x86_64. Install mingw and the libsamplerate for your mingw. The lv2-dev package can come from cygwin. Then run:

PKG_CONFIG_PATH=/usr/x86_64-w64-mingw32/sys-root/mingw/lib/pkgconfig/ meson setup build-win --buildtype=release --cross-file windows-cross-file -Dfftw=disabled -Dstatic-lv2=enabled
CPLUS_INCLUDE_PATH=/cygdrive/c/Users/fschmidt26/syncthing/uni/projects/spectral_amp_modeling/mingw-include/  meson compile -vC build-win/

which should give you a build-win/plugin/lv2/libtacklebox.dll. Change the manifest.ttl file to refer to the .dll instead of .so and copy the whole build-win/plugin/lv2/tacklebox.lv2 directory to %APPDATA%%/LV2/tacklebox.lv2 and you should be good to go.

Installing the plugin

Using the plugin

TODOs / Limitations

License

This software is free software available under the GPL v2 license. If you require different license terms, feel free to contact me.