In the case of a host generic UI for a plugins parameters, if setParamNormalized is called, some plugins will only update their UI and not the internal sound engine. So, it seems the correct way is to always queue parameter changes for dispatch in the audio thread instead, even when these changes are UI thread edits.
If that’s the case what is the purpose of setParamNormalized on the editcontroller? Should a host ever call this, and for what?
(I do hope the answer is not the host is supposed to call this as well as dispatching parameter changes in the audio thread… surely the plugin is responsible to manage its own internal state and reflect this back to its own view. The view should be a black box to the host imo)
You call IEditController::setParamNormalized if you change the parameter on the host side, for example when automating parameters, or when providing your own controls for the plug-in parameters like a generic editor.
Ok, that is what I expected. But as explained, some plugins (kilohearts is a known example) will not update their sound engine when this is called.
(a) in the implementation of a generic editor, the host should call this AND queue parameter change events in the audio thread
(b) plugins such as kilohearts are buggy
Could you please clarify if A or B is correct? Im not clear on what the correct implementation is.
(a) is the correct way. The host is always responsible for queuing realtime parameter changes and provide these changes to the IAudioProcessor in the process call.
There are some bad designed plug-ins that shares their parameter state in the edit controller and audio processor, thus they may work if you just set the parameter of the edit controller, but this is wrong.
The normal way for plug-ins is that they call the host when a parameter is changed in the UI thread via IComponentHandler::beginEdit/performEdit/endEdit. The host then sends these changes via IParameterChanges to the IAudioProcessor in the IAudioProcessor::process call.
If a host implements a generic editor, the host has to send the parameter changes to the audio processor via IParameterChanges in the IAudioProcessor::process call, and also to the edit controller via IEditController::setParameterNormalized.
So if the host automates the plugin, its also supposed to update its view with setParameterNormalized as well?
Yes, the host should synchronize the UI (Controller part) with setParameterNormalized.
Note that a Host has to compensate the delay between the time the parameter changes are send to the AudioProcessor (which are processed in advance compared to the audio which is hearable at the speakers) and the Controller (which shows the state of audio hearable at speakers).