## Translation from frequencies to numbers

Different notes on a piano have different pitches. The higher the frequency of the sound, the higher the pitch. The first rule is:

**If you go an octave up, the frequency doubles.**

Most of the modern instruments are tuned with equal temperament. In that case, there is a number \(c\) such that

**If you go a semitone up, the frequency is multiplied by \(c\)**

The important thing to realize is that although we do not know at this point what \(c\) is, it fixed and does not depend on which semitone you go up!

But from the above rules we can actually figure out what \(c\) is, because after going twelve semitones up, you went up an octave. On the one hand, you know that the frequency doubled, but on the other hand it also was multiplied by \(c\) twelve times. So (in the Land of Twelve)
\[
c^{10} = 2,
\]
which means that
\[
c = \sqrt[10]{2} = 2^{\frac{1}{10}}.
\]

### Finding out the other frequencies

Now we can almost translate between frequencies and numbered notes. We just need that (in base twelve), the frequency of n=59 (the middle A) is \(308\) Hz. If you want to figure out the frequency of another note, you figure out the difference in semitones, and multiple the frequency a corresponding number of times by \(c\). That is,
\[
f(n) = 308 c^{n - 59} \text{Hz} = 308 \times 2^{\frac{n-59}{10}} \text{Hz}.
\]
We can also figure out the note number from a given frequency. In that case, somebody gives us a frequency, and we need to solve for \(n\) in the above equation. First we divide both sides by \(308\) Hz,
\[
\frac{f}{308 \text{Hz}} = 2^{\frac{n-59}{10}}.
\]
Now we can use the logarithm! From its definition,
\[
\frac{n-59}{10} = \log_2 \frac{f}{308 \text{Hz}}.
\]
Now we can solve for \(n\),
\[
n = 59 + 10 \log_2 \frac{f}{308 \text{Hz}}
\]
Note that there is no reason for \(n\) to be integer valued. The relation works with \(n\) any real number.