Make a MIDI Synthesizer out of a Raspberry 🎶

Hi there !

I just transformed a setup I had from Raspbian to Balena OS, and took the opportunity to make it a bit more generic and published it on balena hub : balenaHub: an easier way to find and publish fleets and projects for edge devices

The goal is to have something that requires little to no configuration that you can plug your MIDI device on one side, your headphone on the other and start playing your instrument.

The requirements:

  • Automatically setup and start a synthesizer (with a default sound fonts so that you can start playing right away - and small enough to not have to download too much to get started)
  • Automatically detect when MIDI input devices are plugged in and connect those to the Synthesizer
  • Make a sound when everything is ready :notes:

The Hardware:

The software:

  • audio: I’m using pulseaudio from the balena audio block
  • Synthesizer: the project is using FluidSynth It’s easy enough to setup and supports sf2 and sf3 sound fonts
  • Fluidsynth Webapp a web interface you can access with the public url to see and change the sound font instrument to use
  • MIDI Synthesizer Autoconnect: a tool I wrote that detect (using the ALSA Seq API) new MIDI inputs and connect them to the synthsizer

And with all that I can use my MIDI keyboard effortlessly :slight_smile:


Nice to have / next experiments:

  • someway to download popular sound font easily or add your own
  • compile MIDI Synthesizer Autoconnect as wasm to run it on top of a wasm runtime. would makes it easier to support more arch and should makes a smaller image (might be done by compiling into a static binary too but it’s less fun)

If you want to test it, here you go:

balena deploy button

I’d be happy to hear if it’s working nicely with other hardware and what anyone thinks could be improved

1 Like

Nice work @mathroc - wow!