Is anyone aware of any formulas that can be used to calculate consonance or dissonance from a list of frequencies (in hertz)?
I realize consonance/dissonance is a somewhat nebulous concept. What I mean is what the human ear perceives as a need for resolution (I realize this is probably even more nebulous).
So for example, in 440 hz equal temperament, a C major triad starting on C5 (C5 - 523.2511 hz, E5 - 659.2551, G5 - 783.9909) would be perceived as mostly consonant (not in need of resolution), whereas a C diminished triad (C5 - 523.2511 hz, Eb5 - 622.2540 hz, Gb5 - 739.9888) would be perceived as quite dissonant (and in need of resolution). One can imagine upper chord extensions, which would generally (always?) add dissonance. This feels to me like a phenomena which should be able to be approximated with a formula.
For context: I'm working on an application which randomly generates chromatic contexts (sets of possible notes in hertz), scales based upon that chromatic context, and chords based upon those scales. I'm in need of a formula which will allow me to programmatically predict which chord cadences may prove pleasing to the human ear (moving from consonance, to dissonance, and back to consonance).
I realize that this is a difficult problem. Anything you can do to point me in the right direction would be helpful.