Entry Details

Plog
USB MIDI Host
Title
Raspberry Pi MIDI Host
Is Mini
True
Slug
raspberry-pi-midi-host
Content

A Raspberry Pi 3 is a great choice for building a USB MIDI host. Here's how to set it up:

Hardware Setup

  1. Raspberry Pi 3
  2. MicroSD card (at least 8GB)
  3. Power supply (2.5A recommended)
  4. Case (optional but recommended)
  5. USB hub (if you need more than 4 USB connections)

Software Installation

  1. Flash Raspberry Pi OS Lite to your SD card (lighter OS since we don't need a GUI)
  2. Boot up the Pi and complete initial setup
  3. Update the system:
     
    sudo apt update
    sudo apt upgrade
  4. Install required packages:
     
    sudo apt install alsa-utils amidiauto

MIDI Host Configuration

  1. Install the ALSA MIDI utilities:
     
    sudo apt install alsa-utils
  2. Install amidiauto for automatic MIDI connections:
     
    sudo apt install amidiauto
    sudo systemctl enable amidiauto
    sudo systemctl start amidiauto
  3. Create a custom udev rule for your MIDI devices:
     
    sudo nano /etc/udev/rules.d/99-midi.rules
    Add:
     
    SUBSYSTEM=="usb", ACTION=="add", ATTRS{idVendor}=="xxxx", ATTRS{idProduct}=="yyyy", RUN+="/usr/local/bin/midi-connect.sh"
    (Replace xxxx/yyyy with your device IDs, which you can find using lsusb)
  4. Create the connection script:
     
    sudo nano /usr/local/bin/midi-connect.sh
    Add basic connection logic (this is a simplified example):
     
    bash
    #!/bin/bash
    sleep 2
    aconnect -l
    aconnect 20:0 128:0  # Connect device to device (IDs will vary)
  5. Make the script executable:
     
    sudo chmod +x /usr/local/bin/midi-connect.sh

Advanced Setup (Optional)

To make it more user-friendly, you could:

  1. Install web-based MIDI routing with Node.js:
     
    curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
    sudo apt install nodejs
  2. Create a simple web interface to control connections using a framework like Express
  3. Set up headless boot and WiFi for remote access
External Link 1
External Link 2
Edit Back to List