♪Music, Built

Act II · Notes

Part 12 of 68

Scales and Modes

Foundationsstarts at this level37 min of film12 chaptersprerequisites: none

Why do keyboards have seven white keys and five black, what makes that choice of notes special, and how many scales could there be?

Every octave of every keyboard has seven white keys and five black, and the part derives that layout from the fifth of Part 1. Stack fifths and fold them into an octave: at five, seven and twelve notes the steps between neighbours come in just two sizes, and those stacks are the pentatonic, diatonic and chromatic scales. The three-gap theorem says a stack never has more than three sizes of step, and the sizes at which it has two (2, 3, 5, 7, 12, 17, 29, 41, 53) are the denominators of Part 6's continued fraction. Seven notes give seven modes, which fall in order of brightness along the chain of fifths, each the one before with a single note lowered. The white keys are also the most even way to choose seven notes of twelve; every kind of interval in them comes in two sizes, with the tritone as a single landmark; and each interval occurs a different number of times (2, 5, 4, 3, 6, 1), so that a move of a fifth changes one note, which is the system of keys. Minor borrows a leading note and so has three forms. Whole-tone and octatonic scales map onto themselves and have no home. A fourth can be filled six ways, and south Indian theory makes 2 x 6 x 6 = 72 parent scales that way; maqam and slendro divide the octave where no piano key lies. Burnside's lemma counts 352 shapes of scale on twelve notes, 66 of them with seven notes, and among those the white keys are the most even, have the most fifths and are the smoothest. The frontier is why the world's scales have five to seven unequal steps. The Tune is played in the seven modes and in scales of five, six and eight notes.

What you need. Part 1 for the fifth; Part 5 for roughness; Part 6 for commas, meantone and continued fractions; Part 10 for the hexachord and spelling; Part 11 for necklaces. Counting and modular arithmetic.

Ideas, mathematics and history
stacking fifths to 5, 7 and 12, the three-gap theorem, maximal evenness, the modes by brightness, scales of the world, counting scales with Burnside
What we build, compute and hear
all 352 necklaces of twelve; the Tune in every mode

What you will be able to do

Foundations

  • Build the pentatonic, diatonic and chromatic scales by stacking fifths.
  • Name the seven modes, put them in order of brightness, and write each on any note.
  • Write the three forms of the minor scale and say what each is for.

Full course

  • Find the sizes of step in a stack of any generator, and where there are two.
  • Compute a scale's interval vector, its common tones under transposition, and its evenness.
  • Count scale shapes with Burnside's lemma, and the melakartas by their rule.

Research

  • State the three-gap theorem and its link to continued fractions.
  • Set out the competing explanations for scales of five to seven unequal steps.

Practice

  • Choose a mode or a symmetric scale for the colour it gives.
  • Move between keys by the notes they share.
  • Lay out the notes of an instrument that plays one scale.

Contents

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

  1. 0Seven white keys and five blackFoundations2 min
  2. 1Stacking fifthsFoundations3 min
  3. 2Three gapsResearch2 min
  4. 3Seven notes, seven modesFoundations5 min
  5. 4Why this scaleFoundations4 min
  6. 5Minor's three formsFoundations2 min
  7. 6Fewer notes, and moreFoundations3 min
  8. 7A scale in two halvesPractice3 min
  9. 8Other maps of the octavePractice3 min
  10. 9Shapes among twelve pitch classesPractice3 min
  11. 10Frontier: why five to seven unequal steps?Research3 min
  12. Variation 12, 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.

Seven white keys and five blackFoundations2 min

Look at a keyboard. A conventional piano-style keyboard: a concert grand, many church organs or a toy. In every octave there are seven white keys and five black ones, a design with a long history, alongside many alternative layouts. Listen to the white keys, from C up to the next C. Then to the black keys.

You know both of those. The first is the familiar major-scale pattern in Western tonal music. The second, the five black keys, is a scale too, with a long history in many traditions: you can pick out folk songs from Scotland, China and West Africa on those five keys alone.

So here is the question for this part. Why seven and five? Twelve keys could be split six and six, or eight and four. And why are the black keys bunched as a pair and a triple, and not spaced out evenly? History and instrument making matter. We can also explain useful mathematical properties of this layout. By the end of this part you will be able to derive this picture from one interval, the fifth of Part 1, and to identify properties that distinguish its pitch-class shape, up to transposition, within a twelve-note model.

Rhythm told us when. A scale tells us which: the few notes a piece of music chooses, out of all the notes there could be. We begin by stacking fifths, and find that at five, seven and twelve notes something special happens. Seven notes give seven modes, and we put them in order from bright to dark. We ask what is special about the white keys, and get three answers. We meet the minor scale in its three forms, and scales with fewer notes and more. We look, briefly, at how other traditions divide the octave. And then we count every scale that could exist on twelve notes, and find where ours sits among them.

1Stacking fifthsFoundations3 min

What do you get from one interval, repeated?

Part 1 found the most consonant interval after the octave: the fifth, three to two. Part 6 tuned whole instruments with it. Here we use it to choose notes. Start anywhere, say on F, and go up a fifth, and another, and another. Whenever a note leaves the octave, bring it back down. Draw the octave as a circle: once round is twice the frequency. F. Then C. Then G, D, A. Stop at five notes and look at the steps between neighbours. There are only two sizes: a whole tone of two hundred and four cents, and a wider step of two hundred and ninety-four. Add a sixth note, E, and that tidiness goes: three sizes. Add a seventh, B, and it comes back. Five whole tones, and two small steps of ninety cents. These have the white keys' diatonic pattern, here in Pythagorean tuning rather than modern equal temperament. Go on. Eight, nine, ten, eleven notes all leave three sizes of step. At twelve there are two again, and now they are nearly equal: ninety cents and a hundred and fourteen.

Why stop at twelve? Because at twelve the stack very nearly closes. Go up one more fifth, the thirteenth note, and it lands almost exactly on the note we started from. Almost: it is cents too high. That small gap is the comma we met in Part 6, twelve fifths against seven octaves, and it is the difference between the two sizes of step in the twelve-note stack. Shave a fiftieth of a semitone off every fifth and the gap vanishes, the two sizes become one, and you have the keyboard's equal temperament. The twelve notes on a piano are a stack of fifths, bent slightly so that it closes.

Five, seven and twelve. Among the stacks of four through twelve notes discussed here, those three have two step sizes, and each of them is a scale with a name. Here they are, in the tuning the stack gives them.

The pentatonic scale, five notes. The diatonic scale, seven. The chromatic, twelve. One interval, repeated, produces the pentatonic pattern, the diatonic pattern and twelve chromatic pitches. Our five-note chain starts on F; transpose its pattern to F sharp for the black keys. Is that luck? There is a theorem that says it is not.

2Three gapsResearch2 min

Why five, seven and twelve?

