♪Music, Built

Act V · After Tonality

Part 31 of 68

Transformations

Foundationsstarts at this level35 min of film10 chaptersprerequisites: Part 5, Part 13, Part 15, Part 19, Part 27, Part 28, Part 29

When late-Romantic and film harmony leaves the key behind, what logic connects its chords?

Two chords that share no key can still sound inevitable. Hugo Riemann's moves name the logic: P, L and R each keep two notes of a triad and move the third by a semitone or a whole tone. Built by brute force, the PLR group and the transpositions and inversions are both of order 24, commute, and each acts on the 24 triads in exactly one way: two dual groups, and L and R alone generate the first, a dihedral group in which LR has order 12. Euler's lattice, closed by equal temperament into a torus, draws every triad as a triangle; from C major there are 1, 3, 6, 8, 5 and 1 triads at 0 to 5 steps, B flat minor alone the farthest. Repeating P and L walks the hexatonic scale, P and R the octatonic; the families split the triads four and three ways, and an augmented triad sits one semitone from six of them. The chain R, L, R, L... visits all 24 triads, as Beethoven's Ninth begins to, and is one of exactly 62 tours. Film composers use chromatic mediants for wonder and the hexatonic pole for the uncanny; jazz moves through three keys a major third apart, and the tritone substitution is the same idea for seventh chords. The Tune is harmonized by a walk on the Tonnetz that rediscovers tonic, subdominant and dominant.

What you need. Part 6 for Euler's lattice and the comma; Part 13 for triads; Part 19 for the hexatonic cycle; Part 27 for Tristan; Part 28 for the symmetric scales; Part 29 for inversion. Group actions, dihedral groups, breadth-first search, Hamiltonian cycles.

Ideas, mathematics and history
Lewin's intervals as group actions, the T/I and PLR groups and their duality, the Tonnetz as a torus, hexatonic cycles, film music's wonder chords
What we build, compute and hear
the group checked by brute force; the Tune harmonized by a walk on the Tonnetz

What you will be able to do

Foundations

  • Hear and name P, L and R, and the chromatic mediants and hexatonic pole built from them.
  • Find a triad's place on the Tonnetz and walk between triads by flips.
  • Explain why the R-L chain visits every triad.

Full course

  • Build the PLR and T/I groups by brute force and show they commute and act simply transitively.
  • Count distances, cycles, systems and Hamiltonian tours on the PLR graph.
  • Compare PLR distance with voice-leading distance.

Research

  • Design a listening experiment that separates the circle of keys, the Tonnetz and voice leading.

Practice

  • Score a cue with mediants and poles, and harmonize a melody by a walk on the Tonnetz.

Contents

Each chapter has a home level. Choose a track to see what to read and watch: Foundations 27 min · Full course 31 min · Research 35 min · Practice 31 min.

  1. 0Two chords that share no keyFoundations2 min
  2. 1Naming the movesFoundations5 min
  3. 2Two groups, one dualityFoundations4 min
  4. 3The TonnetzFoundations5 min
  5. 4Hexatonic and octatonic cyclesFoundations4 min
  6. 5The long chainFoundations3 min
  7. 6Wonder, and the uncannyPractice3 min
  8. 7Thirds in jazzFoundations3 min
  9. 8Frontier: other spaces, real listenersResearch4 min
  10. Variation 31, recap and problemsAll tracks2 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 chords that share no keyFoundations2 min

Listen to a progression of our own, in the manner of a film score at a moment of wonder: C major, E major, C major again, A flat major, F, and home. Every chord is an ordinary major triad. But C major and E major share only one note, and no single diatonic scale contains both; the same is true of C and A flat. Tonal analysis can describe them through mixture, chromatic mediants or applied functions; transformations offer another useful account, without requiring one shared diatonic scale.

The tool to describe them came late. The nineteenth-century theorist Hugo Riemann taught that every chord is the tonic, dominant or subdominant of some key. But music after Wagner moves between chords that no single key holds. In 1987 David Lewin proposed a change of view: stop naming the chords, and name the moves between them. Three moves do most of the work: each keeps two notes of a triad and shifts the third. They form a group, and this part builds it, and its twin.

Here is the plan. First the three moves, P, L and R, heard. Then the two groups of twenty-four operations they belong to, built by brute force, and a surprising fact about how they fit together. The Tonnetz, a map on which every triad is a triangle and the whole space is a torus. Cycles, and the long chain through all twenty-four triads. Film's chromatic mediants and jazz's cycles of major thirds. And the frontier: do listeners actually feel these distances?

1Naming the movesFoundations5 min

What is the smallest change that makes a new triad?

Here are the three moves. P, for parallel, turns C major into C minor: the root and fifth stay, and the third moves down a semitone. L, the leading-tone exchange, turns C major into E minor: E and G stay, and C moves down a semitone to B. R, for relative, turns C major into A minor: C and E stay, and G moves up a whole tone to A. Each move undoes itself: do it twice and you are back where you started.

A question for your ears. C major, three times, each time followed by a different one of the three moves. Which pair is P, major turning to minor on the same root: A, B or C? Listen for the bass.

C is P: the bass stays on C, and the chord darkens from major to minor. A is L, to E minor, whose bass moves up to E; B is R, to A minor, whose bass moves up to A. All three change just one note of the chord.

Count how far the voices move. P and L move one voice by one semitone; R moves one voice by a whole tone. The theorist Richard Cohn calls this parsimonious voice leading. P and L attain the one-semitone minimum for distinct triads; R requires two. This pitch-class economy is exact, while perceived smoothness also depends on register, voicing and context.

The moves work on minor triads too. From A minor: P raises the third a semitone, C to C sharp, giving A major. L raises the fifth a semitone, E to F, giving F major. R lowers the root a whole tone, A to G, giving C major, the relative major. Each keeps two notes. Listen to all three.

