This patch works still has 'quick hack' status in that it relies on a WaveTrack already in place in the project. Probably only suitable as a Plug In in its current form. Possibly could evolve into something more useful in time.
From John Huddleston:
This is my first patch for a project like this so please let me know if it is lacking in any way.
This patch includes basic MIDI playback of single tracks using PortMidi libraries (which you'll need to download). You can start playback from any location and toggle the channel buttons to the left of the notetrack to turn particular instruments on and off. A MIDI preferences tab was also added to allow selection of MIDI playback devices.
There are so many more things that need to be added but I want to put this out for you all to review so I can get feedback about the basic implementation decisions and hopefully some suggestions about how to seamlessly integrate MIDI into the existing wave-oriented playback
system. To test MIDI, you will need to open a wave file before you can get playback. This is because complete integration would involve some macrostructural changes to the playback logic which should probably be made after the MIDI sections have been fully tested.
So, if this seems like a worthwhile starting point, I would love to continue working on this project to see it become a full-fledged component of Audacity.