Forum
    • Categories
    • Register
    • Login

    XY Pad Gain Scaling...

    Scheduled Pinned Locked Moved Unsolved Scripting
    1 Posts 1 Posters 11 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.
    • J
      JamesC
      last edited by

      Morning all hope you are all enjoying the holidays still.

      I've got an XY Pad in a project that in itself is working nicely doing what it should and has a knob assigned to X axis and one to Y axis as you would expect, I'm wanting to control the gain on 4 simple gains 2 on the X 2 on the Y which again I've got working as it should, I'm just not sure to the maths for the values currently I've got it set to this:

      inline function onxypadControl(component, value)
      {
      	local x = component.data.x;
      	local y = component.data.y;
      	
      	gains1[0].setAttribute(gains1[0].GainValue, 36 * x);
      	gains1[1].setAttribute(gains1[1].GainValue, 36 - 36 * y);
      	
      	gains2[0].setAttribute(gains2[0].GainValue, 36 * x);
      	gains2[1].setAttribute(gains2[1].GainValue, 36 - 36 * y);
      	
      	knbxy[0].setValue(x);
      	knbxy[1].setValue(y);
      	
      	component.repaint();
      	
      }
      

      Which works to set the gain between 0 and 36. Now 36db is going to be way too loud for whats going on here so yes I could reduce that but also gain running right down to -100 whats the easiest way for me be able to include some of that in the range essentially looking at -30 to 20 or some such or in other words almost barely noticeable to packs some punch if you want.

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

      26

      Online

      2.1k

      Users

      13.1k

      Topics

      113.8k

      Posts