X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=scripts%2Famp3.lua;h=186ece97312a6fd7d6eebd72140c65956c0d49b4;hb=9ff94edd6eefd441cb3f277c14eaca55ca2b9c1d;hp=2f246a252dd8637c02164c7a7a0694582faea30e;hpb=1473c2d36460707f6484fe5a0f1d913fbb8a77e0;p=ardour.git diff --git a/scripts/amp3.lua b/scripts/amp3.lua index 2f246a252d..186ece9731 100644 --- a/scripts/amp3.lua +++ b/scripts/amp3.lua @@ -1,6 +1,7 @@ ardour { ["type"] = "dsp", name = "Simple Amp III", + category = "Example", license = "MIT", author = "Robin Gareus", email = "robin@gareus.org", @@ -31,15 +32,15 @@ end -- This is as efficient as Ardour doing it itself in C++ -- Lua function overhead is negligible -- --- this also exemplifies the /simpler/ way of letting ardour to --- the channel and offset mapping. +-- this also exemplifies the /simpler/ way of delegating the +-- channel-mapping to ardour. function dsp_run (ins, outs, n_samples) local ctrl = CtrlPorts:array() -- get control port array (read/write) local gain = ARDOUR.DSP.dB_to_coefficient (ctrl[1]) - assert (#ins == #outs) -- ensure that we can run in-place + assert (#ins == #outs) -- ensure that we can run in-place (channel count matches) for c = 1,#ins do - --for c in pairs (ins) do -- also works, slightly less effective + assert (ins[c]:sameinstance(outs[c])) -- check in-place ARDOUR.DSP.apply_gain_to_buffer (ins[c], n_samples, gain); -- process in-place end end