Marc Nostromo

A view askew on music technology

That Raspberry Pi Synth

| 17 Comments

So, after all the exposure of the create digital music post, it is high time I added a little bit of background to the Raspberry Pi-MS Korg combo. I really should have done that before I leaked the video anywhere but ho well, timing was also good with the korg announcement.

So, what’s that thing exactly ?

I’ve been, over time, expanding slowly a new framework for writing sound tools. Sequencers, synthesizers, midi processor.. anything. You could see it as my own little supercollider. Within the framework you can code sound modules (oscillators/filters/effects/..), connect them together in a nord modular/reactor fashion and map controls from those modules to midi. The swiss-knife army tool of the trade. With emphasis on portability. Because I’m extremely interested in embedded platforms and odd/cheap units.

The synth demonstrated in this video is just one application of this framework, ported to the Raspberry Pi.

It’s a simple 2 Osc/2 Filter/1 Envelope graph with proper MIDI mapping to correspond to some of the MS-20 controller layout. It’s interesting to see how important and strong the MS-20 legacy still is. I could have done the exact same demo with a MPK mini, but I’m sure it wouldn’t have the impact this one had. The thing about this controller, beside it’s heritage, is that is implies the promise of hours of fiddling and finding unique sounds. It is something you want to bond with and spend time with, much to the opposite of all generic controller most manufacturers do now. Providing a screen-less software back-end to such a controller effectively completes that feeling of being in presence of a physical loving machine.

Porting to the raspberry pi

Compiling for the RPi was the easiest thing ever. Installing the image is super easy and after connecting it to a wired network and enabling sshd from the install menu, it was up and running. I made the mistake at first to try to cross-compile it as I usually do but the toolchain misses a lot of headers and libraries (SDL/ASLA/Jack) and so I reverted to compiling on the board itself which, after a few usual apt-get and selecting a debian build in cmake went as a breeze. It’s super slow when trying to optimise the code (about 30 minutes while on my old mac it takes about 20 seconds) but other than waiting, there was no headache to get a running executable.

Performances

I was eager to test the performance of the RPi. It is a lot cheaper than the Beagleboard, my previous target for linux-based embedded synth, and possibly less performant so I was wondering what would be possible to do with it. Of course the minimum latency is heavily going to depend on what type of synth you’re trying to run and -although the architecture of the synth is pretty simple- the two filters are quite big models so it’s a fairely ‘heavy’ synth. For comparison, I’ve already gathered the maximum number of voices depending on the sample buffer settings for the beagleboard over here.

HDMI out:

My first test was simply to use the ALSA default driver. It won’t accept latencies below 256 samples which isn’t super good but a 6 msecs latency is not that bad. The results are:

  • 512 samples – 4 voices
  • 256 samples – 2 voices
 USB Audio:
Connecting a cheap USB audio also works out of the box
  • 512 samples – 5 voices
  • 256 samples – 4 voices
  • 128 samples – 2 voices
  • 64 samples – 1 voice

Conclusion

The RPi is a very decent plaform and provides a great environment out of the box to develop audio applications. Sure, it won’t be able to support a full polyphonic top of the notch soft synth ala u-He but it has plenty of resources to do a very powerful monosynth, polyphonic cheap synths or trackers (my next effort will be to fully port LittleGPTracker on it).

As such it will surely do some concurrence to the arduino/at mega based world also. It doesn’t have yet the ease of connection to external digital/analog environment as the arduino does but I guess it’s just a matter of time before ladyada & sparkfun rolls simple shields to enable it. The beagleboard stays a also decent contender for bigger project but at the price of the RPi, it’s a steal.

17 Comments

  1. Looks (and sounds) like a great project for Raspberry Pi! Any chance you might make the code available for others to experiment with?

    Thanks.

    • At this point, it is a work in progress so I’m not intending to make the code available. Especially that it is part of a bigger framework and woudn’t necessarily a good starting point. There are other options available (like supercollider, pd or chuck) that should be easily portable and give you the same flexibility.

  2. Wondering if/how getting this will happen. Will you be releasing or selling the synth? It sounds great and your project sounds like a great starting point for others. Would love more info.

  3. Thanks for the info, I am working on a similar project but for the mpk mini, pure data and sooperlooper ;) looking forward for more experimentation!

  4. Pingback: LittleGPTracker on RPi | Marc Nostromo

  5. Pingback: RPi Turbo Update | Marc Nostromo

  6. sorry, maybe stupid question, but how i can install this synth to my pi ? i didnt found any link to image or any receipt where i can get it.
    thank you

    • At this point, it was just a technological demo so there’s indeed no download link. I will release some synth in the future for sure, so keep you eyes peeled.

  7. Hi Marc
    Great work, well beyond my capabilities.
    I wonder, given the relatively low cost of the RPi, have you thought of using one as a sort of master coltroller, to distribute MIDI data to more slave units for increased polyphony/decreased latency?

    Peter

    • Hi Peter,

      Yes.. I do have something like that in mind… and to be honest even a lot broader than just for RPis. I need to write a grand plan on paper from all my thoughts on the subject but it’s definitely going in that direction !

      Cheers
      /M

  8. Pingback: PIANA: Synthesizer บน Raspberry Pi | Raspberry Pi Thailand

  9. Cool project. I would love to see the RasPi used as a headless vst host where the controls are accessed from a browser on a remote central controler. This would save the main DAW computer from over clocking on multiple vst’s

  10. maybe soundtracker?

    or a dos tracker running in dosbox?

    its a pity the onboard audio is so bad
    (hdmi output is useless – I don’t own anything with a hdmi input on it! – the only options seem to be a usb audio interface or maybe to make the raspi generate rf)

  11. Have you tried using Hifiberry? It’s communicating with rPi over the i2s.
    I’m using it as a DAC and it’s so much better that the standard one.

    • I haven’t so far. I’m using a cheap usb audio adapter and it seem to do what I need to. I’ll keep it in mind though, thanks !

Leave a Reply

Required fields are marked *.