Replaced the timer and its callback by a thread for receiving midi in