Put marks round a circle by stepping the same distance again and again, as we did with the fifth. In 1958 three mathematicians proved a conjecture of Hugo Steinhaus: however many marks you make, and whatever the step, the gaps between neighbouring marks have at most three different lengths. Never four. Here is the count for our stack, for every number of notes up to sixty. Mostly there are three sizes. Now and then there are only two.

Before we look at where the twos fall, think about one case. Five notes left two sizes of step. Why did the sixth note make three? Pause for a moment.

The new note has to land inside one of the wide steps. It cuts that step into a whole tone and a small remainder of ninety cents. The other wide step is still whole. So for a moment there are three sizes: the old wide step, the tone, and the remainder. The seventh note cuts the last wide step the same way, and we are back to two.

Two sizes of step occur at two, three, five, seven, twelve, seventeen, twenty-nine, forty-one and fifty-three notes, and nowhere else below sixty. Five, seven and twelve are in that list because of what a fifth is; this generator has special near-closure properties; choosing it and building instruments around it also have a history. And the list goes on to numbers that other musicians did choose. An unequal seventeen-position system appears in medieval Arabic theory; it is not seventeen equal divisions or a description of every maqam. Jing Fang studied a fifty-three-fifth near-return in ancient China. Part 6 compared equal divisions and found fifty-three especially accurate within its tested range. You have met these numbers. They come from the continued-fraction family of approximations to the fifth, including intermediate convergents; not every number listed is a full convergent denominator. A scale with two sizes of step is what a good rational approximation to the fifth looks like when you play it.

3Seven notes, seven modesFoundations5 min

Which of the seven is home?

An ordered pitch collection can already be called a scale. For the tonal modes illustrated here we also choose a home: one note that the others are heard against, where a tune comes to rest. Here are our seven notes as the stack made them, each a fifth above the last. Any of the seven can be home, and each choice is called a mode. The names are Greek, borrowed and misapplied by medieval theorists; Glarean expanded the historical modal system in 1547, but the modern seven-mode collection, including Locrian, is not simply his twelve-mode system. What matters is the order. Make F the home note, and every other note lies above it in the chain of fifths: in the usual raised-degree ordering this is the brightest mode, Lydian. Make B the home note, and every other note lies below it: Locrian, the darkest. Between them the other five line up in order.

To compare them fairly, give all seven the same home note, C. Lydian is a major scale with its fourth note raised. Lower that note by a semitone and you have the major scale itself, which as a mode is called Ionian. Lower one more note, the seventh, and it is Mixolydian. And so on down the table: each mode is the one above it with a single note lowered by a semitone, shown in red. Listen to all seven, over a held C.

Bright to dark in six steps. The top three have a major third above the home note, and sound major. The next three have a minor third, and sound minor; the fifth row, Aeolian, is the natural minor scale. The last, Locrian, has no perfect fifth above its home note, and it is less common as a stable tonal basis, though it is used.

Try your ear on it. Two modes, on the same home note. Which is the brighter: A or B?

B. It was Mixolydian, and A was Dorian. They are neighbours in the table, and they differ in one note only: the third. That one semitone is the difference between major and minor.

Musicians need to talk about the notes of a scale without saying which key they are in, so the seven places have numbers, and names. One is the tonic, the home note. Five is the dominant, a fifth above it; four, the subdominant, a fifth below. Three is the mediant, halfway between tonic and dominant. And seven, when it lies a semitone under the tonic, is the leading note; we will hear why shortly. With numbers, a mode is a short formula: the major scale with some places lowered or raised. Lydian is major with a sharp four. Mixolydian, major with a flat seven. Dorian, flat three and flat seven. A jazz player reads those formulas the way you read a word.

There are two ways to compare a major scale with a minor one, and the difference matters. We compared C major with the darker modes on C: the same home, different notes. Those are parallel scales. But the white keys also contain a minor scale: start on A. Same seven notes, different home. C major and A minor are called relatives. Listen: the notes of C major from C; the same notes from A; and then the two home chords.

Nothing changed but where the music came to rest. That is what a mode is: not a set of notes, but a set of notes and a decision about which of them is home. Every major key has a relative minor a minor third below it, and a piece can pass from one to the other without changing a single note.

What do the modes do to our Tune? Less than you might expect, and the reason is worth noticing. The Tune uses only six notes of its scale; it never touches the seventh. So in the Mixolydian mode, which differs from major only in the seventh, the Tune does not change at all. A melody of six notes cannot tell those two modes apart. Guido's hexachord, from Part 10, had the same blind spot, and historical hexachord mutation served the wider gamut and solmization patterns, not merely this melody's missing seventh. When we play the Tune in every mode, at the end of this part, we will give it a second voice that does use the seventh.

4Why this scaleFoundations4 min

What is special about the white keys?

The stack of fifths is one way to arrive at the white keys. Here is a second, which uses no fifths at all. Suppose you want seven notes out of twelve, spread as evenly as possible round the octave. Seven does not divide twelve, so they cannot be equally spaced. The best you can do is to space them twelve sevenths apart, and choose an offset of five sevenths of a semitone, then move each point back to the preceding integer semitone. That gives places zero, two, four, five, seven, nine and eleven: C, D, E, F, G, A, B. The white keys. This selects a pitch-class pattern; transposition and the separate choice of a home note determine its tonal use. In 1991 John Clough and Jack Douthett called such a set maximally even. And the five places left over, the black keys, are the most even way to choose five. The keyboard is two maximally even sets, fitted together.

Evenness has a consequence. In the white-key scale, count intervals in steps of the scale: a second is one step, a third is two. Every one of them comes in exactly two sizes. Seconds are one or two semitones. Thirds are three or four: minor and major. And so on up. But the two sizes are not equally common. Of the seven fourths, six are perfect, and one is a semitone wider: the tritone, from F to B. An interval that occurs only once is a landmark. Within this collection it identifies a distinctive pair, but every relative mode shares that pair. The tritone alone does not tell you which note is home. A scale of equal steps has no landmarks.

A third property, and the strangest. Take the seven notes and count the pairs. How many pairs are a semitone apart? Two. A whole tone apart? Five. Minor thirds, four. Major thirds, three. Fourths or fifths, six. Tritones, one. Six kinds of interval, and six different counts: every number from one to six, once each. A scale like that is called deep. Compare a scale of six equal steps. It has no semitones, no minor thirds and no fifths at all. The white keys contain a little of everything, in graded amounts, and the interval they have most of is the fifth.

Those counts are not a curiosity. They say what happens when the scale is moved. Shift all seven notes up by some interval: common-tone counts are related to interval multiplicities. For the non-tritone classes used in this example the counts agree; a tritone transposition counts both ends of each unordered tritone pair. The fifth occurs six times. So a major scale moved up a fifth keeps six of its seven notes, and changes one. Moved up a semitone, which occurs twice, it keeps only two. Listen to the scale on C, then on G, then on D flat.

