1 --- session-script example to modulate plugin parameter(s) globally
3 -- Ardour > Menu > Session > Scripting > Add Lua Script
4 -- "Add" , select "Modulate Plugin Parameter", click "Add" + OK.
6 -----------------------------------------------------------------------------
7 -- This script currently assumes you have a track named "Audio"
8 -- which as a plugin at the top, where the first parameter has a range > 200
9 -- e.g. "No Delay Line"
17 name = "Modulate Plugin Parameter",
19 author = "Ardour Lua Task Force",
20 description = [[An example session to modulate a plugin parameter.]]
23 function factory () -- generate a new script instance
25 local count = 0 -- script-instance "global" variable
27 -- the "run" function called at the beginning of every process cycle
28 return function (n_samples)
29 count = (count + 1) % 200; -- count process cycles
30 local tri = math.abs (100 - count) -- triangle wave 0..100
32 -- get the track named "Audio"
33 -- see also http://manual.ardour.org/lua-scripting/class_reference/#ARDOUR:Session
34 -- and http://manual.ardour.org/lua-scripting/class_reference/#ARDOUR:Route
35 local route = Session:route_by_name ("Audio")
36 assert (not route:isnil ()) -- make sure it exists
38 -- the 1st plugin (from top) on that track, ardour starts counting at zero
39 -- see also http://manual.ardour.org/lua-scripting/class_reference/#ARDOUR:Processor
40 local plugin = route:nth_plugin (0)
41 assert (not plugin:isnil ()) -- make sure it exists
43 -- modulate the plugin's first parameter (0) from 200 .. 300
44 ARDOUR.LuaAPI.set_processor_param (plugin, 0, 200.0 + tri)