HISE Logo Forum
    • Categories
    • Register
    • Login

    Global Variable vs. Passing Reg Variables Around?

    Scheduled Pinned Locked Moved Scripting
    7 Posts 3 Posters 416 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.
    • E
      ericchesek
      last edited by

      Hello!

      I have an interface script with a combo box, and a reg boxValue that updates with the value every time the menu selection is changed.

      Now I want to use boxValue in a sampler script processor. Is there a way to pass the reg from the interface script to the sampler script? I found that defining boxValue as a global variable works as intended, but I'm unsure if this is good practice.

      LindonL d.healeyD 2 Replies Last reply Reply Quote 0
      • LindonL
        Lindon @ericchesek
        last edited by

        @ericchesek said in Global Variable vs. Passing Reg Variables Around?:

        Hello!

        I have an interface script with a combo box, and a reg boxValue that updates with the value every time the menu selection is changed.

        Now I want to use boxValue in a sampler script processor. Is there a way to pass the reg from the interface script to the sampler script? I found that defining boxValue as a global variable works as intended, but I'm unsure if this is good practice.

        • its not .

        define a slider(knob) in your script processor and update it with your "boxValue" when it changes. Then in your script processor use this slider...

        HISE Development for hire.
        www.channelrobot.com

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

          @ericchesek What Lindon said. Also what value does the reg hold, is it the same as the combo box value?

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

          E 1 Reply Last reply Reply Quote 0
          • E
            ericchesek @d.healey
            last edited by

            @d-healey
            Correct, it's the same value as the combo box.

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

              @ericchesek Then why do you need the reg?

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

              E 1 Reply Last reply Reply Quote 0
              • E
                ericchesek @d.healey
                last edited by

                @d-healey
                The only answer I have is "I don't know." 😅
                So it's possible to get the value of the combo box directly from a sampler script? I thought that had to be done in the interface script for some reason.

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

                  @ericchesek

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

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

                  22

                  Online

                  1.7k

                  Users

                  11.9k

                  Topics

                  103.6k

                  Posts