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.

24 comments:

  1. This is cool! Would you be willing to post a build list and instructions?

    Did you write custom software to show the signal chain on the display?

    ReplyDelete
    Replies
    1. I updated the post with the hardware used. Software is a custom app running on top of Jack audio.

      Delete
    2. Thank you, is Jack Audio running on top of Windows or another OS?

      Anything else I should know before trying out myself?

      Delete
    3. It's running on a Raspberry Pi - so Linux.

      Delete
  2. Hi. How did you install it in linux? Is there a different download file for that?

    ReplyDelete
    Replies
    1. I'm using custom software for my pedalboard, but I've also made a simple LV2 plugin available here: https://github.com/mikeoliphant/neural-amp-modeler-lv2

      Delete
  3. how is switching/updating between presets/profiles? contending with any lag or split second signal loss?

    ReplyDelete
    Replies
    1. I haven't optimized for that, as it isn't important to me. I don't see why it couldn't be done, though.

      Delete
    2. I see, was just wondering if it was happening or not as this inspired me to do something for gig practice... pet peeve of mine when sound skips for a bit while switching digital multieffects. good to know it can be fixed though somehow...

      Delete
    3. Just to be clear - I'm talking about switch complete presets. There is no interruption when using a stomp to enable/disable/modify effects in a preset.

      Delete
  4. Hi... project looks great. I had been thinking of implementing a 'hardware' version of NAM, specifically on a Pi, maybe running MODEP which can host LV2 and other plugin formats. Very interested in knowing more about your project, particularly this "My pedalboard is using a custom app on top of Jack audio".

    ReplyDelete
    Replies
    1. A bit more info about my pedalboard is here: https://blog.nostatic.org/2020/11/guitar-amplifier-and-pedal-simulation.html

      Delete
    2. I also used the mod stuff initially. No need to use MODEP - just install it directly. I wrote up instructions a while back - they may be a bit out of date, but probably still mostly work: https://blog.nostatic.org/2020/01/using-mod-devices-guitar-effects.html

      Delete
    3. Cheers Mike. Good to know about the manual install. I used MODEP because I wa basically burnt out from the headaches of getting the AudioInjector interface board working. When I came across a turnkey solution I jumped at it. I think the next thing for me to try is getting NAM LV2 plugin running in mod-host and then look at getting some knobs to talk to it.

      Delete
    4. I gave up worrying about trying to find a practical integrated audio solution and just went with an external USB audio interface. Easy (as long as you make sure you get something supported well in Linux) and works great.

      Delete
  5. I would like to do the same with NAM, but want to implement a hdmi display with touch (amazon ones), this type of display will work as plug and play with your project? This in order to modify presets fast.

    ReplyDelete
  6. Hi Mike, nice job with the lv2 ! I'm trying to integrate it with Modep. I succesfully build it on my Pi4, I can load the guitar effect, but, as you already know, I can't assign any model using gui (cause there is no gui for this lv2 I guess ?). Do you have any advice to help me loading a tone in my NAM pedal running in MODEP ? Thank you ...

    ReplyDelete
    Replies
    1. You need an updated version of the MOD UI that lets you upload NAM files. I suggest asking on the MODEP forum: https://community.blokas.io/

      Delete
    2. OK, thanks, I will. If any interresting answer, I'll post it here.

      Delete
    3. OK, now it works ! Let me explain for all the newbies like me :
      I first tried to get and re-compile the last mod-ui from github. It compiled fine, but still, I had no button to load any .nam.
      After reading tons of article, I found this one https://community.blokas.io/t/please-add-the-nam-models-directory/4584
      This was the last part of the solution. So to sum it up, here is what to do to have a working NAM LV2 on a Rpi4 + MODEP :
      - Install PatchOS and activate Modep https://blokas.io/patchbox-os/
      - Update your system :
      sudo apt update
      sudo apt dist-upgrade
      - Add some effects and pedals :
      sudo apt install modep-lv2-*
      sudo cp -rvf /usr/modep/lv2/* /var/modep/lv2
      sudo chown -Rvf modep:modep /var/modep/lv2
      sudo chmod -Rvf 775 /var/modep/lv2
      - Install NAM LV2 from here : https://github.com/mikeoliphant/neural-amp-modeler-lv2 :
      - After a successful compilation, copy nam lv2 in the right place (assuming you git pulled your files in your home directory) :
      sudo cp -rvf ~/neural-amp-modeler-lv2/build/neural_amp_modeler.lv2 /var/modep/lv2/
      sudo chown -Rvf modep:modep /var/modep/lv2/neural_amp_modeler.lv2
      sudo chmod -Rvf 775 /var/modep/lv2/neural_amp_modeler.lv2
      - Finally, create the repository where you'll copy your .nam files :
      sudo mkdir -p "/var/modep/user-files/NAM Models"
      chown -Rvf modep:modep "/var/modep/user-files/NAM Models"
      And voila ...
      Hope it will help.

      Delete
  7. Hey, I have been trying some options and I am interested on StompboxUI. The download available on GitHub seems to work only on Windows, where can I get the Linux download? I tried to build from source but it seems I can't get Linux as target and stompbox (core) can't be built by Visual Studio (there are only CMake files)

    ReplyDelete
    Replies
    1. This is probably better discussed on GitHub. StompboxUI only works on Windows and Android. The core stompbox builds on Linux (using CMake).

      Delete
  8. This is a interesting project. What type of NAM model are you using, lite, feather or nano? How much CPU does it take to run NAM on RPi4?

    ReplyDelete
    Replies
    1. RPi4 can run standard NAM models with enough CPU to spare for some lightweight effects.

      Delete