Piano Key Frequencies and the Science of Music

This interactive graph visualizes the relationship between a piano key's number and its fundamental frequency, bringing together concepts from both mathematics and physics.

The Mathematics Behind the Sound

The frequency of each piano key is not a linear progression; it follows an exponential curve. This is based on the 12-tone equal temperament system, a mathematical tuning method that divides an octave's frequency ratio (2:1) into 12 equal semitone steps. The frequency $f(n)$ of any key $n$ is calculated using the exponential formula:

$ f(n) = 440 \times 2^{\frac{n-49}{12}} $

In this formula, key 49 is the standard A4 note, which is universally tuned to 440 Hz.

The Physics of Sound

In physics, frequency is a measure of how many times a sound wave vibrates per second, measured in Hertz (Hz). The higher the frequency, the higher the pitch we perceive. The $y$-axis of this graph represents frequency, visually demonstrating how the pitch increases exponentially across the keyboard. When you press the "Play Note" button, a pure tone (a sine wave) with the calculated frequency is generated, allowing you to hear the physical manifestation of the formula.

Selected Key: 49 Frequency: 440.00 Hz

Quiz: Test Your Knowledge

Using the formula from the graph, what is the frequency of the note one octave below A4? (Note: An octave is 12 semitones.)