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