Midi2lua
local midiData = tempo = 120, tracks = [1] = time = 0.00, event = "note_on", note = 60, velocity = 100 , time = 0.50, event = "note_off", note = 60, velocity = 0 , Use code with caution. Key Use Cases
Lua uses a clean, readable syntax that makes it highly accessible to beginners who are new to programming.
Are you using with a specific software (like Reaper , Renoise , or LÖVE )?
In live entertainment, software like grandMA, Onyx, or QLab controls complex lighting rigs and audio cues. Many of these professional platforms utilize Lua for advanced automation. Midi2Lua allows technicians to use affordable, consumer-grade MIDI controllers to trigger advanced lighting states, move automated fixtures, or sync video playback seamlessly. Gaming and Simulators midi2lua
We’re seeing developers use midi2lua for:
Midi2Lua: Bridging the Gap Between Musical Composition and Game Scripting
for track in mid.tracks: track_notes = [] absolute_ticks = 0 open_notes = {} # (note, channel) -> (start_tick, velocity) local midiData = tempo = 120, tracks = [1] = time = 0
Programs like Reaper and Renoise use Lua natively. A midi2lua pipeline allows you to create custom macros, map complex controller behaviors, and automate editing tasks that standard MIDI mapping cannot handle.
Incorporate metrical structure for loop points or measure‑based callbacks.
This conversion is particularly popular in gaming and automated music systems where a game engine or mod uses Lua for its scripting logic. Primary Uses of midi2lua In live entertainment, software like grandMA, Onyx, or
Assuming you have the tool installed (or the script cloned), usage is typically as simple as a command line argument:
If you want to customize how your Lua data is structured, you can write a quick Python script using the mido library to handle the heavy lifting: