Great to know. Thanks!
I had been trying to get midi.send working in hello_gong so that’s where I copy/pasted that part. Although I ended up using the earthsea script to get my midi send working.
I’ve got a Livid Block grid controller and it needs to have the midi note sent back to it for the LEDs to light up. I’m guessing this would be similar for other controllers like launchpad or apc40.
FWIW here’s what I added:
local function note_on(note, vel)
if nvoices < 6 then
midi.send(midi_device, {144, note, vel})
--engine.start(id, getHz(x, y-1))
engine.start(note, getHzET(note))
start_screen_note(note)
nvoices = nvoices + 1
end
end
local function note_off(note, vel)
midi.send(midi_device, {144, note, 0})
engine.stop(note)
stop_screen_note(note)
nvoices = nvoices - 1
end
midi.add = function(dev)
print('earthsea: midi device added', dev.id, dev.name)
dev.event = midi_event
midi_device = dev
end