That is the whole idea behind key signatures. Every step along the chain of fifths changes one note, so nearby keys share nearly everything, and a piece can slip from one to the next with a single sharp or flat. Part 15 is built on it. For now: the white keys are generated by fifths, they are as even as possible, their intervals come in two sizes with a single landmark, and they are deep. Within this twelve-note model, the combined properties identify the diatonic pitch-class shape up to transposition.

5Minor's three formsFoundations2 min

Why does the minor scale keep changing?

Common-practice tonal minor uses flexible sixth and seventh degrees, often taught through three scale forms. The natural minor is the Aeolian mode: on A, all white keys. The harmonic minor raises the seventh note by a semitone, for a reason we will hear in a moment. But that leaves a step of three semitones between the sixth and the seventh, an augmented second, which some styles avoid and others emphasize. So the melodic minor raises the sixth as well, on the way up, and puts both back on the way down, in the usual classical scale exercise. Actual melodies use these degrees flexibly; jazz melodic minor commonly keeps both raised in either direction.

Why raise the seventh at all? Listen to two endings on the same chord. Which sounds more final: A or B?

Listeners familiar with this tonal style may find B more final. The two differ in one note of the first chord. In A it is the natural seventh of the scale, a whole tone below the home note. In B it is raised, so that it lies a semitone below. In this harmonic and stylistic context, a note a semitone below home often suggests upward resolution; musicians call it the leading note. The major scale has one built in. The minor modes do not, so composers borrowed it, and the harmonic minor scale is the natural minor with that one loan. A scale, it turns out, is not always a fixed set of notes. It can change with what the music is doing.

6Fewer notes, and moreFoundations3 min

What do scales of five, six and eight notes do?

Seven is not the only number. Five notes: the pentatonic scale, the first stop of the stack of fifths. This anhemitonic pentatonic has no semitones, reducing one familiar source of close-note tension; roughness and musical fit still depend on register, spectrum and context, and it turns up in the folk music of every inhabited continent. Six equal steps: the whole-tone scale. Eight notes, in alternating whole and half steps: the octatonic scale. And a common six-note blues-scale diagram: minor pentatonic plus the flat fifth. Actual blues pitch practice also uses bends and flexible thirds. Listen to the four.

Two of these are strange in a way you can count. Move the major scale up a semitone at a time and you get twelve different sets of notes before it comes home. The pentatonic and the blues scales have twelve versions too. But the whole-tone scale has only two: move it up a whole tone and every note lands on another note of the scale. The octatonic has only three. Olivier Messiaen, who built much of his music from such scales, called them modes of limited transposition. Transpositional symmetry removes some pitch-inventory landmarks, but rhythm, drones and melodic emphasis can still establish a home. The whole-tone scale has no fifths either. Composers reach for these scales when they want music to float, or to threaten, without arriving anywhere.

Here is a small experiment on what the number of notes does. Monochord throws dice to make a wandering line: up one step, down two, and so on, thirteen moves. Then it plays that same line three times, on a scale of five notes, of seven, and on all twelve. The throws of the dice are identical. Only the notes allowed are different.

Listen to how the three versions differ. This is a toy comparison: identical scale-degree moves also change semitone distances and pitch range, so it does not isolate note count alone. Nobody composed any of them. With five notes and no semitones, many combinations can be forgiving in familiar styles; that is why beginners are given pentatonic instruments, and why so many folk melodies are pentatonic. With twelve, nothing is ruled out, so nothing is implied. A scale is a set of constraints, and the constraints do a good deal of the composing.

7A scale in two halvesPractice3 min

How were scales built before keyboards?

Before keyboards, and long before anyone drew a circle of twelve notes, scales were built in another way, in ancient Greek theory, with related ways of combining pitch groups in other traditions; this is not a single origin story for all scales. Fix the strong notes first: the home note, the fourth above it, the fifth, and the octave. That leaves two fourths to fill, with a whole tone between them. Fill each fourth with two more notes, and you have a scale of seven. A filled fourth is called a tetrachord: four strings. On our twelve notes a fourth is five semitones, and there are exactly six ways to cut five into three steps.

The major scale is two tetrachords of the same shape, tone, tone, semitone, with a tone between. Sing the lower half and then the upper: they are the same four-note tune, a fifth apart. Use a different filling, semitone, three semitones, semitone, for both halves, and you get a double-harmonic pattern found under different names in several traditions, and also used in Western music; this equal-tempered demonstration does not reproduce each tradition's tuning and phrasing.

South Indian music made a complete catalogue out of this idea. Venkatamakhin developed a seventy-two-mela framework in the seventeenth century; later theorists standardized the modern catalogue illustrated here. The home note and the fifth are fixed. The fourth is either plain or raised: two choices. For the second and third notes, choose two of semitone positions one, two, three and four in this keyboard abstraction: six choices. For the sixth and seventh, choose two of positions eight, nine, ten and eleven: six more. Two times six times six: seventy-two parent scales, the melakartas, each with a name and a number, used as parents in modern Carnatic classification, with ambiguities and exceptions in how individual ragas relate to parents. Monochord generates all seventy-two, and finds of our seven modes among them. Here is one that is not: the first scale a student in south India learns. You just heard it. It is the scale of two halves from a moment ago.

8Other maps of the octavePractice3 min

Must a scale use our twelve notes?

Everything so far has lived on the twelve notes of a keyboard. Much of the world's music does not. Here is a first look; later parts go properly into each. A major scale, for reference: steps of two hundred cents and a hundred. A quarter-tone teaching approximation to Rast, an important Arabic maqam. Its third note lies between our minor third and our major third, about three quarters of a tone above the second. No piano key plays it. Five equal steps of two hundred and forty cents: a rough stand-in for slendro, one of the two tunings of the Javanese gamelan. And the south Indian scale from the last chapter. Listen to all four.

The note that no piano has deserves a closer listen. Here are three thirds above the same note. One is major, one is minor, and one is neither. Which is neither: A, B or C?

B. It lies halfway between: three hundred and fifty cents, where minor is three hundred and major four hundred. It is called a neutral third. To an ear raised on keyboards it can sound out of tune, a major third gone flat. To an ear raised on maqam it is a note in its own right, a meaningful pitch region, whose intonation can vary by phrase, performer and tradition. Experience shapes tuning judgments alongside auditory constraints, and the scale you grew up with is the ruler you measure with.

A warning before we go on. Those were scales as a keyboard player would hear them: rows of pitches. In their own traditions they are more than that. A maqam is a way of moving through its notes, with its own resting places, and its in-between intervals are tuned a little differently from city to city. A raga has characteristic melodic behaviour and expressive associations; some traditions also associate ragas with times of day. its parent scale is only its list of ingredients. Many gamelans have individual tunings, with intervals and octave stretch varying by ensemble and tradition. Parts 34 to 36 take these traditions on their own terms. For today, notice what they have in common with the white keys. Octave relations, fourths or fifths, and collections of roughly five to seven notes recur in many documented traditions. These are frequent patterns, with exceptions, not laws for every scale. That last fact is the puzzle this part ends on.

