i’m trying to fix my script for the new midi syntax and i’ve hit a weird wall.
to connect my midi keyboard i have this in init (which i lifted directly from Molly):
midi_in_device = midi.connect(1)
midi_in_device.event = midi_event
this does not work. but when i go into the paramater menu for setting midi devices (also lifted) and set it to 2 and then back to 1 it reliably works as expected. here’s that code:
params:add{type = "option", id = "output", name = "Output", options = options.OUTPUT, action = all_notes_kill}
params:add{type = "number", id = "midi_device", name = "MIDI Device", min = 1, max = 4, default = 1, action = function(value)
midi_in_device.event = nil
midi_in_device = midi.connect(value)
midi_in_device.event = midi_event
end}
there must be something somewhere in my giant mess of a script that is blocking it, right? what am i missing?