Forum
    • Categories
    • Register
    • Login

    Rms type or Cosine type Crossfade Curves

    Scheduled Pinned Locked Moved Scripting
    2 Posts 2 Posters 22 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
      Jeetender
      last edited by

      here is a small code, i have a wet and and dry module in HISE, using simple gain, and there is a knob on the UI names wetdryknob, now this script works fine switching between wet and dry from -100 to 0db, but at 50% both the gain are at -50db, the curve is linear, iam not goo at maths, but the gain output should be constant and gain matched. how can i achieve it.

      const var wetdryknob = Content.getComponent("wetdryknob");
      const var FX1 = Synth.getEffect("WET");
      const var FX2 = Synth.getEffect("DRY");
      
      inline function onMasterKnobControl(component, value)
      {
          // Normalize value to 0–1 range
          local normValue = value / 127.0;
         
          // Map WET: 0 → -100dB, 1 → +18dB
          local wetGain = normValue * 127 - 0;
          
          // Map DRY: 0 → +18dB, 1 → -100dB (inverted)
          local dryGain = (1 - wetGain) - normValue * 0 - 101;
      
          FX1.setAttribute(FX1.Gain, wetGain);
          FX2.setAttribute(FX2.Gain, dryGain);
      }
         
      Content.getComponent("wetdryknob").setControlCallback(onMasterKnobControl);
      
      LindonL 1 Reply Last reply Reply Quote 0
      • LindonL
        Lindon @Jeetender
        last edited by

        @Jeetender use an RMS calculation.

        HISE Development for hire.
        www.channelrobot.com

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

        20

        Online

        2.2k

        Users

        13.5k

        Topics

        117.4k

        Posts