The notes

First, let’s define what is a note.

A note is an element of the countable set NN. Here exists a bijection from Z\mathbb Z to NN denoted as kνkk\mapsto \nu_k. Therefore, all notes form a sequence ,ν2,ν1,ν0,ν1,ν2, \dots,\nu_{-2},\nu_{-1},\nu_0,\nu_1,\nu_2,\dots

Our goal is to define a frequency assignment, which is a mapping f:NR+f:N\rightarrow\mathbb R^+, whose meaning is the frequency (in Hz) of the sound of a note.

It is a natural idea to define a sequence fkf ⁣(νk). f_k\coloneqq f\!\left(\nu_k\right).

It makes sense that the sequence is in strictly increasing order.

The octaves

Now, let’s think about a musical interval. At this stage, a musical interval can be defined as an unordered pair of notes. After long time of experimenting, people find that they tend to think a musical interval extremely harmonic if it consists of such two notes that the frequency of one of them doubles that of the other.

In other words, the musical interval of νa\nu_a and νb\nu_b is extremely harmonic if fb=2faf_b=2f_a. In fact, it is so harmonic that if the two notes are played simultaneously, a person tend to think there is only one note being played:

1
2
3
4
motif = c4 c g g a a g2
piano:
V1: o4 motif motif
V2: o5 motif

The audio above is an illustration for octave intervals. As can be heard, the first part of the audio is played in octave intervals while the second part is played in single notes.

Considering that, here comes an amazing idea by which we can kind of make the sequence {fk}\left\{f_k\right\} seem “periodic”. Let the “period” be denoted as nn. Because it is not virtually periodic, we tend to call it an octave instead of a period. After that, the constant nn is the length of an octave.

What on earth is an octave defined? It is k:fk+n=2fk. \forall k:f_{k+n}=2f_k. Why do we say an octave is like a period? It is because according to the explanation above, corresponding notes in different octaves sound so harmonic that a person almost think they are the same. In this way, for some questions, we only need to consider a single octave instead of all notes. Let’s define the base octave, notes of which can generate all other notes by multiplying the frequency by a power of 2: O0{νk|kT}, O_0\coloneqq\left\{\nu_k\,\middle|\,k\in T\right\}, so we can say the frequency assignment has nn different tones. A tone is an integer in T[0,n)Z T\coloneqq\left[0,n\right)\cap\mathbb Z representing where a note is in an octave.

We can thus define a sequence of octaves Om{νk+mn|νkO0}. O_m\coloneqq\left\{\nu_{k+mn}\,\middle|\,\nu_k\in O_0\right\}.

In fact, any octave can be the base octave. They are all the same. For any mm, all notes can be generated by notes in OmO_m. TO1O0O1O20νnν0νlν2n1νn+1ν1νn+1ν2n+12νn+2ν2νn+2ν2n+2n1ν1νn1ν2n1ν3n1 \begin{array}{|c|cccccc|} \hline T & \cdots & O_{-1} & O_0 & O_1 & O_2 & \cdots\\ \hline 0&\cdots& \nu_{-n}&\nu_0& \nu_l & \nu_{2n}&\cdots\\ 1&\cdots&\nu_{-n+1}&\nu_1&\nu_{n+1}&\nu_{2n+1}&\cdots\\ 2&\cdots&\nu_{-n+2}&\nu_2&\nu_{n+2}&\nu_{2n+2}&\cdots\\ \cdots&\cdots&\cdots&\cdots&\cdots&\cdots&\cdots\\ n-1&\cdots&\nu_{-1}&\nu_{n-1}&\nu_{2n-1}&\nu_{3n-1}&\cdots\\ \hline \end{array} If we define pklog2fkp_k\coloneqq\log_2f_k, it is interesting to see that k:pk+n=pk+1. \forall k:p_{k+n}=p_k+1. From that, we can naturally think an excellent frequency assignment be defined as pkp0+kn,p_k\coloneqq p_0+\frac kn, (1)(1) which is an elegant arithmetic progression.

The octave group

Note that here “group” is the group concept in algebra.

Let O0O_0 be isomorphic to the additive group of Z/nZ\mathbb Z/n\mathbb Z, the integers modulo nn, under the isomorphism kνkk\mapsto\nu_k, which means to make O0O_0 a cyclic group of order nn. I call this group an octave group.

To make you have a good sense of what on earth the group looks like, the definition of its group operation can be defined as νaνbν(a+b)%n,\nu_a\circ\nu_b\coloneqq\nu_{\left(a+b\right)\mathbin\%n}, (2)(2) where x%yxyxyx\mathbin\%y\coloneqq x-y\left\lfloor\frac xy\right\rfloor.

