If you are looking for a way to convert MIDI audio (.midi) to text format (.txt), the easiest way would be to use some of the online converters that offer exactly this type of conversion. A midi to txt conversion is probably used to transcript the notations or something.
Open MIDI file Open TXT fileAn online converter for MIDI format