9Shapes among twelve pitch classesPractice3 min

How many scales are possible, and where is ours?

To count scales we need one tool, and it is easiest to see on a small case. Take four places round a circle, each on or off. There are sixteen patterns. But a pattern turned round is the same shape, and there are only six shapes. How could we have known that without drawing them? Burnside's lemma says: for each way of turning the circle, count the patterns that the turn leaves looking the same; then take the average. Not turning at all leaves all sixteen. A half turn leaves four. A quarter turn, either way, leaves two. Sixteen plus four plus two plus two is twenty-four; divided by the four turns, six. The same sum works for any number of places.

Now let us be thorough. How many scales could there be on twelve notes? A scale is a choice of some notes, including its home note; each of the other eleven is in or out. Two to the eleventh: two thousand and forty-eight. But many of those are the same scale starting on a different note, or moved to a different key. Call two sets the same shape if one is the other transposed. Counting shapes is a problem about necklaces: twelve beads, each black or white, where turning the necklace does not make a new one. Burnside's lemma counts them: average, over the twelve rotations, the number of colourings each rotation leaves unchanged. There are three hundred and fifty-two unrooted subset shapes including the empty set: three hundred and fifty-one nonempty ones. This count discards the choice of tonic, so it is not a count of distinct rooted modes. Monochord also lists them all, and gets the same number. Here they are by size. Sixty-six shapes have seven notes.

Here are all sixty-six, each drawn as a polygon in a circle of twelve places. Most are lopsided: notes bunched together, with wide gaps elsewhere. Ask for scales with no gap wider than a whole tone, built only from whole and half steps, and three are left. Ask that the two half steps be kept as far apart as they can be, and there is one. It is the white keys. Out of every possible scale of seven notes, the one on the keyboard is the unique shape up to transposition under this spacing criterion.

Here are those three, as sound. One of them is the major scale. Which: A, B or C?

B. A was the melodic minor scale of chapter five, whose half steps are two notes apart instead of three. C had its two half steps side by side, after five whole tones: nearly a whole-tone scale. All three are used. The major-scale family is widespread, but this comparison does not make it universal.

10Frontier: why five to seven unequal steps?Research3 min

Why do the world's scales look alike?

Five to seven notes, in steps of two sizes: why does so much of the world's music settle there? One kind of answer is that such scales are good at something. Take our sixty-six shapes of seven notes and score each one three ways. Across: how evenly its notes are spread. Up: how many of its pairs of notes are a fifth apart. Colour: the mean modeled roughness of its twenty-one dyad intervals, evaluated at the model's common reference pitch and spectrum. One shape is the most even, has the most fifths, and is the smoothest of all sixty-six. It is the white keys again. On twelve notes, the three things a scale might want do not compete. The diatonic shape leads these particular scores. That is a model result, not proof that it must be preferred in every timbre, register or culture.

But why unequal steps at all? If evenness is good, seven equal steps would be perfectly even. Listen to a scale, and then the start of the Tune played in it. Is it major, minor, or neither?

Neither. That was seven equal steps to the octave. Its third lies between a minor and a major third. Its fifth is a little flat. And something subtler is missing. Every note of an equal scale has exactly the same neighbours at exactly the same distances. Nothing marks any note as different from the rest. Chapter four's landmark, the interval that occurs only once, is gone. In 1999 Sandra Trehub and her colleagues tested babies nine months old on scales they had never heard: one with unequal steps, one with equal. In that task, infants detected changes more successfully in the tested unequal-step condition. This does not establish that equal-step scales cannot support pitch learning or a tonal centre. Unequal steps seem to give the ear something to hold on to.

So why five to seven unequal steps? There are at least four explanations, and none is settled. Memory: processing and remembering many pitch distinctions can be demanding, but there is no established universal ceiling of five to nine usable pitch categories. Orientation: unequal steps tell a listener where in the scale a melody is. Consonance: some proposed models explain common scale patterns through harmonicity or frequent fifths; their predictions depend on assumptions and the traditions compared. We saw a version of that a minute ago. And transmission: scales are passed on by ear and by voice, and only what survives being copied imperfectly for generations is still with us. These are not rivals so much as pressures, and they mostly push the same way. Telling them apart needs scales where they disagree, and people who use them. That work is being done now, and the answers so far differ from one culture's music to the next.

Variation 12, recap and problemsAll tracks3 min

Every part ends by doing something to the Tune with what it has built. This part built scales. So here is the Tune with each phrase in a different mode, from the brightest to the darkest but one; and then its first phrase four more times: in the darkest mode, and in scales of five, six and eight notes. A second voice below the melody fills in the notes the Tune leaves out, and a held C says where home is.

Row twelve of the ledger. seconds. The measurement: from the brightest mode to the darkest, notes fall by a semitone, one at a time, and the Tune goes from a nursery to somewhere much less safe.

What did we find? Stack fifths, and the steps come in two sizes at five, seven and twelve notes; a theorem says why. Seven notes give seven modes, in order of brightness, each the one before with a single note lowered. The white keys are as even as seven notes among twelve can be; each generic second through seventh comes in two sizes; and they are deep. The minor scale borrows a leading note, and symmetric pitch sets need other musical cues to establish a home. A fourth can be filled six ways, and south Indian theory builds seventy-two parent scales from that. And of the three hundred and fifty-two shapes a scale can have on twelve notes, the diatonic shape is maximally even and leads this particular roughness model among the sixty-six seven-note classes.

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? At once: the next part builds intervals and chords out of the scale, and the one after asks how melodies move through it. The deep-scale property becomes the system of keys. Evenness and necklaces return as mathematics. The scales of India, the Arab world and Java each get a part of their own. And the blues scale comes back with the notes that no scale on a keyboard can hold.

And in practice. An improviser learns each mode as a colour to play over a chord. A film composer reaches for Lydian when the scene needs wonder and Phrygian when it needs menace, and these colours depend on several scale degrees and their musical context. A songwriter can write a whole song on the five black keys, without semitone neighbours, while register and harmony still matter. And an instrument maker decides which notes to leave out: a harmonica or a kalimba is a scale made solid.

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

Where it goes next. Part 13 sounds the notes of a scale together: intervals and chords. Melody moves through the scale in Part 14; the deep-scale property becomes the system of keys in Part 15; evenness and necklaces return in Part 33; raga, maqam and the gamelan's tunings get Parts 34 to 36; the blues scale and its bent notes, Part 38.

Key results

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

