Representing music for analysis and composition