Models of Music Cognition and Composition