Receive OSC messages in a VST plugin?

I’m wondering if it is possible in JUCE 8 for a softsynth implemented as a plugin to also receive osc input?

And if so, is that limited to a non-audio thread? (I would assume yes?)
thanks!

Yes, it is possible. At least the Surge XT synth does that.

The OSC messages arrive optionally either in the main/GUI thread or in a dedicated thread with the Juce OSC receiver, so you have to come up with some mechanism to make those messages affect the audio processing thread safely.

Thanks, that’s great to know. Do you know if Juce provides classes for such interthread communication or do people add their own ringbuffered queues and so on?

And do you know whether this works in all hosts? I’ve done a fair bit of audio hacking, but limited JUCE, and none on VST plugins, so am not clear whether a VST plugin can get direct access to the local network ports. I guess I’ll look into Surge’s implementation. Thanks for this!

Juce has the AbstractFifo class but it’s not IMHO the most convenient to use, there’s a more easily usable one for example in the choc library :

Some hosts like Logic may be doing more extensive sandboxing of the plugins that could prevent things like networking from working but I don’t know the details about that. I would say it’s a safe bet not to make your plugin depend heavily on it being able to deal with OSC messages and rather consider that only as an optional extra feature.

1 Like