I'd just like to mention that file format is not so much the issue here... I could make a MIDI with crappy sounds, and encode that to an mp3... but it's not like encoding it in mp3, ogg, or flac magically makes the quality higher... Technically, the majority of digital music made (anything that is not a recording of a live performance) is MIDI...
MIDI is just a bunch of on and off signals letting the computer know when to play a note, and how long to play it for. Therefore, MIDI is the base of a lot of digital music. The only difference is you have assigned a sound sample of higher quality to that track. You could conceivably make a "decent" sounding MIDI through the use of soundfonts... but even then there's issues of firstly, those sounds not carrying over on to anyone else's computer, and also the lack of control over sounds.
Through higher end applications, you still use MIDI for many things, however you are able to define the way in which these are used and sound. As well, formats such as mp3, ogg, and flac are usually recordings, meaning that it captures the audio, and is independant of the sound samples used. Because of this, it plays exactly the same, on any player.
Just some related info.