HISE Logo Forum
    • Categories
    • Register
    • Login

    How do I connect a knob to a CC controller using code?

    Scheduled Pinned Locked Moved General Questions
    5 Posts 3 Posters 67 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.
    • CatABCC
      CatABC
      last edited by

      How do I connect a knob to a CC controller using code?

      //I am a new student at HISE._
      //Windows11 & MacOS Ventura 13.6.7_

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

        @CatABC You can use the on controller callback to get the incoming value of the CC and then set the knob's value.

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

        CatABCC 1 Reply Last reply Reply Quote 0
        • CatABCC
          CatABC @d.healey
          last edited by

          @d-healey Thanks a lot for the tip, I succeeded,🍉 Treat you to watermelon, even though it's just an Emoji,But I really mean it.

          	local number = Message.getControllerNumber();
          	
          	    if (number == 1) { 
          	    
          		   local ccValue = Message.getControllerValue();
          		   Console.print(ccValue);
          		    
          	       local inputValue = ccValue / 127;
           
          	       Console.print(inputValue);
          	       
          	       knb1.setValue(inputValue);
          	       
          	      
          	    }
          

          //I am a new student at HISE._
          //Windows11 & MacOS Ventura 13.6.7_

          VirtualVirginV 1 Reply Last reply Reply Quote 1
          • VirtualVirginV
            VirtualVirgin @CatABC
            last edited by

            @CatABC If you want the knob to represent the actual MIDI values and not a normalized value you can set the "min", "max" and "stepSize" of the knob to reflect that:

            knb1.set("min", 0);
            knb1.set("max", 127);
            knb1.set("stepSize", 1);
            

            If you do that you would just get rid of of the "inputValue" variable and use the "ccValue" directly to set the knob value.

            You can listen to my orchestral mockups here:
            https://www.virtualvirgin.net/

            CatABCC 1 Reply Last reply Reply Quote 0
            • CatABCC
              CatABC @VirtualVirgin
              last edited by

              @VirtualVirgin Cool, thanks for your suggestion, it's very useful

              //I am a new student at HISE._
              //Windows11 & MacOS Ventura 13.6.7_

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

              11

              Online

              1.7k

              Users

              11.8k

              Topics

              103.2k

              Posts