My processor makes changes to parameter values, and the UI accesses these with onDataExchangeBlocksReceived.
Calling the function setParamNormalized seems to be enough for most hosts. For one major host, though, the UI updates, but the actual state of the controller seems not to change. I found that if I also call performEdit, then everything seems to work. This is shown in the code below.
void PLUGIN_API MyController::onDataExchangeBlocksReceived(
Vst::DataExchangeUserContextID userContextID,
uint32 numBlocks,
Vst::DataExchangeBlock* blocks,
TBool onBackgroundThread
) {
for (auto index = 0u; index < numBlocks; ++index) {
auto dataBlock = toDataBlock(blocks[index]);
for (int n = 0; n < N; n++) {
setParamNormalized(n, dataBlock->param[n]);
performEdit(n, dataBlock->[n]);
}
}
}
Am I doing this correctly? Am I suppose to call beginEdit and endEdit too? Or is that just for hosts?
Do I really need to call restartComponent (kParamValuesChanged);? My plugin appears to run fine without a restart.
Hi,
first of all, you should not use performEdit as this is meant to be used for sending parameter changes to the processor thru the host (which may record the parameter changes for automation).
So you have to call restartComponent (kParamValuesChanged) so that the host can update its cache of parameter values of your plug-in always.
Second, why don’t you send the parameter changes back via the processContext->outputParameterChanges list?
Hi,
Thanks for the response. For some reason, restartComponent is loading all of the parameters. This is problematic because I have, as an example, a kick button that increments another parameter. I’m not using processContext->outputParameterChanges because a popular host doesn’t handle it properly.
Could you share more details about this? What is the host doing, and why do you think it is wrong?
Well, it is a little bit difficult to pin down the exact cause. But when I increase the number of VU meters in again to eight, it leads to the host eventually crashing. I haven’t been able to replicate it with other hosts.
I hope you have notified the developers of the host of this fatal behavior.
The parameter you utilize to modify another parameter is that same parameter utilized for any other purpose within the DSP code? If not, you should not expose that to the host. That would be a solution for the restartComponent case.