I'm trying to write a computer program to generate simple random chord progressions. Is there a way of ranking chords based on how nice they will sound after the previous ones?
Any advice would be amazing, thanks.
That is a very complex question. If you are just looking for simplicity, you could follow some fairly straight-forward guidelines though.
Choose some "candidate" chords. I would think
Choose the order of the progression. (Note that these are not requirements for chord progressions in general, but they do provide some programmatic "rules" for a nice sounding progression).
These are just some basic guidelines, but it could be a start for what you're trying to do. Good luck!
EDIT: I don't want to make an assumption about your knowledge of musical notation. So, just to be clear, when I say
Use the chord ladder to determine your chord progression. There's a thorough explanation of it here, but basically, you want to move down the ladder.
So the iii goes to the vi, which can go to either the ii or the IV. Note that in the last measure, you can either resolve to the I, ending your progression or you can go back to the second rung and play the vi and then go either to a ii or IV.
You could follow this in either major or minor. So either do I ii iii IV V vi vii* for Major or i ii* III iv V VI vii* for minor
So pick major or minor. Then pick a chord to start on. Then follow the chord ladder (making a random choice if one is available). When selecting chords, either play two consecutive chords for 2 beats each, or play one chord for 1 or 2 measures. Always end on your I.
It won't be the most interesting thing musically, and you may get the odd funny result, but it will almost always sound pleasing.
The answer by jadarnel27 is a good one, but there are other scenarios one would prefer when a computer program is created.
1) Your computer program can be used to create abstract forms of music. Which brings other interesting questions to the table: what is random? And how to connect randomness?
I would like to advise you not (only) to think (to much) in the 'progression way'
Example: Your computer program creates a 'chord' (so this means multiple sounding notes) Now the question is: how to build the next chord and connect those notes. For example (easy one) C (c-e-g) to G (g-b-d) would go like: c->b e->d g=g
You can play with these connections (look at big band composers but also Stravinsky) learn how you can connect chords. You could find standards that would apply to all chord connections.
Believe me, the most strange random chords will sound awesome.
You can also think in upper structures, so: CMaj7(b9, b13) would be a C chord and a C#min chord at the same time. How can they move in combination?
Long story short: think of ways 'how to connect' the chords, if this is a consistent one, your music will sound coherent.
PS: Also take a look (=listen) at Stockhausen how he deals with this question.