Search code examples
vstjuce

Control Host playback from JUCE audio VST plugin


I am trying to find a way to control the playback position / tempo of a VST Host from a VST plugin build with JUCE.

I am not sure if this is possible.

I found a setPlayHead function on the AudioProcessor, and i think this might be what i am looking for.

https://www.juce.com/doc/classAudioProcessor#a9015f8476c07b173e3c9919b3036339d

But on the doc of the setPlayHead i am reading this:

Tells the processor to use this playhead object.

So can anybody tell me if this is supposed to mean that the new AudioPlayHead that is set on the AudioProcessor will be used for the Hosts playback (z.b. Cubase), or does it mean that only the AudioProcessor of my VST plugin will use this AudioPlayHead, and the AudioPlayHead of the Host remains unaffected)

Thanks for any help / input on this.


Solution

  • A sequencer cannot be controlled by a VST plugin in this way. The VST API doesn't allow for anything like this. The method you've found is actually part of the Juce API which allows a sequencer to pass a playhead structure to a plugin.

    To be fair, there is no technical reason that a plugin couldn't do this. The host would have to supply an unofficial custom opcode and an associated canDo for the feature. However, it would not be part of the VST standard, and would only work for that specific host.

    As far as I know, no major VST host (including Ableton Live, Cubase, etc) has a mechanism to allow this. Thinking from the host's standpoint, it would be a bit crazy to provide such a mechanism. Just imagine multiple plugins trying to stop/play the host's playback at the same time!

    So yeah, sorry, but this is not really possible in the way that you are thinking. However, it would be possible for a VST plugin to control the host's tempo (but not playback state) via Ableton Link. Since Link works over a local network socket, and doesn't have any concept of master/slave, a VST plugin could theoretically send tempo changes to the host in this manner.

    Right now (where "now" == September 2016), Ableton Live is the only sequencer which supports Link, but Ableton has said that they are working with other companies to help them add support for Link, so I wouldn't be surprised if more sequencers start to add Link support in the near future.