A program to analyze and generate music using Markov distributions