The Microtonal Synthesizer has been updated. I used it to explain to someone how to listen to beats and realized that I couldn’t set the cents of notes. Turned out I was forgetting some factors of 100 in one of the functions handling the text fields, and “50” was magically changing to “0.05”. This is now fixed. (Update: as I was writing this post, I noticed that changing the frequency of a note wasn’t working. It should be now.)

So I might as well explain how beats work. Let’s say you have a note at some constant frequency of f. This means that you have some sort of wave that repeats at a frequency of f; if f = 440 Hz, then the wave repeats 440 times per second. It’s not a simple sine wave; the shape of the wave is what gives instruments their characteristic sounds. A sine wave sounds more like an “ooh”, while a brighter sound like “aah” will be a more complex shape. For now, though, let’s assume we’re talking about simple sine waves.

So let’s say you have two of them, one at frequency f1 and the other at frequency f2. The first note can be represented by y = sin(2πf1*t) and the second by y = sin(2πf2*t). Why is the 2π there? The period of sin(t) is 2π, so the period of sin(w*t) is 2π/w. The frequency is 1/(the period), so the frequency is w/2π. Therefore, the frequency of sin(2πft) is f, which is what we’re trying to do. Anyway, the resulting sound wave will be y = A1 sin(2πf1*t) + A2 sin(2πf2*t).

Now, we have these nifty identities to help us simplify. In particular, we have that sin(a) + sin(b) = 2sin((a + b)/2)cos((a – b)/2). We’re going to assume that A1 and A2 are both the same (if they’re not, there’ll be extra sound but it won’t change anything), and we’ll ignore constants out in front, so that the resulting sound wave becomes sin(2π((f1 + f2)/2)t)cos(2π((f1 – f2)/2)t). We also don’t care about phase, so they can both be sines and it doesn’t matter. The important part is that now we have a *product* of sines, one at frequency (f1 + f2)/2 and the other at frequency |f1 – f2|/2.

Hey, look, Wikipedia has a nice graphic about this, and a good explanation of beats.

When you have a product of waves, you get a carrier-envelope situation. The larger frequency, (f1 + f2)/2, is the carrier frequency, while the smaller frequency, |f1 – f2|/2, is the envelope frequency. What the ear actually hears is the individual frequencies f1 and f2 that make up the wave, but since the wave actually gets louder and softer at frequency |f1 – f2|/2, if that frequency is low enough, the ear can actually hear it! You get what are called “beats”. The actual beat frequency is actually |f1 – f2|, though: a complete wave goes up *and* down, but you can’t actually tell the difference between up and down, so it appears to get louder twice per wavelength, at frequency |f1 – f2|.

Try this: go to the synth, go to the “none” preset, and add a note with frequency 50 Hz (it gets rounded to 50.000001, but that’s OK). Give it a shortcut key of ‘a’. Click someplace else to clear the selection, and add another note with frequency 52 Hz and shortcut of ‘s’. Play the two together. You should hear that the sound gets louder and softer twice per second, right? Change the 52 Hz to 51 Hz and see how the beat frequency changes. Now it gets louder and softer once per second. Change both frequencies now to 350 Hz and 351 Hz. The notes are *much* closer together now, but they still beat once per second! For each octave you go up, the frequency multiplies by 2. A1 is 55 Hz and A2 is 110 Hz, a difference of 55 Hz for one octave, while A4 is 440 Hz and A5 is 880 Hz, a difference of 440 Hz for one octave. Basically, the higher the frequency, the more it takes to change the pitch you hear. As a result, sometimes these beats are the only way to actually hear that two notes are different. 350 Hz and 351 Hz are very close together — only about 5 cents — but since they beat once a second, you can hear the pitch difference clearly.

A more common application is in tuning. Go ahead and change the 351 Hz note to 353 Hz, a bigger difference. If your ensemble is tuning to concert F, two clarinetists might indeed be playing 350 Hz and 353 Hz (a true F4 is 349.2 Hz, which you can find out by adding a note 0 cents above F4), and it isn’t easy to tell the difference. But if you listen for the beats, you can tell if you’re off from your neighbor, though not in which direction!

You can use the synth to explore beats as well as interesting tonalities. Have a look!