summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2018-09-25 18:50:14 +0200
committerRobin Gareus <robin@gareus.org>2018-09-25 18:50:14 +0200
commit8ff1cc31cbb0d21b1b8f47c3ec7d0d38c6c3cd35 (patch)
tree5f815a13c51ba14c43872eb1058d1f137248c274
parent99a8899c2dc3c5fb671209965437d173e0585f32 (diff)
Add script to exercise PI-stats interface
-rw-r--r--scripts/_calc_dsp_statistics.lua27
1 files changed, 27 insertions, 0 deletions
diff --git a/scripts/_calc_dsp_statistics.lua b/scripts/_calc_dsp_statistics.lua
new file mode 100644
index 0000000000..2d676055a8
--- /dev/null
+++ b/scripts/_calc_dsp_statistics.lua
@@ -0,0 +1,27 @@
+ardour { ["type"] = "Snippet", name = "Calculate DSP stats",
+ license = "MIT",
+ author = "Ardour Team",
+}
+
+function factory () return function ()
+
+ for t in Session:get_routes ():iter () do
+ local i = 0
+ while true do
+ local rv, stats
+ local proc = t:nth_processor (i)
+ if proc:isnil () then break end
+ if proc:to_plugininsert():isnil() then goto continue end
+
+ rv, stats = proc:to_plugininsert():get_stats (0, 0, 0, 0)
+ if not rv then goto continue end
+
+ print (string.format (" * %-28s | min: %.2f max: %.2f avg: %.3f std-dev: %.3f [ms]",
+ string.sub (proc:name() .. ' (' .. t:name() .. ')', 0, 28),
+ stats[1] / 1000.0, stats[2] / 1000.0, stats[3] / 1000.0, stats[4] / 1000.0))
+
+ ::continue::
+ i = i + 1
+ end
+ end
+end end