I started making a synthesizer, which would take a single instrument sample, and change its pitch via the undocumented audio api.
After I got that wired up, I found a MIDI.lua file that would take a .mid file and load it into a ‘score’ or ‘opus’ table.
Here, I just winged it. I started by looping through all the song’s track data , and started to build code to split channels into different instruments, etc. This is definitely not ‘by the book’ by any means, as I couldn’t find a book… (lots of good references in the main.lua though)
I went through many stages and phases where the sound was popping terribly, notes were being missed, tempo was completely off, etc.
Video:
http://www.youtube.com/watch?v=wTu0HN7yby0&feature=youtube_gdata_player
Source Code: (try it yourself! I’ve only tried it in the Mac Simulator, let me know how it works for you)