There is a long history of using AI to analyze, compose, and perform music.
Atari Cambridge Research- part 5: David Levitt shows Music Box on his Lisp Machine
https://www.youtube.com/watch?v=ocwsVkqEKys
Atari Cambridge Research- part 6: Music box with Tom Trobaugh and drum machine with Jim Davis.
https://www.youtube.com/watch?v=DhA0FGsin_s
Cynthia Solomon has shared a treasure trove of rare classic videos of Seymour Papert, Marvin and Margaret Minsky, kids programming Logo and playing with turtles, and many other amazing things at the MIT AI Lab, MIT Media Lab, and Atari Cambridge Research: