I have 2 toggle buttons in the same panel.
When I read the apvts to save my preset, the toggle state gets out of sync and sometimes I have to click the toggle twice to get the value to where I want it
for (const auto& parameter : apvts.state) {
const juce::String paramID = parameter.getProperty("id").toString();
if (auto* param = apvts.getParameter(paramID)) {
// // Check if the parameter is locked based on its ID prefix
// if (!((paramID.startsWith("INVERSION") && processor.theInversions.isLocked())
// || (paramID.startsWith("DURATION") && processor.theDurations.isLocked())
// || (paramID.startsWith("FIXEDVOICE") && processor.theFixedVoices.isLocked())
// || (paramID.startsWith("SWING") && processor.theSwings.isLocked())
// || (paramID.startsWith("VELOCITY") && processor.theVelocities.isLocked())
// || (paramID.startsWith("VOICING") && processor.theVoicings.isLocked())
// || (paramID.startsWith("VOICINGPHASE") && processor.theVoicingPhases.isLocked())
// || (paramID.startsWith("MODWHEEL") && processor.theModwheels.isLocked())
// || (paramID.startsWith("MUTE") && processor.theMutes.isLocked())
// || (paramID.startsWith("I_LFO") && processor.theInversions.isLocked())
// || (paramID.startsWith("D_LFO") && processor.theDurations.isLocked())
// || (paramID.startsWith("FV_LFO") && processor.theFixedVoices.isLocked())
// || (paramID.startsWith("SWING_LFO") && processor.theSwings.isLocked())
// || (paramID.startsWith("V_LFO") && processor.theVelocities.isLocked())
// || (paramID.startsWith("VOC_LFO") && processor.theVoicings.isLocked())
// || (paramID.startsWith("MOD_LFO") && processor.theModwheels.isLocked())
// || (paramID.startsWith("VP_LFO") && processor.theVoicingPhases.isLocked())
// || (paramID.startsWith("M_LFO") && processor.theMutes.isLocked()))) {
// // If the parameter is not locked, save its value to the preset
//// presets[i].parameterValues[paramID] = param->getValue();
// }
my code is mostly commented out but the problem only resolves (toggles working perfectly)
If I comment out
if
(
auto
* param = apvts.getParameter(paramID)) {
The problem with the toggles syncing correctly goes away.
Another way I can make the problem with the toggles go away is to map them in Abelton, then they work/sync flawlessly
If I subsequently remove the Ableton mapping, the problem returns.