Stacks of fifths\(\displaystyle \text{two }\allowbreak \text{sizes }\allowbreak \text{of }\allowbreak \text{step }\allowbreak \text{at } n = 2, 3, 5, 7, 12, 17, 29, 41, 53\)
The three-gap theorem\(\displaystyle \{k\alpha \bmod 1\}_{k<n} \text{ cut }\allowbreak \text{the }\allowbreak \text{circle }\allowbreak \text{into }\allowbreak \text{gaps }\allowbreak \text{of }\allowbreak \text{at }\allowbreak \text{most }\allowbreak \text{three }\allowbreak \text{lengths}\)
The most even seven of twelve\(\displaystyle \left\lfloor \tfrac{12k + 5}{7} \right\rfloor = 0, 2, 4, 5, 7, 9, 11\)
The diatonic interval vector\(\displaystyle \langle 2, 5, 4, 3, 6, 1 \rangle\)
Scale shapes on twelve notes\(\displaystyle \tfrac{1}{12}\sum_{d \mid 12} \varphi(d)\, 2^{12/d} = 352\)
Parent scales\(\displaystyle 2 \times \tbinom{4}{2} \times \tbinom{4}{2} = 72\)

Try it

Lab 12 · Scales, derived and counted: fifths, evenness and necklaces

Stack a generator and see at which sizes the steps come in two kinds, count the shapes of scale on any number of notes by Burnside's lemma and by listing them, order the seven modes by brightness, test a scale for the three properties of the white keys, and tell modes apart by ear.

Figure produced by Lab 12: Scales, derived and counted: fifths, evenness and necklaces
Produced by the lab below, seed 0, in 0.3 s.
python -m videos.music.labs 12 needs numpy, scipy, matplotlib · download lab12.py · source on GitHub
five pure fifths from C, folded                     C D E G A;  steps 204 204 294 204 294 cents
intervals of a semitone or a tritone in that scale  0 and 0
a generator of 701.955 cents: two sizes of step at  2 3 5 7 12 17 29
   5 notes                                          294.1 and 203.9 cents
   7 notes                                          203.9 and 90.2 cents
   12 notes                                         113.7 and 90.2 cents
   17 notes                                         90.2 and 23.5 cents
Lydian                                              2 2 2 1 2 2 1   brightness 39
Ionian                                              2 2 1 2 2 2 1   brightness 38
Mixolydian                                          2 2 1 2 2 1 2   brightness 37
Dorian                                              2 1 2 2 2 1 2   brightness 36
Aeolian                                             2 1 2 2 1 2 2   brightness 35
Phrygian                                            1 2 2 2 1 2 2   brightness 34
Locrian                                             1 2 2 1 2 2 2   brightness 33
the most even 7 of 12                               0 2 4 5 7 9 11;  steps 2 2 1 2 2 2 1
how often each interval occurs                      2 5 4 3 6 1   (deep: all different)
every kind of interval in exactly two sizes?        yes
its complement                                      1 3 6 8 10
Burnside, 12 beads                                  (1x2^12 + 1x2^6 + 2x2^4 + 2x2^3 + 2x2^2 + 4x2^1)/12 = 352
listed                                              352 shapes; by size 1 1 6 19 43 66 80 66 43 19 6 1 1
shapes that map onto themselves when turned         16:  6 6;  4 4 4;  1 5 1 5;  2 4 2 4;  3 3 3 3;  1 1 4 1 1 4;  1 2 3 1 2 3;  1 3 1 3 1 3
ear problem, the eight modes (listen first)         Phrygian; Aeolian; Dorian; Ionian; Mixolydian; Lydian; Lydian; Lydian

One interval, stacked, gives scales whose steps come in two sizes at 5, 7 and 12 notes; the seven-note one is also the most even choice of seven among twelve, and one of only two in which every interval occurs a different number of times (the other is seven neighbouring semitones). Counting every other possibility shows how unusual that is.
The code (102 lines; it asserts its own result)
"""Lab 12: stack fifths and watch the steps, count scale shapes two ways, put the modes in order, find the most even seven notes among nineteen, and name modes by ear."""

import math
from fractions import Fraction

import numpy as np

from videos.coursekit import labs
from explainer.music.monochord import Clip, concat, mix
from explainer.music.monochord import scales as S
from explainer.music.monochord.partkit import organ_tone

TITLE = "Scales, derived and counted: fifths, evenness and necklaces"
GOAL = ("Stack a generator and see at which sizes the steps come in two kinds, count the shapes of scale on any number "
        "of notes by Burnside's lemma and by listing them, order the seven modes by brightness, test a scale for the "
        "three properties of the white keys, and tell modes apart by ear.")
