I know that if I played C and B together they would be very dissonant compared to if I played a G or C one octave up. Is there a quantitative way to describe that sort dissonance?

Edit: I understand that smaller ratios between the frequencies of the notes means they are more consonant. My question is how to express that. Notes with the ratio of 2:1 are very consonant, and 15:16 are dissonant. Saying that smaller ratios are more consonant is very qualitative, I'm looking for a quantitative way to represent consonance.

Basically, what I'm trying to do is figure out a way to describe to a computer how consonant or dissonant two or more notes are. I want to be able to put in 1:2 or 15:16 and have a programmatic way to determine which one is more dissonant.

  • 2
    If you can tell the computer which tuning system the notes come from, then I think this is possible. E.g., if they come from Equal Temperament, you could look at n mod 12, and go from there. If the frequencies come from Just Intonation, just look at the denomintor of the ratio: smaller is more consonant. But it sounds as if you might be looking for some sort of universal measure of consonance, something that could say "a perfect fifth in Equal Temperament is x times more dissonant than a major seventh in Just Intonation." If so, I can't help you with that (sorry!). – Alex Basson Oct 30 '11 at 10:44

10 Answers 10


Yes, there are ways to measure it, though there are many different algorithms claiming to be more correct than the others. This formula by Vassilakis is recent (2007).

These measure "roughness", which is similar to dissonance. (Dissonance is basically roughness, but weighted towards certain intervals due to cultural conditioning, which is obviously hard to measure quantitatively.) For two sine tones, roughness vs frequency difference looks like this:

Plots with curves for 100, 200, 400, 600, 1000 Hz, showing sensory dissonance increasing quickly and then decreasing slowly as frequency difference of two tones increases Plot of sensory dissonance vs frequency difference, showing regions for "beats", "roughness", and "two tones"

(Source: William A. Sethares)

For more complex signals, made up of multiple tones:

The roughness of signals corresponding to spectra with more than two sine components is calculated by summing the roughness of all sine-pairs in the spectrum.

For tones with harmonic spectra, the net effect of the roughness between all the harmonics present produces graphs with notches of consonance at intervals that we're familiar with, like 3:2 perfect fifth:

Plot of dissonance vs frequency difference, showing peaks at 1:1, 5:6, 4:5, 3:4, 2:3, 3:5, 1:2 frequency ratios

Plot of sensory dissonance vs frequency difference, showing notches at 1/1, 6/5, 5/4, 4/3, 3/2, 5/3, 2/1 frequency ratios

The black curve is from the older Plomp-Levelt 1965 paper, with this description:

We assume that the total dissonance of such an interval is equal to the sum of the dissonances of each pair of adjacent partials ... these presuppositions are rather speculative ... In this way, the curves ... were computed for complex tones consisting of 6 harmonics. ... shows how the consonance of some intervals, given by simple frequency ratios, depends on frequency.

(So the Plomp-Levelt curve is based on summing up the roughness of adjacent partials while Vassilakis sums "all sine-pairs". (Sethares wrote me and says the "adjacent" thing is just because computational power was limited in the 60s. Comparing every pair is more appropriate.))

Further descriptions of this curve can be found in Marc Leman - Foundations of musicology as content processing science (which also talks about deriving the slendro and pelog scales from the same algorithm applied to inharmonic gong instruments) and Plomp and Levelt's Hidden Ratio

