keep linter happy
better living through divmod
simpler MIDI writing helper function