Refactoring of assignVoices function (midi tuplets)