There are lots of algos for this. The ones that work well are complex. None of them work that great on full pieces of complex music with many instruments playing at once.
The Ableton Live music package has a great one built in, which appears to do some kind of probabilistic modelling for harmonies. You can send all kinds of crazy noises into it and the resultant chord progressions become increasingly avant-garde, but remain musical.
These algorithms often output midi (ableton does) and it seems you could put that into this Music Suite software and have it spit out notation.
Look in the literature and you will find tons of research on this stuff.