Plog App Admin
Dashboard
Plogs
Entries
Back to Site
Edit Entry
Plog
Hitachi MQ-25
USB MIDI Host
Yamaha Dx7 Resto
Jasper Synth
FluidSynth on Pi Zero
Title
IsLearning
Slug
URL-friendly name (e.g., "my-entry-title")
Content
<p class="whitespace-pre-wrap break-words">A Raspberry Pi 3 is a great choice for building a USB MIDI host. Here's how to set it up:</p> <h2 class="text-xl font-bold text-text-100 mt-1 -mb-0.5">Hardware Setup</h2> <ol class="[&:not(:last-child)_ul]:pb-1 [&:not(:last-child)_ol]:pb-1 list-decimal space-y-1.5 pl-7"> <li class="whitespace-normal break-words">Raspberry Pi 3</li> <li class="whitespace-normal break-words">MicroSD card (at least 8GB)</li> <li class="whitespace-normal break-words">Power supply (2.5A recommended)</li> <li class="whitespace-normal break-words">Case (optional but recommended)</li> <li class="whitespace-normal break-words">USB hub (if you need more than 4 USB connections)</li> </ol> <h2 class="text-xl font-bold text-text-100 mt-1 -mb-0.5">Software Installation</h2> <ol class="[&:not(:last-child)_ul]:pb-1 [&:not(:last-child)_ol]:pb-1 list-decimal space-y-1.5 pl-7"> <li class="whitespace-normal break-words">Flash Raspberry Pi OS Lite to your SD card (lighter OS since we don't need a GUI)</li> <li class="whitespace-normal break-words">Boot up the Pi and complete initial setup</li> <li class="whitespace-normal break-words">Update the system: <div class="relative group/copy rounded-lg"> <div class="sticky opacity-0 group-hover/copy:opacity-100 top-2 py-2 h-12 w-0 float-right"> <div class="absolute right-0 h-8 px-2 items-center inline-flex"> <div class="relative"> </div> </div> </div> <div class=""> <pre class="code-block__code !my-0 !rounded-lg !text-sm !leading-relaxed"><code>sudo apt update sudo apt upgrade</code></pre> </div> </div> </li> <li class="whitespace-normal break-words">Install required packages: <div class="relative group/copy rounded-lg"> <div class="sticky opacity-0 group-hover/copy:opacity-100 top-2 py-2 h-12 w-0 float-right"> <div class="absolute right-0 h-8 px-2 items-center inline-flex"> <div class="relative"> </div> </div> </div> <div class=""> <pre class="code-block__code !my-0 !rounded-lg !text-sm !leading-relaxed"><code>sudo apt install alsa-utils amidiauto</code></pre> </div> </div> </li> </ol> <h2 class="text-xl font-bold text-text-100 mt-1 -mb-0.5">MIDI Host Configuration</h2> <ol class="[&:not(:last-child)_ul]:pb-1 [&:not(:last-child)_ol]:pb-1 list-decimal space-y-1.5 pl-7"> <li class="whitespace-normal break-words">Install the ALSA MIDI utilities: <div class="relative group/copy rounded-lg"> <div class="sticky opacity-0 group-hover/copy:opacity-100 top-2 py-2 h-12 w-0 float-right"> <div class="absolute right-0 h-8 px-2 items-center inline-flex"> <div class="relative"> </div> </div> </div> <div class=""> <pre class="code-block__code !my-0 !rounded-lg !text-sm !leading-relaxed"><code>sudo apt install alsa-utils</code></pre> </div> </div> </li> <li class="whitespace-normal break-words">Install amidiauto for automatic MIDI connections: <div class="relative group/copy rounded-lg"> <div class="sticky opacity-0 group-hover/copy:opacity-100 top-2 py-2 h-12 w-0 float-right"> <div class="absolute right-0 h-8 px-2 items-center inline-flex"> <div class="relative"> </div> </div> </div> <div class=""> <pre class="code-block__code !my-0 !rounded-lg !text-sm !leading-relaxed"><code>sudo apt install amidiauto sudo systemctl enable amidiauto sudo systemctl start amidiauto</code></pre> </div> </div> </li> <li class="whitespace-normal break-words">Create a custom udev rule for your MIDI devices: <div class="relative group/copy rounded-lg"> <div class="sticky opacity-0 group-hover/copy:opacity-100 top-2 py-2 h-12 w-0 float-right"> <div class="absolute right-0 h-8 px-2 items-center inline-flex"> <div class="relative"> </div> </div> </div> <div class=""> <pre class="code-block__code !my-0 !rounded-lg !text-sm !leading-relaxed"><code>sudo nano /etc/udev/rules.d/99-midi.rules</code></pre> </div> </div> Add: <div class="relative group/copy rounded-lg"> <div class="sticky opacity-0 group-hover/copy:opacity-100 top-2 py-2 h-12 w-0 float-right"> <div class="absolute right-0 h-8 px-2 items-center inline-flex"> <div class="relative"> </div> </div> </div> <div class=""> <pre class="code-block__code !my-0 !rounded-lg !text-sm !leading-relaxed"><code>SUBSYSTEM=="usb", ACTION=="add", ATTRS{idVendor}=="xxxx", ATTRS{idProduct}=="yyyy", RUN+="/usr/local/bin/midi-connect.sh"</code></pre> </div> </div> (Replace xxxx/yyyy with your device IDs, which you can find using <code class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]">lsusb</code>)</li> <li class="whitespace-normal break-words">Create the connection script: <div class="relative group/copy rounded-lg"> <div class="sticky opacity-0 group-hover/copy:opacity-100 top-2 py-2 h-12 w-0 float-right"> <div class="absolute right-0 h-8 px-2 items-center inline-flex"> <div class="relative"> </div> </div> </div> <div class=""> <pre class="code-block__code !my-0 !rounded-lg !text-sm !leading-relaxed"><code>sudo nano /usr/local/bin/midi-connect.sh</code></pre> </div> </div> Add basic connection logic (this is a simplified example): <div class="relative group/copy rounded-lg"> <div class="sticky opacity-0 group-hover/copy:opacity-100 top-2 py-2 h-12 w-0 float-right"> <div class="absolute right-0 h-8 px-2 items-center inline-flex"> <div class="relative"> </div> </div> </div> <div class="text-text-500 text-xs p-3.5 pb-0">bash</div> <div class=""> <pre class="code-block__code !my-0 !rounded-lg !text-sm !leading-relaxed"><code class="language-bash"><span class="token shebang">#!/bin/bash</span> <span class="token">sleep</span> <span class="token">2</span> aconnect -l aconnect <span class="token">20</span>:0 <span class="token">128</span>:0 <span class="token"># Connect device to device (IDs will vary)</span></code></pre> </div> </div> </li> <li class="whitespace-normal break-words">Make the script executable: <div class="relative group/copy rounded-lg"> <div class="sticky opacity-0 group-hover/copy:opacity-100 top-2 py-2 h-12 w-0 float-right"> <div class="absolute right-0 h-8 px-2 items-center inline-flex"> <div class="relative"> </div> </div> </div> <div class=""> <pre class="code-block__code !my-0 !rounded-lg !text-sm !leading-relaxed"><code>sudo chmod +x /usr/local/bin/midi-connect.sh</code></pre> </div> </div> </li> </ol> <h2 class="text-xl font-bold text-text-100 mt-1 -mb-0.5">Advanced Setup (Optional)</h2> <p class="whitespace-pre-wrap break-words">To make it more user-friendly, you could:</p> <ol class="[&:not(:last-child)_ul]:pb-1 [&:not(:last-child)_ol]:pb-1 list-decimal space-y-1.5 pl-7"> <li class="whitespace-normal break-words">Install web-based MIDI routing with Node.js: <div class="relative group/copy rounded-lg"> <div class="sticky opacity-0 group-hover/copy:opacity-100 top-2 py-2 h-12 w-0 float-right"> <div class="absolute right-0 h-8 px-2 items-center inline-flex"> <div class="relative"> </div> </div> </div> <div class=""> <pre class="code-block__code !my-0 !rounded-lg !text-sm !leading-relaxed"><code>curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash - sudo apt install nodejs</code></pre> </div> </div> </li> <li class="whitespace-normal break-words">Create a simple web interface to control connections using a framework like Express</li> <li class="whitespace-normal break-words">Set up headless boot and WiFi for remote access</li> </ol>
External Link 1
External Link 1
Back to List