Midi2lua [2026 Update]

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.

# Convert your MIDI file midi2lua my_song.mid --output my_song.lua If you are working in a restricted environment (like a Roblox plugin), you can use a pure Lua MIDI parser. Simply load the binary MIDI file as a string and decode the variable-length values. midi2lua

If you’ve ever built a rhythm game, programmed a generative visualizer, or tried to sync a light show to a backing track, you know the pain of manually transcribing note data. You have a beautiful melody in your DAW (Digital Audio Workstation), but your Lua script just sees a list of numbers. If you are tired of guessing note timings

Turning MIDI notes into executable code for games, visuals, and custom DAW tools. Let midi2lua handle the handshake

Want a boss in your RPG to cast spells on specific beats of the background music? Convert the MIDI percussion track to Lua. When the Lua clock hits tick 1920 , spawn the fireball. It is deterministic and perfectly synced.

-- main.lua local midi_data = require("song") -- A simple scheduler local current_tick = 0 local bpm = 120 local ticks_per_beat = midi_data.ticks_per_beat