From 0bb3c166e8b93b79c84db6d649231d882e9cf843 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sun, 24 Mar 2024 23:05:32 +0100 Subject: [PATCH] Add example script to exercise Plugin Properties --- share/scripts/_lv2_plugin_property.lua | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 share/scripts/_lv2_plugin_property.lua diff --git a/share/scripts/_lv2_plugin_property.lua b/share/scripts/_lv2_plugin_property.lua new file mode 100644 index 0000000000..5daa181782 --- /dev/null +++ b/share/scripts/_lv2_plugin_property.lua @@ -0,0 +1,23 @@ +ardour { ["type"] = "Snippet", name = "Exercise Plugin Props", + license = "MIT", + author = "Ardour Team", +} + +function factory () return function () + for r in Session:get_routes ():iter () do -- for every track/bus + local i = 0 + while true do + local proc = r:nth_plugin (i) -- for every plugin + if proc:isnil () then break end + local pi = proc:to_insert () + if pi:plugin(0):unique_id() == "http://gareus.org/oss/lv2/zeroconvolv#CfgStereo" then + print (ARDOUR.LuaAPI.get_plugin_insert_property(pi, "http://gareus.org/oss/lv2/zeroconvolv#ir")) + print (ARDOUR.LuaAPI.set_plugin_insert_property(pi, "http://gareus.org/oss/lv2/zeroconvolv#ir", "/tmp/mono-hall.wav")) + -- in case of ZeroConvo.lv2 the new value will only be returned once the IR is loaded, which may take some time + print (ARDOUR.LuaAPI.get_plugin_insert_property(pi, "http://gareus.org/oss/lv2/zeroconvolv#ir")) + end + i = i + 1 + end + end +end end +