This strange behavior in Ableton occurs when restoring state (and default state)?

I’m testing out my plugin. Works fine in Reaper but in Ableton something strange happened.

One of my sliders did not restore properly. The default value of the slider parameter is 0.5f (in a range 0.0f to 1.0f). If I set the slider to the default value, when I exit Ableton and relaunch it, the state is restored and the slider value changed to 0.0f!

Has anyone experienced similar strange behavior from Ableton? I upgraded to Ableton Lite latest version just now and that seemed to fix the issue. But one issue remains, - I insert my plugin on a different track in Ableton and it does not set the all plugin sliders to their default values!

In Reaper, all this works fine. Has anyone else had similar experiences with Ableton, or any insights to share?

Just because your plugin works fine in one host, doesn’t mean that it’s bullet-proof in all hosts. Different DAWs have different ways of initializing plugins and they behave differently when you minimize/maximize the GUI and/or restore state. Use the debugger to walk through the functions calls (constructors, getStateInforamtion, setStateInformation, prepareToPlay), expect them to be in different order with different hosts. Get yourself familiar with Pluginval to make sure you are also covered with the hosts you don’t work with.

1 Like

As duvrin already mentioned, testing the plugin with validators like pluginval is a good idea. I would also suggest replacing your editor with juce::GenericAudioProcessorEditor to see whether the problem still exists.

If I set the slider to the default value, when I exit Ableton and relaunch it, the state is restored and the slider value changed to 0.0f!

You talked a lot about the default values. FYI, if a parameter in APVTS isn’t changed by replaceState(), a parameterChanged() with this parameter will not get called.

1 Like

@zsliu98 @duvrin
I downloaded pluginval and my plugin “all tests passed” at levels 5 and 10; thats a useful tool I didn’t know about.
I think I have to scrutinize my createparameterlayout() and constructor to see how the defaults are set etc. and discover how Ableton might take a different road.

I think that in your case you need to focus on setStateInformation. use ValueTree::toXmlString to print your apvts.state tree and if nothing is wrong there, add your processor as a listener to one of the parameters that doesn’t restore properly and trace back any actions that trigger changes. For example you might find out that when you initialize your GUI you are doing something wrong.

If setStateInformation will print the wrong values to begin with, head over to getStateInformation and see if the values are being saved to your plugin state properly (again by using ValueTree::toXmlString).

Note that getState and setState are being called by the host whenever it decides to (and different hosts will use them in different ways), so they are the immediate suspects whenever the plugin state is not restored correctly.

1 Like