summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2017-02-21 16:12:24 +0100
committerRobin Gareus <robin@gareus.org>2017-02-21 16:15:13 +0100
commit5789206f8807ec6ad919b937dcc582eea2ea7c54 (patch)
tree593ebda02d30e53e2593204937aa01fc531eb884 /scripts
parent35f84bde6a92618179ac13e066fe6d4b15788698 (diff)
update plugin-utils Lua example script
Diffstat (limited to 'scripts')
-rw-r--r--scripts/s_pluginutils.lua11
1 files changed, 10 insertions, 1 deletions
diff --git a/scripts/s_pluginutils.lua b/scripts/s_pluginutils.lua
index 3af803a03e..2f42160b0a 100644
--- a/scripts/s_pluginutils.lua
+++ b/scripts/s_pluginutils.lua
@@ -8,6 +8,7 @@ function factory () return function ()
for r in Session:get_routes():iter() do
if (string.match (r:name(), "dru") and r:n_inputs():n_audio() == 1) then
local proc = ARDOUR.LuaAPI.new_plugin(Session, "http://gareus.org/oss/lv2/fil4#mono", ARDOUR.PluginType.LV2, "cutbass");
+ assert (not proc:isnil())
r:add_processor_by_index(proc, 0, nil, true)
end
end
@@ -16,9 +17,12 @@ function factory () return function ()
-------------------------------------------------------------------------------
-- load a plugin preset
route = Session:get_remote_nth_route(2)
+ assert (route)
-- to 4th plugin (from top), ardour starts counting at zero
plugin = route:nth_plugin(3):to_insert():plugin(0)
+ assert (not plugin:isnil())
ps = plugin:preset_by_label("cutbass") -- get preset by name
+ assert (ps)
print (ps.uri)
plugin:load_preset (ps)
@@ -27,7 +31,12 @@ function factory () return function ()
-- add a LuaProcessor (here "Scope") to all tracks
for t in Session:get_tracks():iter() do
local pos = 0 -- insert at the top
- local proc = ARDOUR.LuaAPI.new_luaproc(Session, "Inline Scope");
+
+ -- the following two lines are equivalent
+ --local proc = ARDOUR.LuaAPI.new_luaproc(Session, "a-Inline Scope");
+ local proc = ARDOUR.LuaAPI.new_plugin (Session, "a-Inline Scope", ARDOUR.PluginType.Lua, "");
+ assert (not proc:isnil())
+
t:add_processor_by_index(proc, pos, nil, true)
-- optionally set some parameters
ARDOUR.LuaAPI.set_processor_param (proc, 0, 5) -- timescale 5sec