A table makes the pattern plain. P keeps the root and fifth and moves the third by a semitone: down on a major triad, up on a minor one. L keeps the minor third: on a major triad the root drops a semitone, C to B, giving E minor; on a minor triad the fifth rises a semitone. R keeps the major third: on a major triad the fifth rises a whole tone, G to A, giving A minor; on a minor triad the root falls a whole tone. On a minor triad every move runs the other way, and that is why doing a move twice brings you back.

Moves combine. L then P takes C major to E major; P then L takes it to A flat major; R then P to A major. Each keeps one note and moves the other two a little: two or three semitones in all. Hear the three; these two-step moves are the chromatic mediants that chapter six finds in film scores.

Lewin's idea was general. Take a space of musical objects, notes, chords or rhythms, and a group of moves acting on it. Then an interval is not a distance but an action: if I am at s, what do I do to reach t? Part 29's transpositions and inversions were already moves of this kind, acting on sets. The moves P, L and R themselves had been described a century earlier, by Riemann and by Arthur von Oettingen. Cohn, Brian Hyer and others revived them in the 1990s, under the name neo-Riemannian theory.

Riemann and Oettingen had a reason to pair the moves. In their dualist theory a minor triad is a major triad turned upside down: C major is built up from C, C, E, G, and its mirror is built down from G, G, E flat, C. So each of P, L and R exchanges a triad with its mirror image across one of its intervals. It is Part 29's inversion, applied to triads a century early. Dualism was abandoned as a theory of hearing, but its mathematics survived.

2Two groups, one dualityFoundations4 min

What do all the moves together form? The program finds out by brute force. Each move is written as a permutation of the twenty-four major and minor triads. Then P, L and R are composed in every possible order, until no new permutation appears. There are : the PLR group. Doing the same with Part 29's transposition and inversion gives the T and I group, also elements. Both have the shape of the symmetries of a twelve-sided polygon, the dihedral group.

Now the surprise. Every PLR move commutes with every transposition and inversion: the program checks all five hundred and seventy-six pairs. For instance, doing P and then transposing by three gives the same result as transposing by three and then doing P. And each group reaches every triad from any starting triad in exactly one way. Lewin called this duality: each group is precisely the set of moves that commute with the other. Thomas Fiore and colleagues proved it in general in 2009.

Hear the duality in one square. From C major: transpose up three semitones to E flat major, then P, to E flat minor. Then the other way round: P first, to C minor, then transpose up three, to E flat minor again. Both routes arrive at the same chord, as they must for every one of the five hundred and seventy-six pairs.

What kind of group is it? The computer can find out by multiplying. Each move undoes itself: P, L and R each have order two. P then L has order three, which is why the hexatonic cycle has six chords; P then R has order four, giving the octatonic cycle's eight. L then R has order twelve, so alternating them visits all twenty-four triads. And P equals R, L, R, L, R, L, R, checked on every triad: P is not needed, and L and R alone generate all twenty-four elements. Two reflections whose product has order twelve make the dihedral group of order twenty-four, the symmetries of a regular twelve-sided polygon. The same group as transposition and inversion, acting the other way round.

A group gives a distance: the fewest moves from one triad to another. A breadth-first search from C major finds them all. E major is two steps away, L then P. A flat major is two steps, P then L. A flat minor, which shares no note with C major, is three. And the farthest triad of all, five steps away, is .

Why does it matter? The two groups are two descriptions of the same twenty-four triads. Transposition sees C major and E major as related by a move up a major third. The PLR group sees the same pair as two smooth steps, L and then P. A composer can think in either way, and the duality specifies how their actions commute. This duality requires the stronger mutual-centralizer relationship, with simply transitive actions; commuting alone does not establish it.

3The TonnetzFoundations5 min

Can every triad be drawn on one map?

Euler drew the first version of this map in 1739. Each node is a pitch class. Moving right goes up a perfect fifth; moving up and to the right goes up a major third; and so moving up and to the left goes up a minor third. Every small triangle is a triad: those pointing up are major, like C, E, G here, and those pointing down are minor.

On the map, the three moves become flips. A major triad shares an edge with three minor triads. Flip it across the edge of its third and fifth and you get L. Flip across the edge of its root and fifth, the horizontal one, and you get P. Flip across the edge of its root and third and you get R. Two notes stay, because the edge stays; the third note jumps to the other side.

The map does not go on for ever. Twelve steps to the right, twelve fifths, bring you back to the same pitch class. Three steps up, three major thirds, C, E, G sharp, C, also bring you back. Identifying every lattice point with the same twelve-tone pitch class, including diagonal equivalences, gives a torus, the surface of a doughnut. The two periods alone would leave repeated pitch classes. On it there are twelve nodes and twenty-four triangles: exactly the twenty-four major and minor triads. Chapter two's distance is the number of triangles you cross on this surface.

How far is each triad from C major? A breadth-first search across the triangles answers it. One step: C minor, E minor and A minor. Two steps: six triads, the major chords a third away and the neighbouring fifths, G and F. Three steps: eight minor triads. Four: five major triads, including F sharp and the remote B and C sharp. And five steps: only B flat minor, the single farthest triad on the torus, the one chapter two found. On average a triad is two and two thirds steps from C.

Here is a walk on the torus chosen by chance: eight moves, each P, L or R, never the same one twice in a row, starting from C major. Every step is smooth, yet after eight of them the walk has wandered to D major, four steps from home by the shortest route. Listen to how each chord follows naturally from the last, and how far the whole thing drifts.

The map is old. Euler drew a lattice of fifths and thirds in 1739 to describe just intonation, as Part 6 did. Arthur von Oettingen and Hugo Riemann developed it in the nineteenth century as the Tonnetz, the tone network. In just intonation the map never closes: four pure fifths overshoot two octaves and a pure third by a comma. Equal temperament makes the comma vanish and closes the map into a torus. Part 32 builds a larger geometry, for chords of any size.

