Sunday, 31 May 2020

Octave stretching and tuning a piano

I wanted to post something explaining the phenomenon of "octave stretching" on a piano - that is to say when a piano is tuned, the octaves are slightly further apart than the 2:1 ratio they ought to have according to musical theory. To understand why this is the case, a bit of background knowledge is involved.

"Theoretical" frequencies of notes

The first thing to understand is how the frequency of a note relates to our perception of pitch and musical intervals. The study of this has a long history, going back at least as far as Pythagoras (570-495 BC). He realized that a difference in pitch of one octave was related to doubling or halving the the length of a string under a similar tension (he might have perhaps used a monochord or something similar to work this out). We now understand that this is due to the frequency or number of vibrations per second of the sound (Pythagoras was aware of this, but did not have any means of measuring the number of vibrations directly). Nowadays (not in Pythagoras' time) we normally tune instruments using a system called "equal temperament" - how this came about is a long story in itself, and one which I hope to write about in a future post, but for now I will just describe the method.

So, to explain how the "theoretical" frequencies are calculated. Firstly, the note "A" above middle C is taken as a reference point, and if the piano is tuned to standard pitch, as would be expected for example if tuning for a concert, this would be set to 440Hz or cycles per second. Just to explain what is meant by this, the picture below represents the sound wave:

Obviously this is just a visual representation - what is really happening is a set of alternate compressions and rarefactions in the air, so we could imagine the line when it reaches the top as a compression and at the bottom as a rarefaction. A "cycle" would be the area represented by the red lines below:

So, in other words, there would be 440 successive compressions and rarefactions every second.

Secondly, an octave is standardly taken as a ratio of 2:1 in frequency - so that means that if A above middle C is 440Hz, the A above that ought to be 880Hz, and the one below 220Hz, and so on (this would give us a theoretical frequency for all the 'A's on a piano with a standard compass as follows:

A0 (Bottom A): 27.5 Hz
A1: 55 Hz
A2: 110 Hz
A3: 220 Hz
A4 (A above Middle C): 440 Hz
A5: 880 Hz
A6: 1760 Hz
A7 (Top A): 3520 Hz

Then, having obtained all the 'A's, we want to get the other notes in the scale. As I mentioned above, modern tuning uses a system called "equal temperament", which means that all the notes in the scale are equally spaced from each other, in a logarithmic sense (as I said earlier, I won't go into the historical background of this now). But as there are twelve semitones in a scale, we need to multiply by the twelfth root of two each time:

So in other words if we want to go from an 'A' to a 'B flat' we multiply by this factor and keep doing so again for each successive semitone. This means, for example, that Middle C will have a pitch of 261.6Hz (rounded to one decimal point).

So once we have all the notes in the scale, we can just multiply or divide the frequency by 2 for each octave, and thus we end up with 'theoretically correct' values for every note on the piano. When you use an ordinary chromatic tuner, such as a guitar tuner, these are the frequencies that you will be tuning to (I won't list these exhaustively as it is easily available elsewhere). However, when tuning a real piano, as opposed to a theoretical one, it just doesn't quite work like that.

All about overtones

To understand this a bit better, we need to understand the sounds that are produced when a string, fixed at both ends, is struck by a hammer. A key figure in the science of musical sounds was the German scientists Hermann von Helmholtz (1821-1894), who invented a device called the Helmholtz resonator (amongst numerous other contributions to physics). He was able to explain that when a string vibrates, it does so in a complex manner, so that it vibrates through its entire length, 1/2 its length, 1/3 of its length, and so on as demonstrated by the diagram below:

The string is actually undergoing all these complex vibrations at once (only the first eight are illustrated above); this is one of the factors that gives the acoustic piano a particularly rich tone. Incidentally, the difference between a "bright" and "mellow" sound in a piano's tone is that when the tone is bright, the overtones are relatively more prominent. However, the overtones do become progressively weaker on a real piano as you work your way up the series, and bass notes (long strings) will have much stronger and more prominent overtones than notes in the treble. These overtones are important in various ways in tuning a piano, but for practical purposes nothing above the 8th overtone is really useful.

The string should therefore produce, as well as its fundamental frequency, overtones at double, triple, quadruple its fundamental frequency and so on. However, this is based on the assumption that the string is perfectly flexible, which is not the case; in reality, the string has a certain amount of stiffness. This stiffness has the effect of making the upper overtones relatively sharp of their "correct" frequency, and it turns out that in general, the shorter and thicker the string is, the more pronounced this effect will appear to be. Thus, a string which is tuned to A (440Hz) should in theory have its second partial (overtone) at 880Hz, but we might find in practice, say, that it is 881Hz (as an example). The general name for this effect is Inharmonicity.


How does this affect the tuning of a piano?

It turns out that what the ear perceives to be an "in tune" piano is based on lining up the harmonics of notes in successive octaves so that they coincide with each other, as this produces a "clean" sound. What this means is that when tuning the treble, if you move up an octave, you are generally aiming to tune the fundamental frequency of the note to the second harmonic of the note an octave lower; but because this second harmonic is higher than musical theory would suggest due to the effect of inharmonicity described above, the note an octave higher would correspondingly be sharper. So from the example above, if we set the A above middle C to 440Hz, and the second harmonic of that note is 881Hz in practice, we will be aiming to tune the A an octave above that to 881Hz. The way that this can be done when tuning is by listening for beats, which are interference patterns between strings at slightly different frequencies, and in this case it is the second harmonic of the lower note and the fundamental of the higher one that will generate this. If you can eliminate the beats, the string is in tune.

I should point out that in practice, particularly in the bass, it is a little bit more complicated than this because there are multiple harmonics that may coincide (e.g. 2nd of lower note with 1st of upper note, 4th of lower note with 2nd of upper note and so on), and also double octaves can be check (i.e. 4th of lower note with 1st of upper note). The increased prominence of these overtones in the lower bass means that it isn't always possible to achieve a perfectly "beatless" tuning in the same way.
  
A good tuning may vary according to the piano

If you set out to get the best tuning possible on a very small upright (or baby grand), and did the same with a large concert grand, the two pianos would not necessarily be in tune with each other at the end of the process. Generally speaking, pianos with longer strings in the bass will have less inharmonicity than pianos with shorter bass strings, and therefore the resulting frequencies of the notes will be closer to their "theoretically correct" value, whilst those on the piano with shorter strings will be 'stretched' more. It should be noted that these differences apply particularly to the bass and tenor sections of the instrument where string lengths are limited by the size of the case, whereas strings in the treble are normally fairly similar in length no matter how big the piano.

How does this cause octave stretching?

The effect of inharmonicity is always that the upper harmonics are sharp of their 'theoretical' value, never flat. Thus if notes in the treble are tuned to the upper harmonics of the notes an octave down, or the upper harmonics of notes in the bass are tuned to notes above them, the effect is that the octave is made slightly wider. Additionally, the stretching will normally be greater in the bottom bass and the high treble than in the middle of the keyboard - this is because the strings are very short in the top treble, and thicker in the bass, as the lengthi is limited by the size of the case.

A way of expressing this is the 'Railsback curve', named after O L Railsback. The eponymous inventor, Dr Ora Railsback, taught at Illinois State Teachers' College (now Eastern Illinois University) from 1924 to 1950 and was head of the Physics Department for much of that time; he also completed a doctorate in Physics at the University of Indiana in the 1930s, and during the Second World War enlisted in the US Army. He was a keen musician who founded the college's first marching band, and his PhD research was in the physics of music. As well as his famous 'curve', he was also involved in the development of the Stroboconn, an early type of electro-mechanical musical tuning aid, first marketed in the 1930s (transporting this device required taking around two large cases each weighing around 15 kilos). In 1950, Railsback left to become Head of Physics at the University of Illinois.



On the diagram above, the 88 notes of a standard-compass piano appear on the axis in the middle (I have only highlighted the As and the top C). The blue dots represent a hypothetical "real" piano tuning (by this I mean that I have put in some example data to illustrate), and the red line is the "Railsback curve", which is a best-fit line representing an "ideal" tuning of that particular piano (the values of the curve should be roughly representative of what would be expected in reality).

It should be pointed out that the Railsback curve is not based on any particular mathematical equation, but rather on empirical observation of how the frequencies of notes relate to their theoretically correct values, when a piano is tuned in a way that is pleasing to the ear, and as mentioned above, the curve may differ according to the piano.

I hope the above will give a bit more insight into what "octave stretching" is on a well-tuned piano.

4 comments:

  1. Helpful article for a musician who doesn't have a good brain for mathematics -- thank you! Question: do your blue dots represent a hypothetic real tuning just or shortly after tuning, or after some time has passed and the tuning has drifted?

    ReplyDelete
    Replies
    1. Many thanks, the blue dots hypothetically represent a freshly-tuned piano, i.e. it's where the pitch ought to be if the piano is going to sound good. Andy

      Delete
  2. Thank you for a wonderful explanation of the history, theory, and practice of dealing with these inherent compromises. This was the best writing that I found on the topic. A great balance between thoroughness, clarity, and length. Well done!

    ReplyDelete
  3. Burton & Wilson, The Piano Craftsmen Was Founded By Robert A. Burton In 1951. The Wilson Family Joined The Firm In 1975. We Serve As Concert Technicians To The San Jose Center For The Performing Arts, The San Jose Civic Auditorium, The Montgomery Theater As Well As Universities, Schools And Churches In The Bay Area. We Serve 2,000 Clients Each Year In Their Homes And Studios. We Serve As Heirloom Piano Movers For The Greater Bay Area And Offer Climate Secured Storage For Fine Pianos. We Have Strong Feelings About Skills And Training At Burton & Wilson, The Piano Craftsmen.

    ReplyDelete