Refactored MidiPlayer.java

Refactoring done for MidiPlayer.java