Hear the comma that keeps Euler's map open. Go up a major third from C on the lattice, and the E is a pure third, five to four, cents above C. Go four fifths to the right instead, pure fifths, and come down two octaves: that E is cents up. The two Es differ by cents, the syntonic comma. First C with each E; then the two Es alone, alternating.

In just intonation those are different notes, so the lattice never wraps round: it is an infinite plane. Twelve-tone equal temperament identifies both routes with the same E. Identifying all equivalent pitch classes gives the finite torus used here; other finite temperaments can give other quotients.

The map has also been built into instruments. On an isomorphic keyboard every chord has the same shape in every key. The Wicki-Hayden layout, used on concertinas from the 1890s, is one; the harmonic table, a grid of hexagonal buttons, is another. On a harmonic table a major triad is always the same small triangle of three buttons, and P, L and R become a single finger moving to a neighbouring button. Several electronic instruments are laid out on exactly this map.

4Hexatonic and octatonic cyclesFoundations4 min

What happens if you repeat two moves?

Repeat two moves in turn and the chain must come back home, because the space is finite. P and L, alternating from C major: C, C minor, A flat, A flat minor, E, E minor, and C again, six triads. P and R alternating: eight triads, from C through E flat, F sharp and A. Hear both cycles; every step changes a single note.

Gather the notes each cycle uses. The hexatonic cycle uses six pitch classes, exactly Part 28's hexatonic scale, a half step and a minor third, repeated. The octatonic cycle uses eight, the octatonic scale, Messiaen's second mode. The cycles are Part 28's symmetric scales, walked one chord at a time; that is where their names come from.

Richard Cohn made these cycles the basis of a theory. The four hexatonic cycles split the twenty-four triads into four families of six, triads a major third apart, joined by the smoothest voice leading. Opposite each other in a cycle sit two triads that share no notes, like C major and A flat minor: the hexatonic pole. The pole sounds strange, even uncanny, although each voice moves only a semitone. Cohn's book Audacious Euphony, of 2012, builds a theory of late Romantic harmony on it.

Run the hexatonic cycle from every triad, and the twenty-four fall into exactly four families of six. Cohn named them after the points of the compass. Run the octatonic cycle the same way and they fall into three families of eight. Every triad belongs to exactly one family of each kind. These families are the orbits of the subgroups made by P and L, and by P and R: the same counting as Part 29's set classes, one level up.

Each hexatonic family has a hidden centre. Carl Friedrich Weitzmann noticed it in 1853. The augmented triad, C, E, G sharp, divides the octave into three equal major thirds. Move any one of its notes by a semitone and you land on a major or minor triad: six of them, C, E and A flat major, and C sharp, F and A minor. Listen to the augmented chord resolving each way in turn: one voice moves each time.

How do the two pictures fit together? Each of Cohn's families sits between two augmented chords a semitone apart: the family of C major uses C, E, G sharp and B, E flat, G, and nothing else. Weitzmann's region looks out from one augmented chord in both directions: its three major triads come from one of Cohn's families and its three minor triads from the next. Either way, an augmented chord sits one semitone from six triads, which is why it sounds as if it could go anywhere.

The octatonic families were heard long before they were named. Rimsky-Korsakov used the octatonic scale so often that Russian musicians called it his scale. His pupil Stravinsky sounded C major and F sharp major together in Petrushka, in 1911. Look at the families: C and F sharp lie in the same octatonic family, with E flat and A, major and minor. So the famous clash is two chords from one eight-note scale, a tritone apart. Part 28 heard the scale; here the family explains the chord.

5The long chainFoundations3 min

Can one pattern of moves visit every triad?

A celebrated long chain comes from Beethoven. In the development of the second movement of his Ninth Symphony, of 1824, Richard Cohn traces a passage of nineteen triads, C major, A minor, F major, D minor, B flat, G minor, E flat and on, each reached from the last by R or by L, alternately. No key holds it: it slides through most of the triads there are. Continued, the chain would visit all twenty-four before coming home.

Here are the nineteen chords as the chain gives them, in our own voicing on Part 7's piano, at a brisk pace. Listen to how smooth each step is, and how far the whole passage travels: it starts in C major and ends in A major, by way of keys with five and six flats and sharps.

A question for your ears. Two chains of six chords, both starting from C major and moving smoothly. One stays inside the key of C; the other, made only of R and L moves, wanders out of it. Which one stays home, A or B?

A stays home: C, A minor, F, D minor, G, C, every chord in C major. B starts the same way, but its fifth chord is B flat major, and B flat is not in C major; the chain is already on its way to the flat keys. Both can sound smooth; only A remains diatonic to C major. A chromatic chain can still have a tonal context.

Continued, the chain visits every one of the twenty-four triads exactly once before returning to C major: a single loop through the whole space, alternating major and minor. On the Tonnetz it runs in a straight band across the torus. Beethoven's passage walks most of the way round.

The R L chain is one way to visit every triad once and come home. Are there others? A program can try every route on the graph of moves: there are exactly such tours, counting each once whatever its starting point or direction. Only one of them, the R L chain, uses no P at all. Here is another, which leans on P: major to minor and back, on and on, with L and R to change family. Twenty-four chords, each once.

Why must the chain visit every triad? Take R then L from C major: C, A minor, F major. Each R L pair moves a major triad down a fifth; the pair acts like a transposition. Down a fifth twelve times passes through all twelve major triads before C comes back, and the R inside each pair stops on a minor triad, the relative minor, twelve more, all different. Twenty-four chords, each once: the order of L R is twelve, as the group in chapter two predicts.

6Wonder, and the uncannyPractice3 min

Why do some chord changes sound magical?

