Range- scaling faders - how to

Hi.

I’m answering to what AposMus wrote:

The way he describes works as long as you do not use automation. The UI script is limiting the control, but the parameter in the engine still has the full range. If you assign this parameter to an automation channel it will go over the full range and I’m pretty sure this is not what you want.

There is a better way to limit the range of parameters. Instead of using the UI script, you must use the Lua Script module in the Program Tree. The basic procedure is as follows:

In the Lua Script module you define a script parameter. The change callback adjusts the engine parameter with setParameter. You can limit the range with defineParameter or with the change callback. The MacroPage control gets connected to the script parameter. If you assign an automation channel to it, it will have the correct range, because it uses the range you defined in the script. The script parameter serves as an interface between the control on the MacroPage and the engine parameter.

Here is some example code for the Lua Script module:

-- limit Osc 1.Mix of the Synth Zone to a range of 0 to 30%
defineParameter('p1', nil ,0 ,0 ,100, function() onP1Changed() end)

function onP1Changed()
  this.parent:getZone():setParameter("Osc 1.Mix", p1 * 0.3) -- range is 0 to 30 %
end

Cheers,

Matthias