TASKS = [
    "Set GENERATOR to 697 (a meantone fifth) and to 709 (a wide one). Which sizes of scale have two kinds of step now? What happened at 12, and why?",
    "Set EDO to 19 and K to 7, then to 12. Is the most even scale deep? Does it have an interval that occurs only once? What are its two step sizes?",
    "Set BEADS to 6, 7 and 8. Compare Burnside's count with the list. For which sizes does some shape map onto itself when turned, and why can it not happen for 7?",
]
GENERATOR = 701.955     # the interval that is stacked, in cents
LIMIT = 31              # stacks of up to this many notes
BEADS = 12              # notes to the octave for the count of shapes
EDO, K = 12, 7          # the most even K notes among EDO equal ones
SR = 48_000


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

    # 1. Problem 1: five pure fifths from C
    five = S.stack(5, S.FIFTH)
    names = ["C", "G", "D", "A", "E"]
    order = np.argsort((np.arange(5) * S.FIFTH) % 1.0)
    lab.row("five pure fifths from C, folded", " ".join(names[i] for i in order) + ";  steps " + " ".join(f"{x:.0f}" for x in S.gaps(five)) + " cents")
    lab.row("intervals of a semitone or a tritone in that scale", f"{S.interval_vector((0, 2, 4, 7, 9))[0]} and {S.interval_vector((0, 2, 4, 7, 9))[5]}")

    # 2. where the steps come in two sizes (Problem 4)
    two = S.moments(LIMIT, g)
    lab.row(f"a generator of {GENERATOR:g} cents: two sizes of step at", " ".join(str(n) for n in two))
    for n in two[2:6]:
        lab.row(f"   {n} notes", " and ".join(f"{x:.1f}" for x in S.gap_sizes(S.stack(n, g))) + " cents")
    assert all(len(S.gap_sizes(S.stack(n, g))) <= 3 for n in range(2, LIMIT + 1))

    # 3. the modes, in order
    for name, steps in S.by_brightness():
        lab.row(f"{name:<11}", " ".join(str(x) for x in steps) + f"   brightness {S.brightness(steps)}")

    # 4. the white keys' three properties, for the most even K notes of EDO
    notes = S.maximally_even(K, EDO, offset=K - 2 if (EDO, K) == (12, 7) else 0)
    steps = S.steps_of(notes, EDO)
    vec = S.interval_vector(notes, EDO)
    lab.row(f"the most even {K} of {EDO}", " ".join(str(n) for n in notes) + ";  steps " + " ".join(str(s) for s in steps))
    lab.row("how often each interval occurs", " ".join(str(v) for v in vec) + ("   (deep: all different)" if S.is_deep(notes, EDO) else "   (not deep)"))
    lab.row("every kind of interval in exactly two sizes?", "yes" if S.has_myhill(steps) else "no")
    lab.row("its complement", " ".join(str(n) for n in range(EDO) if n not in notes))
    if (EDO, K) == (12, 7):
        assert vec == (2, 5, 4, 3, 6, 1) and notes == (0, 2, 4, 5, 7, 9, 11)

    # 5. every shape (Problem 2)
    divisors = [d for d in range(1, BEADS + 1) if BEADS % d == 0]
    lab.row(f"Burnside, {BEADS} beads", "(" + " + ".join(f"{S.euler_phi(d)}x2^{BEADS // d}" for d in divisors) + f")/{BEADS} = {S.burnside(BEADS)}")
    neck = S.necklaces(BEADS)
    counts = S.classify(BEADS)
    lab.row("listed", f"{len(neck)} shapes; by size " + " ".join(str(counts[k]) for k in range(BEADS + 1)))
    turn = [s for s in neck if s and len({S.rotate(s, k) for k in range(len(s))}) < len(s)]
    lab.row("shapes that map onto themselves when turned", str(len(turn)) + ("" if not turn else ":  " + ";  ".join(" ".join(str(x) for x in s) for s in turn[:8])))
    assert S.burnside(BEADS) == len(neck)

    # 6. the ear problem (Problem 3): eight modes on C
    order = S.by_brightness()
    picks = [int(x) for x in rng.integers(0, 7, 8)]
    c4 = 261.6255653005986
    tone = lambda semis, sec: Clip(organ_tone(c4 * 2 ** (semis / 12.0), sec, partials=5, decay=3.0), SR).fade(0.01, 0.08).at_level(-20.0)        # noqa: E731
    scales = []
    for p in picks:
        ns = list(S.pcs(order[p][1])) + [12]
        placed = [(tone(n, 0.4), 0.3 * k) for k, n in enumerate(ns)] + [(Clip(organ_tone(c4 / 2, 0.3 * len(ns) + 0.4, partials=3), SR).fade(0.2, 0.3).at_level(-30.0), 0.0)]
        scales.append(mix(placed))
    lab.audio = concat(scales, gap=0.8)
    lab.row("ear problem, the eight modes (listen first)", "; ".join(order[p][0] for p in picks))

    fig, (a, b) = labs.figure(2)
    ns = np.arange(2, LIMIT + 1)
    sizes = [len(S.gap_sizes(S.stack(int(n), g))) for n in ns]
    a.bar(ns, sizes, color=[labs.GOLD if s == 2 else "#888" for s in sizes])
    a.set_title(f"Sizes of step in a stack of {GENERATOR:g}-cent fifths")
    a.set_xlabel("notes in the stack")
    a.set_ylabel("different sizes of step")
    a.set_yticks([1, 2, 3])
    b.bar(range(BEADS + 1), [counts[k] for k in range(BEADS + 1)], color=labs.GOLD)
    b.set_title(f"Shapes of scale on {BEADS} notes: {len(neck)} in all")
    b.set_xlabel("notes in the scale")
    b.set_ylabel("shapes")
    lab.fig = fig
    lab.note = ("One interval, stacked, gives scales whose steps come in two sizes at 5, 7 and 12 notes; the seven-note one is "
                "also the most even choice of seven among twelve, and one of only two in which every interval occurs a different "
                "number of times (the other is seven neighbouring semitones). Counting every other possibility shows how unusual that is.")
    return lab

Now change it

  1. Set GENERATOR to 697 (a meantone fifth) and to 709 (a wide one). Which sizes of scale have two kinds of step now? What happened at 12, and why?
  2. Set EDO to 19 and K to 7, then to 12. Is the most even scale deep? Does it have an interval that occurs only once? What are its two step sizes?
  3. Set BEADS to 6, 7 and 8. Compare Burnside's count with the list. For which sizes does some shape map onto itself when turned, and why can it not happen for 7?

Problems, with solutions

Try each problem before opening its solution.

  1. Five-note chain. A pure fifth is approximately 702 cents. Stack four of them from C and fold them into one octave. Name the five notes, give the steps between them in cents, and say which interval of the major scale is missing from this scale altogether.

    Solution

    The fifths give C, G (702), D (1404 − 1200 = 204), A (906), E (1608 − 1200 = 408). In order: C, D, E, G, A, at 0, 204, 408, 702 and 906 cents, with steps of 204, 204, 294, 204 and 294 (the last back up to C). There is no semitone anywhere, and so no tritone either: the scale's interval vector is ⟨0, 3, 2, 1, 4, 0⟩. This removes semitone and tritone interval classes; it does not guarantee that every register, voicing and timbre sounds smooth.

  2. Necklaces of six. Use Burnside's lemma to count the shapes of scale on six notes to the octave (necklaces of six beads in two colours), and list them. Which of them maps onto itself when turned?

    Solution

    The rotations of six places are by 0, 1, 2, 3, 4 and 5; a rotation by 6/d places (there are φ(d) of each kind) leaves 2^(6/d) colourings unchanged. So the count is (1·2⁶ + 1·2³ + 2·2² + 2·2¹)/6 = (64 + 8 + 8

    • 4)/6 = 14. By number of notes: 1, 1, 3, 4, 3, 1, 1. Those that map onto themselves under a turn of less than a full circle are the empty set, the full set, the two notes a tritone apart (steps 3 3), the three evenly spaced notes (2 2 2), and the four notes with steps 1 2 1 2. A shape with a prime number of notes out of a number it does not divide, such as seven of twelve, can never do this, which is one reason diatonic scales have twelve distinct transpositions.
  3. Ear. The lab plays eight scales on C in a random order, each one of the seven modes. Name each, or at least say whether it is brighter or darker than the one before.

    Solution

    The lab prints the order. Listen for the third first (major in Lydian, Ionian and Mixolydian; minor in the rest), then for the one note that tells neighbours apart: the raised fourth of Lydian, the lowered seventh of Mixolydian, the raised sixth of Dorian against Aeolian, the lowered second of Phrygian, and the lowered fifth of Locrian.

  4. Build. With scales.stack, use a generator other than the pure fifth: a fifth of 697 cents (meantone) and one of 709. At which numbers of notes do the steps come in two sizes now?

    Solution

    In the lab set GENERATOR. At 697 cents the list is 2, 3, 5, 7, 12, 19, 31, 43 (through sixty notes): the same up to twelve, and then the meantone divisions of Part 6 (19 and 31 equal steps) in place of 17 and 29. At 709 cents it is 2, 3, 5, 7, 12, 17, 22, 39. Five, seven and twelve remain two-gap counts over much of that neighborhood, except at exact closures such as 700 cents for twelve notes: they do not depend on the fifth being pure, only on its being roughly seven twelfths of an octave. What changes is which of the two steps is the larger: at twelve notes a 697-cent fifth gives steps of 115 and 79 cents, a pure fifth 114 and 90, and at exactly 700 the two are equal.

  5. ★ Nineteen notes. On nineteen equal notes to the octave, which seven are maximally even? Is that scale deep, and does it have a landmark interval? What would its "black keys" be?

    Where the frontier is. The formula ⌊19k/7⌋ gives notes 0, 2, 5, 8, 10, 13, 16, with steps 2, 3, 3, 2, 3, 3, 3: five large steps and two small, in the diatonic pattern, and it is the scale generated by 19-equal's fifth (11 steps). Every generic interval comes in two sizes, so it has Myhill's property, and its tritone analogue occurs once. It is not deep in the strict sense (its interval vector, ⟨0, 2, 5, 0, 4, 3, 0, 6, 1⟩, has repeated zeros), though its non-zero entries are all different. The complement has twelve notes, with steps 1, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 2: one possible nineteen-note keyboard could use seven white keys and twelve black. Historical keyboard layouts vary. The open questions are perceptual: which of the diatonic scale's properties listeners actually use, and whether scales built to have them in other tunings can be learned as readily (see Balzano 1980; Trehub and others 1999; and the microtonal literature in Sethares 2005).

