mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 23:35:03 +01:00
add a script to exercise varispeed playback
This commit is contained in:
parent
bcee4e1518
commit
4e693c1830
1 changed files with 32 additions and 0 deletions
32
scripts/varispeed_callback.lua
Normal file
32
scripts/varispeed_callback.lua
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
ardour {
|
||||||
|
["type"] = "EditorHook",
|
||||||
|
name = "Varispeed Test - 100ms Callback",
|
||||||
|
author = "Ardour Lua Task Force",
|
||||||
|
description = "An example script that invokes a callback a every 0.1sec and modifies the transport speed",
|
||||||
|
}
|
||||||
|
|
||||||
|
function signals ()
|
||||||
|
s = LuaSignal.Set()
|
||||||
|
s:add (
|
||||||
|
{
|
||||||
|
[LuaSignal.LuaTimerDS] = true,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
return s
|
||||||
|
end
|
||||||
|
|
||||||
|
function factory (params)
|
||||||
|
-- upindex variables
|
||||||
|
local cnt = 0
|
||||||
|
local speed = 0
|
||||||
|
local delta = 0.01
|
||||||
|
return function (signal, ref, ...)
|
||||||
|
cnt = (cnt + 1) % 5 -- divide clock: every half a second
|
||||||
|
if cnt == 0 then
|
||||||
|
if speed < -0.25 then delta = delta * -1 end
|
||||||
|
if speed > 0.25 then delta = delta * -1 end
|
||||||
|
speed = speed + delta
|
||||||
|
Session:request_transport_speed (speed)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
Loading…
Add table
Add a link
Reference in a new issue