Refactor, renaming a few variables.
All-notes-off event on all channels if sequences change to avoid hanging notes.