Perhaps this ?
see also this thread
I found this article, for a Jupyter notebook example of a Markov chain generated chord progression:
Markov Chain for music generation by Alexander Osipenko in @TDataScience Markov Chain for music generation | by Alexander Osipenko | Towards Data Science
2 Likes