Note that this binary operator \circ can be extended to be used for the whole NN while the definition remains the same as Formula 2.

The octave group has a musical meaning which we should take a further look at musical intervals to find out.

The musical intervals

Taking Formula 1, people find that although it is sometimes subjective whether a musical interval sounds harmonic or not, it does not depend on where the interval is located but on how far the two notes making up the interval are.

Taking this sense, we can consider only those intervals involving ν0\nu_0 because we can always translate a interval so that one of its notes is ν0\nu_0. Taking this idea, we can conclude that an interval can be represented by a note νk\nu_k because the interval is equivalent to another interval which consists of ν0\nu_0 and νk\nu_k.

We can make this idea even further. Previously, I have stated that a note can always be generated by a note in O0O_0. Therefore, an interval can be represented as a note in O0O_0.

Now, let’s look back to the octave group (O0,)\left(O_0,\circ\right). Denote the interval bb as that represented by νb\nu_b. Then, translate interval bb to such a location that its lower note is νa\nu_a. Then, its higher note represents the same interval as νaνb\nu_a\circ\nu_b.

Well, why do we focus on the group? It is because we need to mention an important concept in group theory, which is “generator”. It has something to do with determining the value of nn.

The value of p0p_0 does not matter because changing it is just a translation of the whole sequence. What really matters is the value of nn.

The inventor of the current prevailing frequency assignment (which is the 1212-tone equal temperament shown in Formula 3) may think the generator of the group a vital thing. Actually, people think it a wonderful thing that a note representing a very harmonic interval is a generator of the octave group.

Fortunately, such a goal is achievable. People find that if pb=pa+712p_b=p_a+\frac7{12}, then the interval (which is the perfect fifth interval if you know music theory) consisting of νa\nu_a and νb\nu_b sounds very harmonic:

1
2
3
4
motif = e4 a f2 d4 g c2
piano:
V1: motif
V2: (transpose 7) motif

Furthermore, as can be seen in the following table, ν7\nu_7 is a generator of the group O0O_0 if n12n\coloneqq12: j01234567891011ν7jν0ν7ν2ν9ν4ν11ν6ν1ν8ν3ν10ν5 \begin{array}{|c|cccccccccccc|} \hline j&0&1&2&3&4&5&6&7&8&9&10&11 \\\hline \nu_7^{\circ j}& \nu_0&\nu_7&\nu_2&\nu_9&\nu_4&\nu_{11}&\nu_6&\nu_1& \nu_8&\nu_3&\nu_{10}&\nu_5 \\\hline \end{array} Thus, wonderful! Let’s take n12n\coloneqq12.

The 1212-tone equal temperament

The 1212-tone equal temperament is the most popular frequency assignment used nowadays. It is defined as fk16.35162k12,f_k\coloneqq16.3516\cdot 2^\frac k{12}, (3)(3) which can be derived from Formula 1 taking p04.03136n12. p_0\coloneqq4.03136\qquad n\coloneqq12.

The frequency assignment has 1212 different tones, 77 of which have their names: Cmν12m,Dmν12m+2,Emν12m+4,Fmν12m+5,Gmν12m+7,Amν12m+9,Bmν12m+11. \begin{align*} \mathrm C_m&\coloneqq\nu_{12m},\\ \mathrm D_m&\coloneqq\nu_{12m+2},\\ \mathrm E_m&\coloneqq\nu_{12m+4},\\ \mathrm F_m&\coloneqq\nu_{12m+5},\\ \mathrm G_m&\coloneqq\nu_{12m+7},\\ \mathrm A_m&\coloneqq\nu_{12m+9},\\ \mathrm B_m&\coloneqq\nu_{12m+11}. \end{align*} The famous “middle C” is C4\mathrm C_4.

This notation is called the scientific pitch notation.

Note that in fact, this definition of 1212-tone equal temperament has some slight error. The accurate value for p0p_0 is p0log25574 p_0\coloneqq\log_255-\frac74 because it is stipulated that f(A4)=440f\left(\mathrm A_4\right)=440, which is standardized as ISO 16 and known as A440.

Why 712\frac 7{12}

People think if the ratio of two frequencies is a simple rational number, then the interval of the two notes is harmonic.

2712322^\frac 7{12}\approx\frac32, which is a simple ratio. Harmonic, huh.

(Finally, as is a notice, codes appearing above are alda codes, which are used to write music.)