1 ardour { ["type"] = "Snippet", name = "Calculate DSP stats",
3 author = "Ardour Team",
6 function factory () return function ()
8 for t in Session:get_routes ():iter () do
12 local proc = t:nth_processor (i)
13 if proc:isnil () then break end
14 if proc:to_plugininsert():isnil() then goto continue end
16 rv, stats = proc:to_plugininsert():get_stats (0, 0, 0, 0)
17 if not rv then goto continue end
19 print (string.format (" * %-28s | min: %.2f max: %.2f avg: %.3f std-dev: %.3f [ms]",
20 string.sub (proc:name() .. ' (' .. t:name() .. ')', 0, 28),
21 stats[1] / 1000.0, stats[2] / 1000.0, stats[3] / 1000.0, stats[4] / 1000.0))