Reply To: How paramater values are stored in the Ctrlr VST and sent back to the device?

Home Forums General Programming How paramater values are stored in the Ctrlr VST and sent back to the device? Reply To: How paramater values are stored in the Ctrlr VST and sent back to the device?

#121139
dnaldoog
Participant
  • Topics: 4
  • Replies: 480
  • Total: 484
  • ★★

Hi Damien,

Maybe something like this using stateData?

You can save all sysex data as one long string and on load send packets of data back to the synth by locating each F0 in the string:

“Called When Ctrlr state is saved”

m=MemoryBlock(allpaneldata)
stateData:setProperty("myBigString",m:toHexString(1))

and recover with something like:*

“Called When Ctrlr state is loaded”


local str = stateData:getProperty("myBigString")
local data = MemoryBlock(str)
for i = 0, data:getSize() - 1 do
    if data:getByte(i) == 240 then
        panel:sendMidiMessageNow(CtrlrMidiMessage(data:getRange(i, 600):toHexString(1)))
    -- i.e.sysex message = 600 bytes
    end
end

*Untested pseudocode. Let me know if this is what you mean.

Also more reading:

Global Persistent Variables?

In that example data is saved emulating a table key/value structure

See source code of my Juno Alpha panel.

Do NOT follow this link or you will be banned from the site!