1 ardour { ["type"] = "Snippet", name = "Plugin Utils" }
3 function factory () return function ()
5 -------------------------------------------------------------------------------
6 -- add a Plugin (here LV2) to all mono tracks that contain the pattern "dru"
7 -- and load a plugin-preset (if it exists)
8 for r in Session:get_routes():iter() do
9 if (string.match (r:name(), "dru") and r:n_inputs():n_audio() == 1) then
10 local proc = ARDOUR.LuaAPI.new_plugin(Session, "http://gareus.org/oss/lv2/fil4#mono", ARDOUR.PluginType.LV2, "cutbass");
11 r:add_processor_by_index(proc, 0, nil, true)
16 -------------------------------------------------------------------------------
17 -- load a plugin preset
18 route = Session:route_by_remote_id(2)
19 -- to 4th plugin (from top), ardour starts counting at zero
20 plugin = route:nth_plugin(3):to_insert():plugin(0)
21 ps = plugin:preset_by_label("cutbass") -- get preset by name
23 plugin:load_preset (ps)
26 -------------------------------------------------------------------------------
27 -- add a LuaProcessor (here "Scope") to all tracks
28 for t in Session:get_tracks():iter() do
29 local pos = 0 -- insert at the top
30 local proc = ARDOUR.LuaAPI.new_luaproc(Session, "Inline Scope");
31 t:add_processor_by_index(proc, pos, nil, true)
32 -- optionally set some parameters
33 ARDOUR.LuaAPI.set_processor_param (proc, 0, 5) -- timescale 5sec