Hi Jules,
I am working on an Audio Plugin for Pro Tools 12 and have encountered some weird error that resets parameter values to 1.
I suspected setParameter() or setParameterNotifyingHost(), and it turns out that setParameterNotifyingHost() seems to have a bug in it.
void AudioProcessor::setParameterNotifyingHost (const int parameterIndex, const float newValue)
{
setParameter (parameterIndex, newValue);
sendParamChangeMessageToListeners (parameterIndex, newValue); // may be a problem !!
}
If you have a look at the code above, we are supposed or encouraged to scale an input parameter in setParameter() to be in the range of 0 and 1.
But, how about the line below? sendParamChangeMessageToListeners() is sending an unscaled newValue to the host. This upset Pro Tools.
Or, are we supposed to scale the value before we pass onto setParameterNotifyingHost() ?
Our codebase became very big and we are not able to modify all occurrences of setParameterNotifyingHost() at this stage.
It may be a workaound to change "float newValue" parameter to a pointer so that we can update it in setParameter().
We'll need to modify the juce_AudioProcessor.cpp for now.
Chan