Switch to 3D

Piano String Harmonic Modes - 2D

Strike the string, see its spectrum, and hear the partials. Change tension, length, mass and hammer point.

Independent checks

The science

Standing waves. A string fixed at both ends obeys the wave equation y_tt = (T/mu) y_xx. Its modes are sin(n pi x / L) with frequencies f_n = n f1, f1 = (1/2L) sqrt(T/mu): longer, lighter or looser strings sound lower.

Hammer position. A string released from a triangle of height h with the peak at x = aL has mode amplitudes b_n = 2h sin(n pi a) / (n^2 pi^2 a (1-a)). Hitting at a = 1/7 removes the 7th harmonic, because that mode has a node under the hammer.

Stiffness. Real steel resists bending, so f_n = n f1 sqrt(1 + B n^2). Upper partials go sharp by a few cents to tens of cents, which is why piano octaves are stretched when tuned.

Energy. The potential energy of the initial shape equals the sum of mode energies, E = (T pi^2 / 4L) sum n^2 b_n^2 (Parseval); the checks panel verifies this and a finite-difference simulation of the wave equation.

Simplifications. Each partial decays as exp(-t n / tau1) by assumption; the soundboard, coupled strings, longitudinal modes and hammer contact time are ignored. Educational model, not an instrument design tool.