diff options
author | Robin Gareus <robin@gareus.org> | 2016-04-14 03:08:58 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2016-04-14 03:08:58 +0200 |
commit | 5bbfd0d1bd7d0fc443b25ed16a6df38d8937b19d (patch) | |
tree | 6226351723d470e31910d6b54a24684825aa7190 /scripts/amp3.lua | |
parent | 204c8016c70ea0e91534e30bc5b879da5540e1de (diff) |
luaproc: assert instance access
Diffstat (limited to 'scripts/amp3.lua')
-rw-r--r-- | scripts/amp3.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/amp3.lua b/scripts/amp3.lua index 2f246a252d..ffffd57361 100644 --- a/scripts/amp3.lua +++ b/scripts/amp3.lua @@ -31,15 +31,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 |