Notes and sources

Sources

Books: D. Tymoczko, A Geometry of Music (2011), ch. 4; W. A. Sethares, Tuning, Timbre, Spectrum, Scale (2nd ed., 2005); H. Powers and others, "Mode", in The New Grove Dictionary of Music and Musicians (2nd ed., 2001); O. Messiaen, Technique de mon langage musical (1944); H. Glarean, Dodecachordon (1547); P. Sambamoorthy, South Indian Music (1958–69), for the melakarta scheme; H. Farmer, A History of Arabian Music (1929), and S. Marcus, Music in Egypt (2007), for the seventeen-note and quarter-tone systems; J. Kunst, Music in Java (3rd ed., 1973); T. Johnson, Foundations of Diatonic Theory (2003).

Papers: V. T. Sós, "On the distribution mod 1 of the sequence nα", Annales Universitatis Scientiarum Budapestinensis, Sectio Mathematica 1 (1958); S. Świerczkowski, "On successive settings of an arc on the circumference of a circle", Fundamenta Mathematicae 46 (1958); C. Gamer, "Some combinational resources of equal-tempered systems", Journal of Music Theory 11 (1967); G. Balzano, "The group-theoretic description of 12-fold and microtonal pitch systems", Computer Music Journal 4 (1980); J. Clough and G. Myerson, "Variety and multiplicity in diatonic systems", Journal of Music Theory 29 (1985); N. Carey and D. Clampitt, "Aspects of well-formed scales", Music Theory Spectrum 11 (1989); J. Clough and J. Douthett, "Maximally even sets", Journal of Music Theory 35 (1991); S. E. Trehub, E. G. Schellenberg and S. B. Kamenetsky, "Infants' and adults' perception of scale structure", Journal of Experimental Psychology: Human Perception and Performance 25 (1999); K. Z. Gill and D. Purves, "A biological rationale for musical scales", PLoS ONE 4 (2009); J. M. McBride and T. Tlusty, "Cross-cultural data shows musical scales evolved to maximise imperfect fifths" (preprint, arXiv:1906.06171, 2019).

About this partfrom its README

Part 12 of a sixty-eight-part course in music (see the series plan and the syllabus). Part 11 said when; this part says which: the few notes a piece of music chooses out of all there could be. It derives the pentatonic, diatonic and chromatic scales from one interval, the fifth of Part 1; puts the seven modes in order of brightness; asks what is special about the white keys and gets three answers (they are maximally even, every interval in them comes in two sizes, and they are deep); meets minor's three forms, scales of five, six and eight notes, tetrachords, the seventy-two melakartas, maqam and slendro; and counts every shape a scale can have on twelve notes. The scale module is Monochord's (explainer/music/monochord/scales.py), the pictures are in explainer/music/scaleviz.py, and every sound is computed in compute.py. Published findings are the ones listed under Sources.

  • Seven white keys and five black. The white keys and the black keys, heard; the question (why seven and five, and why the black keys come as a two and a three); the plan.
  • 1. Stacking fifths. Pure fifths from F, folded into an octave and drawn round a circle; the steps they leave: two sizes at five notes (294 and 204 cents), three at six, two at seven (204 and 90), three from eight to eleven, two at twelve (114 and 90); why the stack never closes: the thirteenth note misses the first by the Pythagorean comma of Part 6, 23.5 cents; the three stacks played: pentatonic, diatonic, chromatic.
  • 2. Three gaps. The three-gap theorem (1958); the number of sizes for stacks of up to sixty notes; a predict-pause (why a sixth note makes three sizes); two sizes at 2, 3, 5, 7, 12, 17, 29, 41, 53: Arabic theory's 17, Jing Fang's 53, and denominators of convergents and intermediate convergents of Part 6's continued fraction.
  • 3. Seven notes, seven modes. The white keys as a chain of fifths, F C G D A E B; a mode for each choice of home note, bright to dark along the chain; all seven on C, each the one before with one note lowered; an ear question (Dorian and Mixolydian); the seven degrees and their names (tonic, supertonic, mediant, subdominant, dominant, submediant, leading note); relative and parallel: A minor has C major's notes and another home, C minor has C major's home and three other notes; why the Tune, which has no seventh, is the same in Ionian and Mixolydian.
  • 4. Why this scale. Maximal evenness (Clough and Douthett, 1991): note k at ⌊(12k + 5)/7⌋ gives C D E F G A B, and the five places left over are the black keys; generic seconds through sevenths in two sizes, with one tritone pair as a landmark (it does not identify a tonic); the interval vector ⟨2, 5, 4, 3, 6, 1⟩: a deep scale; a scale moved up a fifth keeps six notes, up a semitone only two (heard on C, G and D flat).
  • 5. Minor's three forms. Natural, harmonic (a step of three semitones) and melodic; two endings (an ear question): the leading note.
  • 6. Fewer notes, and more. Pentatonic, whole-tone, octatonic and blues scales; how many transpositions each has (12, 2, 3, 12): modes of limited transposition; symmetric pitch inventories whose home can come from musical context; a random walk on each scale, heard: what the choice of notes does before any melody is composed.
  • 7. A scale in two halves. Tetrachords: the six ways to fill a fourth; the major scale as two equal halves; a scale of two other halves; a modern 72-melakarta scheme following Venkatamakhin's organizing principle (2 × 6 × 6); Mayamalavagowla.
  • 8. Other maps of the octave. A major scale, Rast in quarter tones, five equal steps as a stand-in for slendro, and Mayamalavagowla, as bars of cents and as sound; the neutral third, 350 cents, between minor and major (an ear question); a caution: a maqam, a raga and a gamelan's tuning are more than rows of pitches; some frequent features, without claiming universal rules.
  • 9. Shapes among twelve pitch classes. Burnside's lemma on a necklace of four beads, counted by hand (six, not sixteen); 2048 sets of notes that contain the home note; on twelve places: 352 unrooted shapes including the empty set (351 nonempty), by size 1, 1, 6, 19, 43, 66, 80, 66, 43, 19, 6, 1, 1; all 66 shapes of seven notes; three made only of whole and half steps (an ear question); one with its half steps as far apart as possible.
  • 10. Frontier: why five to seven unequal steps? The 66 seven-note shapes scored by evenness, by number of fifths and by Part 5's roughness: the white keys come first on all three; seven equal steps (an ear question): no major or minor, no landmark; Trehub's infants (1999); four explanations, none settled. ★ research problem.
  • Variation 12, recap and problems. The Tune in the seven modes, brightest to darkest, then in pentatonic, whole-tone and octatonic scales, with a second voice two places below and a held C; the ledger; what we found; five problems; where it comes back; in practice; references; Part 13.
