Default
Google

The Mathematics of Piano Tuning

(Really)

Netscape users note: This page complies with HTML4.0 specs. Netscape users may see strange characters. Please download the latest version of Netscape (Mozilla) or IE5

You're sure you want to know more about piano tuning, and the underlying mathematics behind it? Go for it!

Pythagorean chords

Good old Pythagoras (circa 460BC – 580BC) figured out by trial and error that two similar strings sounded very much the same when plucked. But then, he found that if a string was only allowed to vibrate at half the other string's length, the string's tone would be raised by a complete octave. The note sounded the same, only higher.

Needless to say he didn't stop there. If you halve the string again, the tone would be another octave higher, and halving it again... Plucked all at once, these strings all produced the same note, only higher and higher in tone. If he had doubled the length of the string instead of halving it, he would have achieved the same, only an octave lower.

Unfortunately, Pythagoras didn't stop there. He found that if you let the string vibrate at two thirds its length, the pitch would be just as pleasing as halving it, if not more. Pythagoras had hit on what is now called the perfect fifth. Good for him.

Then, in a fit of sadism, he restricted the vibration of the string to four-fifths its full length, thereby discovering the major third. That's right: a 2/3 of the length produces a perfect fifth, and 4/5 of the length produces a major third. Confused? Read on.

When the full length, the 1/2 length, the 2/3 length, and the 4/5 length were all plucked together, a refreshing chord was produced. The major chord had been discovered, and it was good (to our ears). So far so good.

The chromatic scale

But then, along came the Gregorian Chant and its accidentals. Oh, let's add a C sharp (C#) or G flat (Gb) et cetera, etc, &c they said - while Pythagoras turned uneasily in his grave.

Well, according to the human ear there are three distinguishable notes between the tonic and the third, and two between the third and the fifth, and another four between the fifth and the tonic an octave higher. That makes 12 tones.

Heavy mathematics and physics: Pythagoras vs. Gregorians

