don't ship fan-out instrument lua script (but keep it as example)

This commit is contained in:
Robin Gareus 2016-11-10 04:54:42 +01:00
parent b116a68a5c
commit e34f8dbf1e

View File

@ -17,13 +17,13 @@ function factory () return function ()
for r in sel.tracks:routelist ():iter () do
local proc = r:the_instrument ():to_insert()
if proc:isnil () then
print ("Track", r:name(), "does not have an instrumenr plugin")
print ("Track", r:name(), "does not have an instrument plugin")
goto next
end
local plugin = proc:plugin(0);
if (r:n_outputs ():n_audio() ~= proc:output_streams():n_audio()) then
print ("Instrument outputs", proc:output_streams():n_audio(), "do not match track outputs", r:n_outputs ():n_audio())
print ("Instrument ", proc:name(), "outputs", proc:output_streams():n_audio(), "do not match track outputs", r:n_outputs ():n_audio())
goto next
end
@ -36,7 +36,12 @@ function factory () return function ()
targets[nn] = targets[nn] + 1
end
-- create busses
if #targets < 2 then
print ("Instrument ", proc:name(), "has only 1 output bus. Nothing to fan out.")
goto next
end
-- create busses ; TODO retain order
for t,c in pairs (targets) do
local rt = Session:route_by_name (t)
if rt:isnil () then
@ -44,13 +49,15 @@ function factory () return function ()
end
end
r:output():disconnect_all(nil)
r:panner_shell():set_bypassed(true)
r:output():disconnect_all (nil)
r:panner_shell():set_bypassed (true)
-- connect the busses
for i = 1, proc:output_streams():n_audio() do
local pd = plugin:describe_io_port (ARDOUR.DataType("Audio"), false, i - 1)
local nn = proc:name() .. " " .. pd.group_name;
local rt = Session:route_by_name (nn)
assert (rt)
local op = r:output():audio (i - 1)
local ip = rt:input():audio (pd.group_channel)