I stumbled upon an old topic on Mac OS X Hints (which no longer exists) that explained something interesting: iTunes, at one point, could convert MIDI files. In the example, it was a conversion to an Audio CD, but in practice, it was possible to encode in any format.
It was quite useful for obtaining an easily editable version of a MIDI file, making it playable anywhere, albeit with the limitations of Apple’s synthesizer.
Firstly, this feature no longer works. Music no longer plays MIDI files, and even macOS no longer integrates a MIDI synthesizer directly. Secondly, it’s not limited to iTunes: QuickTime Player 7 can play MIDI files, and if you have a license for QuickTime 7 Pro (I’ll let you look it up), you can export to AIFF. This solution works until macOS Mojave, the last OS compatible with QuickTime 7. Thirdly, the QuickTime 7 synthesis isn’t extraordinary, so the resulting file is quite average.
Up to iTunes 11
For testing purposes, I went back in time with old versions of iTunes. The most recent one that accepted my MIDI files was version 11.4 under Mac OS X Snow Leopard. With iTunes 12 under Lion or Mountain Lion, it doesn’t work. It might be usable with newer OS versions than Snow Leopard and an older version of iTunes (10 or 11), but I couldn’t test it.
Once the file is in iTunes, it can be burned or converted (your choice). An interesting point to note is that the synthesis isn’t the same on all devices. On the same Mac (Snow Leopard, iTunes 11), the output is the same with both methods (iTunes or QuickTime 7). However, when I performed a conversion via iTunes on Snow Leopard and another on macOS Mojave with QuickTime 7 Pro, the two files were different. So, there might have been a different synthesizer at some point.