🎼 Interval Lab: Just, Pythagorean and Equal Tuning, Beats and Roughness

2D interactive simulation · educational model

lower note  upper note  partials closer than ~6 % (they interfere and beat). Roughness plot: dots = the 13 notes of the selected tuning, white line = the interval you picked.

The science

Pitch and cents. A pitch interval is the frequency ratio r = f2/f1; we measure it in cents c = 1200 log2 r (an octave is 1200 cents, an equal-tempered semitone 100 cents). Equal temperament uses r = 2k/12; just intonation uses small whole-number ratios (3/2, 5/4, 6/5…); Pythagorean tuning stacks pure 3/2 fifths and folds them back into one octave.

Why twelve fifths do not close. Stacking 12 perfect fifths overshoots 7 octaves by the Pythagorean comma 312/219 = 531441/524288, which is 23.46 cents. That mismatch is why no tuning can have every fifth pure and an octave that closes; equal temperament spreads the error (each fifth is 1.955 cents narrow).

Beats. Two tones of nearby frequency add to sin(2πf1t)+sin(2πf2t) = 2 cos(πΔf t) sin(2π̄f t), an oscillation whose amplitude swells and fades Δf = |f1−f2| times per second. Real notes are not pure sines: partial n has frequency n f with amplitude 1/n here (a sawtooth-like spectrum), so beats appear wherever any pair of partials nearly coincide.

Roughness. The curve uses the Plomp–Levelt dissonance model in Sethares' parametrisation, d = a1a2(e−3.5 s Δf − e−5.75 s Δf), s = 0.24/(0.021 fmin+19), summed over all partial pairs. It peaks when partials are about a quarter of a critical band apart. It models sensory roughness only; the feeling of "consonant" or "sad" also depends on culture and context.

Simplifications. Fixed harmonic spectrum, no inharmonicity, constants are fitted averages from psychoacoustic experiments, Lissajous shows the nearest ratio with denominator ≤ 16 and drifts with the leftover mistuning.