MIDI Synthesizer Engine
Instructions for configuring a Raspberry Pi 3B or 4 as a portable, headless, ultra-low latency MIDI synthesizer using the FluidSynth synthesizer.
Raspberry Pi 3B/3B+ (lower power requirement when using a battery bank):
(Discontinued, but still widely available)
Raspberry Pi 4 (2GB+ allows for larger SoundFont options):
USB sound card (required for low latency):
Devices that I have personally tested as working flawlessly, though I'm sure most others also work well:
USB MIDI device
A USB MIDI keyboard, guitar, or perhaps something that you have built yourself?
Download the latest version of Raspberry Pi OS Lite from: https://www.raspberrypi.org/software/operating-systems/
Burn the image to a 4GB+ MicroSD card using Balena Etcher (or other image writer of choice): https://www.balena.io/etcher/
Mount the FAT32 "boot" partition on the card on your computer.
Create an empty file on the root of the drive named "ssh" with no file extension to enable the SSH server.
Create a new text file in the root of the drive named "wpa_supplicant.conf" and save the text below customized to your locale and wireless network:
Boot the Pi. When connected to the network, it should respond at address: raspberrypi.local
Launch PuTTY (or your SSH client of choice) and connect/log-in as username "pi" with password "raspberry".
Run sudo apt update && sudo apt upgrade to upgrade all installed software to current versions.
Run sudo raspi-config, change the default password, configure the device for your locale, and enable console autologin in the boot options.
Run sudo apt install alsa-utils fluidsynth screen to install the required synthesizer packages.
Run cd ~/ && wget https://raw.githubusercontent.com/KOOPInstruments/raspi-synth/master/synth.sh && chmod +x ~/synth.sh to download the headless raspi-synth script, and mark it for execution.
Run nano ~/.bashrc, add the line /home/pi/synth.sh to the end of the file, and press Ctrl-o Ctrl-x to save and quit nano. This will tell the Pi to launch the script automatically on login (which also means launch on boot due to console autologin enabled earlier).
Run cat /proc/asound/cards to get a list of connected sound devices, and take note of the unique sound device name string on the same line as the device number, example in bold: 2 [CODEC ]: USB-Audio - USB AUDIO CODEC.
Run nano ~/synth.sh and edit the line beginning with audioDevice=$ to insert your unique sound device name between the double-quotes in the 'grep' statement. Press Ctrl-o Ctrl-x to save and quit nano.
Run alsamixer press F6 to select your sound card, set the master volume to a reasonable level, and press Esc to exit.
Run sudo reboot and test out your new synthesizer!
Using Different SoundFonts:
Download your General MIDI SoundFont (.SF2) file to the /home/pi/ folder, run nano ~/synth.sh and change the end of the line beginning with screen -dmS FluidSynth0 to modify the path for your SoundFont file name and location, for example: /home/pi/Timbres\ Of\ Heaven\ GM_GS_XG_SFX\ V\ 3.4\ Final.sf2