Sonic Pi Midi Box Controller

Hi, I read the tutorial (and browsed through the forum) but something wasn’t immediately apparent to me…

I am hoping to make my MIDI instrument, based on a Raspberry Pi3. It will hopefully have a keyboard (piano keys) and sliders and dials/knobs.

I was hoping to run a synth (such as Sonic Pi) that can play both generated-sounds and pre-recorded samples; who’s parameters and values can be tweaked by the MIDI controller (eg: the dials and sliders would affect sustain/amp/echo etc) and the key-presses would alter something akin to the pitch velocity parameter. It seems that Sonic Pi has some great features that would be well suited to this and the ability for fine-control of each sound.

Is this something that can be done with Sonic Pi or am I right in thinking that all input has to be typed as code? If it accepts typed commands only, I presume I would need the MIDI controller to pass code strings to the GUI somehow, from a script.

Also, here is a link to some great free samples (in various categories) which people here may find useful…

Thank you.

Hi @veganpete,

It is definitely possible: Sonic Pi can receive and send both MIDI and OSC messages.
(See and if you haven’t already).
I have never used this feature myself (so someone else will no doubt have more knowledge about it) but here is a possibly relevant example: Polyphonic gated synth for Sonic Pi 3, works on a Pi3

1 Like

Also, Free Sample Libraries.... whats out there is a perfect place for that free samples link - feel free to add it there in the first post :+1:

I was going to reply to this but Ethan beat me to it, with an example that I wrote for a midi keyboard input. I would just add that I find using OSC input particularly from the app TouchOSC is a very convenient way to let you control Sonic Pi, and I have published quite a lot of examples of this both on youtube and on my blog that may give you some ideas. The TouchOSC app is available for android and Mac ios and is very modestly priced.

1 Like

Thanks, I had seen that post but unfortunately I can’t add it there, as it’s a patrion-only thread. Could someone possibly post it there for me please? Thank you!

Thanks so much! I’ll check it out and hopefully use Sonic Pi in my build

Perfect! Thanks for all the info and links. Truly exciting! :slight_smile: Much appreciated.