[Solved] VST3 and preset changes driving me nuts

I fixed it. The problem is a conceptual difference in Juce between VST3 and other plugin formats:
Whenever a host is querying a parameter value, this ends up in a call to AudioProcessorParameter::getValue() and my guess is that this is what is supposed to happen.

However, the implementation for VST3 is different, it does not work like that because the value is cached in JuceVST3EditController::Param.

The fix requires a change in two locations:

A very small function in JuceVST3EditController::Param:

void updateParameterValue()
{
    // retrieve the current value from Juce::AudioProcessorParameter and update
    // the value stored in Vst::Parameter to ensure its up-to-date
    setNormalized(param.getValue());
}

And now the most important part, update the cached value so that the host sees the most recent value and not a possibly outdated one:

Vst::ParamValue getParamNormalized(Vst::ParamID id) override
{
	// cached parameter value might be outdated, update it before returning
	if (auto* parameter = getParameterObject (id))
	{
		if(auto* juceParam = dynamic_cast<Param*>(parameter))
			juceParam->updateParameterValue();
		return parameter->getNormalized();
	}
	return EditController::getParamNormalized(id);
}