Arp not saving in presets..
-
OK so I have an Arp using the Arpeggiator1 midi processor from the hard coded scripts.
I have built a panel and a bunch or controls to manage it.
And made sure they are all set up as SaveInPreset. I mod some values in it and asave a preset.. I reload the preset later and all the arp settings are missing...
I look inside the preset and see:
<Control type="ScriptSliderPack" id="VelocitySliderPack" value="31" data="128...f5BA..HHD..PiP..f+BA..9KD..3uP...FBA..jHD..3uP..f+BA..9KD..3uP..f+BA..9KD..3uP..f+BA..9KD..3uP..f+BA..9KD..3uP..f+BA..9KD..3uP..f+BA..9KD..3uP..f+BA..9KD..3uP..f+BA..9KD"/> <Control type="ScriptSliderPack" id="NoteLengthSliderPack" value="31" data="128....iBA..PGD...cP..fkBA..3HD..PgP..fkBA..VJD..XoP..fkBA..VJD..XoP..fkBA..VJD..XoP..fkBA..VJD..XoP..fkBA..VJD..XoP..fkBA..VJD..XoP..fkBA..VJD..XoP..fkBA..VJD..XoP..fkBA..VJD"/> <Control type="ScriptSliderPack" id="PitchSliderPack" value="31" data="128............................................................................................................................................................................"/> <Control type="ScriptPanel" id="ArpSettingsPanel" value="0"/> <Control type="ScriptComboBox" id="ArpSettings" value="3"/> <Control type="ScriptSlider" id="ArpSteps" value="32"/> <Control type="ScriptSlider" id="ArpTempo" value="11"/> <Control type="ScriptSlider" id="ArpSwing" value="0.17"/> <Control type="ScriptPanel" id="ArpDirectionPanel" value="0"/> <Control type="ScriptComboBox" id="ArpDirection" value="1"/> <Control type="ScriptSlider" id="ArpOctave" value="0"/> <Control type="ScriptSlider" id="ArpSetpIncrement" value="1"/> <Control type="ScriptButton" id="SaveSettings" value="0"/>
So my arp data is being saved in the preset - but its not being reloaded(applied to the controls) when I select the preset.
What am I doing wrong?
-
OK so I worked out what was wrong -and its a bit of a logic bomb for anyone working in the same way.. explanation time:
I have a set of widgets to manage ARP settings, I also have a combobox with 20 slots. You select one of these 20 and an arp set-up is deployed - you can save your current arp set up into any of these slots.
So in review a set of widgets with values and a combo box and a set of 20 slots - each with a set of widget values.
So the user changes some settings in the arp and saves a preset: all good everything is written out to the preset.
The user loads a preset , everything good here too, all the values written back into the widgets, except that at some point in the process...... the combobox event gets called - and it uses its current value to identify a slot full of values and then overwrites all the gui settings....
grrr..
So I need a way to NOT have the preset values overwritten by an internally saved version. Any ideas?
-
@Lindon What is the saveInPreset state of the combo box?
-
This is actually pretty easy to solve: the combobox must restore its value before any other UI element. It will load its predefined and after that every control will override the value with its custom one.
The order of restoring is simply the order in the list. It has some implications for the z-level hierarchy but I can‘t think of an scenario where this is an actual problem.
Another solution might be to make the combobox not persistent - if every UI control you store in there is persistent, the state will be restored correctly anyway.
-
@Christoph-Hart Ok great - so al I need do is re-order the comboBox to the top of my arp panel and it will be actioned first by the preset load? Does the order that values are stored in the preset XMl itself make a difference? If so I can "python it" into another position.
-
@Christoph-Hart Wow I wish I knew this a while ago! So every time you switch a preset it loads according to the list order? Just playing and it's solving problem I had with reverbs and delays creeping through when switching presets...
-
@DanH nope! spoke too soon....