Update script to use new process_map() API
This commit is contained in:
parent
65425b9fe2
commit
28accee44e
|
@ -11,6 +11,11 @@ function dsp_ioconfig ()
|
||||||
return { { midi_in = 1, midi_out = 1, audio_in = -1, audio_out = -1}, }
|
return { { midi_in = 1, midi_out = 1, audio_in = -1, audio_out = -1}, }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function dsp_configure (ins, outs)
|
||||||
|
n_out = outs
|
||||||
|
n_out:set_midi (0)
|
||||||
|
end
|
||||||
|
|
||||||
function dsp_runmap (bufs, in_map, out_map, n_samples, offset)
|
function dsp_runmap (bufs, in_map, out_map, n_samples, offset)
|
||||||
local ob = out_map:get (ARDOUR.DataType ("midi"), 0)
|
local ob = out_map:get (ARDOUR.DataType ("midi"), 0)
|
||||||
if ob ~= ARDOUR.ChanMapping.Invalid then
|
if ob ~= ARDOUR.ChanMapping.Invalid then
|
||||||
|
@ -28,7 +33,5 @@ function dsp_runmap (bufs, in_map, out_map, n_samples, offset)
|
||||||
ba:add ({0x80, 64, 127})
|
ba:add ({0x80, 64, 127})
|
||||||
mb:push_back (n_samples - 1 - offset, ba:size (), ba:to_array());
|
mb:push_back (n_samples - 1 - offset, ba:size (), ba:to_array());
|
||||||
end
|
end
|
||||||
|
ARDOUR.DSP.process_map (bufs, n_out, in_map, out_map, n_samples, offset)
|
||||||
-- passthrough audio, apply pin/channel mapping
|
|
||||||
ARDOUR.DSP.process_map (bufs, in_map, out_map, n_samples, offset, ARDOUR.DataType ("audio"))
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -14,6 +14,10 @@ function dsp_ioconfig ()
|
||||||
return { { midi_in = 1, midi_out = 1, audio_in = -1, audio_out = -1}, }
|
return { { midi_in = 1, midi_out = 1, audio_in = -1, audio_out = -1}, }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function dsp_configure (ins, outs)
|
||||||
|
n_out = outs
|
||||||
|
end
|
||||||
|
|
||||||
-- "dsp_runmap" uses Ardour's internal processor API, eqivalent to
|
-- "dsp_runmap" uses Ardour's internal processor API, eqivalent to
|
||||||
-- 'connect_and_run()". There is no overhead (mapping, translating buffers).
|
-- 'connect_and_run()". There is no overhead (mapping, translating buffers).
|
||||||
-- The lua implementation is responsible to map all the buffers directly.
|
-- The lua implementation is responsible to map all the buffers directly.
|
||||||
|
@ -41,8 +45,7 @@ function dsp_runmap (bufs, in_map, out_map, n_samples, offset)
|
||||||
-- The following code is needed with "dsp_runmap" to work for arbitrary pin connections
|
-- The following code is needed with "dsp_runmap" to work for arbitrary pin connections
|
||||||
-- this passes though all audio/midi data unprocessed.
|
-- this passes though all audio/midi data unprocessed.
|
||||||
|
|
||||||
ARDOUR.DSP.process_map (bufs, in_map, out_map, n_samples, offset, ARDOUR.DataType ("audio"))
|
ARDOUR.DSP.process_map (bufs, n_out, in_map, out_map, n_samples, offset)
|
||||||
ARDOUR.DSP.process_map (bufs, in_map, out_map, n_samples, offset, ARDOUR.DataType ("midi"))
|
|
||||||
|
|
||||||
-- equivalent lua code.
|
-- equivalent lua code.
|
||||||
-- NOTE: the lua implementation below is intended for io-config [-1,-1].
|
-- NOTE: the lua implementation below is intended for io-config [-1,-1].
|
||||||
|
|
|
@ -54,13 +54,16 @@ function dsp_init (rate)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function dsp_configure (ins, outs)
|
||||||
|
n_out = outs
|
||||||
|
end
|
||||||
|
|
||||||
function dsp_runmap (bufs, in_map, out_map, n_samples, offset)
|
function dsp_runmap (bufs, in_map, out_map, n_samples, offset)
|
||||||
local pos = self:shmem():atomic_get_int(0)
|
local pos = self:shmem():atomic_get_int(0)
|
||||||
local buffer = self:shmem():to_int(1):array()
|
local buffer = self:shmem():to_int(1):array()
|
||||||
|
|
||||||
-- passthrough all data
|
-- passthrough all data
|
||||||
ARDOUR.DSP.process_map (bufs, in_map, out_map, n_samples, offset, ARDOUR.DataType ("audio"))
|
ARDOUR.DSP.process_map (bufs, n_out, in_map, out_map, n_samples, offset)
|
||||||
ARDOUR.DSP.process_map (bufs, in_map, out_map, n_samples, offset, ARDOUR.DataType ("midi"))
|
|
||||||
|
|
||||||
-- then fill the event buffer
|
-- then fill the event buffer
|
||||||
local ib = in_map:get (ARDOUR.DataType ("midi"), 0) -- index of 1st midi input
|
local ib = in_map:get (ARDOUR.DataType ("midi"), 0) -- index of 1st midi input
|
||||||
|
|
Loading…
Reference in New Issue
Block a user