Ported to RtMidi 2.1, tested on Python 2.6, 2.7, 3.4.