HISE Logo Forum
    • Categories
    • Register
    • Login

    Change Variables within function

    Scheduled Pinned Locked Moved Scripting
    5 Posts 3 Posters 38 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.
    • B
      Ben Catman
      last edited by

      Hey guys, i am so sorry for this question, its so noob, but i sinmply have forgotten how to do it:
      How can i assign a variable to a value that i get with an inline function? I decklar a variable x on global level, but how can i change the value?

      Thank you so much
      🙄

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

        @Ben-Catman x = 10

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

        B 1 Reply Last reply Reply Quote 0
        • B
          Ben Catman @d.healey
          last edited by

          @d-healey

          haha of course, but i want to change the value x with a slider and use the new value within another inline function like this:

          var x = 10;

          • get new value from slider for x / say x becomes 12
            -> use the new x value in another inline function:

          Filter1.setAttribute(1,(value+x);

          d.healeyD ChazroxC 2 Replies Last reply Reply Quote 0
          • d.healeyD
            d.healey @Ben Catman
            last edited by

            @Ben-Catman said in Change Variables within function:

            i want to change the value x with a slider

            In your slider's control callback use x = value

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

            1 Reply Last reply Reply Quote 0
            • ChazroxC
              Chazrox @Ben Catman
              last edited by Chazrox

              @Ben-Catman

              I think you could just

              reg x = yourKnob.getValue(); // declare x
              // then just use 'x'...
              

              I think you can also

              local x = yourKnob.getValue(); // from within your inline function...
              // then use 'x'...
              
              1 Reply Last reply Reply Quote 0
              • First post
                Last post

              31

              Online

              1.8k

              Users

              12.0k

              Topics

              104.2k

              Posts