I think you can use Audacity to import a MIDI and then export that same audio file as an MP3, but I'm not entirely sure, as I don't work with MIDI's much. I hope this helps you! :) If anything, check in the help section of the documentation that comes with Audacity. or the FAQ/Documentation on the site that I linked above. Either of those hopefully will have what you need. ;)
Audacity can work to record your computer's audio, as long as you are using Windows. I'm not sure if there's an equivalent option on other operating systems, but you could probably find out. If you are on Windows, go to your audio host options (to the left of where you choose you recording input) and choose "Windows WASAPI." Then all you have to do is choose the current headphones or speakers that you are using and you can record what your computer is playing. Here's how to do it on Windows 10:
I hope this helps a little more than my last reply... X3