end
function dsp_configure (ins, outs)
assert (ins:n_audio () == outs:n_audio ())
local tbl = self:table ():get () -- get shared memory table
end
function dsp_configure (ins, outs)
assert (ins:n_audio () == outs:n_audio ())
local tbl = self:table ():get () -- get shared memory table
-- the actual DSP callback
function dsp_run (ins, outs, n_samples)
assert (n_samples < 8192)
-- the actual DSP callback
function dsp_run (ins, outs, n_samples)
assert (n_samples < 8192)
for k = 1,4 do
if xfade > 0 and k > ho and k <= ho + 1 then
ARDOUR.DSP.mix_buffers_with_gain (outs[c]:offset (off), mem:to_float (off), siz, 1 - xfade)
for k = 1,4 do
if xfade > 0 and k > ho and k <= ho + 1 then
ARDOUR.DSP.mix_buffers_with_gain (outs[c]:offset (off), mem:to_float (off), siz, 1 - xfade)
return 20 * 1000 ^ (x / w)
end
function x_at_freq (f, w)
return 20 * 1000 ^ (x / w)
end
function x_at_freq (f, w)
function grid_db (ctx, w, h, db)
-- draw horizontal grid line
function grid_db (ctx, w, h, db)
-- draw horizontal grid line
- local db = ho * filt['hp']:dB_at_freq (f)
- return db + lo * filt['lp']:dB_at_freq (f)
+ -- calculate transfer function response for given
+ -- hi/po pass order at given frequency [Hz]
+ local db = ho * filt['hp']:dB_at_freq (f)
+ return db + lo * filt['lp']:dB_at_freq (f)
ctx:set_source_rgba (.5, .5, .5, .8)
grid_db (ctx, w, h, 0)
ctx:set_source_rgba (.5, .5, .5, .8)
grid_db (ctx, w, h, 0)
ctx:set_source_rgba (.5, .5, .5, .5)
grid_db (ctx, w, h, -12)
grid_db (ctx, w, h, -24)
ctx:set_source_rgba (.5, .5, .5, .5)
grid_db (ctx, w, h, -12)
grid_db (ctx, w, h, -24)
grid_freq (ctx, w, h, 10000)
ctx:unset_dash ()
grid_freq (ctx, w, h, 10000)
ctx:unset_dash ()
ctx:set_source_rgba (.8, .8, .8, 1.0)
ctx:move_to (-.5, db_to_y (response(ho, lo, freq_at_x (0, w)), h))
for x = 1,w do
local db = response(ho, lo, freq_at_x (x, w))
ctx:line_to (-.5 + x, db_to_y (db, h))
end
ctx:set_source_rgba (.8, .8, .8, 1.0)
ctx:move_to (-.5, db_to_y (response(ho, lo, freq_at_x (0, w)), h))
for x = 1,w do
local db = response(ho, lo, freq_at_x (x, w))
ctx:line_to (-.5 + x, db_to_y (db, h))
end