Headless Pi Synth

Categories: Development, News

I’ve put together a headless implementation of FluidPatcher that works on a Raspberry Pi without the need for any extras (i.e. buttons/screens) by polling for specific CC messages to change patches. Just another way people can try out the code and come up with their own use cases. I like to think of someone just dropping a caseless Pi on the stage at a show and plugging a long headphone cable from it to the mixer – punk AF.

  • Hi,

    very good software,

    but my problem is that i can only hear channel 1.
    when i change to channel 2 i hear nothing
    maybe because i do not know
    how to find the right values for
    for my keyboard, an M-Audio Keystation 61 MKIII ?
    can anyone help me?

    Thank you

    • Thanks, Michael! You’re not hearing anything when you switch to MIDI channel 2 because there are no instruments assigned to play on that channel. The idea is to leave your keyboard playing on MIDI channel 1, then switch between the patches defined in the bank0.yaml file by sending control change (CC) messages. Looks like you can set up the Keystation to send momentary CC messages when you press the octave +/- buttons – see the screencap from the manual below.
      Alternatively, you could assign a soundfont to each MIDI channel by replacing bank0.yaml with something like the text below, but then you’re limited to 16 different sounds. Check the wiki (https://github.com/albedozero/fluidpatcher/wiki/Bank-Files) for info on structuring bank files.

          1: VintageDreamsWaves-v2.sf2:000:001
          2: VintageDreamsWaves-v2.sf2:000:002
          3: VintageDreamsWaves-v2.sf2:000:003
          4: VintageDreamsWaves-v2.sf2:000:004
          5: VintageDreamsWaves-v2.sf2:000:005
          6: VintageDreamsWaves-v2.sf2:000:006
          7: VintageDreamsWaves-v2.sf2:000:007
          8: VintageDreamsWaves-v2.sf2:000:008
          9: VintageDreamsWaves-v2.sf2:000:009
          10: VintageDreamsWaves-v2.sf2:000:010
          11: VintageDreamsWaves-v2.sf2:000:011
          12: VintageDreamsWaves-v2.sf2:000:012
          13: VintageDreamsWaves-v2.sf2:000:013
          14: VintageDreamsWaves-v2.sf2:000:014
          15: VintageDreamsWaves-v2.sf2:000:015
          16: VintageDreamsWaves-v2.sf2:000:016

  • Hi!
    Your headlesPI synth seems to me the best hardwaresolution for impementing in my gitanova-project. Unfortunately I know nothing about PI, linux, …
    I did all my projects so far on ESP32 in C++
    Is there any way to use a PI-Zero /512 MB no Wifi?
    How long would it take fom Power-on till redy-to-play?
    Could you possibly provide me with a micro-sd card wich I could put into the sd-slot of a factory-new PI-zero (I have my own SF2-files which I would like to put on the sd-card too)..
    Could you send such a sd-card with all the software to my adress in Austria? I would be very interested!!!
    Best regards

    • Hi Michael – This works fine on the Pi Zero, but there is a little more latency since the processor isn’t as fast. The drawback is there is no built-in headphone jack, so you’ll need a USB sound card, or with considerable effort you can add a headphone jack yourself as described in this article: https://learn.adafruit.com/adding-basic-audio-ouput-to-raspberry-pi-zero. The drawback of having no wi-fi is you’ll have to plug in a screen and keyboard if you want to add soundfonts or make changes to the banks. It seems impractical to send you an SD card, as the amount software added on to the basic “Raspberry Pi OS Lite” image (find at https://www.raspberrypi.org/downloads/raspberry-pi-os/) to run the synth is pretty minimal – but if you’re trying to learn about the Pi a good place to start is Adafruit’s Lessons: https://learn.adafruit.com/search?q=raspberry%2520pi%2520lesson%25201. I’m working on a script that can do all the setup for you once you have the basic image installed – if I get it working I’ll update the video description with a link.

  • Cool project! Thanks for making it available! Would this work on a Pi 2? (I have a few of those collecting dust.) If so, would latency be an issue? I want to use this with an old M-Audio KeyStation Pro 88. Ideally, I’d like to be able to assign various voices to the buttons on the controller. In a nearly perfect world, I’d be able to press and hold a button then tap it to cycle thru sound fonts, long-pressing again. In a really perfect world, the Pi would send messages to the controller’s LCD to display the mode, assigned voice, etc.

    • I’ll go out on a limb and say it will work on a Pi 2 – I’ve gotten it working on the Pi Zero with only a shade of latency, and the Pi 2 has roughly the same clock speed and 4 cores. I think my first prototype actually ran on a Pi 2 as well, but it’s been a bit.
      I’m about to release a new version of the software that includes tools in the API to link control change messages (CCs) to various functions like changing patches, toggling effects, etc. Not sure if you’d be able to talk to the controller’s LCD via MIDI, however – some of them might listen to SYSEX messages or something, but that would be complicated.

  • I am trying to install and use the headlesspi but gets error when trying to run it.
    This is the result when running headlesspi.py.

    Traceback (most recent call last):
    File “headlesspi.py”, line 12, in
    import patcher
    File “/home/pi/fluidpatcher/patcher/__init__.py”, line 18
    VERSION = 0.3.1
    SyntaxError: invalid syntax

    Can anyone help me?

    • Ha – you caught my mistake! 🙂 The version should be enclosed in quotes to be a string, otherwise python tries to interpret it as a decimal. It’s fixed in the latest release. Thanks!

  • Would it be possible : Controlling fluidsynth via hardware midi knobs
    (for example with an arduino as a midi controller which works like QSynth)

    • Yes, but the exact method depends on what you want to do. It sounds like maybe you want to control the reverb and chorus parameters in FluidSynth using hardware knobs, like the QSynth GUI? Are you thinking of building something from scratch, or do you have a DIY Arduino MIDI controller that you are hoping to use?

      • I want to build a box from scratch with a LCD-Display
        and a Rotary-Encoder with Push-Button
        to display availible Soundfont-Files, choose one ,then
        display the instruments of the choosen Soundfont-File
        and then choose a Instrument to play on my midi-Keyboard.

        In the second step i want to control the reverb parameters
        in Fluidsynth with hardware knobs like the QSynth

        Arduino was my first idea. Maybe there are better solutions?

        • Just to be clear – Fluidsynth can’t run on the Arduino. You could connect the buttons, knobs, and/or encoders to an Arduino, and then have it communicate with FluidSynth running on a Raspberry Pi or other computer – probably using a serial port connection. However, you can also connect buttons and encoders directly to the Pi’s GPIO pins. Potentiometers won’t work because the Pi doesn’t have analog inputs, but buttons and rotary encoders work just fine. You could build something from scratch almost exactly like the SquishBox that would do what you’re thinking (my hackaday instructions might help), you’d just add more hardware buttons and modify the fluidpatcher code a bit. I use the SquishBox to control reverb parameters by just mapping them to sliders on my MIDI controller.

  • Hi there, I have installed the headless pi synth on my rpi3 and it’s working well but certain keys are not playing notes for example “enter”, “data” and “0” keys.

    Any idea what might be the issue and how to fix it?

    Thanks a lot

    • What model of keyboard are you using? Those keys you listed sound like they might be used for data entry when you’re in some kind of edit mode. There’s probably an “edit” or “cancel” button somewhere that you need to press to get out of edit mode.

    • ok so I pressed some key combinations on the MIDI and it’s working now 😀. Thanks for putting together everything.

  • hello I have a Raspberry Pi4 with 2GB RAM and I would like to connect it to my ROCKJAM mod RJ461 but it doesn’t have a MIDI port and only the following inputs 1) Micro SD card slot 2) USB input (MP3 playback) 3) MIC input, 4) Input AUX headphone output, 5) DC input, as I said for the MIDI input you should create a circuit to be mounted inside it because inside it already has its tracks on the electrical circuit, best regards Roberto Zora

    • I don’t think there’s an easy way to do this. If this picture is the same as the back of your keyboard it looks the MIDI space is a cutout for a USB-B jack. My guess is that your keyboard’s printed circuit board (PCB) has a couple of pads that provide a serial MIDI signal. A lot of additional components are needed to convert this to a USB signal – that’s probably why they left it empty.
      You might be able to wire a USB <-> MIDI converter cable to these spots on the keyboard’s PCB and get it to work. If you have a picture of the PCB or a link to the manual I might be able to make a better guess 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *

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