Example program:
local LuaMidi = require ('LuaMidi');
local tracks = LuaMidi.get_MIDI_tracks("tetris.midi");
events = tracks[2]["events"]
for i=2, #events do
console.log(events[i]:get_duration()); --no return value
end
Tetris.midi in a zip file.
On line 147 of LuaMidi.lua, the event table created for the new NoteEvent doesn't have duration information. I gave a look at raw_note myself but it was tough to determine how to find a duration from that.
I take it what needs to happen is looking at the difference between a NoteOn and NoteOff event, but I'm not familiar enough with the MIDI spec or how the data is being digested to really discern how to figure that information out.
Example program:
Tetris.midi in a zip file.
On line 147 of LuaMidi.lua, the event table created for the new NoteEvent doesn't have duration information. I gave a look at raw_note myself but it was tough to determine how to find a duration from that.
I take it what needs to happen is looking at the difference between a NoteOn and NoteOff event, but I'm not familiar enough with the MIDI spec or how the data is being digested to really discern how to figure that information out.