From 96a3e4d321c49ba6b4cc895ae8cf8b14fe794e1b Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 17 Mar 2017 18:13:16 +0100 Subject: [PATCH] Add example Lua script to print region transients --- scripts/_region_transients.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 scripts/_region_transients.lua diff --git a/scripts/_region_transients.lua b/scripts/_region_transients.lua new file mode 100644 index 0000000000..de42992dd1 --- /dev/null +++ b/scripts/_region_transients.lua @@ -0,0 +1,16 @@ +ardour { ["type"] = "Snippet", name = "Region Transient List" } + +function factory () return function () + local sel = Editor:get_selection () + for r in sel.regions:regionlist ():iter () do + local region_pos = r:position() + local region_off = r:start() + print (r:name(), r:position(), r:start()) + local trans = r:transients() + for t in trans:iter() do + -- print absolute timeline position of transients + print (t + region_pos - region_off) + end + print ("----") + end +end end