Midi2lua ⏰ 🆕
-- Usage Example: -- local midiData = parseMIDI("song.mid") -- for _, note in ipairs(midiData.notes) do -- print(string.format("Note: %d, Start: %.2fs, Duration: %.2fs", note.pitch, note.time, note.duration)) -- end
time = 0, type = "note_on", channel = 1, note = 60, velocity = 90, time = 0.5, type = "note_off", channel = 1, note = 60, velocity = 0,
file:close()
The user interacts with a MIDI device, sending a raw data packet (usually a 3-byte message containing the status, note/CC number, and velocity/value). midi2lua
: A converter takes the MIDI data and transforms it into a series of task.wait() and RemoteEvent calls that tell the server to play specific sound IDs at specific times.
What (e.g., Roblox, REAPER, Defold) you are targeting
Rhythm games (like Guitar Hero or Dance Dance Revolution clones) require precise synchronization between music tracks and on-screen notes. Manually coding thousands of falling notes is an impossible task. -- Usage Example: -- local midiData = parseMIDI("song
A single Lua file that returns a table like:
The Lua runtime matches the MIDI input to a specific script template and executes the corresponding code instantly. Writing a Basic midi2lua Script
Beyond the named tools, a rich collection of Lua libraries enables developers to create custom midi2lua solutions: Manually coding thousands of falling notes is an
It is incredibly easy to embed into larger applications (like game engines and DAWs).
(related search suggestions sent)
Overview
Midi2Lua provides a straightforward interface with three primary functions:

