A low latency guitar effects processor in C++ suitable for running on smaller boards (e.g. a raspberry pi).
The web UI calls into the web server which then manipulates the pedal board.
The AudioTransformer class uses RtAudio to interface with the sound card.
The values read from the soundcard are then streamed into the provided transformation function and written back out to the output device.
pedal.h defines an interface for all pedals to conform to.
The root of it is the Transform
function which takes an input signal, performs
any kind of transformation, and returns an output. All input and output values
should remain in the range [-1, 1] otherwise you'll produce some really gnarly
popping and cracking.
Many of the pedals utilize the Q library for some signal processing primitives (e.g. filters, compression, etc.). Some other utility classes can be found in the fx directory of this repo.
The Describe
function advertises the current state of the pedal, primarily
the knobs. These knob name and values will be used to display in the UI
(covered later).
AdjustKnob
provides a knob from the UI and relies on the implementation to
make the required changes to the pedal. These changes should be applied in a way
such that subsequent calls to Describe
will reflect these changes (otherwise
the UI won't update).
Each pedal should register itself via the REGISTER_PEDAL
macro. This connects
the pedal to the PedalRegistry so that other components can find it without explicitly knowing
about its existence.
The PedalBoard
essentially just wraps a list of pedals and chains their Transform
functions.
The web server uses the crow library to expose endpoints that manipulate the pedal board.
The PedalRegistry is used here to automatically expose newly added pedals. You only need to add an include statement within the handlers file to trigger the registration.
The web UI uses React. The bulk of the logic lives in app.jsx.
-
First clone the repo:
git clone --recurse-submodules https://github.com/Quinny/GuitarEffects
-
Then install RtAudio. The steps here depend slightly on the platform you are building on. See install.txt from the RtAudio repo. After following all the steps there run
make install
in the RtAudio directory so that the library files can be linked properly. -
Install boost using your package manager (e.g.
brew
,apt-get
,yum
, etc). If you Google "Install boost using<package_manager>
you should find the corresponding package name. -
Install sdl2 using your package manager (e.g.
brew
,apt-get
,yum
, etc.). If you Google "Install sdl on<platform>
you should find more detailed instructions. -
Run
make server
from this repo's root. -
Open a github issue if I missed a required dependency.
From the web
directory, run sudo ../bin/server
(sudo is required to run on
port 80).
My current setup is as follows:
- A raspberry pi 4 connected to a 7 inch touch screen
- A Behringer audio interface connected to the PI's USB port
- My guitar is plugged into the audio interface input port, and then the output of the audio interface runs into my amp (or into the start of your physical pedal chain)
- The server program from this repo runs on the raspberry pi
- Chromium runs and connects to
localhost
so that I can interface with the pedals from the touch screen
You can mix and match whatever components you want, any audio interface with an input and output port should work, and you can run the server program on any device you can plug an audio interface into. I've run this setup using my Macbook with similar results (though bulky and less portable).
Note that since the server program exposes an HTTP server you can actually navigate to the IP address of your PI from any device connected to the same wifi and control your pedal chain from there.