The hook's progression used chords called chromatic mediants. Two major triads, or two minor ones, a third apart, sharing just one note. C major to E major is L and then P; C to A flat major is P and then L. Tonal theory can call them chromatic mediants or explain them through mixture; on the Tonnetz they are two steps apart. Schubert used them constantly, and in the twentieth century film composers did too. The hook's progression was built from exactly these.

A question for your ears. C major followed by another triad, twice, on the bowed strings. In one pair the two chords share two notes; in the other they share none at all. Which pair shares nothing, A or B?

B shares none: C major to A flat minor, the hexatonic pole. Yet the voices hardly move: C to B, E to E flat, G to A flat, a semitone each, in all. A is the gentle L move, to E minor, keeping two notes. Film composers use the pole for the uncanny: the sound of something nearby that should not be there.

Three trips away from C major and back, on the bowed strings. To E major and back: L and P, a bright lift. To A flat major and back: P and L, warmer and darker. To F sharp major and back: four steps, no notes in common, six semitones of voice leading, tied with D and B flat major for the largest voice-leading distance from C among these triads.

Film music is now a field of study. Frank Lehman's Hollywood Harmony, of 2018, catalogues these transformations across many scores, chromatic mediants for awe and wonder, the hexatonic pole for menace and the supernatural. The scores are in copyright, so this film analyses the moves and plays its own. Film conventions and listener exposure can shape these associations; a chord change has no fixed emotional meaning. Part 44 builds music for picture and play.

The moves were heard long before film. Schubert put whole sections a major third away from the home key. Liszt and Wagner used hexatonic chains for magic, as in Parsifal. Brahms set chromatic mediants inside otherwise classical forms. The triad survived Wagner; what changed was how triads were connected. For much of that music, the transformational view describes the practice better than keys do.

How does a composer use this? Start from a triad, choose the effect, and then pick the move. For warmth and lift, a chromatic mediant, L P or P L, with one note held across the change. For menace, the hexatonic pole: three voices slide a semitone and no note is held. Give the held note to one instrument, so the ear hears the pivot. And remember that context decides: the same move in a hymn sounds like a hymn.

7Thirds in jazzFoundations3 min

What did Coltrane do with a major third?

Jazz found the same symmetry. John Coltrane's Giant Steps, recorded in 1959, moves between three tonal centres a major third apart: B, G and E flat, which divide the octave into three equal parts, each approached through its own dominant chord, at a very fast tempo. Jazz players call these Coltrane changes and still practise them. The tune is in copyright, so the film names the moves; Part 39 plays changes of its own.

On the Tonnetz the three keys lie along one line, each a major third above the last, and three steps bring you back to the start: the map's wrap-around. Between major chords a major third apart, the PLR group needs just two moves, the same pair that drives the hexatonic cycle. Coltrane's harmony walks the torus in the direction Part 28's augmented triad points.

Here is the skeleton of the idea, in our own voicing and at a slow tempo: B major, then D seven leading to G major, then B flat seven leading to E flat major, then F sharp seven leading back to B. Three keys, each a major third below the last, each prepared by its own dominant. A chord progression like this is common property; the melodies written over it are not.

The parsimony idea carries over to four-note chords. Take the dominant seventh, C, E, G, B flat, and the half-diminished seventh, its upside-down twin. Search all twenty-four for chords the four voices can reach in two semitones of motion: there are . of them move two voices by a semitone each and keep the other two; one, E half-diminished, moves a single voice by a whole tone. Among them is C seven to F sharp seven, two chords a tritone apart that share E and B flat: jazz calls it the tritone substitution. And F half-diminished to E seven is the very move inside the first chords of Wagner's Tristan, from Part 27.

The idea extends beyond triads. Adrian Childs, Edward Gollin and others built Tonnetze for four-note seventh chords. Dmitri Tymoczko treats voice leading as motion in a geometric space of chords, which Part 32 builds. Chromatic mediants are common in rock and in film-inspired pop. And the transformational view has been applied to rhythms, timbres and even form. Part 39 hears jazz harmony, and Part 32 the geometry under all of it.

8Frontier: other spaces, real listenersResearch4 min

Do listeners feel distance on the Tonnetz?

Do listeners feel these distances? In 1998 Carol Krumhansl asked listeners to rate how well pairs of triads fitted together. Her results followed distance on the circle of keys, and also, separately, the PLR moves. The group duality concerns actions on triads; it does not make a key-circle distance identical or dual to a PLR distance. These measures can make different predictions for the ear. Listeners with different training, or different exposure to film music, may also differ. And the evidence is still a handful of experiments, with small samples.

The film can at least compare two measures of distance. For each of the twenty-three other triads, its distance from C major in P, L and R steps, and the fewest semitones the three voices must move to reach it. The two agree fairly well, a correlation of . Close in moves usually means close in voice leading. But not always: the triads that need the most voice leading, six semitones, are D, F sharp and B flat major, and none of them is the farthest in moves: that is B flat minor. Which distance the ear uses is exactly the frontier's question.

Theorists have built other spaces too. Generalized Tonnetze put other intervals on the axes and other chords in the triangles. Tymoczko's geometry makes every chord of n notes a point and every voice leading a path, as Part 32 will show. Part 29's Fourier view places triads in a space of spectral magnitudes. Which space best matches what the ear does is open, and each one makes testable predictions about similarity and surprise.

Machines offer a third witness. Train a model on many chord sequences and it gives every chord a vector, a point in a learned space. In several such studies, chords a fifth apart, and relative major and minor, end up near each other. The model never saw a Tonnetz, so its geometry reflects the training data, representation, objective and model assumptions. That suggests a comparison, with held-out material and controls for chord frequency: does the learned space agree with P L R distance, with voice leading, or with neither? Part 62 builds chord recognition, and this part's distances are the baseline it can be compared with.

