VST2 speaker arrangement woes

DSP, Plugin and Host development discussion.
Post Reply New Topic
RELATED
PRODUCTS

Post

So I'm writing the VST2 wrapper for my plugin can change between mono and stereo.

When the user changes from mono to stereo, fine, I update my speaker arrangements, call setNumInputs, setNumOutputs and issue an ioChanged.

Problem is: processReplacing doesn't get sent the number of channels, so how do you know when the host has started sending you sample data for the new number of channels?

Post

I think there is a check you can do to see if an input is connected. This is what I'm doing through WDL-OL for plugins that support side-chains.

Post

Think I've figured it out. I was using the Vst2Wrapper in the VST3 SDK as a reference, but I think there's a race condition in that, as I don;t beleive you can call setNumInputs/setNumOutputs on the UI thread without synchronising with the audio thread. The approach I've gone for is to call setNumInputs(2)/setNumOutputs(2) once and be done with it. I was not implementing getInputProperties/getOutputProperties properly, but it seems that these can be used to tell the DAW about mono/stereo and if you switch to mono but leave the number of inputs as 2, my assumption is that the DAW will always give you back two channel pointers in each of the inputs and outputs even though it will only use the first channel. Would be interested if anyone thinks that's a bad assumption.

Post Reply

Return to “DSP and Plugin Development”