I updated to the latest version of the AAX wrapper today and run into the issue that it is not possible to load a simple default preset from the AudioProcessor constructor anymore. ProTools sends 0 values to all parameters after the plugin loaded the startup preset.
Changing the wrapper back to an older version fixes the issue. I see in the code that a lot of things changed (Normalized parameters and other changes).
Odd. When my plugin is opened in Protools I get called twice, once with the default value provided by the getParameterDefaultValue() method and then a second time with a 0. Anyone seen this before?
The call stack is different though. The second time, with the wrong value, it's coming via AAX:Classes::JuceAAX_Processor::setChunk() and SendRampUpdates() .. mmm off to read the manual.
Update: presume it's something to do with this:
"When a plug-in is first instantiated, CProcess::GetChunk() is called to retrieve the plug-in’s default chunk. Pro Tools caches this chunk in the session and associates it with the plug-in, andCProcess::SetChunk() is called with this default chunk on any future instantiations of the plug-in in the session."
Right - turns out you need to clear the cache - see my post on the digi developer forum. This problem has some implications for default preset handling which I'll pick up with Avid...
I'm in the process of creating an AAX version of our synth plug-in, and have run into the problem where Pro Tools sets all the parameters to 0.0f...
Now, I could, as Jules suggests, override AudioProcessor::getParameterDefaultValue and assign the correct default parameter values.
However, I have read many posts on here and the Digi DevCon forums about SetChunk and GetChunk etc - is implementing my own chunk handler the way forward?
Please don't use the old (and soon to be deprecated) getParameterDefaultValue method - there are now methods in the AudioProcessorParameter class that you should override to do that kind of thing, and we've added some functionality to that class that doesn't exist in the processor base class.
Hi MCSoftware, as Jules said you should be using the AudioProcessorParameter class. This class will force you to override getDefaultValue which should return the value the parameters should have if the user opens your plug-in on a new track for the first time. The setChunk/getChunk calls are used to save/load your plug-in's state (including the values of your parameters) from a project file. These AAX calls simply get redirected to your AudioProcessor's setStateInformation/getStateInformation. You must restore your Plug-in's parameter values with the data supplied in the setStateInformation call. Here is some minimal code to save/restore your parameters using JUCE's ValueTree (note: this will only work if you are using the new AudioProcessorParameter class):
Did you ever find a workable solution for custom default presets with JUCE in AAX?
This seems to only be true before Pro Tools has cached the default chunk. I think the code you’ve posted will only work in cases where the default parameter values never change.