New MidiInputHandler for real time input. Some refactoring