Parsing Musical Structure to Enable Meaningful Variations