From: rusin@washington.math.niu.edu (Dave Rusin) Newsgroups: sci.math,sci.electronics.misc,alt.sci.physics.acoustics Subject: Piano tuning (was Re: Pythagorean comma) Date: 30 Jan 1996 16:43:03 GMT In article <4ejgp4$bns@geraldo.cc.utexas.edu>, Bruce Bostwick wrote: >seriously, though, piano tuners can detect differences in pitch of >less than a hertz (yes, I do mean one cycle per second!) and the good >ones can match pitches to within a hundred ppm or better. Really this is not so much a good ear as good trigonometry, and I subject students to it from time to time. Suppose you have two sine waves (pure, stable tones) of equal amplitude (loudness) but slightly different frequency (pitch). This means they are changing the air pressure by a multiple of sin( f1 t + c1) and sin( f2 t + c2) respectively. The chord that you hear when the tones are sounded together is the result of the sum of these changes in air pressure (superposition principle). Writing these functions in the form sin( a + b ) and sin( a - b ) we expand using the angle-addition formula and add to get 2 sin(a) cos(b), that is, [ 2 cos( (f1-f2)/2 * t + (c1-c2)/2 ) ] * sin( (f1+f2)/2 * t + (c1+c2)/2 ) This may be viewed -- err, heard -- as a pure tone whose frequency (f1+f2)/2 is midway between the other two (which is to say, it sounds pretty much like either one of them separately), but which is not stable. Indeed, its magnitude is slowly changing -- from being twice as loud as either component, as you might expect, to nearly silent. The magnitude goes through a complete cycle with frequency (f1-f2)/2. In particular, for two tones whose frequency differs by 1 Hz, this results in a sound whose amplitude drops to zero twice every 2-second period. In other words, there will be a distinct warbling sound, as if the tone were coming from a horn and the player were applying a mute off and on, once per second. The sound is referred to as beats, and the frequency (f1-f2) is the beat frequency. A piano tuner thus need not be able to decide if each of the two or three strings supposedly playing one note really produce the same frequency. S/he need only play the two notes together, then sharpen or flatten one so that beats are eliminated. No particularly good ear is needed, although without training one will just as often flatten what one should sharpen, since the beat-frequency method is only sensitive to the _absolute value_ of f1-f2. This same idea can be used to tune strings playing two different notes. As has been noted earlier in this thread, an "ideal" fifth is a chord using two frequencies in a 3:2 ratio. This is almost the change in frequency between two notes which are 7 half-steps apart on the piano, say between an A and an E. Unique Factorization being what it is, however, this is not possible globally, and that interval on a piano is usually tuned so that the ratio of frequencies is 2^(7/12):1, which is about 0.12% too small. The A near the middle of the keyboard is supposed to ring at 440 Hz, and thus the E above it at 659.26 Hz. One may tune that E first to 660 Hz by first eliminating beats relative to the A, then flattening the note (by loosening the string) until beats are heard at a rate of about one every 1-1/3 second. One can actually proceed through the whole 12-note octave with just the single tuning fork in this way. The process is known as the Circle of Fifths. It works because [7] is a generator of Z/12Z. In practice of course things never go this smoothly. One must contend with a number of issues, among them: (1) A 1% difference in frequency produces a noticeable beat when the tones are near the center of the keyboard. But when f1 = 50 Hz or 3500 Hz, this becomes rather hard to pick up, and a nuisance to control. (2) A tone on a real instrument is not a single frequency but the sum of many, with different amplitudes. If this sounds like Fourier analysis, it is, except that the frequencies need not all be integer multiples of the lowest (i.e., "harmonics"). It's actually in the harmonics that one listens for beats when tuning fifths, and when tuning low notes (see (1)). But when the higher frequencies are not multiples of the fundamental, one finds that two notes may be "in tune" with each other's fundamental frequency but not with the higher ones. (3) The trigonometry used above assumed the two waves were of equal magnitude. This is not critical in practice, but it is worth noting that the trigonometry is much murkier in general. For example, sin( f1 x ) + 2 sin( f2 x ) does not factor as A* sin( f3 x ) * cos( f4 x), say. Indeed, you might compute the first few zeros of the sum (try, say, f1= Pi and f2 = 0.97 Pi) and you'll notice that they are not equally separated. You do hear something like beat frequencies, but the frequency of the underlying tone also changes in time. (Now it sounds more as if the horn player were swinging on a swing and you had the Doppler effect to contend with too.) At my home page there are a few other odds and ends as well as some citations regarding some mathematical features of sound and music. A direct URL is http://www.math.niu.edu/~rusin/papers/uses-math/music. dave ============================================================================== From: Bruce Bostwick Newsgroups: sci.math,sci.electronics.misc,alt.sci.physics.acoustics Subject: Re: Piano tuning (was Re: Pythagorean comma) Date: 30 Jan 1996 22:13:18 GMT rusin@washington.math.niu.edu (Dave Rusin) wrote a right scholarly reply which was far too long for my article editor to quote :-( ... Yes, the beat frequency is the absolute value of the pitch difference. You do have to be very careful to remember which string is the reference and which one is being tuned, and it is *easy* to go the wrong way (broken a couple of bass strings that way!) In the middle of the keyboard, the fifths *do* come out about a beat and a half flat, and the strings have more than enough harmonics to make it audible. It is hard to hear this ratio at the top or the bottom, but you usually tune those by octaves anyway. In practice, it's a lot easier to set the temperament in a two-octave scale by the circle of fifths than it is to do anything else. You can do it by thirds, etc. but it's a lot harder. There is an *excellent* book by J. Cree Fischer on the subject, if anyone is interested in further reading. http://ccwf.cc.utexas.edu/~lihan/ ============================================================================== Date: Thu, 1 Feb 1996 10:27:52 -0600 (CST) From: Bob Dillon To: Dave Rusin Subject: Piano tuning (was Re: Pythagorean comma) Just a little side note in which you may be interested. In many small twin engine airplanes, autosynchronizers are not installed, and synchronization of the props is done by ear just as is your description of piano tuning. Bob ============================================================================== Date: Thu, 1 Feb 96 10:32:37 CST From: rusin (Dave Rusin) To: bdillon@admin.aurora.edu Subject: Re: Piano tuning (was Re: Pythagorean comma) Cool! It's also true that this technique is the basis of FM (frequency modulation) radio transmission: broadcast a wave of high frequency and constant amplitude, but change the frequency (slowly); the radio receiver buzzes at the nominal frequency (fixed) and then the trig identity produces a "beat" frequency which flutters at the rate the two frequencies differ. With a 100MHz nominal frequency, the frequencies of sound (say 100Hz - 10kHz) can easily be overlaid as a beat frequency. dave ============================================================================== Date: Fri, 22 May 1998 12:31:33 -0700 From: Fabio Rivera To: rusin@math.niu.edu Subject: Piano Tuning. Dear Dr. Ruskin: I am an applied math student at San Francisco State University in California. I am doing a project on the effect of octave stretching on equal temperament tuning. In all the books of tuning theory I've come across, perfectly tuned octaves are assumed; however, it seems that no tuners actually tune pianos that way. My hope is to construct a model that will account for this stretching. My belief is that this stretching is only partially the result of inharmonicity (the effect of string width) and that stretched octaves provide a further correction to tuning. Most string players stretch their notes at higher octaves, for example. Have you come across any research on this topic? I am: Tony Gualtieri tonyg@sfsu.edu ============================================================================== From: Dave Rusin Date: Mon, 15 Jun 1998 01:11:36 -0500 (CDT) To: bobafett@sfsu.edu Subject: Re: Piano Tuning. You sent me mail a few weeks ago on piano tuning. You asked in particular about octave stretching. It seems to me there are two issues here, physical and perceptual. On the physical side we have the problem that real strings -- particularly metal ones -- don't have a well-defined pitch. If you watch amplitudes of vibrations on an oscilloscope, you don't really see a stable pattern; rather, there's a pattern, but it's changing over time. Mathematically, this amounts to adding a sine wave with a frequency which is not quite a mutliple of the fundamental frequency. In practice this means that some strings cannot be tuned to other strings or to a fixed ideal pitch. I'm less clear on the perceptual end of things. The human auditory system is pretty responsive over a wide range of frequencies (much more so than the retina, for example) but not uniformly so. I'm under the impression that to get a suitable response at the extreme ends one has to magnify the sensation, stimulating the inner ear at frequencies a little beyond the desired one in some sort of brain-fake. I know that the people who design recording equipment (mikes, speakers, CDs) understand all these perceptual issues -- I saw it in a FAQ once! -- so I can only imagine musicians would have picked this up, too. If you get better information I'd like to know it; I can add it to the site. dave