is it possible to automatically launch a lua script when starting Ardour?
Not directly at application start, but when a session is loaded
A script can subscribe to signals, and the script then runs when a given event occurs.
Here is an example, after saving add it via Menu, Edit > Lua Scripts > Lua Script Manager > Action Hook
ardour {
["type"] = "EditorHook",
name = "Rewind and Roll on Load",
author = "Ardour Team",
description = "Session-load callback example",
}
-- subscribe to signals
-- http://manual.ardour.org/lua-scripting/class_reference/#LuaSignal.LuaSignal
function signals ()
return LuaSignal.Set():add ({[LuaSignal.SetSession] = true})
end
-- create callback functions
function factory () return function (signal, ...)
assert (signal == LuaSignal.SetSession)
if not Session:transport_rolling() then
Session:request_locate (0, false, ARDOUR.LocateTransportDisposition.MustRoll, ARDOUR.TransportRequestSource.TRS_UI)
end
end end
This works great with my script, however I have a problem with audio starting to play at the end of the script
I have this:
function factory () return function (signal, ...)
assert (signal == LuaSignal.SetSession)
....
local playhead_is_at = Session:transport_sample ()
Session:request_locate (playhead_is_at, false, ARDOUR.LocateTransportDisposition.MustRoll, ARDOUR.TransportRequestSource.TRS_UI)
end end
Ardour loads audio files but causes randomness Segmentation fault
On the other hand, it works well in the context of an action script.
Why this ?
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.