Tuesday, November 17, 2026

nam-cpu-trainer

A couple of months ago I released the first version of nam-cpu-trainer, a Neural Amp Modeler (NAM) trainer designed for high performance on CPUs.

NAM training on CPU has historically been impractical since the pytorch-based official trainer is notoriously slow if you aren't running it with a GPU (that isn't the nam trainer's fault, really - pytorch on CPU is just slow).

A while back I decided to work on a project to improve my understanding of modern neural network learning methods. The result of that is  cpugrad, a fully custom, CPU-based machine learning library focused primarily (currently, anyway) on time series data (ie: audio samples).

nam-cpu-trainer was my first major test of a real-world problem using cpugrad. It has come along so well that, in the latest release, it now supports all of the functionality needed to train NAM A2 models. Accuracy in my testing is on par or better than the official nam trainer, and CPU training performance is comparable to an equivalent-tier GPU. Ie: don't expect your old laptop CPU to outperform an RTX 5090, but my Ryzen 7 5700x using nam-cpu-trainer outperforms pytorch on my RX6700 GPU. 

SpiceForge - a LiveSPICE-based audio circuit editor and live simulator

I recently released the first version of a SpiceForge, a cross-platform circuit editor and live simulator built on top of the foundation of LiveSPICE.

Key features over LiveSPICE are a new circuit simulator that supports fully dynamic pots and switches, a cross-platform editing and simulation front-end app, and a cross-platform audio backend (currently ASIO and JACK).

 

Saturday, May 23, 2026

Building for Raspberry Pi using Github Actions

While Raspberry Pi SBCs have gotten significantly more powerful over the years, they are still pretty limited compared to a PC when it come to compiling. Building a complicated project on a Pi4 or even a Pi5 can be slow, and it is easy to run out of memory when compiling on the smaller (ie: 1-2GB) versions.

I wanted to provide release binaries for Raspberry Pi for several of my GitHub projects, and didn't want to do a manual build and upload. Fortunately, with a bit of digging, I found and was able to use Pieter Pas'  docker-arm-cross-toolchain to build for Raspberry Pi using GitHub actions.

Here is an example snippet for setting up a Pi4/Pi5 build matrix in a Github action:

name: Raspberry Pi Build on: workflow_dispatch: jobs: build-rpi: name: Build Raspberry Pi strategy: matrix: native_arch: [rpi4, rpi5] runs-on: ubuntu-latest container: image: ghcr.io/tttapa/docker-arm-cross-toolchain:aarch64-rpi3-linux-gnu-gcc12 steps: ...do something

Note the "gcc12" at the end of the docker image path. This ensures that your RPi build will work on RPi OS versions going back to Bookworm.

When you get to building, assuming that you are using CMake, you can specify the build tools by using:

-DCMAKE_TOOLCHAIN_FILE=/home/develop/opt/x-tools/aarch64-rpi3-linux-gnu/aarch64-${{ matrix.native_arch }}-linux-gnu.toolchain.cmake

You can see this at work in myneural-amp-modeler-lv2 and NeuralAudio GitHub repositories. Have a look at the "release" GitHub actions.

Monday, February 10, 2025

State of NAM on Raspberry Pi


It's been almost two years now since I first posted a video of Neural Amp Modeler captures running on my Raspberry Pi 4.

A lot has changed since then.

Originally, the NAM playback code was extremely expensive. So much so that a Raspberry Pi 4 could only manage to run "feather" models.

Because I wanted to run more accurate models, NAM  optimization became a bit of a pet project. With some optimizations to the NAM Core codebase, we were able to increase performance by more than 2x. That, combined with more widespread availability of a 64bit OS for the Pi, made "standard" NAM captures possible - with plenty of headroom left for a cabinet IR and some light effects.

More recently, I have been working on my own implementation of WaveNet and LSTM models, with a focus on performance. The result of which, you can see running in the image above in my Stompbox app.

Note the numbers in the bottom left - that is the realtime CPU usage as reported by Jack. This is running a "standard" NAM capture. Audio buffer size is 96 samples. CPU usage of "standard" models is now low enough that I can easily run two models at once, with plenty of CPU left over for IR and effects. I can even (just barely) run three models at once.

Saturday, April 15, 2023

This Boss SD-1 Pedal Does Not Exist

 


I've been messing around lately with combining Neural Amp Modeler with another open source project I've contributed to in the past - LiveSPICE.

LiveSPICE allows you to simulate audio circuits in real-time, which is very cool. The disadvantage it has is that it is very CPU-heavy. It's CPU usage is also not super consistent, but can be spiky, which makes it hard to use in a live, low-latency environments without getting audio dropouts.

It *is* however, very easy to use it to generate training data for Neural Amp Modeler. So that's what I did.

Because it uses a simulation of the pedal circuit, the generated training audio has none of the added noise that is difficult to fully avoid when capturing actual pedals. This "idealized" version of the pedal should be even easier for the neural net model to learn.

And indeed, it is. Here is the ESR of a "feather" model (the smallest, least CPU-intensive default NAM model type).

It shows 0.000, but it was actually around 0.0001.

You can get the resulting .nam model here on ToneHunt.

Wednesday, March 8, 2023

Neural Amp Modeler (NAM) running on Raspberry Pi


Recently I've been messing around with, and contributing to the Neural Amp Modeler project. It uses machine learning (more specifically the WaveNet model) to create captures of amplifiers and distortion pedals.

It has been gaining a lot of traction recently, with lots of people modeling their equipment. The resulting models are very good.

I've now got it integrated into my Raspberry Pi pedalboard. The audio for the above video was recorded on a Raspberry Pi 4.

The hardware on the pedalboard consists of:

- Raspberry Pi 4
- Hotone Jogg audio interface
- Hotone Ampero Control MIDI Controller
- Wio Terminal (used for a serial-based display)

My pedalboard is using a custom app on top of Jack audio, but I have also made a Neural Amp Modeler LV2 plugin available.

Tuesday, September 13, 2022

Chord data for jazz standards

I recently started playing jazz on bass guitar. So naturally, I also recently started writing software for facilitating jazz practice.

As a basis for a number of my projects, I needed access to chord data from a corpus of jazz standards. The best source I found was the database of user-submitted scores for the IReal mobile app: https://www.irealpro.com/main-playlists

I've been converting these to an easy-to parse json format. The current database of songs can be found here:


Here is an example score:   
  
{ "Title": "Alone Together", "Composer": "Schwartz Arthur", "Key": "D-", "Rhythm": "Medium Swing", "Sections": [ { "Label": "A", "MainSegment": { "Chords": "Dm6|Em7b5,A7b9|Dm6|Em7b5,A7b9|Dm6|Am7b5,D7b9|Gm7|Gm7|Bm7,E7|Gm7,C7|Fmaj7|Em7b5,A7b9" }, "Endings": [ { "Chords": "Dmaj7|D(Em7b5),(A7b9)" }, { "Chords": "Dmaj7|Dmaj7" } ] }, { "Label": "B", "MainSegment": { "Chords": "Am7b5|D7b9|Gm6|Gm6|Gm7b5|C7b9|Fmaj7|Em7b5,A7b9" }, "Endings": [] }, { "Label": "A", "MainSegment": { "Chords": "Dm6|Em7b5,A7b9|Dm6|Em7b5,A7b9|Dm6,Bm7b5|Bb7,A7b9|Dm6|Em7b5,A7b9" }, "Endings": [] } ] }