Midi2lua May 2026

Enter —a lightweight utility that acts as a translator between the universal language of MIDI and the elegant simplicity of Lua tables. What is midi2lua ? At its core, midi2lua is a parser/converter. It takes a standard .mid file (or raw MIDI bytes) and converts the event stream into a native Lua data structure.

-- Output from midi2lua { ticks_per_beat = 480, tracks = { { -- Track 1: Piano { tick = 0, type = "note_on", note = 60, velocity = 100 }, { tick = 120, type = "note_off", note = 60, velocity = 64 }, { tick = 240, type = "note_on", note = 64, velocity = 95 } } } } 1. Rhythm Games (Roblox / Love2D) If you are building a Dance Dance Revolution or Guitar Hero clone in Roblox (Luau) or Love2D, timing is everything. midi2lua allows your level designers to compose in FL Studio or Ableton, then drop the exported file into your game’s asset pipeline. midi2lua

Instead of hardcoding noteOn(60, 100) a thousand times, you feed your MIDI file into midi2lua , and it outputs a table like this: Enter —a lightweight utility that acts as a

function love.update(dt) -- Convert real time to ticks (simplified) current_tick = current_tick + (dt * (bpm / 60) * ticks_per_beat) It takes a standard

If you are tired of guessing note timings or hardcoding arrays of integers, give it a try. Compose in the piano roll. Code in Lua. Let midi2lua handle the handshake. Have you used MIDI with Lua before? Are you building a rhythm game or a synth tool? Let me know in the comments below.