Hi friends,
I ran into a Touch automation problem with a VST3 plug-in in Reaper (Windows and macOS) and thought I’d write it up in case it helps someone else. Our plug-in mirrors parameters of a networked hardware device, so changes arrive on a network thread, and I was calling beginChangeGesture(), setValueNotifyingHost() and endChangeGesture() straight from there. Write mode recorded fine, but in Touch mode the envelope followed my movements for a few ms and then jumped back to its initial value. The AU build was fine.
It turns out the VST3 wrapper only forwards beginEdit/endEdit on the message thread, and values set from other threads go out via outputParameterChanges without a gesture, so Touch never engages. Apparently, this is in accordance with the VST3 spec, and has been that way for a while now.
Moving my calls to the message thread fixed it.
What I couldn’t find is any mention of this in the docs. setValueNotifyingHost, beginChangeGesture and endChangeGesture don’t mention threads, and the AudioProcessorParameter::Listener docs even note that many processors change parameters and start gestures during their audio callback. The call is dropped silently, and the AU, AAX, VST2 and LV2 wrappers don’t filter by thread, so behaviour differs per format. The explanation only turned up in the wrapper source and an older thread.
Could the docs mention the VST3 requirement on those three functions? A debug-only warning when the wrapper drops a gesture would be nice too, along the lines of the assert JUCE already has for hosts calling setState off the UI thread.
Cheers,
B.