Moved midi event detection up into the event loop.
Refactoring
Added handling for dropped clients