Refactored MidiClient.