Grouping notes and rests