First off, you don't need to post a giant code block twice if you're only changing one line.
Second, changing the file extension really doesn't actually mean anything. You can use the .mid extension on an ABC notated file if you really wanted. The difference would be in how it's processed. Earlier someone mentioned that Port made an ABC parser, so I'd start by asking him for that code.
Third, you need to explain to us what you're trying to do better. MIDI files are commonly associated with containing musical data, so pretty much everyone here is assuming that you're trying to input musical data into Blockland. Since Blockland can't read MIDI files, they're suggesting you convert into a different music file format: ABC. I get the feeling that what you're trying to do is almost entirely unrelated to music, and you're using MIDI data that's also unrelated to music. Explain to us what you want to do with the MIDI file in more detail.