My plug-in is failing AU Validation through auvaltool with the following error:
Testing that parameters retain value across reset and initialization
ParameterID=98116753, Scope=0, Element=0: Saved Value = 0.943359, Current Value 0.500000
ParameterID=98116759, Scope=0, Element=0: Saved Value = 0.900391, Current Value 0.500000
ERROR: Parameter did not retain set value when Initialized
* * FAIL
The parameters in question are gain parameters which pass the check a few lines above in auvaltool:
Parameter ID:98116753
Name: Filter 1 - Gain
Parameter Type: Generic
Values: Minimum = -27.00, Default = 0.00, Maximum = 27.0
Flags: Values Have Strings, High Resolution, Can Ramp, Readable, Writable
-parameter PASS
...
Parameter ID:98116759
Name: Filter 7 - Gain
Parameter Type: Generic
Values: Minimum = -27.00, Default = 0.00, Maximum = 27.0
Flags: Values Have Strings, High Resolution, Can Ramp, Readable, Writable
-parameter PASS
Only these two parameters are showing the error even though, as you can tell by their names, they are just 2 of 7 identical gain parameters.
The parameters are created like so (in a for-loop):
auto gain = std::make_unique<ParamFloat>("gain" + String(i),
groupName + " - Gain",
NormalisableRange<float>(-globals::gainRange,
globals::gainRange),
0.f,
String(),
AudioProcessorParameter::genericParameter,
[](float value, int) -> String
{
int dp = 2;
if (value >= 10.f)
dp = 1;
return String(value, dp);
},
[](const String& text) -> float
{
return text.getFloatValue();
});
Then added to a group which is in turn added to the AudioProcessorValueTreeState using this method:
The parameter values are set in the setStateInformation()
in the usual way:
void PluginProcessor::setStateInformation (const void* data, int sizeInBytes)
{
std::unique_ptr<XmlElement> xml(getXmlFromBinary(data, sizeInBytes));
if (xml.get() != nullptr)
if (xml->hasTagName(apvts.state.getType()))
apvts.replaceState(ValueTree::fromXml(*xml));
// ...
}
I’ve run auvaltool in debug and put a breakpoint in setStateInformation()
but it doesn’t seem to be called during this test that’s failing!
Any help with this would be greatly appreciated, thanks!