HISE Logo Forum
    • Categories
    • Register
    • Login

    SliderPack for variables storage: strange behaviour

    Scheduled Pinned Locked Moved Scripting
    16 Posts 3 Posters 220 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.
    • G
      Giuseppe @d.healey
      last edited by

      @d-healey said in SliderPack for variables storage: strange behaviour:

      Try assigning a control callback to the sliderpack and get the value in there instead of in on init.

      Thanks a lot David. I thought about the SliderPack custom callback, but I should have specified that the only reason the SliderPack is there is because to store data (in the real script it will be invisible). Should I create the callback regardless of the user interaction?

      PS: yes, I'm coming from there! :)

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

        @Giuseppe said in SliderPack for variables storage: strange behaviour:

        Should I create the callback regardless of the user interaction?

        Yes

        @Giuseppe said in SliderPack for variables storage: strange behaviour:

        PS: yes, I'm coming from there! :)

        Your code now makes sense :) I was there too when I first started.

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

        G 2 Replies Last reply Reply Quote 1
        • G
          Giuseppe @d.healey
          last edited by

          @d-healey thanks again, will give it a try tomorrow!

          1 Reply Last reply Reply Quote 0
          • G
            Giuseppe @d.healey
            last edited by

            @d-healey said in SliderPack for variables storage: strange behaviour:

            Yes

            Update: I just stored the variables in two separate Sliders instead of SliderPacks and it works. It's the SliderPack having this init behaviour for some reasons.
            Will try to store the values into a numeric array because having a bunch of knobs just for variable persistence sounds a bit tedious.

            G 1 Reply Last reply Reply Quote 0
            • G
              Giuseppe @Giuseppe
              last edited by

              @Giuseppe New update: no matter what widget I use and/or control callback assigned to it, Hise just won't recall the saved value when launched, A new compile or an interaction with the UI is required to restore those values I need to be persistent.
              I'm obviously doing something wrong, but honestly what's the best way to store a value that needs to be recalled at launch? Is using widgets a good solution or is there something that simply makes a variable persistent?

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

                @Giuseppe said in SliderPack for variables storage: strange behaviour:

                Is using widgets a good solution

                It's pretty much the only solution

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

                G 1 Reply Last reply Reply Quote 0
                • G
                  Giuseppe @d.healey
                  last edited by

                  @d-healey ok, but given that Hise can't read the numeric value of a given widget until an UI event happens or a new compile is launched, how does one solve the issue?
                  Say I want to print the value of a given widget at launch, where should I put the Console.print() line?
                  What I'm trying to understand is how Hise handles the variables storage.

                  d.healeyD G clevername27C 3 Replies Last reply Reply Quote 0
                  • d.healeyD
                    d.healey @Giuseppe
                    last edited by d.healey

                    @Giuseppe said in SliderPack for variables storage: strange behaviour:

                    where should I put the Console.print() line?

                    In the component's control callback - the component must have saveInPreset enabled.

                    What I'm trying to understand is how Hise handles the variables storage.

                    Only component values are saved/restored, not variables.

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

                    1 Reply Last reply Reply Quote 1
                    • G
                      Giuseppe @Giuseppe
                      last edited by

                      @Giuseppe Thanks David. It's starting to make sense :)

                      1 Reply Last reply Reply Quote 0
                      • clevername27C
                        clevername27 @Giuseppe
                        last edited by

                        @Giuseppe Also: ScriptSliderPack.getDataAsBuffer().

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

                        17

                        Online

                        1.7k

                        Users

                        11.8k

                        Topics

                        102.8k

                        Posts