Raspberry Pi Plays A MIDI Tune Wherever You May Roam

MIDI controller keyboards are great because they let you control any synthesizer you plug them into. The only downside: you need a synthesizer to turn MIDI notes into actual sounds, slightly complicating some summer night campfire serenading. Not for [Geordie] though, who decided to build the nanoPi, a portable, MIDI instrument housing a Raspberry Pi.

Using a Korg nanoKEY2 USB MIDI controller as base for the device, [Geordie] took it apart and added a Raspberry Pi Zero W, a power bank to, well, power it, and a USB hub to connect a likewise added USB audio interface, as well as the controller itself. As the nanoKEY2 has a naturally slim shape, none of this would ever fit in it, so he designed and 3D printed a frame to extend its height. Rather than wiring everything up internally, he decided to route the power and data cable to the outside and connect them back to the device itself, allowing him to use both the power bank and the controller itself separately if needed.

On the software side, the Pi is running your common open source software synthesizer, Fluidsynth. To control Fluidsynth itself — for example to change the instrument — [Geordie] actually uses the Termius SSH client on his phone, allowing him also to shut down the Pi that way. While Fluidsynth’s built-in MIDI router could alternatively remap the nanoKEY2’s additional buttons, it appears the functionality is limited to messages of the same type, so the buttons’ Control Change messages couldn’t be remapped to the required Program Change messages. Well, there’s always the option to fit some extra buttons if needed. Or maybe you could do something clever in software.

As you may have noticed, the nanoPi doesn’t include any speaker — and considering its size, that’s probably for the best. So while it’s not a fully standalone instrument, it’s a nice, compact device to use with your headphones anywhere you go. And thanks to its flexible wiring, you could also attach any other USB MIDI controller to it, such as this little woodwind one, or the one that plays every pop song ever.


One thought on “Raspberry Pi Plays A MIDI Tune Wherever You May Roam

  1. Very nice! A beautiful build. Hmm, my NanoKEY had a couple of the plastic keys break — if other parts around it were 3d printed, replacing those mightn’t be as odd.

    Fluidsynth is pretty flexible, but in my experience needs quite a bit of extra software plumbing to make it work well headless. I have a Pi-based setup that is meant to turn my various MIDI controllers into basic synths, and Fluidsynth works great in that context, but I had to write various scripts and services to handle connecting the controllers to it and switching instruments.

    If you want more experimental synthesizering than just Fluidsynth, though, you could do this but replace Fluidsynth with Orac, a modular synth setup originally for the Critter & Guitari Organelle — see https://community.blokas.io/t/orac-2-0-for-the-raspberry-pi/1099 . You can assemble chains of modules, including implementations of some of the Mutable Instruments Eurorack modules, and have multiple synths running at once; the demo preset is a synth on MIDI channel 1, a sampler on channel 2, with a drum machine in the background. The drawbacks are that it needs extra sound hardware to sound good (the internal Pi audio is pretty noisy), and it’s a lot more complicated to get music out of; you do need to build patches, though once assembled, they can be controlled entirely by MIDI CCs. It looks as though someone wrote a web interface to it while I wasn’t paying attention, so the barrier of needing something to control it running Pure Data or Lemur is gone.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.