What is computed and built

python -m videos.music.music12.compute (under a minute) fills .cache/music12/.

Item What it computes Checked against
hook the white keys from C and the black keys, on Part 7's piano —
stack one- to twelve-note chains built from pure fifths, folded into an octave; their steps in cents 294/204, 204/90 and 114/90 cents; the comma, 23.46
gaps the number of sizes of step for stacks of 2 to 60 notes never more than three; two at 2, 3, 5, 7, 12, 17, 29, 41, 53
modes the seven modes on C, spelled; their brightness; which degrees of the Tune each changes each is the one before with one note lowered
why the maximally even seven of twelve; evenness of every seven-note set; interval vectors; common tones ⟨2, 5, 4, 3, 6, 1⟩; six notes kept a fifth away
minor three forms of A minor; two cadences —
fewer four scales and their numbers of distinct transpositions 12, 2, 3, 12
halves the six tetrachords; the 72 melakartas by Venkatamakhin's rule 72 different scales; six of the seven modes among them
maps Rast in quarter tones, five equal steps, Mayamalavagowla each adds up to 1200 cents
every all necklaces of twelve beads in two colours, listed; Burnside's count 352 both ways; by size; C(11, 6) = 462
frontier every seven-note shape by evenness, fifths and mean roughness of its pairs (Part 5's model) the diatonic is first of 66 on each
tune Variation 12 every note is in its phrase's scale

Monochord's scales are held against these in tests/music/test_scales.py; this part's claims and clips in tests/music/test_music12.py.

Sounds. Sixteen clips, all on Part 7's piano (physical model), some over a held C from an organ tone. The scales of chapter 1 are in pure fifths; Rast, the five equal steps and the seven equal steps are tuned in cents; everything else is in twelve-tone equal temperament. There are no recordings.

What the models are, and are not. The stack of fifths uses floating-point logarithms of pure fifths. Brightness is the sum of a mode's notes in semitones above its first; it orders the modes as their home notes lie along the chain of fifths, and it is a convention, not a measurement of anything heard. Evenness is the size of one Fourier coefficient of a set of notes; other measures agree on which seven notes come first. Roughness is Part 5's Plomp–Levelt model on equal-tempered pairs of seven-partial tones, averaged over a scale's 21 pairs; it is one model of consonance, evaluated at a common reference pitch and spectrum. Other assumptions can change the ranking, including the winner. Rast is given in the quarter-tone approximation of twentieth-century Arabic theory (steps of 4, 3, 3, 4, 4, 3, 3 quarter tones); practice differs by region and by player. Slendro is represented by five equal steps, which no gamelan plays exactly: each is tuned to itself. The melakartas are generated by rule; their names and the ragas assigned to them are not. The second voice of the Variation is two scale steps below the melody, with no regard for harmony; it is there so that the seventh degree, which the Tune lacks, is heard.

Notes

The five-note pure-fifth chain matches the black-key spacing pattern after transposition; it is not literally the equal-tempered black keys. Historical seventeen-note Arabic theory and Jing Fang’s fifty-three-fifth near-closure are not claims that those traditions used equal divisions. Glarean’s twelve historical modes differ from the modern seven rotations. The modern melakarta catalogue should not be attributed unchanged to its seventeenth-century precursor. Rast quarter tones and equal-step slendro are teaching proxies, not complete performance tunings. Roughness scores are model results, not universal preferences.

Companion material in this repository

The syllabus's plan for this partfrom SYLLABUS.md, the plan of record
  1. Hook: the white keys and the black keys; why seven and five; the plan.
  2. Stacking fifths: steps of two sizes at five, seven and twelve notes; the three stacks, heard.
  3. Three gaps: the theorem; where a stack has two sizes (a predict-pause); 17, 53 and Part 6's continued fraction.
  4. Seven notes, seven modes: the chain of fifths; brightness; all seven on C (an ear question); the Tune's blind spot.
  5. Why this scale: maximally even; two sizes of every interval; deep; a scale moved by a fifth.
  6. Minor's three forms: natural, harmonic, melodic; the leading note (an ear question).
  7. Fewer notes, and more: pentatonic, whole-tone, octatonic, blues; scales with two and three transpositions.
  8. A scale in two halves: tetrachords; the 72 melakartas.
  9. Other maps of the octave: Rast, slendro, Mayamalavagowla; what a scale leaves out.
  10. Every scale there is: Burnside's lemma, 352 shapes; the 66 with seven notes; three; one (an ear question).
  11. Frontier: the white keys against the other 65; seven equal steps (an ear question); four explanations.
  12. Variation 12: the Tune in ten scales. Outro: problems, payoffs.

Covers: generating scales by fifths and the three-gap theorem; maximal evenness, Myhill's property and the deep scale; the seven modes ordered by brightness; minor's forms; pentatonic, whole-tone, octatonic and blues scales; a first look at raga, maqam and slendro; necklaces counted with Burnside's lemma. Built and computed: the scale module (monochord/scales.py); all 352 necklaces of twelve beads, classified; the pictures of scales (explainer/music/scaleviz.py). Variation 12: the Tune in all seven modes, then pentatonic, whole-tone and octatonic. Frontier: why scales have five to seven unequal steps: the competing explanations. Reading: Clough & Douthett (1991); Carey & Clampitt (1989); Tymoczko, A Geometry of Music ch. 4.

Build the film

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

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

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