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 @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.Oa7c6sas6qvMpiKkPNUWa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XtaOC2aWDNLhnl9x75Wsjp.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
                                • toxonicT
                                  toxonic @d.healey
                                  last edited by

                                  @d-healey uhh, that sounds complicated... 🤔

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

                                    @toxonic Yup :)

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

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

                                      If these are standard HISE preset files though (.preset) then they will automatically be in the appData/User Presets folder.

                                      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 so, could i just change the file extension to .preset ? 😏

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

                                          @toxonic I doubt it

                                          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 Mhh, i compiled the plugin for testing purposes, but i cannot find the appData directory. Where is the place, i should search for?
                                            I build a vst3 fxplugin and put the dll to my standard vst3 folder. It works fine so far in the DAW (except the preset issue), but i there's no appData directory created after the first launch.

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

                                            21

                                            Online

                                            1.7k

                                            Users

                                            11.8k

                                            Topics

                                            102.8k

                                            Posts