I'm making a program that generates random simple melodies, based an a randomized basic chord progression from the C Major scale.
What would be a good way to generate a chord progression of 4 triads from this scale? Generating 4 completely random triads (from the 7 existing ones) from the scale usually doesn't sound very good.
I need an approach to generate a chord progression that will sound good or okay, but I don't want to simply choose a progression randomly from an existing pool of progressions. I still want the program to generate these 4 triads by itself, using some simple algorithm to ensure that the generated progression sounds decent.
(As I said, these 4 triads will each be taken from the 7 triads of the C Major scale).
Please note: This question is not a duplicate of my previous question about an approach for creating an algorithm for melody creation. This one is about finding a way to generate a chord progression. Generating melodies is a different topic.
Thanks for your help
EDIT: General guide lines on how to know if a triad will sound okay next to another triad, will also be great.