saveInPreset not working for panel data?
-
@VirtualVirgin
saveInPreset
only applies to a component'svalue
. So if you want to store data in a panel that is recalled later you need to store it in the panel's value.Old thread about it - https://forum.hise.audio/topic/52/variable-persistence?_=1737825758997
-
@d-healey Thanks!
A bit of that is above my head, so a couple of questions:Does the panel.value have a dedicated function that I would be interrupting by writing other data to it? Or is it specifically meant to store any data?
In the example(s) on persistent data, you are using an object.
Does it have to be an object or can I make the top level of panel.value an array with objects in it? -
The panel's value is just the same as the value for any other component. So when the preset is loaded the panel's on control callback is triggered and the value is available in the parameters.
I haven't used this kind of thing for a long time. I believe it can store an array too but you'd need to test it. If not you could just wrap your array in an object.
-
@d-healey Ok...
So I'm trying to handle the value data, but after I put it into an object, I don't understand how to get individual values stored in the object.Also,
I don't see any kind of object being stored in the Panel1 here:
I can't find a listing for that object anywhere in the Script Watch Table.
-
@d-healey Ok, I got the value now:
It just seemed like a strange syntax! -
@VirtualVirgin You could do it like this which might make it seem like it makes more sense
const panelObj = Panel1.getValue(); Console.print(panelObj.test1);
-
@d-healey
Do you have cases where you need to store panel data in presets?
Is there another method that you use?I'm a little confused reading about the "Control Data" for panels.
I already have data on panels such as:
panel.data.pitchSet
panel.data.tValueThe former being an array and the latter is an integer.
Am I supposed to be passing those into panel.setValue()
i.e.panel.setValue(panel.data.tValue);
or instead of writing to the panel.data.tValue in the first place, I should be writing the data to:
panel.setValue( { "tValue" : tValue });
-
@VirtualVirgin said in saveInPreset not working for panel data?:
Do you have cases where you need to store panel data in presets?
I don't think I have. If I have a bunch of data to store that isn't directly tied to a component I use a slider pack. For example for my AHDSR I have one set of knobs to control the different parameters, but each articulation in my instrument gets its own set of values. So I use a sliderpack to store the AHDSR values for each articulation and when the user switches articulation I just pull the values from the sliderpack and apply them to the knobs.
Do you have a link to that bit of documentation that you've posted?
-
@VirtualVirgin
I often store objects in panels, this is a small example of storing different data (objects, arrays, properties) in panels.
Each panel store each effect modules min, max, defaultvalue, value etc...
HiseSnippet 2333.3oc0Z0sbaab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+YuFAsYeMBoukCaouKEiL+87oQG0i3Oq69PI1gqnnNWLp.ViDW3vSStvAd+cEpihZAs3pgJBDqL2+RU6Oz5nC+lY0PGMQ+bTRUNzY+j0JuVkF0WdkF0pV4lxnehZfWqxqp8pZ0LMMmFCu+ZcCnnxJMpW0x5lyuQFJb69+ORaT1URDf+byJBHo0FZplcyNJXF84dbqKNQvPsUZTwrt0zNh76q831VKKV.jT8UUplCVlQqrG2NYSAlZUMqr78HK4crKBPxxKW2ZYQT5eZusge2B+JRiKcAky5QBhn7JkpaSthZSjWXZAssIgWFw5IpsE2LSQ8I2c0sqGeI1+10Gldv.9VeDguev5cHz1cRcY3mrNzsgMHomCfomosgmGZLgP7Uj87aFPf9SIkkuGnKct2Lv2e8r2Q3a5Ki94ZGvy2wQYuabtALdBnSWlKjleoy9gzngoeggIuv7EteWX9see92W39wZM421V93ctbvKuI46X7F+7COUSdi4iA6BZ69E25aM7iFJ49tCykBKOYzyHIJn+lDn7TsT83ukGP5278aS7vYreuMS3oxWtdNOwzd9PXdTSlGNXRq+726mWw51edkEt2gH7sD5ClP5eolvj+gDfEgDe3.3mqAkj++.3J+kOsO.C8kg1AZG1uaKneoMAfpO+93.ZpywOfubrIeLGPsH9NhA+W3S7jV7wpwSZkLYZSRAoI4WDm5KaEILHOSKy48xXORNNWr43u8ce2OrV7ophIsd0p+60RNbyX19mqscvvIn8Cqkt5gfvtADxWS.mQpU3er1iVYh2KF42GqQWrc.6qhecWd8umHn.6aewSwWP6.9XjU7o5SUysK0g9U11YU0TBV4gJX0Gpf0dnBt7CUv5OTAW4gJXi6VP9+YD1neDqqrXjhxAM2Qb9XU0c7wPTtHOT4+ATb2TuM
-
@VirtualVirgin said in saveInPreset not working for panel data?:
@d-healey
Do you have cases where you need to store panel data in presets?Yes a truck load of array data - for the XYPad panel - that is the recording of a series of X/Y values that make up the path teh XY pad plays thru....
I just store it in XYPanel.data and get it out on init.