HISE Logo Forum
    • Categories
    • Register
    • Login

    Store values in ScriptPanel data object

    Scheduled Pinned Locked Moved General Questions
    51 Posts 6 Posters 2.6k 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.
    • toxonicT
      toxonic @Christoph Hart
      last edited by

      @Christoph-Hart Ahhhh, okay.... Thank you for your quick response! :-)

      1 Reply Last reply Reply Quote 0
      • toxonicT
        toxonic
        last edited by

        I don't know why, but i have huge problems in understanding, how to access the data stored in a panel.
        I have a quite complex project i'm working on, so i tried to boil it down to a snippet, that demontrates my problem. This makes it look awkward in some aspects, but keep in mind, that it's just a small part of the whole project.
        Maybe someone take look at it?

        HiseSnippet 3366.3oc4a07aabbEeojGISF6D6XGzVffhAFsnRH1Rjxel3jJZIKYyF8Aqnra.LDXWs6PwEZ4NL6NTRLoAvEnEn+CzC4RQ.J50dt8PQ7e.t.8dQAR.5o1bvGZQOzB39dyreL6pkxTxNNMtzFF6Nyadya989blYccetEKHf6aTn3586xLJbBRi9dh1y21zwyn1MMJ7sHq27VtNBq1Mavd+KT2mEvDqyBDFy0uqYP.y1nPgQuERdghGyP96QyNmoqomEKoICi6xcrXK4zwQjzZ8puqiq6hl1r0c5nQ8kpVyh6MO2k2CDsQIkM5ZZss4VrULQxFgXTXrErcDb+FBSAKvnvwlia2uQa9tdJ5uqSfyltL7kJFM.FoZdQtqMJwXqFy21w0tdDDDXXTfTOAPFUAHmkrrisSb6I.yojcPSFgNdTXjzh2noDuJ5hWYMwKGQpflHcLkHcZRCKemthjdP44kH07DL+Vl.rqKJJZMFoYIx7bfBOwTcL2lsnO7R7Hl3JkKed5UKWdxqWpzzSSWi0h4y.MXPIPQDHn6X5SuSs44c5x8.VDPeG58tWD+1hIh6Yhy0PzS.rs4650bIlGf.9hyM44oC32vviE7rO.NLD7XceSu.GgC26oiOy2yeG1SAKlS.hhyVmaxM1.v4DjEabKluDUGV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aVtRkqTQNSuL4Ndn1lYKKsLjCiSlQx.Csqf2vPyTRWGlxR5LwVRIDb3LjzmRY7T7MHawH37NFQlJNdgtbvLyUeYCig25abBTRQfHskGg.UWlwtqvvB1yjEr0s7TTcidBdGHJZTkjZHYj7jBEOAfh9roT87T.eijA9JRl2E3UsX6pRwgch00Qz9JXXZMDIbDxP7o.pQyGnFib4zHUjQ0PXUpzGYQsmZO1iSTelhCMmGd+0nhNyx4FxuyvXixzH2H5yqR.C247gX4ISZoSqtg+gzOHFfLxJYI2h+viOojrxOcRVBBabfAHNAoVvcwdsLcilbHu7Q4aK54RYKOOliNlV97lgwkkWymrEPA4I2jdQxx36zJQeLYJsUGX6pMsrv5kuPECi7GyLGgwbwivXtzQXLW9HLlqbDFyUOBi4ZG3XvSJHLRB5aDZ1p9JQgju5uPJPRusG8+2.ImK4G1YjwP5aMA9oekIvtEWrmq69nAaLCcM1lsa1cX6CKIrsO7r+1a84evOC2fsuyl8vSRJ6WlPMUsAxceYrb8EjdmEJDeZTPq+WvHY7ys�
        
        LindonL 1 Reply Last reply Reply Quote 0
        • LindonL
          Lindon @toxonic
          last edited by

          @toxonic

          okay so you are storing the values you want in the panel with this:

          // Store values from dummy array in Panel
          UI_Panels[0].setValue(stutterPresets);
          

          so I think you need to get the values back out with:

          stutterPresets = UI_Panels[0].getValue();
          

          HISE Development for hire.
          www.channelrobot.com

          toxonicT 1 Reply Last reply Reply Quote 0
          • toxonicT
            toxonic @Lindon
            last edited by toxonic

            @Lindon Oh, i see, i misspelled stutterPresets in my comments (i wrote stutterPanels), but I already tried that. The switch / case statement in UI_PanelsCallback seems not to be triggerd, so i tried to

            UI_Panels[0].setValue(stutterPresets);
            

            in diffenerent places, but it always results in a single 0.0 value in the dummy array (and some error messages related to that).

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

              @toxonic what is this giving you?

              Console.print(UI_Panels[0].getValue());
              

              HISE Development for hire.
              www.channelrobot.com

              toxonicT 1 Reply Last reply Reply Quote 0
              • toxonicT
                toxonic @Lindon
                last edited by toxonic

                Okay, i made a mistake first... :D
                The console spits out [Array], so i just don't really know, what's wrong....

                EDIT: Inside the UI_PanelsControlCallback it spits out 0

                toxonicT 1 Reply Last reply Reply Quote 0
                • toxonicT
                  toxonic @toxonic
                  last edited by

                  @toxonic I think I just have a basic problem understanding, how and where to store and recall values in panels.... :-(

                  d.healeyD ustkU 2 Replies Last reply Reply Quote 0
                  • d.healeyD
                    d.healey @toxonic
                    last edited by

                    @toxonic Why are you wanting to store values in a panel in this way? There is probably a better way to do what you want.

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

                    1 Reply Last reply Reply Quote 0
                    • ustkU
                      ustk @toxonic
                      last edited by ustk

                      @toxonic This should help you to understand the principle:

                      HiseSnippet 1486.3ocsW0raabCDlqr2zraZRZ.5wdfPmjPUbjb9soHs1R1tPMwxBVNIsHnHfZWJKFuhbAWJ6HXXfdnO.8QnuB8Mq25wzgjqzt5GqXKftHHVbFNC+luYHGx1RQ.MIQHQNdGMJlhb9R2Ni3p9M5SXbTycPN2wsiRHoM4sIbZDp9nXRRBMD43r1Oomii25Hy2+7i0IQDd.MSDB8FAKf9J1.lJSZ6sdIKJZORH8H1fby9Qa0LPvaHhDCA7rlaUTLI3DxwzVD8zJ3hbtwtgL.McTDEMAlScQ3nN8Emwsy+MrDV2HpdPMTGvQVwnF8YQgsGGqIHjy5syh70rQ9W6tOKjMQdFC7UFE3LKxyANEVFjpcMfjSNHstER2ysSfjEqxznwysbaxUTYOBP04ghctnBCccaHfYvUaLfbBcOILXhEkdR0pUvv+U9688A5NQgOkHwljaM7Kvis7XppgXPrfCCJUzptHXSlI0GpTB9kaSp9oM5kbQ2K2DiVsA9O3A3s4XQ2OPCTXUehBmnqBSfeSwAis.DpY8b92H3fte.Vhy6p3OuGIJgVAeBu6yqtQ0K.Oa7c6sas6qvMpiKkPNUWaCtlpvTNA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DNLhnl9x75Wsjp.pTm5Fz5aICYR0n7up4ZbC+pK8F9WUHdO21LUP+EiwBK.iv4w+efwz2Eca2c60Ct.XF.W2cueYUeDzmY4OTLTej29DkjAm34B6e5.mHEPgUmC8GRz46B5td1wU0i0LPGJOzL3SvWpxZ5wNoJqMVIZ.IPJdefsWo9kW2zHAvD27PSO280iwSZR55BMFQCfGA99f.c3eenQ7hsYyUvlGtB17nUvlGuB17jUvlmtB17rkZi982aOTIFX2N.BZuqoujiyt1mrY5t9e.4zdxOB
                      

                      Note that, as @d-healey said, there might be a better way for your use case. My example makes no sense since knobs and buttons can be saved in preset, but it's just an example for storing an object in a panel... I use this to store other kind of data than component values (and this was before the apparition of file handling...)

                      Can't help pressing F5 in the forum...

                      1 Reply Last reply Reply Quote 1
                      • toxonicT
                        toxonic
                        last edited by

                        @d-healey @ustk i'm not at home at the moment, but i'll try your example tomorrow. Indeed i want to store knob values , but in my project i use a sequencer, and when i try to use the preset browser, the sequencer will stop running on each preset change, so i can't use that option.
                        What could be another approach?

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

                          @toxonic You could write the values to a file. Using a panel also relies on the preset system BTW.

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

                          toxonicT 1 Reply Last reply Reply Quote 3
                          • toxonicT
                            toxonic @d.healey
                            last edited by

                            @d-healey okay, that's a good point!

                            1 Reply Last reply Reply Quote 0
                            • toxonicT
                              toxonic
                              last edited by

                              Saving values in a file works fine so far, this seems to be the way to go for me.
                              Just a quick question: which directory would i have to specify in the code, that the compiled plugin can find the preset files in it's own directory (or maybe a subdirectory)? is there a wildcard for that?

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

                                @toxonic I'm not entirely sure of the question but I think your answer might be here - https://docs.hise.audio/scripting/scripting-api/filesystem/index.html#special-locations

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

                                toxonicT 1 Reply Last reply Reply Quote 1
                                • toxonicT
                                  toxonic @d.healey
                                  last edited by

                                  @d-healey ahh, okay! Is there a way to embed the textfiles with the stored parameter values in the compiled binary? I mean, i don't want the end user needing to care about the correct location for the files in order to get the compiled plugin working properly.

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

                                    @toxonic Just include them as scripts

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

                                    toxonicT 1 Reply Last reply Reply Quote 1
                                    • toxonicT
                                      toxonic @d.healey
                                      last edited by

                                      @d-healey Okay, i didn't know, that this works. Actually, the files are saved in the UserPresets Directory.

                                      1. Do the files need a special filexetension, like .js?
                                      2. Can i pass the path in the include statement? Soemthing like
                                      include ("./UserPresets/filename");
                                      

                                      or do the files then need to be stored in the Scriptssubfolder in order that HISE can find them?

                                      1. Can the content of the files be modified, when the the plugin is compiled, so that the user can change the "presets" ?

                                      Sorry for all these questions, but i never used includes for anything other than external scripts...

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

                                        @toxonic They will need to be js files and they need to be in the Scripts folder. The content can't be changed because they are part of the plugin. If you want the files to be separate then you need to find a way of including in one of the appData folders.

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

                                        toxonicT 1 Reply Last reply Reply Quote 0
                                        • toxonicT
                                          toxonic @d.healey
                                          last edited by

                                          @d-healey Okay,thank you for your quick response! 😊
                                          How will the AppData folder be created? When i compile a plugin i usually only find the compiled binary. Is there any information on that topic out there?

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

                                            @toxonic That folder is created automatically when the plugin/standalone runs the first time. If you want to put files in it then you'll need to build an installer that creates the folder and puts the files there.

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

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

                                            20

                                            Online

                                            1.7k

                                            Users

                                            11.8k

                                            Topics

                                            102.8k

                                            Posts