Before the research problem, an audit of this part's claims. Computed exactly: the groups, their orders, the distances, the cycles and the sixty-two tours. Computed from our own definitions: voice leading as the fewest semitones three voices must move. Taken from the literature: Beethoven's chain from Cohn, film usage from Lehman, ratings from Krumhansl. Not measured here at all: how any listener hears a move. The moves are a fact about chords; their effect is a question about people.

A concrete version. Choose pairs of triads that the circle of keys and the Tonnetz rank differently. Collect ratings of similarity and fit from listeners with varied training. Fit a model from each space and compare them, with intervals. Which geometry of triads matches what listeners hear? The answer would say whether these moves are a theory of hearing, or only of writing.

Variation 31, recap and problemsAll tracks2 min

Every part ends by doing something to the Tune with what it built. This time a program harmonizes it by walking on the Tonnetz: every two beats it may stay, or take one or two P, L or R steps, to a triad containing the melody note, preferring the smallest moves and ending at home. The walk it finds is C, C, A minor, C, F, C, G, C: with C major supplied as both start and finish and a fixed transition cost, it chooses familiar tonic, subdominant and dominant triads. Chords need contain only the melody note sampled every two beats, not every intervening note.

Row thirty-one of the ledger: seconds; the measurement is the walk itself, eight chords and the moves between them.

What did we find? P, L and R each move one voice, by a semitone or a whole tone. With transposition and inversion they form two groups of twenty-four that commute, each the dual of the other. The Tonnetz draws every triad as a triangle on a torus, where B flat minor is five steps from C. Repeating two moves walks Part 28's symmetric scales. R and L alternating visit all twenty-four triads, as Beethoven's chain begins to. And film and jazz use the moves every day.

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 geometry of chords and voice leading. In the mathematics of rhythm and scale. In jazz harmony. In music for picture and play. And in machines that recognize chords.

And in practice. Film composers reach for mediants and poles, knowing what they suggest. Songwriters move between chords by keeping two notes. Jazz players practise cycles of major thirds. And analysts name the moves when no key fits.

The books and papers this part follows. The full list, with notes, is in the README.

Where it goes next. The geometry of chords in Part 32; the mathematics of scales in Part 33; jazz harmony in Part 39; music for picture in Part 44; chord recognition in Part 62.

Key results

The part's results in one place, for revision.

The moves\(\displaystyle P, L, R: \text{ two }\allowbreak \text{notes }\allowbreak \text{kept, }\allowbreak \text{one }\allowbreak \text{moved } 1 \text{ or } 2 \text{ semitones}\)
Two groups\(\displaystyle |\langle P,L,R \rangle| = |\langle T,I \rangle| = 24, \ \text{commuting}\)
The dihedral relations\(\displaystyle P^2 = L^2 = R^2 = 1, \ (LR)^{12} = 1, \ P = R(LR)^3\)
Distances from C\(\displaystyle 1, 3, 6, 8, 5, 1 \text{ triads }\allowbreak \text{at } 0 \ldots 5 \text{ steps}\)
Tours\(\displaystyle 62 \text{ Hamiltonian }\allowbreak \text{cycles; }\allowbreak \text{one }\allowbreak \text{without } P\)

Try it

Lab 31 · Transformations, computed

Apply P, L and R to any triad; build the PLR and T/I groups and check that they commute; find the shortest walk between two triads and its voice leading; and hear the three moves well enough to name them.

Figure produced by Lab 31: Transformations, computed
Produced by the lab below, seed 0, in 0.3 s.
python -m videos.music.labs 31 needs numpy, scipy, matplotlib · download lab31.py · source on GitHub
P, L, R of C                                                     Cm, Em, Am
orders of the PLR and T/I groups; do they commute?               24, 24; True
shortest word C to F#; semitones moved directly                  PRPR; 6
the cycle of PL from C: length, pitch classes                    6, [0, 3, 4, 7, 8, 11]
hexatonic and octatonic systems (orbits of PL and PR)            4 of 6, 3 of 8
tours of all 24 triads by P, L and R (Hamiltonian cycles)        62
triads at each distance from C major                             {0: 1, 1: 3, 2: 6, 3: 8, 4: 5, 5: 1}
ear problem: the eight moves in the order played (listen first)  P L L R L P P R

Each move keeps two notes and is its own inverse; the moves commute with transposition and inversion; and on the torus no triad is more than five steps from any other.
The code (85 lines; it asserts its own result)
"""Lab 31: transformations, computed: P, L and R on any triad, the two groups of 24 built and checked, the shortest
walk between any two triads on the Tonnetz, the hexatonic and octatonic systems, the 62 tours, and eight pairs of
triads to name by ear."""

import numpy as np

from videos.coursekit import labs
from explainer.music.monochord import SR, Clip, concat
from explainer.music.monochord import neoriemann as N
from explainer.music.monochord.partkit import organ_tone

TITLE = "Transformations, computed"
GOAL = ("Apply P, L and R to any triad; build the PLR and T/I groups and check that they commute; find the shortest walk "
        "between two triads and its voice leading; and hear the three moves well enough to name them.")
TASKS = [
    "Choose START and END triads. What is the shortest P, L, R word between them, and how many semitones do the voices move?",
    "Change WORD (for example 'PL', 'PR', 'LR'). How long is the cycle it makes from C major, and which pitch classes does it use?",
    "Is the PLR distance from C major a good predictor of voice-leading distance? Plot one against the other for all 23 triads.",
]
START = (0, "M")
END = (6, "M")
WORD = "PL"


def chord(t, seconds=1.0, low=55):
    y = None
    for pc in sorted(N.pcs(t)):
        m = low + ((pc - low) % 12)
        s = organ_tone(440 * 2 ** ((m - 69) / 12), seconds, partials=6, rolloff=0.6, decay=2.0) * 0.25
        y = s if y is None else y + s
    b = organ_tone(440 * 2 ** ((t[0] + 36 - 69) / 12), seconds, partials=6, rolloff=0.6, decay=2.0) * 0.2
    return Clip(y + b, SR).fade(0.01, 0.1)