Other logarithmic scales:
  • earthquakes (richters)
  • sound (decibels)
  • fractal dimension
  • But you see, it just isn't so! Our ear tried to squeeze the tonic, third and fifth so that the "distance" between these tones is the same. It actually turns out that our ear hears tones logarithmically. A logarithm is the inverse of an exponential function, such as f(x) = 2x. But you'll see a demonstration of this in a moment.

  • k is a constant determined by the thickness, weight and tension
  • L is the length
  • T is the tension
  • ρ is the mass per unit length
  • The relationship between the frequency and the length of the string is simply f = k/L. This can be derived from:
    1. the fact that the string must produce a standing wave
    2. the formula v = (T/ρ)½
    3. the wave formula fλ
    You can try manipulating 2 and 3 yourself — get rid of v and solve for f.

    Eh????? Can we put it in a form easier to understand?

    Well, let's try taking the ratios between two notes... k cancels out, so all we're left with is

    f = 1/L

    Technically, Pythagoras' chords are diatonic, while the Gregorian scale is tempered.
    Easy! So, according to Pythagoras, if the tonic is 1 then the third is 1/(4/5) = 1.25 and the fifth is 1/(2/3) = 1.5. These relative frequencies produce a major chord. Perfect.

      Note Relative Value International
    Frequency
    Common Names
    0 C 1.0000 261.6 Tonic, Doh
    1 C#/Db 1.0595 277.2 Minor 2nd
    2 D 1.1225 293.7 Major 2nd,
    Supertonic, Ray
    3 D#/Eb 1.1892 311.1 Minor 3rd
    4 E 1.2599 329.6 Major third,
    Mediant, Me
    5 F/E# 1.3348 349.2 Perfect 4th, Sub-
    dominant, Fah
    6 F#/Gb 1.4142 370.0 Devil's 4th
    7 G 1.4983 392.0 Perfect 5th,
    Dominant, Soh
    8 G#/Ab 1.5874 415.3 Minor 6th
    9 A 1.6818 440.0 Major 6th, Sub-
    mediant, Lah
    10 A#/Bb 1.7818 466.2 Augmented 7th
    11 B 1.8877 493.9 Major 7th, Lead-
    ing note, Te
    12 C 2.0000 523.3 Perfect 8th,
    octave, Doh'
    But! what does the Gregorian chromatic 12-tone conventional scale dictate? As we said, the frequency goes up exponentially, and our ear hears it logarithmically. That is: the first note is 1, the second note is 21/12, the third is 21/12 × 21/12, the fourth is 21/12 × 21/12 × 21/12,... the nth is 2(n-1)/12.

    Now here's the rub. According to Pythagoras, E (note 4) is meant to be 1.25, and G (note 7) is meant to be 1.5. But according to the Gregorians, E is 1.260 and G is 1.498. They're marked red in the table beside.

    The phenomenon of Beats

    Hey, there's not much difference between 1.5 and 1.498, or 1.25 and 1.26, is there? Is there?? Actually, in music it's a significant difference.

    Let me demonstrate. Click here to hear two frequencies very close to 440Hz (MP3 54.6Kb).

    Visually, the waveform is (b) below. The graphs show how the waveform is derived: The two waves are of slightly different frequency, and are both plotted together in (a). Now according to superposition, you simply add the two waves together to get the resultant, shown in graph (b). Our ears hear the change in amplitude (height) as a change in volume. So the sound produced gets louder and softer, louder and softer, producing the phenomenon known as beats.

    Fourier Analysis and trigonometric identities show that the resultant waveform is y = 2ymcos(2π×½(f1f2)t×cos(2π×½(f1+f2)t).

    From the graph and the formula above, it can be seen that the average frequency is ½(f1+f2)Hz and a beat will occur every (f1f2)-1 seconds.

    Lets try an example to clear things up. The international frequency for E above middle C is 329.6Hz. The frequency according to Pythagoras (if C is defined as 261.6Hz) is 327.0Hz. Hence if you were to play both notes together, you'd hear a beat every 1/(329.6-327)=0.4 seconds. Or, if you were to try a G above middle C, there'd be a beat every 2.5 seconds. Both very significant.

    So how about chords? A C-E Pythagorean chord doesn't have any beats. However, in the Gregorian standard there would be 5 times as many beats as there were for a single note. That is, there'd be a beat every 0.4/5 = 0.08 seconds. Similarly, for the C-G chord there are 3 times as many beats, i.e. 2.5/3 = 0.83 seconds (These values are for chords above middle C).

    You see, Pythagoras' chords were perfect. That is, there aren't any beats if you play C-G-E using his particular lengths of string. However, the Gregorian scale means that you can't play C-G-E without beats!

    Tuning a piano

    So what does this all mean to piano tuning?

    Well, you can tune a piano in many different ways, but you've got to first set the benchmark by tuning at least one octave (using the Gregorian scale, not Pythagoras).

    In practice, you set each note according to the last, going up typically in 5ths, i.e. C-G-D-A-E-B-F#-C#-G#-D#-A#-F-C. But you have to tune each note slightly flatter than perfect, because of the difference between 1.498 and 1.5. By counting the beats you can tune it to have equal temperament, i.e. the relative frequencies go up exponentially by 21/12.

    Version comments

  • OK, I've got to put something up within two weeks geocities said. So here's a rush job.
  • This page will be updated after April so please keep hats on.
  • hmm...that was March last year and I still haven't updated the text in this document. Hmm...
  • maybe I won't change it after all. You know, uni and stuff.
  • all right so i'm lazy. i promise i'll put more up. gimme time! (have the HSC on this year, equivalent to the SATs I think only worse cos it determines whather I get into Uni!)
  • OK, now that I've finished my first year of uni, I can put more stuff up. Also, I've learnt a few more things about harmonics which will help explain things. I've also got to change this background image... hmmm....
  • Endnote

    It has only been with the use of computers that this technical analysis could be carried out. Older analyses have been with fractional approximations, such as demonstrated in Fisher's Piano Tuning: A complete guide. Computers have allowed me to use decimal approximations, which are less misleading when it comes to understanding harmonics.

     <- Netscape users may see the year being "100" because there is a Y2K bug in it. Get Mozilla or IE5.


    Acquiring image from ProHosting Banner Exchange