The blue curve is from Sethares Relating Tuning and Timbre, which uses this MATLAB calculation, also based on the Plomp-Levelt curves. (And here's my Python translation.) Here's a MATLAB-based app that uses the 2007 Vassilakis model to also calculate the same curve for 6 harmonics (and has the M3 as more consonant than the m3).

You can see the two curves disagree on whether the m3 or M3 is more consonant. I'm not sure if this is due to calculating only adjacent partials vs all partials or if the partials have different amplitudes or what. Of course, real instruments produce lots of variation in their harmonic spectra, even playing the same note on the same instrument, so these curves are all inherently approximations. Here's a plot I made of violin vs clarinet, showing that the M3 is more consonant when the violin is playing the higher note, due to clarinets producing mostly odd harmonics.

Also, for more than 2 tones, the Sethares algorithm ranks minor and major chords as equally consonant, which is not the usual interpretation. So Erlich and Monzo interpret Sethares' number as only a measure of "roughness" and require "dissonance" to include both "roughness" and "tonalness", where major chords are more consonant because they are closer to the root of a harmonic series (4:5:6) while minor chords are farther away (10:12:15). I don't know of a way to quantify that for arbitrary frequencies, though.

  • 1
    That first curve looks like it matches human perception very well, with dissonance initially being low due to the inability to perceive a difference between two tones that are very close but not an exact match. – user28 Jun 29 '12 at 18:17
  • 4
    Ah, I have a bit more narrow definition of beating than what is used there. I restrict it to the variation in loudness, the amplitude fluctuations described on that page. One it gets into roughness or dissonance I would no longer call it beating. That's what I meant in my comment above: 2.01:1 doesn't sound dissonant (in the grating, disharmonious sense) even though you can hear the beating as amplitude fluctuation. – user28 Jul 9 '12 at 1:30
  • 1
    @SideshowBob because the test tones only have a few lower harmonics. – endolith Dec 27 '17 at 3:52
  • 1
    @SideshowBob see flic.kr/p/edmgiY for comparison – endolith Dec 27 '17 at 6:32
  • 1
    I searched heavily for "This formula" thanks a lot :) – Wolf Aug 28 '18 at 8:50

Yes. It has to do with the ratio of their frequencies. Essentially, the smaller the numbers involved the better.

