This awe-inspiring compendium of awesomeness provides what is probably (haven't actually put it to the test yet) a workable skeleton:
I think a framework for generating dance music would probably best be implemented as either a set of self-permutating code generators or, as it appears to be in the book and the Perl.com article, a stack of permutations. I think a set of self-permutating code generators is actually a much more powerful design, with the caveat that you would want some way of prioritizing, tracking, and correlating the existing permutations. (After all there has to be a meta-pattern to the selection of permutations.)
What I have in mind here is not necessarily a giant music-generating code-brain, as much as a musical equivalent to Rails scaffolding - something you can use to auto-generate a skeletal "song" which you then work on manually.
Anyway, I'm just thinking aloud, but it could be pretty cool, especially when combined with Live's controller-mapping facility, which would make operating a device of that nature in real time pretty easy. As long as you had good patches to work with in the live context, a combination of knob-twiddling for sonic shaping and drumming for sequencer control would be pretty cool. (I initially wasn't going to mess with Live, since I don't own it and it's beaucoup dinero, but the MIDI controller mapping is just way too cool.)