The shape that survives everything else
Assumes: A melody is a walk, not a set · The leap that pays itself back
Sing a tune somebody knows, in the wrong key, out of tune, on the wrong instrument, with all its intervals stretched. They will still recognise it.
That is such a familiar fact that it takes an effort to see how strange it is. Nearly every quantity this collection measures about music has been destroyed by that description. The pitch classes are gone with the transposition. The interval sizes are gone with the stretching. The tuning system, the timbre, the spectrum that makes an instrument what it is — all gone. Whatever is doing the recognising is reading something that survived all of it.
The thing that survived has a name and it is embarrassingly small.
The code
A melody’s contour is the sequence of signs of its intervals: up, down, or the same. Nothing else. Not how far up, not from where, not on what.
The last row is worth pausing on. This collection has spent nine essays on the combinatorics of scales, and every property in that apparatus — the interval vector, Myhill’s property, maximal evenness, well-formedness — is unchanged by reversal. A set and its retrograde are one object to all of them.
Contour is the first quantity in this collection that a retrograde changes. It is the cheapest possible description of a melody and it is also the first one that knows which way time runs.
What it costs to keep only the shape
The price can be counted exactly, because at short lengths the whole space of melodies is enumerable.
Thirty-seven per cent is a remarkable figure in both directions.
It is small: a listener holding only the contour has thrown away more than half the tune and could not distinguish it from a thousand others of the same length. Anyone who has tried to identify a melody from a hummed contour alone — which is what a query-by-humming system attempts — has met the ambiguity directly. It is the same trade absolute pitch makes in the other direction: a memory for the note itself is far more information and is very nearly useless for recognising a tune, because the tune arrives transposed.
It is also large: two thirds of a byte out of a code that costs nothing to compute, requires no absolute pitch, no key, no tuning reference and no knowledge of the scale being used. The 63 per cent that was discarded is exactly the part a transposition, a retuning or a new instrument would have changed anyway. Contour is not a lossy summary of a melody chosen for convenience; it is the largest part of a melody that is invariant under the transformations music actually applies to it.
That is why it is the right thing for the memory to keep, and it is a good deal more principled than it looks.
What the count of contours is not
The figure above reports 243 contours and 262,144 melodies, and the obvious way to turn that into bits is to take the base-two logarithm of each: 18 against 7.925, which is where the figure of 44 per cent came from and which is wrong.
That step assumes the 243 contours are equally likely, and they are not. The commonest of them holds 15,106 of the sequences and the rarest holds 8, a spread of nearly two thousand to one, because a contour with no repeated notes in it can be realised in far more ways than one that demands three of the six degrees be identical. The quantity a listener actually receives is the entropy of that distribution, and the distribution is lopsided:
| population | melodies | contours | melody bits | contour bits | kept |
|---|---|---|---|---|---|
| every sequence | 262,144 | 243 | 18.00 | 6.59 | 37% |
| returns to its start | 32,768 | 181 | 15.00 | 6.38 | 43% |
| begins and ends at the bottom | 4,096 | 59 | 12.00 | 4.81 | 40% |
So the honest headline is 37 per cent and not 44, and the seven points were an artefact of counting the shapes rather than weighing them. The argument survives the correction intact, because the argument was never about the exact figure: it was about the discarded remainder being the part a transposition would have destroyed anyway, and that does not move.
Two things in the corrected table are worth more than the correction. The first is that the closing caveat of this essay named the wrong assumption. It warned that the bits treat every sequence as equally likely — which is true, and which is harmless here, because the enumeration really is uniform over sequences by construction. The assumption that actually bit was a different one, and nobody wrote it down because it was hidden inside a logarithm of a count.
The second is that the ratio is a property of the population and not of the code, and it moves the right way. On the population this essay’s central argument is actually about — sequences that return to where they started, which is what a tonal melody does — contour keeps 43 per cent rather than 37. The constraint strips melodic variety faster than it strips shape. That is the stronger version of the claim, and it was available on the same enumeration the arch argument already runs on.
The ambiguity, made concrete
An average of a thousand melodies to a contour is a number; it is more useful to see what those thousand have in common, which is almost nothing.
=+=+=--=-=- — same, up, same, up, same, down, down. Any melody whose first seven moves have those signs shares this much of it, whatever the sizes: the opening fifth could be a semitone and the contour would not notice, and the tune would be unrecognisable.This is the practical form of the same fact. A search system that indexes tunes by their sign sequence — the Parsons code, which is exactly this and was designed for a printed dictionary of themes in 1975 — needs about a dozen notes before the index is discriminating, and needs no key, no rhythm and no musical training from whoever is doing the searching. Twelve notes of contour is 311, which is enough addresses for every theme anybody has written down.
So the shape that survives transposition and retuning does not survive a change of clock. The contour a listener actually receives is the second of these, and the census this essay is built on enumerated the first — which is a limit on the whole construction rather than a detail of it.
The arch, which is not a preference
The single most-cited fact about melodic shape is that melodies are arches: they rise, reach a high point and descend. It is reported for European folk song, for chant, for children’s songs, for several unrelated traditions, and it is usually presented as a discovered universal about musical taste or about breath.
It is neither. It is a consequence of one constraint, and the enumeration shows exactly how.
The middle row is the interesting one and its result is exact rather than statistical. A sequence that returns to its starting point cannot be classified as rising, falling, or any of the four mixed classes, because those classes are defined by the start and end differing. There is no room for a preference: the constraint removes the alternatives.
What the middle row does not explain is why the arch rather than the valley. Both sit at 42.2 per cent — the return makes melodic shape symmetric, and says nothing about which way up.
That equality is not a result of the enumeration, and it is worth saying so, because a number printed by a count looks like a measurement. Reflecting the degree axis maps every sequence to another sequence in the same universe, maps arch to valley and valley to arch, and leaves the constraint starts and ends on the same degree exactly where it was. The two figures are therefore forced to be identical, to the last sequence, for any universe and any length. The third row is the row that says something, because naming the lowest degree is the first constraint in the figure that the reflection does not preserve.
The third row supplies the missing constraint and it is a small one. A tonal melody does not merely return; it returns to a note near the bottom of the range it uses. The tonic is normally the lowest structural note of the phrase, because a phrase that ends on it ends by arriving rather than by continuing. Pin a sequence to begin and end on the lowest degree it touches and it is an arch with a probability of 99.6 per cent, and the residual 0.4 per cent is the sequences that never leave the bottom at all.
So the arch is what “start low, go somewhere, come home” means. There is no aesthetic content in it, and there is no need for one.
What the third row is really a claim about
Stating it that way makes the arch sound trivial, which invites a check: is the constraint doing real work, or has it been chosen to give the answer?
The honest answer is that one part of it is doing real work and the other part is an assumption worth naming.
The return is not an assumption. It is what a tonal melody does and it is measurable independently — a phrase that ends elsewhere is heard as unfinished, which is a claim with cadence experiments behind it.
The low is an assumption, and it is a Western one. A melody whose tonic sits in the middle of its range — which is common in Indian classical music, where the tonic drone is a fixed reference the line moves both above and below — should show the arch far more weakly, and the middle row of the figure says exactly what it should show instead: arch and valley in equal numbers.
That is a prediction, and this collection cannot test it. It is the shape a test would take.
The one operation it does notice
It is worth returning to the retrograde, because the asymmetry is the reason this rung exists at all.
Everything in the scale apparatus is retrograde-invariant, and that invariance is not a defect — it is what makes the census possible. A property that distinguished a set from its reversal would have to be evaluated over orderings, and there are far too many orderings to enumerate.
Contour is the cheapest possible escape from that. It is not a property of a set at all; it is a property of a path, and it costs one sign per move to record. The whole difference between the two halves of this collection is one bit per interval.
That is a much smaller price than the corresponding step elsewhere. A process piece whose form is the orbit of a pattern under rotation is a case where order is the entire content and the pitch material is nearly nothing; the rhythm ladder’s necklaces are the case where discarding the starting position is the standard move and turns out to discard the thing the pattern is for. Melody sits between them: the ordering carries most of the identity, and one bit per move recovers enough of it to search a dictionary with.
Whose melodies, and when
The tunes drawn here are European and there are three of them. Their contour classes are not a finding: two are arches and one is a descent, which on a sample of three is a coincidence of no evidential value whatever.
The enumeration is a different kind of object entirely, and it is what the argument rests on. It contains no repertoire, no period and no taste — it is a count over every sequence of six notes on eight degrees, and a count has no nationality. What makes it apply to music at all is the two constraints, and each of those is stated above with a note on how far it travels.
The published contour surveys — Huron’s over a folk-song corpus is the one usually cited for the nine classes — do find the arch dominant in the repertoires they cover. This essay does not dispute the count; it disputes what the count is evidence of.
Where the code stops being enough
There is a boundary to how far the invariance argument can be pushed, and it is worth marking because the figures make contour look more powerful than it is.
Contour is invariant under transposition, retuning and interval scaling. It is not invariant under the transformations that music also routinely applies. Ornamentation inserts notes, and an inserted note between two steps in the same direction adds a sign the original did not have; a melody with a turn on its third note has a different contour from the same melody plain. Octave displacement — moving one note of a line into another octave, which is ordinary in jazz melody and in any keyboard texture — reverses two signs at once. Rhythmic re-barring does not change the sign sequence at all but changes which notes a listener treats as structural, and a listener comparing contours is almost certainly comparing the contour of the notes they judged important rather than of every note sounded.
So the honest statement is narrower than the figures suggest: contour is invariant under the transformations that change pitch level and pitch spacing, and those happen to be the ones a transposition, a change of instrument and a change of tuning system consist of. It is not invariant under changes to which notes are there, and a great deal of what performers do is exactly that.
At six notes there are 243 possible contours and the entropy is well below the log of that, so the shape is cheaper to hold than its own alphabet implies. That is the practical case for contour being what survives: it is not merely invariant, it is small.
Which computation produced the numbers
The census is exhaustive. Every one of the eight-to-the-sixth sequences is generated, its interval signs taken, and its class assigned by the rule the nine classes are defined by: compare the first note to the mean of the interior notes, and that mean to the last note, with a tolerance of half a degree.
At six notes over eight degrees that is 262,144 sequences and takes a few milliseconds. It does not scale — ten notes over twelve degrees is sixty billion — which is why the length and the range are named in every caption, and why nothing here is claimed for melodies in general on the strength of it. The three constraints are applied to the same enumeration, so the three rows are directly comparable and differ only in the filter.
The bits are 18 for the sequences, which is the base-two logarithm of the count because the enumeration is uniform over sequences by construction, and 6.59 for the contours, which is the entropy of the contour distribution and not the logarithm of how many contours there are. The distinction is the subject of a section above and is worth a sentence here as well: the two differ by 1.3 bits, and the larger of them is the one that reads more impressively.
Both figures still treat every sequence as equally likely, which no repertoire does — a real melodic distribution is much narrower than uniform, so both numbers would fall and the ratio is what to take away rather than either one alone.
What the picture cannot show
It cannot show rhythm, and the omission is severe. A contour with no durations is not what anybody remembers; the reason a hummed tune is recognisable is that the rhythm comes with it, and a rhythm alone is often enough on its own. This model has thrown away half of what identification actually uses.
It cannot show dynamics or articulation. Two performances of one line, one legato and one detached, have the same contour and are different melodic events. The envelope of a note is doing work here that no pitch-based description reaches.
It cannot show scale degree. A rise from the leading note to the tonic and a rise from the fourth to the fifth are both a plus here. In any tonal music those are entirely different events, and a listener who knows the style is not reading a bare sign sequence.
It cannot show what happens over a whole piece. Six notes is a fragment. A melody of thirty notes has an arch inside its first phrase, another inside its second, and a shape over the whole that may be any of the nine — the classification is scale-dependent in a way none of the figures here admit, and the same is true of every repetition statistic in this collection.
And it cannot show why the interior of the arch is what it is. The classification collapses everything between the first note and the last into a single mean. Two melodies that rise smoothly and lurch respectively have the same class, and the difference between them is most of what makes one a tune.
The ladder from here
Three rungs of this ladder have now taken a well-known fact about melodic shape and found it in something other than a preference: stepwise motion in a limit on streaming, post-skip reversal in a boundary, the arch in a return. The pattern is not an accident of choosing the examples — those three are the facts about melody that get taught, and they get taught because they are the ones with regularities visible enough to be noticed.
The next rung asks about the one remaining shape fact, which is size: melodies fit inside about a twelfth, and no argument so far explains why. The answer turns out not to be stamina and not to be memory, but the point in a singer’s range where the mechanism producing the sound changes over — which makes the width of a tune a fact about a larynx.
Part 3 of 8
One essay in the series on melody. The essays either side of this one:
What links here
Essays that reach for this one mid-argument — the half of a link its own author cannot write down.
What this makes readable
Essays that declare this one a prerequisite.
The objects named here
The third way in, after the field and the series: the things themselves, and every essay that touches each one.
ArchContourEnumerationInvarianceMelodic intervalRelative pitchTransposition
- The set with fewer modes than notes enumeration, transposition