The Geometry of Chords
If every chord is a point and every voice leading a path, what shape is the space, and where do the familiar chords sit?
Two voices that cross and two that bounce sound the same, because a chord forgets which voice is which. Folding by octave and permutation turns the plane of two voices into a Möbius strip, unisons on its one edge and tritones down its middle, where parallel, contrary and oblique motion are three directions and a first-species line is a path of shortest steps. Three-note chords live in a twisted prism over a triangle of shapes, the augmented triad at its centre, major and minor triads coiled near it. A voice leading's size is the fewest semitones its voices move; C major to F major is three, to F sharp major six. Only nearly even chords reach a transposition of themselves more cheaply than moving every voice a semitone: the triad, the dominant and minor sevenths; the diatonic scale, the most even seven-note scale, moves to its neighbours on the circle of fifths by one semitone, and the circle is the map of shortest paths between scales. Five symmetries, OPTIC, name the objects of music theory and are counted by brute force; Fourier magnitudes name their qualities. In 17,339 changes of chord Bach's upper voices take the shortest path 67 times in 100, always an even number of semitones from it. The Tune is harmonized by shortest paths, then rerouted through chromatic chords for two semitones more.
What you need. Part 12 for maximal evenness; Part 13 for chords; Parts 16 and 17 for voice leading and Bach's chorales; Part 29 for set classes and homometry; Part 31 for the Tonnetz. Quotient spaces and orbifolds, norms, the discrete Fourier transform.
- Ideas, mathematics and history
- Tymoczko's orbifolds, dyads on a Möbius strip, voice leading as distance, why triads work, the Fourier transform of a chord
- What we build, compute and hear
- chord space as an instrument; minimal voice leading solved; Bach's efficiency measured
What you will be able to do
Foundations
- Explain why octave and permutation equivalence fold chord space, and find a chord on the Möbius strip.
- Hear and measure the size of a voice leading.
- Explain why nearly even chords and scales allow efficient voice leading between transpositions.
Full course
- Compute minimal voice leadings, evenness and Fourier magnitudes for any chord, in any tuning.
- Count chord types under the OPTIC symmetries by brute force.
- Measure a corpus's voice leading against the minimum, with a shuffled control.
Research
- Design a listening experiment that tests whether voice-leading size predicts perceived smoothness.
Practice
- Voice chord symbols automatically by shortest paths, as arrangers and accompaniment software do.
Contents
Each chapter has a home level. Choose a track to see what to read and watch: Foundations 30 min · Full course 33 min · Research 36 min · Practice 33 min.
- 0Two voices, one chordFoundations2 min
- 1Chords as pointsFoundations3 min
- 2The Möbius stripFoundations3 min
- 3Three notes: a triangle in a prismFoundations4 min
- 4The size of a voice leadingPractice3 min
- 5Nearly even chordsFoundations3 min
- 6Scales are chords tooFoundations3 min
- 7Five symmetriesFoundations3 min
- 8What each Fourier coefficient hearsFoundations4 min
- 9How smooth is Bach?Foundations4 min
- 10Frontier: what the geometry does not explainResearch3 min
- Variation 32, recap and problemsAll tracks3 min
Also on this page: Lecture · Key results · Try it · Lab · Problems · Notes and sources · Build the film.
Lecture
The text of each chapter is the film's narration, as it is spoken, so you can read along or revise without the film. The pictures are in the film. A dashed box stands for a number the film computes when it is rendered (hover over it to see what is computed); the README's figures for each chapter, where it lists them, follow the chapter's text.
Two voices, one chordFoundations2 min
Start with a puzzle for the ears. Two voices begin on C and E and glide smoothly. In one of the next two sounds they pass through each other and swap places, the lower ending on top. In the other they meet in the middle and turn back, each returning to where it began. Listen to both: in which do the voices cross, A or B?
Pitch content alone cannot tell you which abstract voice crossed. In A the voices really do cross; in B they bounce. But at every instant both sounds contain exactly the same two pitches, and this chord-space representation does not retain voice identity. That one fact, that a fixed-cardinality chord here is an unordered multiset of pitches, retaining doublings, bends the space of all chords into a strange shape. The synthesized waveforms can differ in phase history, so this is not a proof of universal auditory indistinguishability. This part draws the pitch-space equivalence.
In 2006 the journal Science published a paper on music theory. Its author, the composer Dmitri Tymoczko, treated every chord as a point in a space, every voice leading as a path, and the size of a voice leading as a length. One of its pictures was startling: the space of all two-note chords is a Möbius strip. Two years later, with Clifton Callender and Ian Quinn, he described a whole family of such spaces, built from five symmetries. And he made a claim this part will test: the familiar chords of Western music sit exactly where short paths join them to their own transpositions, which is why harmony and smooth voice leading can work together.
Here is the plan. Chords as points, and why the space folds. Two-note chords on a Möbius strip, and three-note chords in a triangle inside a twisted prism. How to measure a voice leading. Why nearly even chords matter, and how a scale is a chord too. Five symmetries that name the objects of music theory. Fourier magnitudes, and a measurement: how close does Bach come to the shortest paths?
1Chords as pointsFoundations3 min
Where does a chord live?
Write two voices as two numbers, the key number of each, and a chord becomes a point of the plane: C4 in the first voice and E4 in the second is this point. When the voices move, the point moves: a voice leading is a path. But the plane has too many points. E4 in the first voice and C4 in the second is a different point, yet the same chord. And if we care only which notes sound, not in which octave, then C5 with E4 is a C and an E as well.
Two symmetries fold the plane. The first is the octave: keep only pitch classes and every coordinate lives on a circle of twelve semitones, so the plane becomes a square whose opposite edges are glued, a torus. The second is permutation: the point x, y is the same chord as y, x, so fold the square along its diagonal. Half the square is left, and when its edges are glued the gluing has a twist. The diagonal, where the two voices sound the same note, cannot be folded past: it becomes an edge. The next chapter shows the shape that results.
Why fold at all? In counterpoint the voices matter: Part 16 forbade them to cross carelessly. In harmony they do not: Part 13 named a chord by its notes, whoever sings them. The geometry keeps both views: a path remembers which voice went where, while a point forgets. Forgetting has a price, a space with edges and folds instead of a flat plane. And a reward: one picture holds every chord of n notes, in any tuning, including the notes between the piano's keys.
The idea has a short history. John Roeder in the 1980s and Richard Cohn in the 1990s drew chords and voice leadings on lattices and cycles. Clifton Callender in 2004 described continuous transformations between chords. Tymoczko's paper of 2006 found the orbifolds, and the paper of 2008 with Callender and Quinn the whole family. The mathematics was older: quotient spaces and orbifolds, named by William Thurston in the 1970s. What was new was the dictionary between musical words and geometric objects.
2The Möbius stripFoundations3 min
What shape is the space of two-note chords?
Here is the folded space, drawn flat. Across, the chord's centre, the average of its two notes; up, the interval between them, from zero to twelve semitones. All seventy-eight two-note chords of the twelve pitch classes are dots, coloured by interval. The unisons lie along the top and bottom edges, the tritones along the middle. The left and right ends are glued, but with a twist: the arrows point opposite ways, so a chord leaving on the right at the top comes back on the left at the bottom. A strip glued with a twist is a Möbius strip, and it has only one edge: the unisons.
The three kinds of motion from Part 16 become three directions on the strip. In parallel motion the interval stays nearly the same and the chord slides sideways: minor thirds rising a semitone at a time. In contrary motion the centre stays put and the chord climbs straight up from the edge: a unison opening out to a tritone. In oblique motion one voice holds and the chord moves on a slant. Listen to all three, and watch the paths.
The edge explains the hook. Take C and E and raise the lower voice a semitone at a time: C sharp and E, D and E, E and E. At E and E the chord touches the edge: a unison. Keep raising the same voice: E and F, E and G. The chord moves back into the strip, because the voice that crossed is now on top, and the strip does not know which voice is which. Crossing and bouncing are one and the same path in chord space; only the ordered plane could tell them apart.
Counterpoint is a path on the strip. Here is Fux's cantus firmus from Part 16 with the best first-species line that part's search found above it: eleven two-note chords, numbered in order. The path starts and ends on the edge, at the octave, which the strip folds to a unison. In between it wanders into the strip through thirds, sixths and a fifth, never staying in one place. And every one of its ten steps is a shortest path between its two chords: the line moves semitones in all, which is the minimum. Listen, and follow the numbers.
3Three notes: a triangle in a prismFoundations4 min
Where do the triads live?
With three notes, forget transposition for a moment and keep only a chord's shape: the three steps that go round the octave, from note to note and back to the first, which always add up to twelve. C major's steps are four, three and five; C minor's are three, four and five. An ordered gap triple is a point of a triangle; cyclic rotations represent the same transposition class, so the triangle repeats class information. At the centre, four, four, four: the augmented triad, perfectly even. At the corners, all twelve in one step: three voices on a single note. Major and minor triads sit close to the centre, but not on it. The brighter a dot, the more even the chord.
Walk from near a corner to the centre and listen. A cluster, C, C sharp, D; then whole tones, C, D, E; the diminished triad; the major triad; and the augmented triad at the centre. Beside each, its distance from the nearest perfectly even chord, in semitones: four and a quarter for the cluster, falling to zero. The sound opens out as the chord spreads.
Nothing in the geometry needs the piano's twelve keys. The space is continuous, and the chords between the keys are points too. Slide C major's third down a quarter of a semitone at a time until it becomes C minor. Halfway is the neutral triad, with a third exactly between major and minor, a geometric illustration related to neutral thirds; Arabic and Persian intonation and modal practice cannot be reduced to this Western triad, as Part 35 will explain. On the triangle it lies on the straight line between major and minor, and it is the most even of the five. Listen to the third sink.
Put transposition back and the whole space of three-note chords appears. It is a prism: along it runs the sum of the chord's notes, which transposition changes; across it lies the triangle of shapes. Its two ends are glued with a third of a turn: travel the length of the prism, adding twelve semitones to the sum, and you are back among the same chords with the triangle turned. The four augmented triads run straight down the middle, and the twenty-four major and minor triads coil round them. A small voice leading between two triads is a short step between neighbouring points on that coil.
The coil can be measured. For each of the twenty-four triads, the smallest number of semitones C major's three voices must move to reach it. C minor and E minor are one semitone away; five triads are two away, among them A minor, E major and A flat major. The farthest, six semitones, are D, F sharp and B flat major: the far side of the coil. Part 31 counted P, L and R moves; this counts semitones, and the two rankings mostly agree.
One more dimension. For four-note chords the cross-section is a tetrahedron, and the whole space a twisted prism over it. At the centre sits the diminished seventh, perfectly even. Close around it: the dominant seventh and the half-diminished seventh, with the minor seventh a little further out, the chords of tonal harmony and jazz. The first two are each one semitone from a diminished seventh, which is why Part 19's diminished seventh worked as a trapdoor into so many keys. In general, chords of n notes have a simplex for a cross-section, with the perfectly even chord at its centre.
4The size of a voice leadingPractice3 min
How far does a progression travel?
An easy question for the ears, and a harder one for the mind. C major goes to F major and back, twice each, in two different ways. Which sounds smoother, A or B? And then: how would you put a number on it?
A is smoother: C holds, E rises a semitone to F, G rises a tone to A, three semitones in all. In B every voice leaps up a fourth, fifteen semitones in all, and the progression sounds like a block being lifted. Same two chords; one voice leading is five times the size of the other. And A is the smallest possible: no way of moving C major's three voices onto F major's notes adds up to less than semitones.
There is more than one way to measure. Add up the semitones each voice moves, the taxicab size. Or take the straight-line length of the path in chord space, the Euclidean size. Or look only at the biggest single leap. For these three ways from C major, all three measures agree that A is the smallest, and the first two that B, every voice up a fourth, is the largest; C, which sends C down to A, lies between, nine semitones by the sum but a leap of five at most, the same largest leap as B. In many musical cases the measures agree; where they do not, choosing one is part of the theory. This part uses the sum.
How does a program find the smallest voice leading? Try every way of handing one chord's notes to the other chord's voices: six ways for triads, twenty-four for four-note chords. Let each voice move the short way round the octave. Keep the smallest total. A theorem from Tymoczko's work saves effort: there is always a smallest voice leading in which no voices cross, so it is enough to try the n rotations of one sorted chord against the other. Monochord's version tries them all, for chords of any equal size, in any tuning.
What about chords of different sizes? To go from a triad to a seventh chord, or back, some voice must double or split. G seven to C: B rises to C, F falls to E, D falls to C, and G holds; two voices meet on C. Cardinality equivalence, the C of the next chapter's five letters, allows exactly this. The smallest voice leading is then taken over every way of doubling. Four-part harmony doubles one note of every triad, and Part 17's doubling rules choose which.
5Nearly even chordsFoundations3 min
Why these chords, of all chords?
Here is the test of Tymoczko's claim. For every type of three-note and four-note chord, two numbers: across, how far it is from a perfectly even chord; up, the smallest voice leading that takes it to a different transposition of itself. Any chord can move every voice up a semitone, n semitones in all: the dashed line. Almost every chord does no better. A handful do: the major and minor triad, which reaches a transposition with just two semitones, and among four-note chords the dominant seventh, the minor seventh and one more. Look where they sit: close to even, but not at it. The perfectly even chords, the augmented triad and the diminished seventh, do no better than a cluster.
Hear what that buys. C major to E major, a whole key a major third away: C falls to B, G rises to G sharp, two semitones. C seven to E flat seven: two semitones. And the C major scale to the G major scale: one semitone, F to F sharp, the smallest move there is. These collections permit small pitch-class moves; establishing a new key also needs musical context.
Why does it matter? Harmony wants chords that sound good and can be heard as the same chord in many keys. Counterpoint wants independent voices that move by small steps. Nearly even chords satisfy both at once: a progression of such chords can change key while every voice moves by a step. Perfectly even chords are too symmetric: their nearest transpositions are just themselves, so to go anywhere new every voice must move. Tymoczko's thesis is that this geometric fact is why Western music could combine harmony and counterpoint for so long.
Composers used this long before the geometry. Chopin's Prelude in E minor, of 1839, has a left hand of slowly sliding chords. Tymoczko reads it as four-note chords moving mostly one voice, by one semitone, at a time. Some chords resist a simple functional label; the voice leading offers an additional account alongside tonal interpretations. In the space, it is a slow walk near the centre, among the nearly even four-note chords. The same technique runs through Wagner, Debussy and jazz piano.
6Scales are chords tooFoundations3 min
What is a key change, geometrically?
A scale is a set of notes, so it is a chord too, a point in seven-note chord space. Rank all types of seven-note scale by their distance from perfectly even. First comes the diatonic scale, the maximally even scale of Part 12. Second, the melodic-minor set class, which also contains the acoustic or Lydian-dominant mode; third, harmonic minor, with its mirror image harmonic major. These familiar scale classes rank highly under this chosen evenness measure; this is not a derivation of every tonal scale or its use.
So a change of key is a voice leading between scales. From C major to G major one note moves, F up to F sharp; from G to D, again one, C up to C sharp. Each step round the circle of fifths is the smallest voice leading there is, a single semitone in a single voice. Listen to three scales in a row, and hear the one note that changes each time.
Do it for every key. From the C major scale to each of the other eleven major scales, find the smallest voice leading. G major and F major: one semitone. D and B flat: two. And so on, up to F sharp major: six. The numbers are exactly the number of steps round the circle of fifths. The circle that Part 15 drew from listeners' judgements, and that theory books draw from key signatures, is also the map of shortest paths between scales.
This gives tonal music a structure on two levels. Chords move inside a scale, and the scale itself moves against other scales. Both levels use nearly even collections: triads, inside diatonic scales. And both move by small voice leadings: a step in a voice, a semitone in a scale. Tymoczko calls the music built this way the extended common practice, running from Bach through jazz to film. Part 33 builds the mathematics of scales and rhythms underneath.
Jazz uses the second scale on the list as much as the first. Improvisers think in chord-scales, a seven-note scale for each chord. The ascending melodic-minor collection and its modes, including the altered scale and the acoustic or Lydian-dominant scale, are everyday sounds. Moving from one chord-scale to the next usually changes one or two notes and holds the rest. So jazz harmony is voice leading at the level of scales, like modulation in Bach, only faster. Part 39 hears the changes; this geometry lies underneath them.
7Five symmetriesFoundations3 min
What exactly is `a chord'?
Callender, Quinn and Tymoczko noticed that the objects of music theory differ only in which things they call the same. There are five symmetries. O, the octave: C4 and C5 count as one note. P, permutation: it does not matter which voice plays which note. T, transposition: C major and D major are the same kind of chord. I, inversion: a chord and its mirror image count as one, which makes major and minor the same. And C, cardinality: doubling a note does not change the chord. Each choice of letters gives a space, and a different object of music theory.
Inversion is the one symmetry the ear may not grant. Build a chord up from C, four semitones and then three: C major. Now build its mirror image down from C, four semitones and then three: C, A flat, F, which is F minor. With I among the symmetries, the two are the same object. Listen, and judge whether they sound like the same kind of thing.
Most listeners hear major and minor as different in mood, one bright and one dark, though alike in stability. So a theory of tonal harmony usually leaves I out, and a theory of atonal sets, like Part 29's, puts it in. The letters are a choice about what to ignore.
A program can count the chords in each space by brute force: list every chord of three or four pitch classes, doublings allowed, and group together those the symmetries make equal. With octave and permutation only, there are three-note chords. Add cardinality, so doublings vanish, and remain: the pitch-class sets of size one to three. Add transposition and there are chord types. Add inversion as well and there are : Part 29's set classes of one, two and three notes. Each row of this table is a different space, with its own geometry.
The letters line up with ordinary words. O and P: a C major triad, in any voicing. Add T: a major triad, in any key. Add I: a consonant triad, major or minor, the way Riemann's dualism of Part 31 thought of them. All five: the set class of Part 29. Each is a quotient space of the same plane, and the more symmetries, the more the space is folded.
8What each Fourier coefficient hearsFoundations4 min
Can a chord have a spectrum?
There is another geometry hidden in a chord. Write the chord as twelve numbers, one for each pitch class: one where a note sounds, zero where it does not. Then take the discrete Fourier transform, as Part 3 did for sound, but round the circle of the octave instead of along time. The size of the k-th coefficient measures how well the chord lines up with a perfectly even division of the octave into k parts. The third coefficient hears major thirds, the fifth, through a twist of arithmetic, hears the circle of fifths, and the sixth hears whole tones. And the sizes do not change under transposition or inversion, so each set class has one profile, as Part 29's homometric pairs showed, two classes can share one.
Six portraits. The augmented triad lives entirely in the third and sixth coefficients: it is a perfect division of the octave into three. The diminished seventh lives in the fourth. The diatonic scale peaks at the fifth: it is a stretch of the circle of fifths. The whole-tone scale has nothing but the sixth. The cluster peaks at the first, the coefficient of chromatic crowding. And the major triad spreads its weight over the third and fifth: a little augmented, a little diatonic, which is one way to say why it serves in so many contexts.
A question for your ears. Three six-note chords, each held twice. One is built entirely from the circle of fifths, one from major thirds and semitones, one from whole tones. Which is the fifths chord: A, B or C?
B: the pentatonic chord, C, D, E, G, A over a low G, the bright open sound of fifths, with a fifth coefficient of three point seven and none of the others large. A is the hexatonic chord, all third coefficient and no fifth at all; C is the whole-tone chord, nothing but the sixth. These sketches invite a comparison of pitch-set qualities; this informal question does not establish that listeners directly compute Fourier coefficients. The transform uses distinct pitch classes, so the doubled G in B is counted once.
The idea has a history. David Lewin used it, in effect, in 1959. Ian Quinn in 2006 showed that the Fourier magnitudes map out the set classes as qualities: fifthiness, thirdiness and the rest. Emmanuel Amiot's book of 2016 and Jason Yust's analyses use them to describe tonal and post-tonal music. Part 29's homometric pairs share every magnitude; phases can distinguish their pitch-class arrangements; magnitudes alone cannot. And an open question: are listeners hearing the coefficients, or do the coefficients just describe what listeners hear?
So far only the sizes. Each coefficient is a complex number, with a size and a direction. The direction of the fifth coefficient points to a place on the circle of fifths, roughly a key. The C major scale and the G major scale point one twelfth of a turn apart. Jason Yust maps whole tonal pieces as paths through these phase spaces. Sizes say what kind of chord; phases say where it is.
9How smooth is Bach?Foundations4 min
Does Bach take the shortest paths?
Now a measurement. Here is the first phrase of Bach's chorale Wachet auf, in four voices, played on the piano. Under each change of chord on the beat, two numbers for the upper three voices: the semitones Bach's voices actually move, and the smallest number any voicing could move between the same two chords. Where the numbers match, Bach took a shortest path. The first two changes are not changes at all: the same chord, E flat major, re-voiced as the tune climbs its arpeggio.
Now all of them: transitions between distinct registered beat voicings, in three hundred and sixty-four chorales. In the upper three voices Bach's voice leading is the smallest possible in changes out of a hundred. On average his upper voices move semitones per change, against a minimum of ; a random assignment control, measured by shortest pitch-class motion rather than actual registered leaps, gives . With the bass included, the minimum is reached only times in a hundred, and for a good reason: the bass leaps by fourths and fifths to carry the roots of the chords, as Part 17 found. Bach writes nearly shortest paths above a bass that does a different job.
Can you hear the difference? The beat chords of that phrase, twice. In one, the voices are Bach's. In the other, each chord's three upper notes were handed out to the soprano, alto and tenor at random, kept near their own registers. The chords are identical; only the paths between them differ. Which is Bach's, A or B?
A is Bach's: his upper voices move semitones across the phrase; the shuffled version moves , about twice as far, and you can hear the lines jump and tangle. Same chords, same harmony; the difference is entirely in the paths.
The census hides a curiosity. Bach's excess over the minimum is always an even number: zero, two, four, six, never one or three. Here is why. A voice's real move and its shortest move round the octave differ by whole octaves and perhaps by direction, so their sizes are both even or both odd. And the parity of a total move depends only on the sum of the notes before and after, not on which voice takes which note. So every voicing of a progression has the same parity as the minimum, and the excess must be even. A small theorem, and chord changes that agree with it.
What does this show? The minimum ignores register: it may cross voices or leave a singer's range. Bach also obeys other rules: no parallel fifths, sensible doublings, a shaped melody. Tymoczko reads the result as near-minimal paths among nearly even chords; David Huron explains the same habits by how the ear separates voices into streams. Both predict what we measured, and neither alone says which of several shortest paths Bach will choose. Part 17's harmonizer moved its inner voices about half as much as Bach did: the shortest path is not the whole story.
10Frontier: what the geometry does not explainResearch3 min
Is the shortest path what we hear?
The geometry is powerful, and blind in places. It does not see function: G major to C major moves three semitones, G major to E flat major only two, yet the first can serve a central cadential role in tonal music and the second a surprise. It treats every voice alike, while music gives the bass a different job. Octave equivalence throws away register and spacing. A path has no strong beats. And Part 5's roughness depends on the spectrum, which pitch classes alone do not record.
The theory started an argument. Tymoczko's book of 2011 explains five features of tonal music with one geometry. Critics, among them Julian Hook, Richard Cohn and Fred Lerdahl, admired the spaces but asked whether listeners use them, and whether other spaces explain as much. The geometry also maps what is possible: chromatic voice leading in Chopin, Debussy and jazz finds natural descriptions in it. But studies of how listeners hear voice-leading size are still few. A theory can be useful to composers long before it is confirmed for listeners.
And it is not the only geometry. Part 31's Tonnetz counts moves, not semitones. Fourier spaces measure qualities, not paths. Lerdahl's tonal pitch space, from Part 19, measures distances between keys and chords. Learned embeddings fit a space to millions of chord sequences, as a possible extension to Part 62. Each is a hypothesis about what makes two chords close.
A concrete version. Choose pairs of progressions that are equally short in one space and not in another. Ask listeners which is smoother, and which chords belong together, with register and timbre held fixed. Fit each geometry's distance to the judgements and compare them on pairs held out, with intervals. Does voice-leading size predict how smooth a progression sounds? The answer decides whether this geometry is a theory of listening, or of writing.
One more direction. Nothing in the geometry needs twelve-note equal temperament. In nineteen equal steps the thirds are nearly pure, and the nearly even chords are different ones. Spectral chords from Part 30 and just intonation from Part 6 are points between the piano's keys. Composers now use these spaces to find voice leadings in tunings few have played. And that suggests a fair test: does the theory predict which tunings make good harmony?
Variation 32, recap and problemsAll tracks3 min
Every part ends by doing something to the Tune with what it built. This time a program harmonizes the Tune's first two phrases twice, one triad every two beats, each containing the melody note sampled at that two-beat boundary, with C major supplied at both endpoints, minimizing total pitch-class voice-leading cost. First it may use only the chords of C major; it finds C, C, A minor, C, F, A minor, D minor, C. The second search permits chromatic triads and C major but excludes the other diatonic triads; it finds A major, F minor and G minor, and the whole path costs only semitones more. Distant chords, reached by short steps.
Row thirty-two of the ledger: seconds; the measurement is the rerouted path and the two totals of voice leading.
What did we find? A chord is a point, and folding by octave and permutation curves the space. Two-note chords live on a Möbius strip, three-note chords in a twisted prism around a triangle. A voice leading has a size, the smallest total of semitones. Nearly even chords, the triads, the seventh chords and the diatonic scale, reach their own transpositions by one or two semitones. Five symmetries name music theory's objects, and Fourier magnitudes their qualities. And in this corpus and beat-sampling scheme, Bach's upper voices match the pitch-class minimum about two times in three.
Five problems. One to compute, one to prove, one for your ears, one to build, and a research problem, marked with a star. Solutions are in this part's notes. Pause here.
Where does this come back? Next, in the mathematics of scales and rhythms. In jazz voicings. In orchestration, where spacing and register return. And in machines that recognize and generate chords.
And in practice. Arrangers voice chords so every part moves by a step. Jazz pianists keep the guide tones and move them by semitones. Film composers slide between distant chords by small moves. And notation and accompaniment software voices chord symbols automatically, by shortest paths.
The books and papers this part follows. The full list, with notes, is in the README.
Where it goes next. The mathematics of rhythm and scale in Part 33; jazz voicings in Part 39; orchestration and spacing in Part 41; chords recognized and generated by machine in Parts 62 and 65.
Key results
The part's results in one place, for revision.
Try it
Lab 32 · The geometry of chords, computed
Find the smallest voice leading between two chords, measure how even a chord is and how cheaply it reaches its transpositions, read a set's Fourier magnitudes, and test Bach's voice leading against the shortest paths.
python -m videos.music.labs 32
needs numpy, scipy, matplotlib · download lab32.py ·
source on GitHubsmallest voice leading (0, 4, 7) -> (5, 9, 0) 3 semitones; moves [0, 1, 2]
the same, Euclidean and largest leap 2.24, 2
(0, 4, 7, 10): distance from even; cheapest move to a transposition 0.87; 2 semitones, to T3
(0, 4, 7, 10): Fourier magnitudes |F1| ... |F6| 0.52 1.00 1.41 2.65 1.93 2.00
chord types of 3 notes under OP, OPT, OPTI, OPTIC {'OP': 364, 'OPT': 31, 'OPTI': 19, 'OPC': 298, 'OPTC': 26, 'OPTIC': 19}
Bach, 120 chorales (upper three voices): minimal share; means actual/min/shuffled 0.67; 5.90 / 3.87 / 8.66
ear problem: where the minimal voice leading comes in each pair (listen first) first, first, first, second
The smallest voice leading tries every assignment of notes to voices; nearly even chords reach their transpositions cheaply; and Bach's excess over the minimum is always even.
The code (76 lines; it asserts its own result)
"""Lab 32: the geometry of chords, computed: the smallest voice leading between any two chords, evenness and the
nearest transposition, the Möbius strip of two-note chords, Fourier magnitudes, Bach's chorales against the shortest
paths, and pairs of progressions to judge by ear."""
import numpy as np
from videos.coursekit import labs
from explainer.music.monochord import SR, Clip, concat
from explainer.music.monochord import chorales as CH
from explainer.music.monochord import geometry as G
from explainer.music.monochord.partkit import organ_tone
TITLE = "The geometry of chords, computed"
GOAL = ("Find the smallest voice leading between two chords, measure how even a chord is and how cheaply it reaches its "
"transpositions, read a set's Fourier magnitudes, and test Bach's voice leading against the shortest paths.")
TASKS = [
"Choose CHORD_A and CHORD_B (pitch classes, same size; fractions allowed). What is the smallest voice leading, and which voice moves where?",
"Choose CHORD. How far is it from even, and what is its cheapest move to a different transposition of itself?",
"Change UPPER_ONLY. How much closer to the minimum are Bach's upper three voices than all four?",
]
CHORD_A = (0, 4, 7)
CHORD_B = (5, 9, 0)
CHORD = (0, 4, 7, 10)
UPPER_ONLY = True
def chord_sound(keys, seconds=0.9):
y = sum(organ_tone(440 * 2 ** ((m - 69) / 12), seconds, partials=6, rolloff=0.6, decay=2.5) * 0.22 for m in keys)
return Clip(y, SR).fade(0.01, 0.1)
def run(seed=0):
rng = np.random.default_rng(seed)
lab = labs.Lab()
size, moves = G.vl(CHORD_A, CHORD_B)
lab.row(f"smallest voice leading {CHORD_A} -> {CHORD_B}", f"{size:g} semitones; moves {[round(m, 2) for m in moves]}")
lab.row("the same, Euclidean and largest leap", f"{G.vl(CHORD_A, CHORD_B, 'euclid')[0]:.2f}, {G.vl(CHORD_A, CHORD_B, 'max')[0]:g}")
v, k = G.nearest_transposition(CHORD)
lab.row(f"{CHORD}: distance from even; cheapest move to a transposition", f"{G.evenness(CHORD):.2f}; {v:g} semitones, to T{k}")
lab.row(f"{CHORD}: Fourier magnitudes |F1| ... |F6|", " ".join(f"{x:.2f}" for x in G.dft(CHORD)[1:]))
lab.row("chord types of 3 notes under OP, OPT, OPTI, OPTIC", str({k: v for k, v in G.optic_counts(3).items()}))
book = CH.load()[:120]
r = G.bach_voice_leading(book, upper_only=UPPER_ONLY)
lab.row(f"Bach, 120 chorales ({'upper three voices' if UPPER_ONLY else 'all four'}): minimal share; means actual/min/shuffled",
f"{r['minimal_share']:.2f}; {r['mean_actual']:.2f} / {r['mean_minimal']:.2f} / {r['mean_shuffled']:.2f}")
assert all(x == 0 for x in r["excess_hist"][1::2])
# Problem 3: four pairs of progressions; in each pair one is the minimal voice leading
pairs = [((60, 64, 67), (60, 65, 69), (65, 69, 72)), ((60, 64, 67), (59, 62, 67), (55, 59, 62)),
((60, 63, 67), (60, 65, 68), (65, 68, 72)), ((60, 64, 67), (59, 64, 68), (64, 68, 71))]
order, clips = [], []
for a, small, big in pairs:
first = bool(rng.integers(2))
order.append("first" if first else "second")
x, y = (small, big) if first else (big, small)
clips.append(concat([chord_sound(a), chord_sound(x), chord_sound(a), chord_sound(y)], gap=0.15))
lab.audio = concat(clips, gap=1.0)
lab.row("ear problem: where the minimal voice leading comes in each pair (listen first)", ", ".join(order))
fig, (a, b) = labs.figure(2)
pts = [G.dyad_strip(i, j) for i, j in G.dyads()]
ics = [min((j - i) % 12, (i - j) % 12) for i, j in G.dyads()]
a.scatter([p[0] for p in pts], [p[1] for p in pts], c=ics, cmap="viridis", s=30)
a.set_xlabel("centre (glued with a twist at 0 and 6)")
a.set_ylabel("interval")
a.set_title("the Möbius strip of two-note chords")
b.bar(range(0, 8, 2), [r["excess_hist"][k] for k in range(0, 8, 2)], color=labs.GOLD)
b.set_xlabel("semitones more than the minimum")
b.set_title("Bach's voice leading against the shortest path")
lab.fig = fig
lab.note = ("The smallest voice leading tries every assignment of notes to voices; nearly even chords reach their "
"transpositions cheaply; and Bach's excess over the minimum is always even.")
return lab
Now change it
- Choose CHORD_A and CHORD_B (pitch classes, same size; fractions allowed). What is the smallest voice leading, and which voice moves where?
- Choose CHORD. How far is it from even, and what is its cheapest move to a different transposition of itself?
- Change UPPER_ONLY. How much closer to the minimum are Bach's upper three voices than all four?
Problems, with solutions
Try each problem before opening its solution.
-
Compute. Find the smallest voice leading from C major to A♭ minor, and from C⁷ to F♯⁷.
Solution
C, E, G to C♭ (B), E♭, A♭: C down to B, E down to E♭, G up to A♭: 3 semitones, the hexatonic pole of Part 31. C, E, G, B♭ to F♯, A♯, C♯, E: E and B♭ (A♯) hold, C up to C♯, G down to F♯: 2 semitones, the tritone substitution.
-
Prove. Prove that the excess of any voice leading over the minimal one between the same two chords is even.
Solution
For any assignment σ of the second chord's notes to the first chord's voices, the total motion Σ|bσ(i) − aᵢ| has the parity of Σ(bσ(i) − aᵢ) = Σb − Σa, whatever σ is, and whether the moves are real (any octave) or the shortest way round (they differ from the real moves by multiples of 12). So every voice leading between the two chords has the same parity, and the difference of two of them is even.
-
Ear. The lab plays pairs of progressions; one in each pair is the minimal voice leading. Find it.
Solution
The lab prints the answers. The minimal one keeps a common tone and moves the others by steps; the other moves every voice the same way by a leap.
-
Build. Draw the Möbius strip of two-note chords in 19-note equal temperament, and place its thirds.
Where to look.
geometry.dyad_stripworks for any real pitch classes: scale a 19-step pitch class k to 12k/19 and plot all 190 dyads; the 19-tone major third (6 steps, 379 cents) and minor third (5 steps, 316 cents) sit close to the 12-tone ones but on a different lattice, and the tritone line holds no dyad because 19 is odd. -
★ Does voice-leading size predict how smooth a progression sounds?
Where the frontier is. Choose pairs of progressions that are equally short under one measure (voice-leading size, PLR distance, Lerdahl's chord distance) and not under others; ask listeners which is smoother and which belongs together, with register, spacing and timbre held fixed; fit each measure to the judgements and compare predictions on held-out pairs with intervals; report whether musical training changes the winner.
Notes and sources
Sources
- D. Tymoczko, "The geometry of musical chords", Science (2006); C. Callender, I. Quinn and D. Tymoczko, "Generalized voice-leading spaces", Science (2008); D. Tymoczko, A Geometry of Music (2011).
- D. Lewin, "Re: Intervallic relations between two collections of notes", Journal of Music Theory (1959); I. Quinn, "General equal-tempered harmony", Perspectives of New Music (2006–07); E. Amiot, Music Through Fourier Space (2016); J. Yust, "Schubert's harmonic language and Fourier phase space", Journal of Music Theory (2015).
- C. Callender, "Continuous transformations", Music Theory Online (2004); J. Roeder, A Theory of Voice Leading for Atonal Music (1984); R. Cohn, Audacious Euphony (2012).
- D. Huron, Voice Leading: The Science behind a Musical Art (2016); J. Hook, "Why are there twenty-nine tetrachords?", Music Theory Online (2007).
- Part 12 for maximal evenness; Part 16 for Fux; Part 17 for the chorales; Part 29 for set classes; Part 31 for the Tonnetz.
About this partfrom its README
Part 32 of a sixty-eight-part course in music (see the series plan and
the syllabus), the fifth part of Act V. Part 31 named the moves between triads; this part puts every
chord in a space. Following Tymoczko (2006) and Callender, Quinn and Tymoczko (2008), it folds the plane of voices by
octave and permutation into a Möbius strip for two notes and a twisted prism for three, measures the size of a voice
leading, tests the claim that nearly even chords are the ones that reach their own transpositions cheaply, treats scales
as chords and the circle of fifths as a map of shortest paths, counts chords under the five OPTIC symmetries, reads
chords' Fourier magnitudes, and measures how close Bach's chorales come to the shortest paths. The geometry is
Monochord's (explainer/music/monochord/geometry.py); Bach's chorales are Part 17's; every chord is played on Part 7's
piano, and the gliding voices of the hook are synthesized. Published findings are the ones listed under Sources.
- Two voices, one chord. An ear question: two voices that cross and two that meet and turn back (pitch content alone cannot distinguish them: at every instant they hold the same two pitches, while synthesized phase histories can differ); Science, 2006; the plan.
- 1. Chords as points. Two voices as a point of the plane and a voice leading as a path; octave and permutation fold the plane (a torus, then half of it, glued with a twist, with the unisons as an edge); a short history; why fold.
- 2. The Möbius strip. All 78 two-note chords of twelve-note equal temperament, unisons on the one edge, tritones down the middle; parallel, contrary and oblique motion as three directions, heard; crossing and bouncing as one path; Fux's cantus with Part 16's best first-species line as a path whose every step is a shortest one (52 semitones, the minimum), heard.
- 3. Three notes: a triangle in a prism. The 91 ordered gap triples for three-note chords in a triangle, the augmented triad at the centre; from a cluster to the augmented triad, heard (distance from even 4.24, 2.83, 1.41, 0.82, 0); C major to C minor by quarter-semitones through the neutral triad, heard; the twisted prism; four notes and the tetrahedron, the diminished seventh at its centre; the smallest voice leading from C major to every triad (1 to C and E minor, 6 to D, F sharp and B flat major).
- 4. The size of a voice leading. An ear question (C major to F major two ways: 3 semitones against 15); three norms (sum, Euclidean, largest leap) on three voice leadings; chords of different sizes; how the minimum is found.
- 5. Nearly even chords. Evenness against the smallest voice leading to a different transposition, for all 12 three-note and 29 four-note chord types: only (037), (0258), (0358) and (0157) beat moving every voice a semitone, and the perfectly even chords do not; C major to E major and C7 to E♭7 in 2 semitones, the C major scale to G major in 1, heard; Chopin's E minor prelude; why it matters.
- 6. Scales are chords too. The 38 seven-note scale types by evenness: diatonic, then melodic minor, then harmonic minor and major; C, G and D major, one semitone apart, heard; the circle of fifths measured (the smallest voice leading from C major to each major scale is its number of steps round the circle); scales in jazz; two levels at once.
- 7. Five symmetries. O, P, T, I, C; C major and its mirror image, F minor, heard; chord counts by brute force (three notes: 364 under OP, 298 under OPC, 31 under OPT, 19 under OPTIC; four notes: 1,365 and 48); what each space is called.
- 8. What each Fourier coefficient hears. The discrete Fourier transform of a pitch-class set; six portraits; an ear question (which six-note chord is built from fifths? the pentatonic, |F₅| = 3.73); phases; the history (Lewin, Quinn, Amiot, Yust).
- 9. How smooth is Bach? The first phrase of Wachet auf (BWV 140.7), heard, with Bach's motion and the minimum under every change; all 364 chorales: in 17,339 changes of chord, the upper three voices take the minimum 67 times in 100 (mean 5.9 semitones against 3.8, and 8.6 with the voices shuffled), all four voices 40 times; an ear question (Bach's voices or the same chords with their upper notes reassigned: 51 semitones against 103); why the excess is always even; what the measurement does not show.
- 10. Frontier: what the geometry does not explain. Function, the bass, register, rhythm, timbre; the argument; rival geometries; beyond twelve notes; ★ research problem: does voice-leading size predict how smooth a progression sounds?
- Variation 32, recap and problems. The Tune's first two phrases harmonized by the smallest voice leadings among the chords of C major (C C Am C F Am Dm C, 16 semitones), then among chords outside C major (C C A C Fm C Gm C, 18); the ledger; what we found; five problems; where it comes back; in practice; references; Part 33.
What is computed and built
python -m videos.music.music32.compute (about a minute) fills .cache/music32/.
| Item | What it computes | Checked against |
|---|---|---|
hook |
crossing and bouncing glides (an ear question) | the same two pitches at every instant |
strip, duet |
the 78 dyads on the strip; three kinds of motion; Fux's cantus and a first-species line | brute-force minimal sizes |
triangle, neutral |
91 ordered gap triples and their evenness; a walk to the centre; major to minor by quarter-tones | — |
vlsize |
three voice leadings and three norms (an ear question); C major to all 24 triads | brute force with octaves (tests) |
even |
evenness and nearest transposition for every 3- and 4-note set class; three demonstrations | — |
scales |
the 38 seven-note types by evenness; three keys; the circle of fifths measured | — |
mirror, optic |
a chord and its inversion; chord counts under each combination of symmetries | set-class counts (Part 29) |
fourier |
magnitudes and champions for sizes 3 to 7; an ear question | — |
bach |
Bach's voice leading against the minimum, with a shuffled control; Wachet auf; an ear question | the parity theorem |
tune, variation |
Variation 32: two Viterbi harmonizations by smallest voice leading | — |
Monochord's tools are held in tests/music/test_geometry.py; this part's claims and clips in
tests/music/test_music32.py.
Sounds. Part 7's piano (a physical model), retuned for the quarter-tone chords; the hook's gliding voices are synthesized. Bach's chorale is played from the music21 corpus encoding, as in Part 17. There are no recordings.
What the models are, and are not. Voice-leading size here is a sum of semitones between pitch classes; Bach's measured motion uses real pitches, so octave leaps count. The minimum ignores register, ranges and every other rule of part writing. The beat chords are the notes sounding on each beat; passing notes between beats are not counted. Evenness is the Euclidean distance to the nearest perfectly even chord; other measures (Fourier magnitudes among them) rank chords a little differently. The prism and tetrahedron are described, not drawn in three dimensions.
Notes
The fixed-cardinality geometry retains repeated pitches as a multiset. Ordered gap triples repeat transposition classes under cyclic rotation. Neutral-triad interpolation is a geometric example, not a model of Arabic or Persian harmony. Acoustic/Lydian dominant is a mode of ascending melodic minor, not the same rooted scale. Fourier plots use distinct pitch classes and do not demonstrate a listener mechanism. The Bach census counts changed registered beat voicings, including revoicings; its random control uses circular pitch-class distances while the actual voice motion uses register. It is therefore not a matched-register comparison. Tune searches use sampled melody notes, supplied C-major endpoints and specified chord alphabets.
Companion material in this repository
The syllabus's plan for this partfrom SYLLABUS.md, the plan of record
- Hook: crossing and bouncing voices (an ear question: they cannot be told apart); Science, 2006; the plan.
- Chords as points: the plane of voices; folding by octave and permutation; a short history; why fold.
- The Möbius strip: the 78 dyads; parallel, contrary and oblique motion heard; the edge; a first-species line as a path of shortest steps, heard.
- Three notes: the triangle of shapes; from a cluster to the augmented triad heard; major to minor by quarter-tones heard; the twisted prism; four notes; distances from C major.
- The size of a voice leading: an ear question (3 semitones against 15); three norms; chords of different sizes; the algorithm.
- Nearly even chords: evenness against the cheapest move to a transposition; three small moves heard; Chopin; why it matters.
- Scales are chords too: the 38 seven-note types by evenness; three keys heard; the circle of fifths measured; jazz; two levels.
- Five symmetries: OPTIC; a chord and its mirror heard; counts by brute force; names.
- Fourier: the transform of a set; six portraits; an ear question (the fifths chord); phases; history.
- How smooth is Bach?: Wachet auf heard and measured; all 364 chorales; an ear question (Bach's voices or shuffled); the parity theorem; limits.
- Frontier: what the geometry cannot see; the argument; rival geometries; other tunings; the research problem.
- Variation 32: the Tune by shortest paths, then rerouted through chromatic chords. Outro: problems, payoffs.
Covers: chords as unordered points; the orbifolds for two, three and four notes; voice-leading size and its
norms; near-evenness; the OPTIC symmetries; scales as chords and the circle of fifths as shortest paths; the
Fourier transform of a pitch-class set and what each coefficient hears.
Built and computed: monochord/geometry.py: minimal voice leading for chords of any equal size and tuning, in
three norms; the Möbius strip coordinates; the triangle of shapes; evenness and the cheapest move to a
transposition; OPTIC counts by brute force; DFT magnitudes and their champions; Bach's voice leadings against the
minimum with a shuffled control (17,339 changes; upper voices minimal 67 times in 100; the excess always even);
semitone paths between chords.
Variation 32: the Tune's harmony as a path of smallest voice leadings (16 semitones), then rerouted through
chords outside the key (18).
Frontier: Fourier approaches to harmony; what the geometry does not explain; whether voice-leading size predicts
perceived smoothness.
Rights: every sound is the film's own (§2.4); Bach's chorale is public domain, played from the corpus encoding;
Chopin's prelude is described, not played.
Reading: Tymoczko (2006) and A Geometry of Music; Callender, Quinn & Tymoczko (2008); Amiot, Music Through
Fourier Space.
Build the film
python -m videos.music.music32.compute # the part's numbers, into .cache/music32
python tools/build.py music32 # render and assemble the film
EXPLAINER_TTS=silent python tools/qa_scene.py music32 Hook # one chapter, silent, with a contact sheet
Scenes: videos/music/music32. Setup: see the course page. Source of these notes: the README and the scenes' narration.
Build it
python -m videos.music.music32.compute # numbers and sounds (about a minute)
EXPLAINER_TTS=silent python tools/build.py music32 -q l --fps 15 # a silent-narration preview, with the sounds
python tools/qa_sound.py music32 --sync # the sound gates
python tools/dead_air.py renders/music32_480p.mp4 --sound music32 # no empty screen; no sound over a still one
python tools/lecture_length.py music32 # 30 to 60 minutes, listening included
python tools/build.py music32 # 1080p30, narrated
python -m pytest -q tests/music # Monochord against its references; this part's claims and clips
python -m videos.music.labs 32 # the lab (writes a figure and a short WAV)