An algorithm that learns by listening to- and analyzing a number of songs (input), and outputs and print out a new song (or song phrase) on the basis of that input.
Using Markov Chain, the machine progresses a new and unique song by predicting functional harmony from a sources of existing songs.
Using Context Free Grammar, melody is written by following rules formed by the input melody’s relation to the chords.
Generating text as such often turns into gibberish.
The human memory of context in music is shorter and more volatile than in textual or verbal communications.
And the variables are fewer:
Almost any pop/rock song written since 1950’s are structured around 3 or 4 different chords.
Programming from A to Z