MIDI translator in Python