# Plug-in audio parameters aren't recalling their state until the GUI becomes active/visible

**URL:** <https://forum.juce.com/t/plug-in-audio-parameters-arent-recalling-their-state-until-the-gui-becomes-active-visible/27721>\
**Category:** Audio Plugins\
**Created:** [May 17, 2018, 9:22pm UTC](https://forum.juce.com/t/plug-in-audio-parameters-arent-recalling-their-state-until-the-gui-becomes-active-visible/27721 "2018-05-17T21:22:47Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![delta\_44100](https://avatars.discourse-cdn.com/v4/letter/d/8e8cbc/32.png) [@delta\_44100](https://forum.juce.com/u/delta_44100)\
**Post date:** [May 17, 2018, 9:22pm UTC](https://forum.juce.com/t/plug-in-audio-parameters-arent-recalling-their-state-until-the-gui-becomes-active-visible/27721/1 "2018-05-17T21:22:47Z")

</div>

When I open a previously created project into a DAW(Logic Pro X) that uses my plug-in; It is not until the GUI becomes active/visible do the audio parameters recall their state. The automation for the plug-in also doesn’t work until GUI becomes active/visible. When the DAW project is loaded, all the audio parameters are always set to their default values that were given in the **AudioParameterFloat()** constructor, no matter what. It’s appears as though the DAW doesn’t call **setStateInformation()** until the GUI becomes active/visible.

---

<div class="post-metadata">

**Author:** ![daniel](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/daniel/32/790_2.png) [@daniel](https://forum.juce.com/u/daniel)\
**Post date:** [May 18, 2018, 7:01am UTC](https://forum.juce.com/t/plug-in-audio-parameters-arent-recalling-their-state-until-the-gui-becomes-active-visible/27721/2 "2018-05-18T07:01:38Z")

</div>

> [@delta\_44100](#):
>
> It’s appears as though the DAW doesn’t call **setStateInformation()** until the GUI becomes active/visible.

Best to verify or rule out by using breakpoints or DBG statements. If using DBG statements, put some in other places, to make sure you are looking at the right console 😉

What could be the case is, that your plugin was never seen as changed, hence not restored. Normally it would be set dirty (= needs saving) by calling [AudioProcessorParameter::setValueNotifyingHost()](https://docs.juce.com/develop/classAudioProcessorParameter.html#ac9b67f35339db50d2bd9a026d89390e1) or [AudioProcessor::updateHostDisplay()](https://docs.juce.com/develop/classAudioProcessor.html#ab53b860c69380cb34e466b60a3bce3f2). If you just called parameter-\>setValue(), the value never reached the host.

That it works with the GUI makes me guess, that you use some provided structure, that triggered that for you, e.g. using AudioProcessorValueTreeState with attachments would do that without having to write any code. Also maybe beginGesture() or other similar things.

Good luck

---

<div class="post-metadata">

**Author:** ![delta\_44100](https://avatars.discourse-cdn.com/v4/letter/d/8e8cbc/32.png) [@delta\_44100](https://forum.juce.com/u/delta_44100)\
**Post date:** [May 18, 2018, 7:17am UTC](https://forum.juce.com/t/plug-in-audio-parameters-arent-recalling-their-state-until-the-gui-becomes-active-visible/27721/3 "2018-05-18T07:17:23Z")

</div>

Thanks for the help.

---

<div class="post-metadata">

**Author:** ![delta\_44100](https://avatars.discourse-cdn.com/v4/letter/d/8e8cbc/32.png) [@delta\_44100](https://forum.juce.com/u/delta_44100)\
**Post date:** [May 19, 2018, 3:16am UTC](https://forum.juce.com/t/plug-in-audio-parameters-arent-recalling-their-state-until-the-gui-becomes-active-visible/27721/4 "2018-05-19T03:16:10Z")

</div>

I found the problem; I was doing some of the DSP calculations from the **sliderValueChanged()** listener; I had placed them there for efficiency purposes.

---

<div class="post-metadata">

**Author:** ![jamand](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/jamand/32/9071_2.png) [@jamand](https://forum.juce.com/u/jamand)\
**Post date:** [May 25, 2020, 5:32pm UTC](https://forum.juce.com/t/plug-in-audio-parameters-arent-recalling-their-state-until-the-gui-becomes-active-visible/27721/5 "2020-05-25T17:32:05Z")

</div>

I am running into the exact same problem. My plugin recalled the parameters only after the user clicks the plugin in Logic. I am unclear on what your solution was. This problem only happens in Logic it seems.

---

<div class="post-metadata">

**Author:** ![delta\_44100](https://avatars.discourse-cdn.com/v4/letter/d/8e8cbc/32.png) [@delta\_44100](https://forum.juce.com/u/delta_44100)\
**Post date:** [May 26, 2020, 10:59pm UTC](https://forum.juce.com/t/plug-in-audio-parameters-arent-recalling-their-state-until-the-gui-becomes-active-visible/27721/6 "2020-05-26T22:59:37Z")

</div>

Are you running a timer to continuously set the GUI?

---

<div class="post-metadata">

**Author:** ![delta\_44100](https://avatars.discourse-cdn.com/v4/letter/d/8e8cbc/32.png) [@delta\_44100](https://forum.juce.com/u/delta_44100)\
**Post date:** [May 27, 2020, 9:53pm UTC](https://forum.juce.com/t/plug-in-audio-parameters-arent-recalling-their-state-until-the-gui-becomes-active-visible/27721/7 "2020-05-27T21:53:15Z")

</div>

Maybe the constructor is setting parameters to unwanted values.

---

<div class="post-metadata">

**Author:** ![jamand](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/jamand/32/9071_2.png) [@jamand](https://forum.juce.com/u/jamand)\
**Post date:** [July 11, 2020, 7:41pm UTC](https://forum.juce.com/t/plug-in-audio-parameters-arent-recalling-their-state-until-the-gui-becomes-active-visible/27721/8 "2020-07-11T19:41:21Z")

</div>

I solved the problem by reading my parameters from my value tree in processBlock() as opposed to just in prepareToPlay().
