3 name = "Simple Amp III",
6 author = "Ardour Lua Task Force",
8 An Example DSP Plugin for processing audio, to
9 be used with Ardour's Lua scripting facility.]]
12 function dsp_ioconfig ()
15 { audio_in = -1, audio_out = -1},
20 function dsp_params ()
23 { ["type"] = "input", name = "Gain", min = -20, max = 20, default = 6, unit="dB", scalepoints = { ["0"] = 0, ["twice as loud"] = 6 , ["half as loud"] = -6 } },
28 -- use ardour's vectorized functions
30 -- This is as efficient as Ardour doing it itself in C++
31 -- Lua function overhead is negligible
33 -- this also exemplifies the /simpler/ way of delegating the
34 -- channel-mapping to ardour.
36 function dsp_run (ins, outs, n_samples)
37 local ctrl = CtrlPorts:array() -- get control port array (read/write)
38 local gain = ARDOUR.DSP.dB_to_coefficient (ctrl[1])
39 assert (#ins == #outs) -- ensure that we can run in-place (channel count matches)
41 assert (ins[c] == outs[c]) -- check in-place
42 ARDOUR.DSP.apply_gain_to_buffer (ins[c], n_samples, gain); -- process in-place