[SOLVED] replaceState overwrites non-ValueTree variable

Many of my synth’s parameters are not created using ValueTree.

All of a sudden in setStateInformation, when this part is executed;

parameters.replaceState (ValueTree::fromXml (*xmlState));

at least one non-ValueTree variable, that is NOT stored in getStateInformation, nor retrieved in setStateInformation, is overwritten. As a matter of fact the particular variable is calculated, not stored or retrieved!

Perhaps a corrupt XML text in Reaper’s preset file, however I deleted every of my synth’s preset file, and still the same issue.

Yes obviously I messed up somewhere, but perhaps someone else have experienced the same issue and can guide me towards where to find the culprit.

When the value tree is updated, the callbacks for those values will fire. Is the value calculated in one of the parameter callbacks?

1 Like

Yep that was it. I’ve been working on this massive synth for almost 7 years, and totally forget in “parameterChanged” the function that calculates that variable was called.

Much appreciated!

1 Like