views:

170

answers:

3

Hi,

I would like to control the transport (play/stop) of a VST host from within a VST plug-in. It is clear that the sendVstEventsToHost method provides a mean to send commands to the host, but these ones are MIDI, and are said to be attached to the track.

Is it possible? Any idea?

Thanks.

+1  A: 

I don't think it is possible. The VST Plugin specifications are based around audio and midi processing. Controlling the Host is almost not possbile at all. The only exception I can think of is the SetTimeInfo method that allows a plugin to 'request' a new song position. But that method has been marked obsolete in VST 2.4.

You might be able to create a work-around with virtual midi ports and letting the host sync to an external source, which is supplied by your plugin. Haven't thought this through, so not sure it'll work.

obiwanjacobi
A: 

It is definitely not possible. Even though the VST protocol allows plugins to send events to the host, most (if not all?) hosts ignore tempo and song position changes sent to them from plugins.

Although it would be cool to have plugins controlling host tempo and position, like a beat-counting plugin, for instance, this opens the door to lots of potentially nasty side-effects, such as plugins hijacking the host tempo accidentally, or multiple plugins sending conflicting tempo/position changes to the host.

So for this reason, it's not a good idea, and that's why the VST framework doesn't really allow this.

As @obiwanjacobi suggests, the best way to control tempo of a host is via MIDI, which requires writing a virtual MIDI device. Unfortunately that will not let you control host transport, as there is no (non-sysex) MIDI protocol message for doing this.

Nik Reiman
+1  A: 

A quick look at the SDK reveals opcode "audioMasterSetTime", which can set the host tempo etc. So the answer is yes. The bad news is few hosts support it - Bidule being the only one I know of.

Jeff McClintock