Yes, that will be the problem. As soon as the “midi_device_in” object is garbage collected by Lua it will also close its device.
In this simple example you can avoid this by making the object global (remove the local
keyword).
Yes, that will be the problem. As soon as the “midi_device_in” object is garbage collected by Lua it will also close its device.
In this simple example you can avoid this by making the object global (remove the local
keyword).