2 ["type"] = "EditorHook",
3 name = "OSC Callback Example",
4 author = "Ardour Lua Task Force",
5 description = "Send OSC messages",
8 function action_params ()
11 ["uri"] = { title = "OSC URI ", default = "osc.udp://localhost:7890"},
20 [LuaSignal.SoloActive] = true,
21 [LuaSignal.RegionPropertyChanged] = true,
22 [LuaSignal.Exported] = true,
23 [LuaSignal.TransportStateChange] = true
29 function factory (params)
30 return function (signal, ref, ...)
31 local uri = params["unique"] or "osc.udp://localhost:7890"
32 local tx = ARDOUR.LuaOSC.Address (uri)
33 -- debug print (stdout)
34 -- print (signal, ref, ...)
36 if (signal == LuaSignal.Exported) then
37 tx:send ("/session/exported", "ss", ...)
38 elseif (signal == LuaSignal.SoloActive) then
39 tx:send ("/session/solo_changed", "")
40 elseif (signal == LuaSignal.TransportStateChange) then
41 tx:send ("/session/transport", "if",
42 Session:transport_frame(), Session:transport_speed())
43 elseif (signal == LuaSignal.RegionPropertyChanged) then
45 tx:send ("/region_property_changed", "sTTiii",
47 (pch:containsFramePos (ARDOUR.Properties.Start)),
48 (pch:containsFramePos (ARDOUR.Properties.Length)),
49 obj:position (), obj:start (), obj:length ())