Audacity is used to edit sound files. A MIDI file does not actually contain sound. It contains commands to be sent to MIDI instruments (like the speed of the song, when to play what note and how loud). The reason it plays in your computer is that it has some 'default' software MIDI instruments (you can also send them to for instance a keyboard, synthesizer or drumcomputer).
To edit a midi file you can use an arrangement tool like Muse or Rosegarden (I am unsure how well they export to MIDI, but I know they can import). If you want to edit the music in an audacity way, you'll first have to find a way to record what is played, for instance record the output of your soundcard somehow.
You should be able to play the files with 'aplaymidi'.