THIS BARELY WORKS
A system to control simulated guitar pedals using a MIDI foot controller. Designed primarily for Raspberry Pi 4/5, it allows real-time switching of audio effects via Jack audio connections.
- Real-time audio routing (<100ms latency)
- Supports any effects simulator with Jack audio I/O
- Currently only mono effects are fully supported
- LV2 plugin integration via
mod-host
andmod-ui
- MIDI controller configuration
- GUI for setting audio levels of each effect
- Includes a mute switch
- Raspberry Pi 4 or 5 (recommended)
- This will probably run an any computer using Linux. It was developed for and on a Raspberry Pi
- Debian 12 (Patchbox OS)
- Patchbox OS comes with the unessential but useful Modep software preinstalled.
- Compatible audio interface
- MIDI foot controller
- Download Patchbox OS
- Install with these settings:
- Select no additional modules during installation
- Configure your audio interface settings
- Post-installation:
sudo apt install modep-mod-ui git curl build-essential
sudo systemctl disable modep-mod-ui # Prevent mod-ui from auto-starting
For getting the Hot Point to work (that you can set up using patchbox-config
) it may be necessary to do:
sudo systemctl disable dnsmasq
sudo systemctl stop dnsmasq
Patchbox OS includes opt-out telemetry. To remove:
sudo apt purge blokas-telemetry
The LXDE desktop, default to Patchbox OS, takes up screen room for no purpose and can be disabled.
- Edit the file
/etc/xdg/lxsession/LXDE/desktop.conf
a. Remove thelauncher_manager/command=lxpanelctl
line from the [Session] section if it is there b. Remove both thesNet/IconThemeName=PiXflat
andsGtk/CursorThemeName=PiXflat
lines from the [GTK] section - Edit
~/.config/lxsession/LXDE/autostart
a. Remove@lxpanel
line to disable default panel b. Remove@pcmanfm
line to disable desktop icons
To run LV2 simulators an LV2 host is required. The host mod-host
is recommended.
It is a sub mdule of 120Pedal
git clone https://github.com/mod-audio/mod-host
cd mod-host
make
It is possible to use Modep, and in particular, mod-ui
, an Debian-12, (Debian-13 is unknown) but it is not trivial. Use this and follow the instructions in the README.md
.
mod-ui
will not play nicely with Patchstorage and it will not display the nice PNG images of pedals like it will if you install from Patchbox OS, but it is still very useful
- Install required packages:
sudo apt install dnsmasq git hostapd iw jackd2 libasound2-dev \
libjack-jackd2-dev liblilv-dev libreadline-dev libsdl2-dev \
libsdl2-image-dev lv2-dev pkg-config python3.11-dev libipc-run-perl -y
- Install Rust:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
git clone https://github.com/goodtft/LCD-show.git
cd LCD-show
sudo ./LCD35-show
Ensure patch
is in group lightdm
: sudo usermod -aG lightdm patch
Ensure the autologin-session
parameter in /etc/lightdm/lightdm.conf
exists in /usr/share/xsessions/
(E.g: /usr/share/xsessions/LXDE.desktop
so autologin-session=LXDE
)
sudo systemctl restart lightdm
mkdir -p ~/.config/autostart
cat > ~/.config/autostart/120pedal.desktop <<EOF
[Desktop Entry]
Type=Application
Name=120Pedal
Exec=/bin/bash -c "sleep 5 && \${HOME}/120Pedal/gui/run.sh"
Comment=120Pedal Controller
X-GNOME-Autostart-enabled=true
X-GNOME-Autostart-Delay=10
EOF
chmod +x ~/.config/autostart/120pedal.desktop
If not using Patchbox OS (that takes care of this):
- Identify your audio interface:
aplay -l | grep "Your Interface Name"
- Create
/etc/systemd/system/jackd.service
:
[Unit]
Description=JACK Audio Connection Kit
After=sound.target
[Service]
ExecStart=/bin/sh -c 'CARD=$(aplay -l | grep -m1 "Your Interface" | cut -d" " -f2 | tr -d ":"); exec /usr/bin/jackd -d alsa -d hw:$CARD -r 48000 -p 128 -n 2'
Restart=always
User=your_username
Group=audio
LimitMEMLOCK=8589934592
LimitRTPRIO=89
Environment="XDG_RUNTIME_DIR=/run/user/$(id -u your_username)"
Environment="JACK_NO_AUDIO_RESERVATION=1"
[Install]
WantedBy=multi-user.target
- Enable Jack:
sudo systemctl start jackd
sudo systemctl enable jackd
Patchbox OS provides a version of mod-host
but this uses a forked version
cd
git clone https://github.com/worikgh/mod-host.git
cd mod-host
make
./mod-host -n -p 5555
If not using Patchbox OS
cd
git clone https://github.com/worikgh/mod-ui.git
cd mod-ui
python3 -m venv myenv
source myenv/bin/activate
pip3 install -r requirements.txt
# Apply necessary patches
find myenv/lib/python* -name httputil.py | xargs sed -i 's/collections.MutableMapping/collections.abc.MutableMapping/'
make -C utils
export MOD_DEV_ENVIRONMENT=0
python3 ./server.py
Access the interface at http://<your-pi-ip>:8888
(Not HTTPS)
If using Patchbox OS access the interface at http://<your-pi-ip>
(Not HTTPS)
- Clone the repository:
cd
git clone https://github.com/worikgh/120Pedal.git --recurse-submodules
cd 120Pedal/gui
cargo build --release
cd ../midi_driver
cargo build --release
-
Configure your pedal setups in the
PEDALS/
directory (see PEDALS/README.md) -
For LV2 simulators:
./getLV2 # Reads mod-ui pedal configurations
./cfgEffects # Sets up LV2 simulators and Jack connections
TODO: Make some pedals
TODO: Making pedals documentation
The MIDI pedal is driven with three components:
- A reader:
read_midi
that connects to the device and outputs the MIDI data on its STDOUT - A translator:
translate_midi
that reads MIDI on its STDIN and writes (translated) MIDI on its STDOUT - An actor:
jack_midi
that reads MIDI on its STDIN and sets up Jack audio pipes
- Read MIDI Input:
read_midi SINCO
- Translate MIDI Commands:
translate_midi examples/sinco.cfg
- Control Jack Connections:
jack_midi examples/midi_jack.cfg
(export PATH=$PATH:$(pwd)/midi_driver/target/release
read_midi SINCO | translate_midi examples/sinco.cfg | jack_midi examples/sas_house.cfg)
Example pedal definition (PEDALS/lost_world
):
system:capture_1 effect_14:in
effect_13:Out1 system:playback_1
- Ensure Jack is running before starting mod-host
- Verify your audio interface is properly detected
- Check MIDI device permissions
- Using SSH log into the Pi and
tail /tmp/gui.log
(TODO: Integrate with systemd logging)
In the directory mono/
See the README in that file for description of how they work
- Sub module:
basic-pure-data-audio-effects