Skip to content

LuaMidi.get_MIDI_tracks does not set duration on NoteEvents #2

@okiyama

Description

@okiyama

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions