9
$\begingroup$

How could one approach creating a function to measure the dissonant or consonant quality of a given musical interval?

First, rational relations with smaller numerators and denominators are more consonant, like, for example, the perfect 5th $(\frac{3}{2})$ is more consonant than the major 3rd $(\frac{5}{4})$, which is more consonant than a minor 7th $(\frac{7}{4})$. Secondly, approximations (even irrational ones) of those ratios are only slightly less consonant than the ones with a rational number. For instance, $2^\frac{4}{12} (\approx 1.2599)$, the major 3rd in equal-temperament, sounds only slightly less consonant than the just intonation $\frac{5}{4} (= 1.25)$, and is much more consonant than a minor 7th.

New contributor
André Kugland is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
$\endgroup$
7
  • 8
    $\begingroup$ André, your question is very intriguing but definitely not research level mathematics. The problem here is not how represent mathematically this function, but how to define it in a way that is meaningful for a musician or more generally a music expert: precisely for a given frequency, you should be able to quantitatively express what consonance and dissonance are. $\endgroup$ Commented yesterday
  • 7
    $\begingroup$ I think the question is interesting from the mathematical perspective and do not see, why it should be closed. $\endgroup$ Commented yesterday
  • 4
    $\begingroup$ I agree with @mathoverflowUser and I think in general MO could be a little more friendly to "how to model this phenomenon mathematically" type questions because that's a lot of what applied math is... $\endgroup$ Commented yesterday
  • $\begingroup$ @SamHopkins: There is also a theory from Euler about musical consonance: youtube.com/watch?v=B6Dvfv_ASVg $\endgroup$ Commented yesterday
  • 2
    $\begingroup$ I asked this related question a long time ago: mathoverflow.net/questions/64567/… $\endgroup$ Commented yesterday

4 Answers 4

5
$\begingroup$

A simple approach is to approximate the frequency ratio between two pitches by a rational number, reflecting its likely consonance. Given two frequencies $f_1<f_2$ compute the ratio $r=f_2/f_1$ and approximate this by a rational number $r\approx n/m$ with "small" denominator, say $m<20$. The "dissonance" could then be quantified by $$D=\log_2(nm).$$

More physics based approaches exist, see for example Calculating the Dissonance of a Chord according to Helmholtz Theory (2013). A formula that accounts for both frequency and amplitude to quantify how dissonance is perceived by the human ear, is due to Vassilakis (2001).

See also https://music.stackexchange.com/q/4439

$\endgroup$
3
$\begingroup$

As an extension of Carlo's suggestion to approximate with a rational number, another approach is to find the continued fraction expansion of the pitch ratio and then penalize small coefficients early in the CF. For instance, the expansion of $2^{4/12}$ is $1+\dfrac{1\hskip 1em}{3+}\ \dfrac{1\hskip 1em}{1+}\ \dfrac{1\hskip 1em}{4+}\ldots$; cutting this off just before the 4 gives the expected $1+\frac1{3+1}=\frac54$, whereas if we replace the 4 with a 1 and cut off there, we get the slightly messy $\frac97$ of the septimal major third. The specific details of how to penalize small coefficients would have to be filled in, but this is the direction I'd start looking.

$\endgroup$
1
$\begingroup$

It depends on how you define "consonant" or "dissonant" and what you want to do with the function that can define consonance in your terms.

That being said, I have had some 'success' with defining a positive definite kernel over pitches, which has the advantage of letting you / me see music through a geometric lens and you can use machine learing algorithms for instance in algorithmic compositions.

Here is the kernel I have used:

$$k(a,b) = \frac{ab}{\gcd(a,b)^2}$$

. More details can be found here: Symbolic Music Generation with a single MIDI file and an example recent composition can be found here: Chords journey with piano

$\endgroup$
1
$\begingroup$

This isn’t an answer, but too long to be a comment. The real challenge with doing this is that consonance isn’t a strictly mathematical concept, but also a psychological and cultural one. Mathematics can answer the questions of how objects vibrate and what their resonant frequencies will be, but how these frequencies get interpreted is up to the listener.

For instance, a minor sixth has a frequency ratio of 8:5 in just intonation and a major sixth has a ratio of 5:3, both of which are fairly simple fractions. However, if you go back to medieval times, both of these were considered dissonant harmonies to some degree. The modern perception of this interval is very different, which suggests that this is not a question that math can really answer, unless it’s simply the case that we are more accustomed to more tension between sounds nowadays.

Going further, the idea of simple fractions between frequencies giving rise to consonant sounds goes back to the Greeks. The physical origins are clear; it comes from the fact that the resonant frequencies of a plucked string are whole number multiples of the base tone. However, there are cultures whose musical traditions do not lean so heavily on plucked strings. For instance, the overtones of a Djembe are much closer to the square roots of the Dirichlet eigenvalues of a disk, which are the zeroes of Bessel functions. (The lowest frequency comes from a different effect and is not determined by the drum head.)

For Djembe music, it doesn’t make sense to think of consonance in terms of simple fractions between frequencies, although there are certainly different tones that come from the instrument.

$\endgroup$

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.