Here is an abstraction for a 2 step markov chain. It's using the [coll] object and is largely based on ideas from here http://algorithmiccomposer.blogspot.com/2010/05/algorithmic-composition-tutorial-markov.html
it has a time out function that works quite well if you give it discontinuous bits of information - it will end up playing back phrases. The rhythm thing that's included with the help patch isn't great, but it gives some sort of idea.
Simon
the save function is very buggy!!!!
just got rid of the save function altogether - use [textfile] or a message box or something
...the help patch needs a help patch ... I just added a value to the rhythm sequence to keep if from stalling. If it is stopping it is because it is calling up an index that doesn't exist. You can see which index is being addressed inside of the [marvov2step] abstraction - it's the [$1-$2( at the top of the reader subpatch.