Frequency of notes on a piano - interactive learning object

By Murray Bourne, 31 Jul 2017


An interesting mathematical challenge for musicians throughout the centuries has been the issue of tuning instruments so they sound good when played together. Pythagoras and his followers worked on such problems over 2500 years ago.

For stringed instruments (like violin or cello), this is not such a big concern, because slight changes in finger position can produce a pleasing sound.

But for keyboard players, such flexibility does not exist. They have to hope their piano tuner can get things just right.

There is a catch though. On any piano, only 8 notes (out of the 88 notes on a piano) are actually tuned exactly right. Those are all the A notes, from A-27.5 (which means it has a frequency of 27.5 Hz) up to A-3520 (with frequeny 3,520 Hz).

All the other notes are actually slightly "off" - a compromise so that pianos can sound OK when playing in any key. This is due to the oddities of exponential growth and equal-tempered tuning.

You can read more on the background of this at: What are the frequencies of music notes?

The new applet

The new applet follows on from the above considerations and allows you to explore the graphs of piano note frequencies. There is a virtual piano that you can play (one note at a time) and after playing each note, you can see the graph of that note and its frequency.

You can find the new applet here:

Frequencies of Notes on a Piano: Learning object

You can also see a composite signal, which is the sum of the fundamental note A-220 and the note just played.

Here's a screen shot:

piano frequencies


A-440 and A-200

When you play A-440, the graph looks as follows. They grey one is A-220, and the green one is A-440. You'll notice the frequency of A-440 is twice the frequency of A-220, and the wavelength is half as long. The two curves coincide at each major time point (at 1 and 2 on the t-axis).

A-440 frequencies

E - the "perfect 5th"

A perfect 5th above A-220 (in theory) is 220× 3/2 = 330 Hz. On a piano, E is actually 329.63 Hz, just a little bit "flat". You can see in the graph there are 1.5 wavelengths for E (the green curve) in the one wavelength of A-220. It's extremely close, and it appears the two curves coincide at t = 1 and t = 2.

E-330 frequencies

C# - the "major 3rd"

To sound right, a major 3rd "should" have frequency 275 Hz (that is, 5/4 × 220), but is quite "sharp" at 277.18 Hz on a piano.

You can see the green curve is not exactly passing through exactly t = 2. As the frequncies get higher, it becomes increasingly "off".

This was unacceptable to many musicians during the Baroque era, and they would use other tuning methods to make sure the major 3rd sounded better. The downside was they couldn't play in certain other keys at all.

C# frequencies

Signal combinations

In the applet, you can also see the combined signal of the fundamental (A-220 in this case), with the note just played.

A-220 and B♭ - 233.08

These two notes are right next to each other on the piano, and sound discordant (bad) when played together. The combined signal gives some insight why. You can see a regular combined signal which is very close to the original two (grey) signals, resulting in "beating" - a kind of shimmering which is not always pleasant. (It can be put to good use in music, but that's for another discussion.)

b flat combined frequencies

A-220 and C#-275

The major 3rd is one of the most common and "pleasing" sounds in music. On a piano tuned by equal temperament, however, you can see the 3 curves doen't line up so well (the grey A-220, C#-275 and the green combination of the two) because actually, C# is 277.18, which is too sharp for a totally pleasing sound.

C#  combined frequencies

It can't be helped if pianos need to play in any key (which of course, they nearly always need to do).


Piano note frequencies are an interesitng application of trigonometric graphs, exponential growth and music perception.

Once again, here's the link to the applet:

Frequencies of Notes on a Piano: Learning object

See the 2 Comments below.

2 Comments on “Frequency of notes on a piano - interactive learning object”

  1. Alan Cooper says:

    This is very nice. Is there any way of making the sound match the combined notes when the composite signal is being displayed? (I don't have a great ear, but so far as I can tell there is no difference in sound between the two settings)

  2. zac says:

    Thanks, Alan. I did try to get combined sounds working before publishing. Getting the sounds started was OK, but stopping them both was a different matter!

    However, I figured it out and updated the app just now. Please try it again (after a page refresh, if necessary).

Leave a comment

Comment Preview

HTML: You can use simple tags like <b>, <a href="...">, etc.

To enter math, you can can either:

  1. Use simple calculator-like input in the following format (surround your math in backticks, or qq on tablet or phone):
    `a^2 = sqrt(b^2 + c^2)`
    (See more on ASCIIMath syntax); or
  2. Use simple LaTeX in the following format. Surround your math with \( and \).
    \( \int g dx = \sqrt{\frac{a}{b}} \)
    (This is standard simple LaTeX.)

NOTE: You can't mix both types of math entry in your comment.

Search IntMath, blog and Forum