HISE Logo Forum
    • Categories
    • Register
    • Login

    If value, and then if another value

    Scheduled Pinned Locked Moved Scripting
    8 Posts 2 Posters 475 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.
    • T
      tomekslesicki
      last edited by tomekslesicki

      Hey guys! I'm having a hard time figuring something out. It's pretty basic, I've already went through the forum hoping to find an answer but didn't. I'm trying to do an if statement, but depending on two values, so like:

      inline function onArticulationControl(number, value) 
      {
      
         if (value == 1) 
          {
          /// STUFF HAPPENS
      
              if (value of another button == 0) {
              //// SOME CHANGE
              }
      
              if (value of another button == 1) {
              //// SOME CHANGE
              }
      }}
      

      So, i guess the answer is - can I do this and if so, how can I check the value of this button in a middle of the first if statement?

      Does that make sense?

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

        @tomekslesicki Yes you can do that. Use logical operators. Go watch my scripting 101 video if you haven't already.

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

        1 Reply Last reply Reply Quote 0
        • T
          tomekslesicki
          last edited by

          Thanks! But how can I get the value of the button in the statement?

          1 Reply Last reply Reply Quote 0
          • T
            tomekslesicki
            last edited by

            Because

            if (value == 1 && Dirt.getValue() == 0)
            

            doesn't work. I'm sure it has to be something obvious at this point but I'm lost!

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

              @tomekslesicki post a snippet

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

              1 Reply Last reply Reply Quote 0
              • T
                tomekslesicki
                last edited by

                I have a crazy amount of code there, I've tried to rebuild this in a simpler form so that the snipped would make sense to somebody else but now it doesn't work and I feel it would take me a while to figure out why...

                Could you point me into a direction here on how to get the value of a button into the if statement? If the short bit of code I posted above correct (is it?), I'll go looking for problems in the other parts of my script.

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

                  @tomekslesicki The code you posted should work, but without context I can't say it's correct.

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

                  1 Reply Last reply Reply Quote 0
                  • T
                    tomekslesicki
                    last edited by

                    I figured it out, I needed to trigger .changed() on button press to refresh the articulation and reload the sample maps. Thanks, David!

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

                    27

                    Online

                    1.8k

                    Users

                    12.0k

                    Topics

                    104.6k

                    Posts