HomeArticlesSound & Music

Musical Scales: Pythagorean Ratios, Just Intonation and Equal Temperament

Why twelve pure fifths never quite close the octave, how equal temperament spreads that gap evenly across every key, and what makes pentatonic scales sound so consonant.

mysimulator teamUpdated June 2026≈ 7 min read▶ Open the simulation

A scale is a rule for picking frequencies

Every musical scale is, mathematically, a rule for choosing a small set of frequencies out of the continuum of pitches available, spaced so that they sound purposefully related to one another. The starting point for nearly every tuning system in history is the observation that doubling a frequency produces a note that sounds like “the same note, higher” — the octave — and the entire art of tuning is about how to divide that octave into usable steps in between.

live demo · a plucked string's harmonic series building a musical tone● LIVE

The oldest systematic method is Pythagorean tuning, built entirely from the interval of a perfect fifth — a frequency ratio of 3:2, the simplest pleasant-sounding ratio after the octave itself (2:1). Stack fifths repeatedly, folding each result back into a single octave by dividing by 2 as needed, and twelve stacked fifths land you almost, but not quite, back on the starting pitch seven octaves up:

twelve fifths:  (3/2)^12 = 129.746...
seven octaves:  2^7        = 128

Pythagorean comma = (3/2)^12 / 2^7 ≈ 1.01364   (about 23.46 cents, roughly a quarter of a semitone)

That leftover mismatch, the Pythagorean comma, is not a rounding error — it is a genuine mathematical fact: no whole number of pure 3:2 fifths can ever exactly equal a whole number of pure 2:1 octaves, because 3ⁿ can never equal a power of 2 for any integer n. Every tuning system in history has had to decide how to hide this discrepancy somewhere.

Just intonation: pure ratios, awkward modulation

Just intonation builds a scale from small whole-number ratios directly related to the harmonic series a vibrating string naturally produces — a major third as 5:4, a perfect fourth as 4:3, a perfect fifth as 3:2. Chords built this way sound remarkably pure and beat-free, because the frequencies genuinely share simple mathematical relationships that align with the ear's own harmonic processing. The catch is that a scale tuned this way in one key sounds subtly, sometimes badly, out of tune in another key, because the exact ratios that make C major sound sweet don't transfer cleanly to F# major.

Equal temperament: spreading the error evenly

Twelve-tone equal temperament (12-TET), the standard tuning of nearly all modern Western instruments, sidesteps the whole problem by giving up on pure ratios entirely and instead dividing the octave into twelve mathematically identical steps:

semitone ratio = 2^(1/12) ≈ 1.059463

frequency of note n semitones above a reference:  f(n) = f0 · 2^(n/12)

equal-tempered fifth = 2^(7/12) ≈ 1.49831   (vs. pure 3:2 = 1.5 — about 2 cents flat)
equal-tempered major third = 2^(4/12) ≈ 1.2599   (vs. pure 5:4 = 1.25 — about 14 cents sharp)

No interval in equal temperament is perfectly pure except the octave itself — every fifth, third and sixth is very slightly detuned from its ideal small-ratio version — but crucially, every interval is detuned by exactly the same amount in every key, so a piano sounds equally (im)perfect whether you play in C major or F# major. This uniformity is precisely what makes free modulation between keys, and fixed-pitch instruments like the piano, practical.

Scale types: which of the twelve notes to keep

Equal temperament gives you twelve available semitones per octave; a scale then picks a subset and a pattern of steps between them. The major scale follows the step pattern whole-whole-half-whole-whole-whole-half (W-W-H-W-W-W-H); its relative natural minor uses the same seven notes starting from the sixth degree, giving the pattern W-H-W-W-H-W-W. Pentatonic scales (five notes, common across countless musical traditions worldwide) skip the two half-step intervals of the major scale entirely, which is exactly why pentatonic melodies rarely produce a harsh or unresolved-sounding note no matter what order you play them in — there's no semitone clash to avoid.

Cents: measuring the gap between systems

To compare tuning systems precisely, musicians use cents, a logarithmic unit where one equal-tempered semitone is defined as exactly 100 cents and the octave is 1200. The formula cents = 1200 · log2(f2/f1) converts any frequency ratio into this common scale, which is how you get a precise, comparable number — like the Pythagorean comma's ~23.46 cents, or equal temperament's fifth being about 2 cents flatter than a pure 3:2 fifth — for deviations that would otherwise be awkward small fractions.

Frequently asked questions

Why can't Pythagorean tuning ever close perfectly back to its starting note?

Because it stacks perfect fifths (ratio 3:2) to try to reach the same pitch class reached by stacking pure octaves (ratio 2:1), and no integer power of 3 can ever exactly equal a power of 2 — the two systems are built from different prime factors, so a small but permanent mismatch, the Pythagorean comma, is mathematically unavoidable.

Why do pianos sound slightly out of tune with pure harmonic ratios?

Equal temperament deliberately spreads the unavoidable tuning discrepancy evenly across all twelve semitones rather than concentrating pure ratios in one key, so every interval except the octave is very slightly off from its ideal small-number ratio — a compromise that makes modulating freely between keys possible on a fixed-pitch instrument.

Why do pentatonic scales sound consonant in almost any order?

Because they omit the two half-step (semitone) intervals present in a full major or minor scale, there's no closely-spaced note pair to create the sharp dissonance a semitone clash produces — any combination of notes from a pentatonic scale tends to sound open and stable rather than tense.

Try it live

Everything above runs in your browser — open Musical Scales and change the parameters while it is running. Nothing is installed, nothing is uploaded, the whole model lives in one tab.

▶ Open Musical Scales simulation

What did you find?

Add reproduction steps (optional)