HowTo Rearrange The Piano Key Frequencies Formula

193 Views Asked by At

The Piano Frequencies formula maps the position of a piano key on the standard piano n to a specific note and frequency e.g. key n=49 maps to A4 with a frequency of 440 hz.

$ f(n) = 440(\sqrt[12]2)^{n-49}$

Article about the formula here: https://en.wikipedia.org/wiki/Piano_key_frequencies.

My question is pretty simple: how do you re-arrange the equation so that you can find the specific piano note n given a frequency? For example, how do we solve for n in the equation below?

$ 27.5 = 440(\sqrt[12]2)^{n-49} $

I know from trial and error that the note f(n)=27.5 is A1 so n=1. But I had a lot of difficulty in approaching how to rearrange the equation and would appreciate some insight and help. Thanks in advance!

3

There are 3 best solutions below

0
On BEST ANSWER

You have

\begin{align} f(n) &= 440(\sqrt[12]2)^{n-49} \\ &= 440 \left(2^{1/12}\right)^{n-49} \\ &= 440 \left(2^{(n-49)/12}\right) \\ &= 440 \left(2^{((n-1)/12) - 4}\right) \\ &= 440 \left(\frac1{16} 2^{(n-1)/12}\right) \\ &= 27.5 \left( 2^{(n-1)/12}\right) \end{align}

Dividing by $27.5$ on both sides,

$$ \frac{f(n)}{27.5} = 2^{(n-1)/12}, $$

and taking the base-$2$ logarithm on both sides we get

$$ \log_2 \left( \frac{f(n)}{27.5} \right) = \frac{n - 1}{12}, $$

so

$$ n = 1 + 12 \log_2 \left( \frac{f(n)}{27.5} \right). $$

In general the frequencies cannot be written exactly in decimal format and the calculations you do also will not be exact, so you will usually get a result that is not exactly an integer. Round to the nearest integer.

0
On

We have $$27.5=440(\sqrt[12]{2})^{n-49}.$$

Divide by $440$ to get $$\frac{1}{16} = (\sqrt[12]{2})^{n-49}.$$

Now, take the logarithm base $\sqrt[12]{2}$ on both sides. First on the LHS, we have to find $\log_{2^{\frac{1}{12}}}2^{-4}$. In other words, we need to find $x$ in $$(2^{\frac{1}{12}})^x=2^{-4}.$$

$x$ corresponds to the LHS. The RHS is just $n-49$ since we took the $\sqrt[12]{2}$ logarithm. I leave the rest up to you.

0
On

Generally, the equation can be written in the following way: $$f = 440(\sqrt[12] 2)^{n-49}$$ Where $f$ is the frequency of the note you're looking for. You can then divide by $440$ to get the following: $$\frac f{440} = (\sqrt[12] 2)^{n-49} $$ You can now apply a logarithmic function (log base $2^{\frac 1 {12}}$) which removes the tricky exponent. You can learn more about logarithms here. Now we have: $$ \log_{2^{\frac 1 {12}}} \left( \frac f {440} \right) = n-49 \Leftrightarrow n = \log_{2^{\frac 1 {12}}} \left( \frac f {440} \right) +49 $$

Which should give you the answer. You can plug in $f = 27.5$ here to get the answer.

Note: in some cases this result will not be an integer and you may need to round up to the nearest integer with a floor or ceiling function.

Hope this helps!