HISE Logo Forum
    • Categories
    • Register
    • Login

    Inverting a knob

    Scheduled Pinned Locked Moved General Questions
    3 Posts 2 Posters 164 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
      Ender
      last edited by

      Hello everyone,
      i'd like to invert a knob, so the minimum value would be 1 and the maximum 0. Using the properties of the knob doesn't work and found this post (https://forum.hise.audio/post/14243)

      While i understand the idea of this simple line, i don't know how to implement it in a function linked to my knob. Here's what i wrote (I have some experience with C# and a tiny bit of Unity3D oriented Javascipt, so i'm a newbie with Hise scripting ):

      const var knobAmount = COntent.getComponent("LFOAmount");
      
      inline function onKnobControl(value){
      	1-amountKnob.getValue(0, 1);
      }
      

      I'm sure i miss something simple, but i can't figure out what...

      Thanks in advance!

      ustkU 1 Reply Last reply Reply Quote 0
      • ustkU
        ustk @Ender
        last edited by ustk

        @Ender you already have value as callback's argument

        So:

        inline function onKnobControl(value)
        {
        	local invVal = 1-value;
        	
        	Console.print(invVal);
        }
        

        Can't help pressing F5 in the forum...

        E 1 Reply Last reply Reply Quote 0
        • E
          Ender @ustk
          last edited by

          @ustk said in Inverting a knob:

          @Ender you already have value as callback's argument

          So:

          inline function onKnobControl(value)
          {
          	local invVal = 1-value;
          	
          	Console.print(invVal);
          }
          

          Hello @ustk ,

          I just had to do some little adjustment to the function you wrote and everything works like i want :)

          Thank you very much for your help!

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

          25

          Online

          1.7k

          Users

          11.8k

          Topics

          103.0k

          Posts