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": [] } ] }

Friday, October 29, 2021

Arduino sketch for TFT display rendering using serial commands

I've been using a Seeed Studio Wio Terminal as an external display for a Raspberry Pi. I initially wrote an Arduino sketch that took high level, application-specific commands over serial and rendered appropriate display elements. This has the disadvantage that adding UI features required updating the Arduino code, which is more of a pain and slower to iterate on.

Instead, I'm now planning on sending rendering commands over the serial interface - turning the microcontroller into a general purpose rendering device.

I've thrown my initial code up on GitHub here:

github.com/mikeoliphant/SerialTFT

It currently only supports a small set of commands for rendering rectangles and text. I'll be adding more features as I need them.

Sunday, October 17, 2021

Speeding up Arduino TFT (TFT_eSPI) writes

 I've been recently playing around with "Arduino" microcontroller stuff - specifically a Seeed Studio Wio Terminal.

Playing around with the TFT display, I noticed that drawing to it was pretty slow. After doing some research, I found out that direct TFT writes are indeed quite slow. But there is an easy way around it.

The TFT_eSPI graphics library, a modified version of which is used by the Wio Terminal, provides a Sprite class that can be used to do quick TFT writes. If you have enough memory (which the Wio Terminal *just* barely does), you can create a full screen-sized sprite.

The Sprite class supports the same drawing API as the main TFT class, so it is pretty easy to convert code that is writing directly to the TFT to use a Sprite instead.

To initialize it, do this:

TFT_eSPI tft = TFT_eSPI();
TFT_eSprite screen = TFT_eSprite(&tft);

In your setup(), after initializing the TFT, do this:

screen.createSprite(tft.width(), tft.height());

Then, use "screen" instead of "tft" for all of your drawing calls. When you want to update the TFT with the current state of your sprite, do this:

 screen.pushSprite(0, 0);

That's it! The result is a display that will update *much* faster.

One caveat is that this method uses up the vast majority of the Wio Terminal's RAM. It works fine for me, since my application is not otherwise particularly memory hungry. More complicated applications (using WiFi, for example) may run into problems. If that happens, a good (if more complicated) solution would be to use a smaller screen area sprite and do targeted writes to sub-areas of the screen.

Monday, October 4, 2021

Fixing Hotone Jogg ASIO "No devices connected" issue

I recently ordered a Hotone Jogg guitar audio interface pedal and had trouble getting the Windows 10 ASIO drivers to work. Turns out that ASIO support was added with a firmware update, and the pedal I got had the old firmware.

If you are having this problem, you need to get the updated firmware from here:

https://www.hotoneaudio.com/support/2

Scroll down until you see "Jogg firmware with Hotone ASIO driver support" and click on the link to download the firmware.

Follow the included instructions (you have to open up the unit to flip a dip switch, which is not very user friendly) and you should soon be good to go.

Hotone Jogg audio interface pedal works in Linux

 After posting a number of previous posts about guitar audio interfaces that did not work out of the box, I am pleased to report that the Hotone Jogg works right out of the box in Linux. Pleasant surprise!

I couldn't find any information on using this device with Linux, so I thought I'd do this brief post for any future people that may be looking.