HISE Logo Forum
    • Categories
    • Register
    • Login

    saveInPreset not working for panel data?

    Scheduled Pinned Locked Moved General Questions
    11 Posts 4 Posters 605 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • VirtualVirginV
      VirtualVirgin
      last edited by

      I have a bunch of panels enabled for "saveInPreset", but when I save and load presets, none of the panel data are saved. What is the expected behaviour?

      d.healeyD 1 Reply Last reply Reply Quote 0
      • d.healeyD
        d.healey @VirtualVirgin
        last edited by

        @VirtualVirgin saveInPreset only applies to a component's value. 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

        Libre Wave - Freedom respecting instruments and effects
        My Patreon - HISE tutorials
        YouTube Channel - Public HISE tutorials

        VirtualVirginV 1 Reply Last reply Reply Quote 0
        • VirtualVirginV
          VirtualVirgin @d.healey
          last edited by

          @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?

          d.healeyD 1 Reply Last reply Reply Quote 0
          • d.healeyD
            d.healey @VirtualVirgin
            last edited by

            @VirtualVirgin

            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.

            Libre Wave - Freedom respecting instruments and effects
            My Patreon - HISE tutorials
            YouTube Channel - Public HISE tutorials

            VirtualVirginV 2 Replies Last reply Reply Quote 0
            • VirtualVirginV
              VirtualVirgin @d.healey
              last edited by

              @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.

              Screenshot 2025-01-25 at 2.35.12 PM.png

              Also,
              I don't see any kind of object being stored in the Panel1 here:
              Screenshot 2025-01-25 at 2.35.43 PM.png

              I can't find a listing for that object anywhere in the Script Watch Table.

              1 Reply Last reply Reply Quote 0
              • VirtualVirginV
                VirtualVirgin @d.healey
                last edited by

                @d-healey Ok, I got the value now:
                Screenshot 2025-01-25 at 2.41.22 PM.png
                It just seemed like a strange syntax!

                d.healeyD 1 Reply Last reply Reply Quote 0
                • d.healeyD
                  d.healey @VirtualVirgin
                  last edited by

                  @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);
                  

                  Libre Wave - Freedom respecting instruments and effects
                  My Patreon - HISE tutorials
                  YouTube Channel - Public HISE tutorials

                  VirtualVirginV 1 Reply Last reply Reply Quote 0
                  • VirtualVirginV
                    VirtualVirgin @d.healey
                    last edited by VirtualVirgin

                    @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.
                    Screenshot 2025-01-25 at 4.02.26 PM.png

                    I already have data on panels such as:
                    panel.data.pitchSet
                    panel.data.tValue

                    The 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
                    });
                    
                    d.healeyD ulrikU LindonL 3 Replies Last reply Reply Quote 0
                    • d.healeyD
                      d.healey @VirtualVirgin
                      last edited by

                      @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?

                      Libre Wave - Freedom respecting instruments and effects
                      My Patreon - HISE tutorials
                      YouTube Channel - Public HISE tutorials

                      1 Reply Last reply Reply Quote 0
                      • ulrikU
                        ulrik @VirtualVirgin
                        last edited by

                        @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...
                        Skärmavbild 2025-01-26 kl. 11.17.07.png

                        HiseSnippet 2333.3oc0Z0sbaabEFPRniIScsSaunWtASyLTJzv.jTTzwUi9WtpU+vQTUNYznIyJfEjaEHVV.PQwjnY5qQtqOC8tdWts80nWk65aP6Y2EfDfDTRQirSMmw1bO64b1u876xccy.lMILjEnnV7jg8HJp+bsVC8i5rUGL0WYusUT+UZshXADmlXeh2oXu9jPkMG1CGFRbTTUm+MbFUKrfh3y+YsMwdXeaxXRJJmxn1j8ocoQio1b8+H0yaWrC4DZ2TbWa88rY9aw7X8APMuloROr8k31jCwb1lSS42iC6nntjliUMK2F135MrpUw1tRiUp7pUrIXWWRcqkWoVC2ZtXayJJp+rcbnvdnUDNB.u5BaxbF1pCafubANkFRuvivGXozBVYI4cYdN7sHmpxVcndNMSrVgJfVZN11Muz18q0Nf5PGQerM74hIPikHsATctrva9LvyJM7LSAubfjZJHsfDRerVK6.ZunwyvwyGosmeDI.LOjLPQxqxb+8mosEC3vOxnK9RxtAvfQRTploYYTESyEecwhu7kE.2UT.yCYi87t.7UEo9dTeBxsuucDk4i5xb56Q1Jd5R1rt8X9ftKithGNsXwuoXAOFHNx8ZzpHQ7mQaRzNfmzNpjfICoRfkrPwBtr.TodArdHpuTGF7QgKVrPA2qMBIQaDEEPuneDoDLtcpw646PtVHqANg1hkQBBRz75h2H1V8.mWDJf0OB1LEgMYXT7No4w.JS1ckZKveaCWHbdCOuR5lW65VS7QmC2qvAnq.Ah5PC4PQjBUJYFbpY1maC1j022IrjYBCC.FvmU4bzKQWI2kFdD+1QcDVh17MqLYoj7eBMFzgFILThI2E7NukF0oEjFQ8aWR2g3h66EoWFYsbYjogYMIuNA3Aa3Qa6SbNgbMX1M7gLtxny.ms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xAM2Qb9XU0c7wPTtHOT4+ATb2TuM
                        

                        Hise Develop branch
                        MacOs 15.3.1, Xcode 16.2
                        http://musikboden.se

                        1 Reply Last reply Reply Quote 0
                        • LindonL
                          Lindon @VirtualVirgin
                          last edited by

                          @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.

                          HISE Development for hire.
                          www.channelrobot.com

                          1 Reply Last reply Reply Quote 0
                          • First post
                            Last post

                          23

                          Online

                          1.7k

                          Users

                          11.7k

                          Topics

                          101.9k

                          Posts