Is there an “easy” formula for calculating the species and quality of the musical interval between two notes

elementary-number-theorymodular arithmeticmusic-theory

Let's number the scale steps of the major scale $1,2,\ldots 7$, i.e., label them from the tonic upward mod $7$ and then add $1$. With that numbering scheme, let the lowest note of a given diatonic interval be $x$ and the highest note $y$.

Is there an "easy" or at least "manageable" formula/algorithm for the function $I(x,y)$, where $I$ takes values $1,2,\ldots,7$ according as the interval between $x$ and $y$ is a unison, second, third, etc.?

For example, $I(6,4)=6$.

As a further question, could we then modify the formula for $I(x,y)$ into one for $J(x,y)$, where $J(x,y)=(I(x,y),Q)$, with $Q$ the quality (major, minor, perfect, augmented, diminished) of the interval according to some convenient numerical labeling?

Best Answer

For the intervals part, I think that by definition the number-name of the interval is simply the distance, the difference $\;y-x\;$, between scale steps $\;x\;$ and $\;y\;$.

Only with two complications: Intervals are numbered starting from $1$, not $0$; and sometimes one doesn't want to distinguish between a sixth, a 13th, or an inverted third.

That leads to the $\;+1\;$ and the $\;\text{ mod }7\;$ in the formula from the earlier answer $$ I(x,y) \;=\; (y-x)\text{ mod }7 + 1 $$

Now for the quality, I have found the following.

First, we calculate the number of fifths in the interval, which is $\;F(y) - F(x)\;$, where $$ F(x) = 2m - \left\lfloor (m+4)/7 \right\rfloor\times7 - \left\lfloor m/7 \right\rfloor\times7 \text{, where } m = x-1 $$ is the number of fifths (modulo octaves) from the tonic to $\;x\;$. (Note that $\;\left\lfloor \dots/7 \right\rfloor\times7\;$ rounds down to the nearest multiple of $7$.)

Then the quality is $$ Q(x,y) = h(k) - h(-k) \text{,} \\ \text{where } k = F(y) - F(x) \\ \text{ and } h(k) = \max(0, \left\lfloor (k+8)/7 \right\rfloor) $$ where the quality is encoded as

Q(x,y) quality name
... ...
$-3$ doubly diminished
$-2$ diminished
$-1$ minor
$ 0$ perfect
$ 1$ major
$ 2$ augmented
$ 3$ doubly augmented
... ...

There is more behind this, but I cannot expand on that now. For now, suffice it to say that $\;h(k)\;$ indicates how 'major' the $\;k\;$-fifths interval is; and a perfect interval is, in some sense, one that is both major and minor.

Related Question