Nonlinear musical analysis and composition