Unless your .txt file is already MIDI file, it will be not simple to produce MIDI file from it through standard multimedia converters.
Nonetheless, you can try and use tools like ArtWonk, which are using algorithms to generate MIDI music based on any source, be it text, DNA sequence, curves, or pretty much any type of data.