Cool. I love the demo where it's hooked up to a player piano.
After a quick glance at the source, it seems like what you do is build a simple Markov chain from the input snippet and then randomly sample it to produce the output snippet. Is that about right?