BM · 01 Beauty of Math

Lissajous Curves: The Shape of Music

Lissajous Curves: The Shape of Music

Two notes drive one pen, one sideways and one up and down, and together they draw a Lissajous curve. We build it from a single sine wave, turn the timing into lines, ellipses and circles, read the ratio of two notes straight off the picture by counting where the curve touches its box, see why it only closes for whole-number ratios, and why the simple ratios are the musical intervals that sound sweet. Then the surprise: every fifth on a modern piano is about 2 cents narrow, so as pure tones its shape never sits still. Plus the history (Lissajous and Bowditch), where these curves still work today (oscilloscopes, audio vectorscopes, the Gaia space telescope's orbit), and how to draw one in a few lines of code.

Chapters

Cheat sheet

Sources

Transcript

Two notes are playing at the same time. One of them moves a pen from side to side. The other moves it up and down. Together, they draw this. The higher note vibrates exactly one and a half times as fast as the lower one.

Musicians call that a perfect fifth, and the picture is a closed loop that draws the same path over and over. Now nudge one note very slightly out of tune, and the shape won't sit still. It starts to turn. By the end of this video, you'll be able to read the ratio of two notes straight off the picture, and you'll see why the fifths on a modern piano never sit still.

This is Just Known. From unknown, to known. Beauty of Math, episode one: Lissajous curves, the shape of music. Start with one note. A pure tone is the simplest vibration there is: something moving back and forth, smoothly, like a swing.

Its position over time is a sine wave. Now let that motion push a pen sideways instead. On its own, the pen just slides left and right along a line. But if we let time scroll down the screen, the trail it leaves is the same wave. Take a second note, and let it move the pen up and down.

Again, just a line, unless you spread it out over time. So each note on its own is boring: a dot on a line. The magic happens when both notes drive the same pen at once. Begin with two notes at exactly the same pitch: side to side, and up and down, at the same speed, starting together. The pen just draws a diagonal line.

The only thing left to change is the timing: start one motion a little ahead of the other. That head start is the phase difference, delta. With a small phase, the line opens into a thin ellipse. At a quarter of a cycle, ninety degrees, it becomes a perfect circle. Keep going, and it closes back into a line, tilted the other way.

So with equal pitches, the shape tells you one thing: how far apart in time the two vibrations are. Engineers used exactly this to measure phase on an oscilloscope. Now let the notes differ. Make the sideways note vibrate twice as fast as the up-and-down one. In the time the pen goes up and down once, it swings across twice, and it draws a figure eight.

Make the ratio three to two, and you get the shape from the beginning: three swings across for every two swings up and down. In general, the sideways motion is sine of a times t, plus delta, and the vertical motion is sine of b times t. The numbers a and b set the speeds. Delta sets the timing. These are Lissajous curves.

Here's the trick that made these curves so useful: you can read the ratio straight off the picture. Draw a box around the shape, and count how many times the curve touches the top edge. Here, two. Now count the touches on a side edge: three. Three to two.

The vertical note's number shows up along the top, and the sideways note's number shows up along the side. Try this one. Pause if you like. It touches the top three times, and the side four times, so the notes are in the ratio four to three. Before digital frequency counters, this is how you could measure an unknown frequency: put a known one on the other axis, and count the touches.

Why does the three-to-two curve close into a loop? Because after three swings across and two up and down, both motions are back exactly where they started, at the same moment, and everything repeats. That only happens when the ratio is a fraction of whole numbers. Pick a ratio that isn't, like the square root of two, and the motions never line up again. The pen never returns to its starting point.

Given enough time, it fills the whole box, coming as close as you like to every point inside. So a closed Lissajous curve hides a small piece of number theory: the shape closes if, and only if, the ratio is rational. And here's where it becomes music. Notes are vibrations, so a pair of notes is a pair of speeds, and their ratio is exactly what these pictures show. An octave is two to one.

A perfect fifth, three to two. A perfect fourth, four to three. A major third, five to four. The intervals that sound smooth and stable are the simple ratios, and their pictures are simple, tidy loops. A tense interval like the tritone has a complicated ratio, forty-five to thirty-two in one traditional tuning, and its picture is a dense tangle that takes far longer to repeat.

The idea that simple ratios sound consonant is traditionally credited to Pythagoras, around two and a half thousand years ago. Lissajous curves let you see it. Let's make it concrete. Take a note at three hundred hertz, three hundred vibrations a second, and another at four hundred and fifty. That's three to two: a perfect fifth.

Every one hundred and fiftieth of a second, the higher note has made exactly three vibrations, and the lower one exactly two. They line up again, and the whole pattern starts over. So the shape you're watching, drawn slowly here, is traced a hundred and fifty times every second. Feed the two notes into the two inputs of an oscilloscope in X Y mode, and that's exactly what appears on its screen. So what happens when the tuning is off?

Raise the higher note from four hundred and fifty to four hundred and fifty point four hertz. Now it gains a tiny bit on the lower note every second. That changing head start is the phase, delta, drifting, and the shape turns with it, rolling through ribbons and loops. Here's the surprise. Modern pianos use equal temperament, which splits the octave into twelve equal steps.

That makes every fifth slightly narrower than a perfect three to two: by about two cents, two hundredths of a semitone. Take the A at two hundred and twenty hertz. A perfect fifth above it would be three hundred and thirty. The piano's E is three hundred and twenty-nine point six three. Played as pure tones, that pair never settles: the shape keeps rolling, and comes back to the same picture about every one point three seconds.

That slow cycle is the same beat a piano tuner listens for in a fifth. It's the price a piano pays for being able to play in every key. The curves are named after Jules Antoine Lissajous, a French physicist. In the eighteen-fifties, he attached small mirrors to two tuning forks set at right angles, bounced a beam of light off both, and projected it onto a screen. One fork moved the spot sideways, the other up and down, and the vibrations drew themselves in light.

He wasn't the first. The American mathematician Nathaniel Bowditch had studied the same curves in eighteen fifteen, using a swinging pendulum. That's why you'll sometimes hear them called Bowditch curves. You'll still find them at work. Electronics engineers read phase and frequency off Lissajous figures on an oscilloscope.

Audio engineers use a version of the same plot, often called a vectorscope, or goniometer. It draws the left channel against the right to check a stereo mix at a glance, and a mono signal collapses to a single line. And spacecraft fly them. The European Space Agency's Gaia telescope spent over a decade in what's called a Lissajous orbit, around a balance point about one and a half million kilometers beyond Earth, its path looping around that point in two directions, at slightly different rhythms. You can draw one in a few lines of code.

Loop t from zero to two pi. At each step, x is sine of a t, plus delta, and y is sine of b t. Scale them to the size of your canvas, and join the points. Set a to three, b to two, and delta to zero, and you get our perfect fifth. Then play: five and four, a major third.

Seven and six. Or try delta at forty-five degrees, with three and two, and watch the loops fold into a single open curve that the pen just traces back and forth. The code is in the description. Change one number at a time, and watch the shape respond. Let's recap.

A Lissajous curve is two vibrations driving one point, one sideways and one up and down. Their speed ratio sets the shape, and you can read it by counting where the curve touches the edges. The phase sets the timing, turning lines into ellipses and circles. Whole-number ratios close into loops, and the simple ones are the intervals that sound sweet. And when two notes are slightly out of tune, the shape won't sit still.

Next time: what happens when you stack circles on top of circles? It turns out that's enough to draw almost anything. This is Just Known. From unknown, to known.

Note: every curve on screen is computed from its equation. Pictures marked "illustration" (the tuning-fork apparatus, the pendulum, the Gaia orbit, the circles teaser) are not to scale.
Narration voice generated with Google Gemini text-to-speech.