def run(seed=0):
    rng = np.random.default_rng(seed)
    lab = labs.Lab()

    # 1. the moves on a triad
    lab.row(f"P, L, R of {N.name(START)}", ", ".join(N.name(N.OPS[k](START)) for k in "PLR"))

    # 2. the groups
    G, H = N.plr_group(), N.ti_group()
    lab.row("orders of the PLR and T/I groups; do they commute?", f"{len(G)}, {len(H)}; {N.commute(G, H)}")
    assert len(G) == len(H) == 24 and N.commute(G, H)

    # 3. the shortest walk
    w = N.shortest_paths(START)[END]
    lab.row(f"shortest word {N.name(START)} to {N.name(END)}; semitones moved directly",
            f"{w or '(none: the same triad)'}; {N.voice_leading(START, END)}")

    # 4. cycles and systems
    cyc = N.cycle(WORD)
    used = sorted(set().union(*[N.pcs(t) for t in cyc]))
    lab.row(f"the cycle of {WORD} from C: length, pitch classes", f"{len(cyc)}, {used}")
    lab.row("hexatonic and octatonic systems (orbits of PL and PR)", f"{len(N.systems('PL'))} of 6, {len(N.systems('PR'))} of 8")
    lab.row("tours of all 24 triads by P, L and R (Hamiltonian cycles)", str(N.hamiltonian_cycles()))
    lab.row("triads at each distance from C major", str(N.distance_histogram()))

    # 5. Problem 3: eight pairs, each P, L or R
    moves = [str(k) for k in rng.permutation(list("PPPLLLRR"))]
    clips = []
    for k in moves:
        t = N.TRIADS[int(rng.integers(24))]
        clips.append(concat([chord(t), chord(N.OPS[k](t))], gap=0.1))
    lab.audio = concat(clips, gap=1.0)
    lab.row("ear problem: the eight moves in the order played (listen first)", " ".join(moves))

    fig, (a, b) = labs.figure(2)
    d = N.shortest_paths()
    xs = [len(d[t]) for t in N.TRIADS if t != (0, "M")]
    ys = [N.voice_leading((0, "M"), t) for t in N.TRIADS if t != (0, "M")]
    jit = rng.uniform(-0.1, 0.1, len(xs))
    a.plot(np.array(xs) + jit, np.array(ys) + jit[::-1], "o", color=labs.GOLD)
    a.set_xlabel("P, L, R steps from C major")
    a.set_ylabel("semitones of voice leading")
    a.set_title(f"two distances (r = {np.corrcoef(xs, ys)[0, 1]:.2f})")
    h = N.distance_histogram()
    b.bar(list(h), list(h.values()), color=labs.BLUE)
    b.set_xlabel("steps from C major")
    b.set_title("triads at each distance on the Tonnetz")
    lab.fig = fig
    lab.note = ("Each move keeps two notes and is its own inverse; the moves commute with transposition and inversion; "
                "and on the torus no triad is more than five steps from any other.")
    return lab

Now change it

  1. Choose START and END triads. What is the shortest P, L, R word between them, and how many semitones do the voices move?
  2. Change WORD (for example 'PL', 'PR', 'LR'). How long is the cycle it makes from C major, and which pitch classes does it use?
  3. Is the PLR distance from C major a good predictor of voice-leading distance? Plot one against the other for all 23 triads.

Problems, with solutions

Try each problem before opening its solution.

  1. Compute. Find the shortest PLR word from C major to F♯ major, and count the semitones the voices move.

    Solution

    Four steps, for instance P, R, P, R (C, C minor, E flat, E flat minor, F sharp), the most any major triad needs. C, E, G to C♯, F♯, A♯ moves each voice: C to C♯ (1), E to F♯ (2), G to A♯ (3): 6 semitones, the most any triad needs from C major; the two chords share no note.

  2. Prove. Prove that P, L and R each commute with every transposition Tₙ.

    Solution

    Each move is defined from a triad's root and quality alone: P keeps the root, L(r major) = (r + 4) minor, R(r major) = (r + 9) minor, and the inverse formulas for minor triads. Transposing adds n to the root and keeps the quality, so Tₙ(L(r major)) = (r + 4 + n) minor = L((r + n) major) = L(Tₙ(r major)), and the same for P, R and minor triads. (Each move also commutes with inversion, because it is itself defined by inversion about the interval it keeps, and inverting conjugates one such inversion into another.)

  3. Ear. The lab plays eight pairs of triads; each pair is P, L or R. Name them.

    Solution

    The lab prints the moves. P changes the colour (major to minor) and keeps the root in the bass; L moves a voice by a semitone and the bass by a major third; R moves one voice a whole tone and the bass by a minor third.

  4. Build. Write a program that harmonizes any melody by a walk on the Tonnetz, and compare it with Part 17's harmonizer.

    Where to look. neoriemann.harmonize is dynamic programming over the 24 triads: the state is the current triad, the cost of a step is zero to stay and 3k plus the voice leading for k ≤ 2 moves. Run it and Part 17's Viterbi harmonizer on the chorale melodies Part 17 held out, and compare agreement with Bach's chords; expect the Tonnetz walk to do worse on cadences, which it cannot see, and to wander less.

  5. ★ Which geometry of triads matches what listeners hear?

    Where the frontier is. Choose pairs of triads that the circle of keys, PLR distance and voice-leading distance rank differently (the hexatonic pole is close by voice leading and far by key); collect similarity and fit ratings from listeners with varied training; fit a model on each distance, and on combinations, and compare their predictions on held-out pairs with intervals; report whether training or film exposure changes which distance wins.

Notes and sources

