No - you don’t need to do that now.
m = midi.connect()
-- too send start/stop you can use these
m:stop()
m:start()
-- to receive you can use this
m.event = function(data)
local d = midi.to_msg(data)
-- print something for various data types
-- ignore clock for the moment but look at other types
if d.type = "start" then
-- do stuff
end
if d.type = "stop" then
-- do stuff
end
otherwise use the clocks module like:
function midi_event(data)
msg = midi.to_msg(data)
if msg.type == "start" then
clock.transport.reset()
clock.transport.start()
elseif msg.type == "continue" then
if running then
clock.transport.stop()
else
clock.transport.start()
end
end
if msg.type == "stop" then
clock.transport.stop()
end
-- etc...
see my MIDI Monitor script for more of that example