Completed melody generation with 3rd order Markov chain