Assembling a guitar effects pedal with a Raspberry Pi19 Mar 2023
I found this link to a guitar effect pedal software, I got very curious and I decided to assemble it with hardware that I already have. The repo contains code to run a low latency sound effects processor (as in, real time audio).
The code is written in C++, using SDL2 for visual display, RtAudio to interface with the audio i/o and crow for a web server that shows the complete UI for pedal controls.
The hardware I used: a Raspberry Pi 3 mounted to a element14 touch screen, a breadboard to put the push buttons that connect to the Raspberry Pi through the GPIO port, and a USB sound device with mic and audio ports. It’s also the first time I got to test the touch screen.
I did not have trouble making the touch screen work: the Raspberry Pi is screwed behind the screen, connected to each other through the specialised display port, and the screen uses the same official Raspberry Pi plug, it provides enough energy for both components. The Raspberry Pi as a tablet is a very interesting device, even though the initial setup keeps it plugged to the wall and not to a battery. I connected a keyboard anyways, life is too short to use the touch screen keyboard.
After having tested that the screen works, it’s time to compile and install GuitarEffects. The procedure is reasonably well explained in the project readme. This is mostly installing the dependencies with
apt and then running
The only comment I’ve got about the process: installing RtAudio worked practically out of the box (no extra options needed). However, I had an error message when I tried to run
No known system type found for realtime support!. I had to install an ALSA dev package to solve this,
sudo apt-get install libasound2-dev, and then I had no other issues with the installation.
Once everything was compiled, I ran
sudo ../bin/server from the
web directory in the repo. At this moment the program could not determine the audio device to be used, and it asked me through the terminal. Once I selected the audio device, the program opens a window that shows a real time audio wave.
The program also serves a website that offers full pedal controls. You can open it in the Raspberry Pi browser, or any other browser that is in the same network.
The only thing that remains is to plug in an instrument, some speakers, and start playing.
I decided to use a Raspberry Pi 3 instead of the 4, because that one I recently bought and quickly became my Samba file server, replacing my old RPi 3 setup. I think I did needed a 4, and I noted some crackling and popping, making me think that it doesn’t have enough performance. There are ways to configure the Pi for better real time audio performance, including disabling services such as network. This is not an option for this project due to running a web server.
The buttons did not work for me as the project readme states. However, this was something I did not pay too much attention due to being distracted with the web interface. The pedal as of now offers a good deal of interesting effects: autowah, low/high pass filters, flanger, fuzz, delay, distorsion, compressor, reverb, looper, and some others.
As an experiment, I think it was pretty interesting, and a solid project with lots of potential. Some things I would have done with more time:
- Make the buttons work: documentation is not clear on what they specifically do, so I did not bother to make them work
- Improve real time audio performance: the article I linked to above has good suggestions. My setup doesn’t have a fan, so I did not want to mess with overclocking. The web interface shows the system temperature, and it did not change in the hour or so I was playing. It would be a matter of read and weight each suggestion