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 632 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.
    • Felix WF
      Felix W
      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_

      David HealeyD 1 Reply Last reply Reply Quote 0
      • David HealeyD
        David Healey @Felix W
        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.

        Free HISE Bootcamp Full Course for beginners.
        YouTube Channel - Public HISE tutorials
        My Patreon - HISE tutorials

        Felix WF 1 Reply Last reply Reply Quote 0
        • Felix WF
          Felix W @David 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 @Felix W
            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/
            I have a Git repo here:
            https://github.com/craig-van-hise

            Felix WF 1 Reply Last reply Reply Quote 0
            • Felix WF
              Felix W @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

              15

              Online

              2.1k

              Users

              13.1k

              Topics

              113.8k

              Posts