Add click-free bypass/enable to ACE-Amp
This commit is contained in:
@@ -20,6 +20,7 @@ function dsp_params ()
|
||||
return
|
||||
{
|
||||
{ ["type"] = "input", name = "Gain", min = -20, max = 20, default = 0, unit="dB"},
|
||||
{ ["type"] = "input", name = "Enable", min = 0, max = 1, default = 1, bypass = true, toggled = true },
|
||||
}
|
||||
end
|
||||
|
||||
@@ -42,7 +43,13 @@ function dsp_runmap (bufs, in_map, out_map, n_samples, offset)
|
||||
ARDOUR.DSP.process_map (bufs, n_out, in_map, out_map, n_samples, offset)
|
||||
|
||||
local ctrl = CtrlPorts:array() -- get control port array
|
||||
local target_gain = ARDOUR.DSP.dB_to_coefficient (ctrl[1]) -- 10 ^ (0.05 * ctrl[1])
|
||||
local target_gain;
|
||||
if ctrl[2] <= 0 then -- when disabled
|
||||
target_gain = 1.0
|
||||
else
|
||||
target_gain = ARDOUR.DSP.dB_to_coefficient (ctrl[1]) -- 10 ^ (0.05 * ctrl[1])
|
||||
end
|
||||
|
||||
local current_gain = cur_gain -- start with the same for all channels
|
||||
cur_gain = target_gain -- use target gain if no channel is mapped.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user