DEV Community

Lucian (LKB)
Lucian (LKB)

Posted on Originally published at lkforge.com

Why a Tuner and Your Ear Disagree: The 13.7-Cent Compromise

Tune a guitar perfectly to a digital tuner, play a full open major chord, and something is still faintly off — a slow shimmer in the sound. The tuner isn't wrong, and neither is your ear. They're using two different definitions of "in tune," and the distance between them is a fixed, computable number.

Two definitions of "in tune"

A digital tuner uses equal temperament: the octave is divided into twelve exactly equal steps of 100 cents each (a cent is 1/100 of a semitone). That perfect evenness is what lets one instrument play in all keys without retuning. Your ear, on the other hand, hears an interval as pure when its two frequencies form a simple whole-number ratio — a perfect fifth is 3:2, a major third is 5:4 — because then the waveforms lock and stop beating. The problem: those pure ratios don't land on the equal 100-cent grid.

How far apart they are

Computing the deviation for every interval (equal-tempered cents minus the pure ratio in cents):

Interval Pure ratio Equal temp. Pure (cents) Off by
Minor 2nd 16/15 100 111.73 −11.73
Major 2nd 9/8 200 203.91 −3.91
Minor 3rd 6/5 300 315.64 −15.64
Major 3rd 5/4 400 386.31 +13.69
Perfect 4th 4/3 500 498.04 +1.96
Tritone 45/32 600 590.22 +9.78
Perfect 5th 3/2 700 701.96 −1.96
Minor 6th 8/5 800 813.69 −13.69
Major 6th 5/3 900 884.36 +15.64
Minor 7th 9/5 1000 1017.60 −17.60
Major 7th 15/8 1100 1088.27 +11.73

The major third is 13.7 cents sharp, the major sixth 15.6 sharp, and the minor seventh nearly 18 out. But the perfect fifth is only 2 cents flat, and the fourth 2 cents sharp. Since a trained ear notices about 5 cents, the fifths and fourths pass as clean while the thirds and sixths carry the audible "tempered" beating. That's exactly the shimmer in the held major chord — the third is doing it.

Why it has to be this way

A piano can't be perfectly in tune and perfectly playable in every key at once — the two goals are mathematically incompatible. Equal temperament is the elegant surrender: spread the error evenly so no key is worse than any other. Instruments with no frets or keys — a string quartet, a barbershop quartet — can slide each note onto the pure ratio and get beat-free thirds. That pure sound is what your ear is quietly asking a fretted, tempered instrument for, and not quite getting.

What your tuner targets

A tuner takes each string's equal-tempered frequency and shows how many cents you're above or below it. All from f = 440 × 2^((m − 69) / 12):

  • Guitar: E2 82.41, A2 110.00, D3 146.83, G3 196.00, B3 246.94, E4 329.63 Hz
  • Bass: E1 41.20, A1 55.00, D2 73.42, G2 98.00 Hz
  • Violin: G3 196.00, D4 293.66, A4 440.00, E5 659.26 Hz
  • Ukulele: G4 392.00, C4 261.63, E4 329.63, A4 440.00 Hz

Reproduce it

const cents = (ratio) => 1200 * Math.log2(ratio)
const midiToFreq = (m) => 440 * 2 ** ((m - 69) / 12)
// major third: 100*4 - cents(5/4) = 400 - 386.31 = +13.69 cents
Enter fullscreen mode Exit fullscreen mode

Full write-up, chart and the free browser tuners, tone generator and circle of fifths to hear it: Why a Tuner and Your Ear Disagree.

Originally published on LK Forge.

Top comments (0)