Sources

  • D. Lewin, Generalized Musical Intervals and Transformations (1987); R. Cohn, Audacious Euphony (2012); D. Tymoczko, A Geometry of Music (2011); F. Lehman, Hollywood Harmony (2018).
  • R. Cohn, "Maximally smooth cycles, hexatonic systems, and the analysis of late-Romantic triadic progressions", Music Analysis (1996); R. Cohn, "Neo-Riemannian operations, parsimonious trichords, and their Tonnetz representations", Journal of Music Theory (1997); A. S. Crans, T. M. Fiore and R. Satyendra, "Musical actions of dihedral groups", American Mathematical Monthly (2009).
  • C. L. Krumhansl, "Perceived triad distance: evidence supporting the psychological reality of neo-Riemannian transformations", Journal of Music Theory (1998).
  • L. Euler, Tentamen novae theoriae musicae (1739); C. F. Weitzmann, Der übermässige Dreiklang (1853); H. Riemann, Ideen zu einer "Lehre von den Tonvorstellungen" (1914–15).
  • A. Childs, "Moving beyond neo-Riemannian triads: exploring a transformational model for seventh chords", Journal of Music Theory (1998); E. Gollin, "Some aspects of three-dimensional Tonnetze", Journal of Music Theory (1998).
  • Part 6 for the comma; Part 13 for triads; Part 19 for the hexatonic cycle; Part 27 for Tristan; Part 28 for the symmetric scales; Part 29 for inversion.
About this partfrom its README

Part 31 of a sixty-eight-part course in music (see the series plan and the syllabus), the fourth part of Act V. Parts 27 to 30 followed harmony past the edge of the key; this part asks what logic connects chords when no key holds them. It names Riemann's moves P, L and R, builds the PLR and T/I groups by brute force and shows they are dual, draws every triad on Euler's Tonnetz closed into a torus, walks the hexatonic and octatonic cycles, Beethoven's chain and every tour of the 24 triads, hears the moves in film and jazz, and ends at the frontier: which geometry of chords matches what listeners hear. The moves, groups and walks are Monochord's (explainer/music/monochord/neoriemann.py); every progression is ours, played on Part 7's piano and bowed string. Published findings are the ones listed under Sources.

  • Two chords that share no key. A film-style progression of our own (C, E, C, A flat, F, C), heard; each pair keeps one note; an ear question.
  • 1. Naming the moves. P, L and R from C major, each keeping two notes (an ear question: which is P?); the same three from A minor (to A, F and C major); a table of what each move does to a major and a minor triad; Riemann's dualism; two-step moves (LP to E, PL to A flat, RP to A), heard; Lewin.
  • 2. Two groups, one duality. The PLR group and the T/I group built by brute force: 24 elements each, commuting, each acting on the 24 triads in exactly one way; the commuting square (T₃ then P, P then T₃: E flat minor either way), heard; the orders of the moves (2, 2, 2; PL 3, PR 4, LR 12) and P = R(LR)³, so L and R alone generate a dihedral group of order 24; distance; what the duality means.
  • 3. The Tonnetz. Euler's lattice (1739); the moves as flips of triangles; the torus; how far every triad is from C major (1, 3, 6, 8, 5 and 1 at 0 to 5 steps; B flat minor alone at five); a random walk of eight moves, heard; the history of the map; the syntonic comma that keeps it open in just intonation (386.3 against 407.8 cents, 21.5 cents apart), heard; isomorphic keyboards.
  • 4. Hexatonic and octatonic cycles. P, L repeated (six triads) and P, R repeated (eight), heard; the scales they make (Part 28's); Cohn's hexatonic systems; the four hexatonic and three octatonic families; octatonic families in Rimsky-Korsakov and Stravinsky; Weitzmann's region (1853), the augmented triad resolving to its six neighbours, heard.
  • 5. The long chain. Beethoven's Ninth (Cohn's reading): nineteen triads by R and L, heard; an ear question (which chain stays in one key?); the full chain of 24; why it must visit every triad; 62 tours of all 24 triads, counted by search, one of them (11 P, 9 L, 4 R) heard.
  • 6. Wonder, and the uncanny. Chromatic mediants; an ear question (which pair shares no note? the hexatonic pole); three trips from C major (to E, A flat and F sharp major), heard; Lehman's Hollywood Harmony; scoring with moves; where the moves came from.
  • 7. Thirds in jazz. Coltrane changes, named (the tune is in copyright and is not played); three keys a major third apart on the Tonnetz; the skeleton of the idea in our own voicing (B, D7, G, B♭7, E♭, F♯7, B), heard; seventh chords: ten dominant and half-diminished sevenths within two semitones of C7 (nine moving two voices a semitone, one moving one voice a whole tone), with the tritone substitution and the move inside Tristan's first chords, heard; beyond triads.
  • 8. Frontier: other spaces, real listeners. Krumhansl's ratings; PLR distance against voice-leading distance for all 23 triads (correlation 0.74; D, F sharp and B flat major need six semitones); other spaces; learned chord embeddings; an audit of what this part measured; ★ research problem: which geometry of triads matches what listeners hear?
  • Variation 31, recap and problems. The Tune harmonized by a walk on the Tonnetz (at most two moves every two beats, to a triad holding the melody note, ending at home): C, C, A minor, C, F, C, G, C; the ledger; what we found; five problems; where it comes back; in practice; references; Part 32.
What is computed and built

python -m videos.music.music31.compute (about a minute) fills .cache/music31/.

Item What it computes Checked against
hook the film-style progression and its moves, heard —
plr, minor, compound P, L and R from C major (an ear question) and A minor; two-step moves; voice leading in semitones definitions (tests)
groups, commute, relations both groups by closure; commutation; simple transitivity; orders; P = R(LR)³ brute force
spheres, walk, vl breadth-first distances from C; a random walk; PLR against voice-leading distance —
cycles, systems, weitzmann the hexatonic and octatonic cycles and families; Weitzmann's region, heard —
chain, keys, hamilton the R-L chain; an ear question; every Hamiltonian cycle of the PLR graph the L-R graph's single tour
poles, film3 the hexatonic pole (an ear question); three trips from C —
thirds, sevenths three keys a major third apart through their dominants; seventh-chord neighbours of C7 —
comma the pure third against four pure fifths, heard Part 6's comma
tune, variation Variation 31: the Tune harmonized by a dynamic-programming walk on the Tonnetz —

