The first successful Max patch I ever wrote that had any notable degree of complexity was this 2nd species counterpoint generator, which I finished on New Year's Eve, 2018. I had been studying for a couple years with counterpoint master Paul Caputo, and got interested in the idea of writing a program that could generate 2nd species counterpoint. I took a cantus firmus that Paul used for our exercises and wrote a patch that spontaneously composes a countermelody to the cantus at the beginning of each new phrase.
The patch follows all the rules of classic 2nd species counterpoint: no parallel fifths or octaves, no direct motion to the fifth or octave, and strict adherence to the cantus firmus's mode (in this case, the dorian mode). An interesting feature however is that the penultimate note, if it is the 7th scale degree and part of a sequence that is ascending to the tonic, can be raised a half step (for example: C-natural can be raised to C-sharp in the D dorian mode).
I never told Paul about this project - the one time our conversations touched on computers and counterpoint, he laughed it off and said that computers could never write decent counterpoint. Maybe he's right. I still remember the frustration of going over my exercises with him, not understanding a change he made that fell outside of the rules, and him telling me, "the most important thing is if it sounds good."