The perfect unison, with a 1:1 ratio (e.g., C played with the same C), has perfect consonance. C to the next G has a 2:3 ratio; the perfect fifth is the next most consonant. The minor second (e.g., C to C#) is the most dissonant in Western scales with a frequency ratio of 15:16.

What this represents is how often the sound waves "match up". Every third cycle of a C matches with every second cycle of a G, and vice versa; i.e., the peaks of the waves occur at the same time every two cycles (or three cycles, depending on which note you choose as the base). This is often! So overall, your ear perceives the sounds as being in sync and melodious. In contrast, waves that match up infrequently, such as the minor second with only the 15th (16th) cycle matching, are largely out of sync and therefore dissonant.

The mind is strange, and what one perceives as dissonance is not necessarily what another would perceive as dissonance. That said, the closest you'll get to an absolute, objective measure is the base 2 logarithm of the Least Common Multiple of the the sides of the ratio. E.g.:

    lg(LCM(15, 16)) = lg(240) ~= 7.9

This is about 3 times more than

    lg(LCM(2, 3)) = lg(6) ~= 2.6


    lg(LCM(1, 1)) = lg(1) = 0

so this also reflects the fact that the perfect unison has no dissonance. Interestingly, Euler seemed to think the LCM was the way to do this as well1.

(Note that LCM(x, y) = x*y for fully reduced ratios; e.g., 2:3 rather than 4:6.)

[1]: Knobloch, Eberhard (2008). Euler Transgressing Limits: The Infinite and Music Theory. Quaderns d’Història de l’Enginyeria, IX, 9-24. Available online: http://upcommons.upc.edu/revistes/bitstream/2099/8052/1/article2.pdf

  • This isn't quite what I'm asking. I understand the mathematics behind the relationships between the notes. What I'm looking for is a way to express the consonance as a value. Relationships like 1:2, 2:3, and 1:1 are consonant, and 15:16 is dissonant. Is there a way to transform that ratio into a value that represents how consonant or dissonant it is? – Alex Oct 30 '11 at 4:23
  • @Alex Maybe computing the ratio? 15/16 = 0.9375 > 2/3 = 0.66 etc. – user1306 Oct 30 '11 at 14:55
  • 1
    1/1 = 1 > 15/16, so that method doesn't work. I suspect my massaging the numbers I can come up with my own method, but I was hoping someone had already done this sort of thing in the past so I wouldn't have to (re)invent it myself. – Alex Oct 30 '11 at 15:35
  • 2
    I believe this is called "Tenney's harmonic distance". "HD(a/b) = log(ab) where a/b is a relatively prime, usually octave reduced ratio." I plotted it here. (Does this work for chords, too? 4:5:6 is a major chord and 10:12:15 is a minor chord, so minor chord is 1.6 times as dissonant?) – endolith Jun 13 '12 at 21:48
  • 1
    @endolith Good find, very interesting. I would actually expect minor and major chords to have the same amount of dissonance, since both involve a minor third, a major third, and a fifth. I'm inclined to say it's purely the most-dissonant interval that determines the overall dissonance. – user28 Jun 14 '12 at 16:20

Using the empirical formula A+B divided by AB where A and B represent the frequency ratio of the two notes of that interval seems to give an absolute measure of the magnitude of the degree of consonance as follows

Unison-frequency ratio 1:1 yields a value of 2

Octave-frequency ratio 2:1 yields a value of 1.5

Perfect 5th-frequency ratio 3:2 yields a value of 0.833

Perfect 4th-frequency ratio 4:3 yields a value of 0.583

Major 6th-frequency ratio 5:3 yields a value of 0.533

Major 3rd-frequency ratio 5:4 yields a value of 0.45

Minor 3rd-frequency ratio 5:6 yields a value of 0.366

Minor 6th-frequency ratio 5:8 yields a value of 0.325

Major 2nd-frequency ratio 8:9 yields a value of 0.236

Major 7th-frequency ratio 8:15 yields a value of 0.192

Minor 7th-frequency ratio 9:16 yields a value of 0.174

Minor 2nd-frequency ratio 15:16 yields a value of 0.129

Although the formula used is empirical , the results adhere remarkably closely to the accepted order of degree of consonance of the harmonic intervals within an octave

  • It means there are many monotone functions in the math. Looking at the above As and Bs one can see that A+B work equally well, if not better: 2, 3, 5, 7, 8, 9, 11, 13, 17, 23, 25, 31. – horsh Nov 15 '11 at 2:11

Yes, there is a way. There's some brilliant research by Norman D Cook looking specifically the acoustical properties of triads. What he does is sum various partials of any three tones, and maps them onto 3-dimensional space. To make triads fit on 2-D space he calculates the interval difference between the first and second note, and puts that on one axis, the difference between the second note and the third on the y-axis. He then performs the mathematical calculations for various properties such as consonance, tension, modality and instability. He places this on what he calls the triadic grid, where M stands for major triad, m for minor, s for sus, and a for augmented. This theory models how we perceive those chords in the order in which we know them to be consonant, but that we so far have failed to explain mathematically, until now. http://www.res.kutc.kansai-u.ac.jp/~cook/PDFs/MusPerc2009.pdf

The paper is reasonably dense, if you're not into mathematics and music theory I'd suggest watching this video of him discussing his theory. It's revolutionary, I think, because this answer has, I think, so far eluded everybody. It seems like it should be based on how ratios act purely mathematically, but it's actually more complex than that, hence why he calls it a psychophysical model of harmony perception.

N. D. Cooks video on his musical model of dissonance for triads Dissoance calculation


There's a short answer and a longer, more complicated answer; I'll just give the short answer here along with the barest basics of the long answer.

The short answer is: Yes, there is, sorta. If you take the ratio of the frequencies of the two pitches, you'll get some fraction in lowest terms. The smaller the numbers in that fraction, the more consonant the interval. For example, two pitches in unison have a 1:1 ratio. An octave has a 2:1 ratio. A perfect fifth (such as C to G) has a 3:2 ratio, etc. Matthew does a good job in his answer explaining why ratios with smaller numbers sound more consonant than ratios with larger numbers.

But this is all made more complicated by temperament, which is the way in which pitches are tuned relative to each other. See, suppose you tune your A to 440 Hz and then start tuning the other notes relative to that A, using the whole-number ratios as a guide. You'll tune E at 660 Hz, for example. For the first few notes, everything will sound great, but it won't be too long before you start to hear some strange intervals. Some intervals have nice, whole-number ratios, but then others that you'd think should sound good, like the major third from Eb to G, sound really bad. To make a long story short, it turns out to be impossible to tune all twelve chromatic notes using whole-number ratios of frequencies and have everything come out right. Mathematically, it just can't be done.

So you have to make some compromises somewhere. There are many, many different ways to make such a compromise, and I won't detail them here. But for the last two hundred fifty years or so, we've settled on a tuning system known as Equal Temperament. In this system, you start with a reference pitch (e.g. A440), and then the frequency of every other note is 2n/12, where n is the number of half-steps above the reference pitch.

In this system, none of the intervals will have whole-number ratios. But all intervals are consistent (some would say consistently imperfect), and so it allows you to play in any key. It's an effective compromise, but you lose the purity of true whole-number ratio intervals. And so the short answer I gave above turns out to be only sort-of correct, because the consonant intervals will have ratios that are almost, but not in fact actually, nice small whole-number ratios.

  • This is not quite what I'm asking about either. Is there a way to quantitatively measure the difference on consonance or dissonance between two frequencies. For example, say you played the C major chord on an instrument with equal temperament and then played the chord on an instrument with just intonation. The equal implemented would be more dissonant than the just intonation, but is there a way to measure how much more dissonant? – Alex Oct 30 '11 at 4:34
  • "it turns out to be impossible to tune all twelve chromatic notes" In Just intonation there aren't 12 notes. There are just tones in a fractal arrangement with small integer ratio relationships. 12-tone equal temperament is an approximation of Just intonation. – endolith Jun 14 '12 at 14:53

just a couple of additional comments:

  1. To compute a measure of dissonance one should take into account harmonics, i.e. compute all the pairwise contributions to the measureand sum them up (not too hard to do).
  2. For chords of more than two pitches you just sum up all the pairwise contributions to the measure, fundamentals and harmonics.
  3. Dissonance decreases with distance: octave equivalence does not really work in this respect. A minor second is more dissonant than a minor nine that is in turn more dissonant than a minor 17.

Take all the theory with a grain of salt. You may love hot peppers or hate hot peppers.

You may think the major 7th chord (for instance C E G B) that ends many jazz compositions and Darius Milhaud's "La Création du Monde" is the most beautiful consonance imaginable, far more interesting than a plain triad. Or you may think it's the most horrible dissonance.

Consonance and dissonance can be defined objectively, as you see in the other answers, but most people think of them as subjective terms. As such, they depend on the ears, taste and history of the listener.

  • 3
    As a teenager I tried to devise the most dissonant chord I could, and came up with a C major triad superimposed on an F# major triad. I was pleased with how crunchy this sounded at the time. Many years later I hear the same chord and it seems nowhere near as dissonant as when I first heard it. Either I've become more jaded over the years, or maybe (I hope) I've become more harmonically sophisticated. It's me that's changed though, not the notes I'm hearing. – Brian THOMAS Apr 17 '14 at 12:35

You wrote "Chord" but spoke only about two notes combinations, and the answer is already marked. Also don't forget that we are speaking about music here. What is measured is not the physical tone but the perception of the listener.

I wanted to answer nevertheless that for 'real' chords with three or more members the simple math does not apply anymore. The psychological component becomes more important. An augmented chord (c e g#) is (imperfect) consonance for all combinantions, yet it is perceived as one of the most dissonant chords.

Also for two note combinations it matters in which octave you play them. Dissonant intervals are less dissonant if you play them one octave apart while consonant intervals are less consonant when played apart, both psychological effects.

There are other parameters other than the pitch that may take over. Even with just tuning intervals on the lower end of our hearing spectrum do not sound nearly as "good" as in the middle range. Our ear is not linear, it has it preferred bands in the audio spectrum, where the spoken language is.

  • Not all of the intervals in an augmented triad are consonant. The augmented fifth is a dissonance. – Aaron Apr 19 at 4:23

I would answer this from a pure music theory perspective, rather than from a signal processing or EE or audio engineering perspective. The problem when you go down that road (IMO) is that you get into all sorts of signals that can be observed on a oscilloscope, or run thru an FFT, that are not musical at all, it might be the sound of the metal to metal screeching of a rail car on the tracks. In musical terms all kinds of semi-tones that are not found on the diatonic or chromatic scale.

From a musical theory perspective, dissonance is measured by the amount of ALTERED notes in the chord. Altered notes are simply the b5, #5, b9, and #9. In C major these are Gb, G#, Db, and D# respectively. Notice these are all a 1/2 step above and below the 5 and the tonic (root) of the chord. The root and the 5 are the most consonant sounding notes, so by playing notes just 1/2 step away we get the dissonant sound.

Go to a piano or guitar, and play a chord using only these notes - G, C#, G#, C - the 5, b9, #5, and root, in ascending pitch. This is about as dissonant as you'll want to hear.


The problem with Tenney’s Harmonic Distance formula and other formulas is that for higher primes and composites in ratios that sound close to simple ratios they’ll be measured as having a larger HD for instance 3001/2000 sounds incredibly close to a perfect fifth but has a very large HD even though it would be consonant. Here’s a paper on harmonicity where the formula works for many situations but probably has the same problem: https://www.mat.ucsb.edu/Publications/Quantification_of_Harmony_and_Metre.pdf

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.