I have this code:
// check: int k = valueTreeState.getParameter("DETUNE")->convertFrom0to1(valueTreeState.getParameter("DETUNE")->getValue()); const auto xml = valueTreeState.copyState().createXml(); const auto presetFile = topDirectory.getChildFile(currentBankName).getChildFile(presetName + "." + extension); if (!xml->writeTo(presetFile)) { DBG("Could not write preset file: " + presetFile.getFullPathName()); jassertfalse; }
When I run the debugger and look at the value of k, it is always correct, say -23.
However, the resulting xml file always shows the default value (and this is true for all other parameters…):
<PARAM id="DETUNE" value="0.0"/>
This parameter was defined as follows:
std::make_unique<juce::AudioParameterFloat>("DETUNE", "FM Detune", juce::NormalisableRange<float>{-40.f, 40.f, 1.f}, 0.f)
What could be the issue here?
