Bit of refactoring tidy-up to MIDI code