Controlling external software synths with MIDI


Is it possible to control external synth’s from sonic pi? I know you can send midi notes, but I am wondering if it’s possible to control a synths ADSR or any other knob/slider from Sonic Pi?

I’d be trying this out in ableton using the omnisphere 2 vst synth.

Thanks for the help!


Hi there,

which external synth(s) are you trying to control, and what API(s) do they support (i.e. OSC/MIDI)?

I’m trying to control Omnisphere 2 and it supports midi

Thanks, Sam!!

Which OS are you running?

I’m using apple, osx yosemite on a macbook pro.
And am using Ableton for my daw

Ok, then you just need to enable the built-in virtual loopback midi port to let you send midi from Sonic Pi to another app :slight_smile:


A quick google turned up this which may help:

I got things set up and it’s all working! Midi CC messages and all.

An infinite amount of thanks to you, Sam!


Fab stuff - I love the video :slight_smile:

Btw- top tip - if you find yourself combining in_thread and loop chances are you’ll be better off just using a live_loop instead!


I’ve been playing with the super donate-ware synth HELM with Sonic Pi 3 on my Mac. Here is a video showing two parameters (volume and bpm) of the synth being controlled. Any of the other knobs and sliders can be controlled in a similar manner. Links to the code shown in the text below the video.


Thanks, Robin! You have had the answers to all my questions

1 Like

Hi all—I’m sending MIDI via Sonic Pi (3.1.0) to Logic Pro (10.4.4) in order to control some software synths.

  • I have four live loops playing MIDI notes, each sending over the same port, but on its own channel (1–4 respectively), using the “channel: [x]” opt.
  • In Logic, I have four independent tracks receiving MIDI via a corresponding MIDI channel (1–4).

However, each track in Logic is receiving all MIDI regardless of the channel that I’ve specified in the track’s Inspector—that is, instead of each track receiving only one note message, it receives all four.

  • For example, Sonic Pi is playing a :c4 on MIDI channel 1, but instead of being received on only Track 1 in Logic, that :c4 is sounding on all four tracks. I only have Channel 1 selected as the MIDI channel for Track 1 in Logic, and Channel 2 for Track 2, etc.

Is this an issue with Sonic Pi or Logic?

Hi there,

by default Sonic Pi’s midi function sends a MIDI event to all connected MIDI devices on all channels. This makes it very easy to get things working in simple cases. However, for more sophisticated uses, such as the one you’re describing where you’re working with multiple MIDI streams it clearly is an issue.

The solution to this is to use the port: and channel: opts to midi to restrict the outgoing messages to just a specific MIDI port and channel:

midi :e1, sustain: 0.1, port: "moog_minitaur", channel: 1

Hope that this helps.

Thanks Sam. As mentioned in my prior post, I’m already employing the “channel” (and even “port”) opts to specify individual MIDI channels. That said, in Logic, I’m still receiving MIDI data on all channels despite also specifying channels within that environment. I don’t know if it’s a Sonic Pi or Logic issue.

You could use something like Midi Monitor (i believe it’s Mac only, but there are probably other options for other OSes if necessary) to check what MIDI is actually being sent, which should help determine where the problem comes from.

A rather late answer to jkbrogan’s post from Feb '19:
It’s a Logic Pro issue, not one of Sonic Pi: By default, Logic ignores the midi channel you specify to a track. However, you can change this: Project Settings > Recording > “Auto demix by channel if multitrack recording.” I’m afraid, you are supposed to do that newly for each project. But once this is done for your project you’re free to use all of Logic’s sounds simultaneaously, one instrument of the orchestra for each midi channel you set in your Sonic Pi code.