mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-08 07:45:00 +01:00
luaproc: assert instance access
This commit is contained in:
parent
204c8016c7
commit
5bbfd0d1bd
2 changed files with 15 additions and 6 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue