i do not know how the algorithm works. at some level the steps appear to be random with some intelligence behind it. for instance with some songs i've noticed the chorus will have the same step patter ...
I think there is a mac application called soft windows. Dancing Monkeys doesn't appear to be that complicated. Also I believe the author has the source on the site and it looks to be done in c and mat ...