Merge midi changes (bug #4441)