Monochord's tools are held in tests/music/test_neoriemann.py; this part's claims and clips in tests/music/test_music31.py.

Sounds. Part 7's piano and bowed string (physical models). There are no recordings. The progressions are ours; Beethoven's chain is heard only as its skeleton of triads in our voicing (the chain itself, not his orchestration), and the Coltrane changes are a progression, not the tune.

What the models are, and are not. Voice leading here is the fewest semitones three (or four) voices must move, with octaves ignored; real voice leading also weighs register, doubling and which voice moves. Distance is counted in P, L and R steps; a theory with other moves (Cohn's, Tymoczko's, the circle of keys) would count differently. The harmonizer uses only the moves and the melody: it knows nothing of function, cadence or style, which is why its rediscovery of tonic, subdominant and dominant is worth noticing. Film and listener claims are cited, not measured.

Notes

The groups act on twelve-tone pitch classes, ignoring register, doubling and spelling. P and L move one semitone; R moves two and is not equally minimal. L retains a minor third and R a major third. A common diatonic scale is not required for a tonal interpretation. The torus identifies all lattice points with the same pitch class, including diagonal equivalences. Commutation alone does not prove group duality. The Tune search is given C major at both endpoints, fixed costs and melody samples every two beats; it does not independently discover tonality or constrain every melody note. Emotional associations and learned embeddings require separate listener evidence and controls.

Companion material in this repository

The syllabus's plan for this partfrom SYLLABUS.md, the plan of record
  1. Hook: a film-style progression of our own heard, each pair keeping one note; the plan.
  2. Naming the moves: P, L and R from C major (an ear question: which is P?) and from A minor, heard; a table of what each move does; Riemann's dualism; two-step moves heard; Lewin.
  3. Two groups, one duality: both groups of 24 by brute force, commuting and simply transitive; the commuting square heard; orders and P = R(LR)³, a dihedral group; distance; meaning.
  4. The Tonnetz: Euler's lattice; moves as flips; the torus; distances from C major (1, 3, 6, 8, 5, 1); a random walk heard; history; the comma that keeps the just lattice open, heard; isomorphic keyboards.
  5. Hexatonic and octatonic cycles: both heard; their scales; Cohn's systems; four and three families; Rimsky-Korsakov and Stravinsky; Weitzmann's region heard.
  6. The long chain: Beethoven's Ninth (Cohn); nineteen triads heard; an ear question (which chain stays in one key?); all 24; why; 62 tours, one heard.
  7. Wonder, and the uncanny: chromatic mediants; an ear question (the hexatonic pole); three trips from C heard; Lehman; scoring with moves; the Romantics.
  8. Thirds in jazz: Coltrane changes named; three keys on the Tonnetz; the skeleton heard in our voicing; seventh chords two semitones from C7, the tritone substitution and Tristan's move heard; beyond triads.
  9. Frontier: Krumhansl's ratings; PLR against voice-leading distance; other spaces; learned embeddings; an audit; the research problem.
  10. Variation 31: the Tune harmonized by a walk on the Tonnetz. Outro: problems, payoffs.

Covers: intervals as a group acting on a space; the T/I group on the twenty-four triads; P, L and R; the PLR group and its duality with T/I; the dihedral relations; the Tonnetz as a torus and the comma that keeps the just lattice open; hexatonic and octatonic cycles and systems; Weitzmann's region; the long chain in Beethoven's Ninth and the Hamiltonian tours of the triads; chromatic mediants and the hexatonic pole in film; third-related cycles in jazz (Part 39) and parsimonious seventh chords. Built and computed: monochord/neoriemann.py: P, L, R and T/I on the 24 triads; both groups by closure, their orders, commutation and simple transitivity; breadth-first distances and shortest words; cycles and their orbits; orders of words; every Hamiltonian cycle of the PLR graph (62); Weitzmann's regions; voice leading for three and four voices; dominant and half-diminished seventh neighbours; a dynamic-programming harmonizer on the Tonnetz. Variation 31: the Tune harmonized by a walk on the Tonnetz: C, C, A minor, C, F, C, G, C. Frontier: generalized Tonnetze and other spaces; how listeners judge distance between triads; learned chord embeddings. Rights: every sound is the film's own (§2.4); Beethoven's chain is heard as triads in our voicing; the Coltrane tune and the film scores are named and analysed, not played. Reading: Lewin (1987); Cohn, Audacious Euphony; Crans, Fiore & Satyendra (2009); Lehman, Hollywood Harmony.

Build the film

python -m videos.music.music31.compute        # the part's numbers, into .cache/music31
python tools/build.py music31                  # render and assemble the film
EXPLAINER_TTS=silent python tools/qa_scene.py music31 Hook   # one chapter, silent, with a contact sheet

Scenes: videos/music/music31. Setup: see the course page. Source of these notes: the README and the scenes' narration.

Build it
python -m videos.music.music31.compute                          # numbers and sounds (about a minute)
EXPLAINER_TTS=silent python tools/build.py music31 -q l --fps 15   # a silent-narration preview, with the sounds
python tools/qa_sound.py music31 --sync                         # the sound gates
python tools/dead_air.py renders/music31_480p.mp4 --sound music31  # no empty screen; no sound over a still one
python tools/lecture_length.py music31                          # 30 to 60 minutes, listening included
python tools/build.py music31                                   # 1080p30, narrated
python -m pytest -q tests/music                                 # Monochord against its references; this part's claims and clips
python -m videos.music.labs 31                                  # the lab (writes a figure and a short WAV)