Group sonorities by measure and tempo
Refactor code