Replies: 4 comments 2 replies
-
you can convert your table to a string and save it with stateData() . stateData() is a function in Ctrlr that creates a valuetree and saves/reads datas when the host launches or quits. You need to assign 2 scripts within the global propeties. No external file needed here. it's going to be added temporarly at the bottom of the Ctrlr.settings file in "user/library/preferences/Ctrlr/" on mac. And it is also saved as datas in your session file (in the xxxsessionnamexxx.cpr for cubase for exemple ) within a VST/AU host. NOTE: It works only if the Ctrlr App is quited with the panel loaded. If you close the panel then quits it won't save the datas and could not load when you open Ctrlr App afterwards. it works very well within vst hosts. Everytime you save a session within the host it goes through the SaveStateData script and when you load the session it reads the ReadStateData script. SaveStateData method (global "called when Ctrlr State is saved") :
ReadStateData method (global "called when Ctrlr is loaded"):
I did not try it, it's based on some of my functions but it should work. Please let me know. |
Beta Was this translation helpful? Give feedback.
-
You can actually save tables themselves using SaveStateData = function(--[[ ValueTree --]]stateData) if not rawequal(next(patchDataTable), nil) then -- it's probably never nil local mem = ValueTree("memory") for i, v in ipairs(patchDataTable) do mem:setProperty(tostring(v), tostring(panel:getModulatorByName(v):getModulatorValue()), nil) end stateData:addChild(mem, -1, nil) end -- table not empty end and reload like this: ReadStateData= function(--[[ ValueTree --]] stateData) local mi = stateData:getChildWithName("memory") patchDataTable = {} if mi ~= nil then -- ~ if stateData:hasProperty("mi") then ... for i = 0, mi:getNumProperties() - 1 do local k = mi:getPropertyName(i) -- k is the name of the control local v = mi:getProperty(k) patchDataTable[k] = v -- and/or panel:getModulatorByName(k):setModularValue(v) end end end in the
|
Beta Was this translation helpful? Give feedback.
-
I think this is what you are after. There are 8 possible wave sample values for each modulator, which are saved to state and can be saved as json. Updated 04/04/2022 |
Beta Was this translation helpful? Give feedback.
-
This new version allows for spaces or dashes in the modulator name, but is much more complex coding wise: |
Beta Was this translation helpful? Give feedback.
-
When writing modulator values to a table can this table be saved in the panel itself so the next time the panel is loaded I can call a specific table and the modulator values are reloaded?
In that way modulators can be 're-used' and I could have a panel with just 1 Layer instead of many.
I noticed with the method provided by dnaldoog in another post works but the table is again empty when the panel is loaded again.
I am aware of the save to file method.
Beta Was this translation helpful? Give feedback.
All reactions