Setup a Raspberry Pi as a headless MIDI USB host, with auto-connection and MIDI merging of all sources.
Tested with a RPi 3B and Zero 2W, but should work with any model. MIDI Bluetooth will only work on model 3/4 and Zero 2W as earlier models don't have an onboard bluetooth chip (though it might be possible to used an external BT dongle).
- Download latest Raspberry Pi OS lite image and install it on your SD card with Raspberry Pi Imager
- Create a new file named
ssh
in/boot
folder of the SD card to enable SSH access. - SSH to your RPi with
ssh pi@<IP_ADDRESS>
(default password israspberry
) - Run this command:
bash <(curl -Ls https://raw.githubusercontent.com/sinedied/pi-midi-host/main/setup.sh)
- Reboot
Note: the filesystem is switched to read-only at the end of the setup, to avoid SD card corruption when powering off. To switch it back on and off, use the
rw
andro
commands.
Use these alias to quickly manage your midi setup:
midi
: show connected midi devicesconnect
: reconnect all midi devices
- Disable SSP mode (if needed):
sudo hciconfig hci0 sspmode 0
- Turn on your bluetooth device and put it in pairing mode
- Run
sudo bluetoothctl -a
default-agent
pair <BT_ADDRESS>
trust <BT_ADDRESS>
to allow auto reconnectionconnect <BT_ADDRESS>
if connection did not workexit
You can SSH to the device without knowing its IP address using ssh [email protected]
after initial setup.
Most of this work was based on instructions from this post.
Additions:
- All-in-one script to setup a new Pi
- MIDI in/out filters for specific devices
- Bluetooth device connection instructions
- Commands aliases
- Drivers for M-Audio MIDISPORT 2x2