David Cope used lisp for his 'Experiments in Musical Intelligence'. Lisp is very suited to this problem, and it's through his books that I first 'got' lisp (at the time, I was trying to do something similar in Java). Anyone interested in algorithmic composition should absolutely check out his work.