stateData – value of a variable

Home Forums General Programming stateData – value of a variable

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #70628
    proton
    Participant
      • Topics: 19
      • Replies: 94
      • Total: 113
      • ★★

      Hi all,
      a quick question:
      Is there a way to store a value of a variable during the process of saving the project by a DAW?
      I know how to tackle the saveState/loadState of a modulator value, uiTextLabel etc. but today i need to store a group of variables with assigned values.
      To be more specific and explain what I am doing:
      – my panel is using few buttons to save the current value of other modulators, a kind of a preset manager so for example Mod_1 has a value 100, Mod_2 = 200, I press presetButton_1 and save/assign both values to variables Mod_1_preset_1 = 100 and Mod_2_preset_1 = 200, now I can change the values of Mod_1 and Mod_2 and when I need I can press presetButton_2 and save/assign their values to another set of variables, for example Mod_1_preset_2 = 127 and Mod_2_preset_2 = 0. I use LUA methods to reassign those saved values (preset_1 or preset_2) to Mod_1 and Mod_2 and this way I can store presets on the fly and use this technique to quickly change from sound to sound. In standalone this is enough to work properly but as a VST or AU I need a way to store the assigned values of Mod_1_preset_1, Mod_2_preset_1, Mod_1_preset_2, Mod_2_preset_2 etc. I hope you get the idea.
      So, the question is what do I need to use as arguments for
      stateData:setProperty(“???”,???, nil) ?
      I tried something like this but of course is giving me an error:

      on save:
      P1_1 = Mod_1_preset_1 —– /// the value of Mod_1 /// —–
      stateData:setProperty(“Pset1_1”, P1_1, nil)
      on load:
      P1_1 = stateData:getProperty(“Pset1_1”)
      Mod_1_preset_1 = P1_1

      Thanks in advance for any input guys!
      Cheers!

    Viewing 1 post (of 1 total)
    • The forum ‘Programming’ is closed to new topics and replies.
    There is currently 0 users and 72 guests online
    No users are currently active
    Forum Statistics
    Threads: 2,495, Posts: 17,374, Members: 77,605
    Most users ever online was 12 on January 22, 2019 3:47 pm
    Ctrlr