Once you start using lua it’s easy to store values in variables. I guess these however aren’t by default stored in a snapshot (at leadt not when I tried). however, some of them should better be stored as well to allow a snapshot to function correctly. For instance I’m using controls to define the number of polychain voices an instrument can have, but then the actual voices are being stored in tables, as these are not one-to-one with any control value. It would be valuable if there is a way we could define what variables should be stored as well in a snapshot.
hmm, that is a very good question / idea. I think that storing of values of every variable would be rather difficult and maybe a bit of an overkill. I can imagine, however, making it possible to store these values in the parameter map and having callback functions that would be triggered when the snapshot is saved and recalled. Then, you could use something like “onSnapshotSave” callback to memorize your data and “onSnapshotLoad” to load the data back and bring the Lua script to a known state. Would that work for your script?
You are reading my mind
I just did not dare suggesting it myself.
@martin Hi, did you implement this? I can’t see it in the documentation.
@NewIgnis Hi, did you end up finding a solution for storing extra data in the parameter map?
Hi, no I haven’t. If I need more than one starting ‘case’, I resolve it with lua datatables that then fill up variables. Not with snapshots.
There is v3.7 beta available, I asked users for testing and I received quite some feedback in return. Mostly additional feature requests or feature extensions. Based on that I have decided to make the release (v3.7, which might eventually become the 4.0) more complete and bring some of those requested features.
One of them is an option to persist Lua data, it is basically what @NewIgnis asked for here. The latest beta (not uploaded to the forum yet) offers a function to persist and load complete Lua table. The data is internally stored as a JSON. I am considering an option to be able to edit that data file in the editor (in the future).
I am coming to the same point.
Persistent storage will be great and I have been thinking about this.
I am building a live set with the Electra One, 2x AS1 synths and an Pioneer SP16.
The SP16 is dump, you cannot retrieve the current parameter value from the device. So I you make a template you need save a snapshot that matches your project.
Now if we had persistent storage we could make a “project selector” and switch pre mades sets that match what the SP16 has loaded.
Another use case is to load the sequences stored in snapshots.
For example the AS-1 has a 64 step sequencer ( the Pro 6 as well ).
I am building an editor for that.
Now if we had Access to the snapshots actual parameter data/values so we can load sequences stored in any snapshot.
Make a Lua function and a dial to scroll through the available sequences.
If you make you own sequence you could just store the snapshot and retrieve that sequence in a later stage.
I am not sure if it makes sense what I wrote.
In short I think getting read // access to the full values stored in a snapshot will be useful as well.
And in a way provides persistent storage since snapshots can be stored by the user.