Form and structure

The shape that survives everything else

Throw away a melody's key, its tuning, its instrument and the sizes of its intervals, and what is left is a string of pluses and minuses. That string is what a listener who cannot name a note still has, and it costs 37 per cent of the tune to keep. The arch that melodic shape is famous for is not in it as a preference: enumerate every six-note sequence that begins and ends on the lowest degree it uses and 99.6 per cent of them are arches, because a melody that comes home from below has nowhere to go first but up.

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.

What a change of everything else leaves alone. Twinkle, twinkle under four transformations, each drawn as its own path and labelled with its contour class. Transposition and a change of tuning leave the sign sequence identical; doubling every interval leaves it identical too, because a sign is not a size. Playing it backwards does not — 4 of 5 share the original's contour. That is the one thing here that a retrograde changes and an interval vector does not.
Fig. 1 Twinkle under four transformations, each drawn as its own path. Transposing it up a tritone leaves the sign sequence untouched. Retuning it to Pythagorean moves every degree by up to twenty-two cents, and the line visibly differs — and the sign sequence is identical, because a sign is not a size. Doubling every interval produces a melody in a different scale system altogether and again the signs are unchanged. Playing it backwards is the one operation that does change them, and it is the one operation an interval vector also cannot see.

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.

What is left when only the shape is kept. Of the 262,144 sequences of 6 notes over 8 degrees, there are 243 distinct contours — every possible sign pattern occurs — so an average of 1,079 different melodies share each one. A melody carries 18.0 bits at this length and its contour carries 7.9; remembering the shape and nothing else keeps 44 per cent of what is there. That is the price of a code that survives transposition, retuning and a change of instrument.
Fig. 2 Every sequence of six notes over eight scale degrees — 262,144 of them, enumerated rather than sampled. There are 243 distinct contours between them, which is three to the fifth: every possible sign pattern occurs, so nothing is unreachable. An average of 1,079 different melodies share each contour. A melody of this length carries 18 bits and its contour carries 6.6 — not the 7.9 that the count of contours suggests, for the reason set out two sections below — so remembering the shape and discarding everything else keeps 37 per cent of what was there.

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.

Twinkle, twinkle as a path. Twinkle, twinkle plotted as 42 notes against the 10 scale degrees it uses, one column per note. Its largest melodic interval is 7 semitones and it spans 9; the mean absolute step is 1.46 semitones. “Ah! vous dirai-je, maman”, French, printed 1761 — six bars, the outer strain and its middle.
Fig. 3 Twinkle as a path. Its contour begins =+=+=--=-=- — 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.
Frère Jacques as a path. Frère Jacques plotted as 32 notes against the 15 scale degrees it uses, one column per note. Its largest melodic interval is 7 semitones and it spans 14; the mean absolute step is 2.52 semitones. French, traditional — eight bars, sung as a four-part round with entries two bars apart.
Fig. 4 Frère Jacques, whose contour class is also an arch and whose path is not remotely the same shape. Two melodies in one class is what a nine-way classification means, and it is why contour class is a coarse statistic while the full sign sequence is a usable code. The nine classes are the summary; the 243 sign patterns are the thing that carries 6.6 bits.

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.

The shape depends on which axis it is read along. Each tune's contour taken twice: once by note, which is what the census enumerated, and once by sampling the tune at equal intervals of clock time, which is what a listener's ear is given. The two sign sequences differ on 44 of 101 positions across the three tunes — more than half of them in one case. The nine-way class survives in 3 of 3, so the coarse description is robust to the choice and the fine one is not. Every contour drawn earlier was the first of the two.
Fig. 5 Each tune’s contour taken twice: once by note, which is what the census enumerated, and once by sampling at equal intervals of clock time, which is what the ear is given. The two sign sequences differ on 44 of the positions across the three tunes.

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 arch is not a preference. Every sequence of 6 notes over 8 scale degrees — 262,144 of them, enumerated rather than sampled — classified by contour, under three constraints. With none, the nine classes are spread. Requiring the sequence to return to its starting degree leaves only the arch, the valley and the flat, at 42.2 per cent each for the first two. Requiring it to begin and end on the LOWEST degree leaves the arch alone, at 99.6 per cent. Nothing here prefers a rise followed by a fall; the constraint is that the melody comes home, and a melody that comes home from below has nowhere to go but up first.
Fig. 6 The same 262,144 sequences classified into the nine contour classes, under three constraints. With none, the nine are spread and the two arch classes take twenty per cent each. Require the sequence to end on the degree it started on and six of the nine classes vanish completely — not become rare, vanish — leaving the arch, the inverted arch and the flat. Require it to begin and end on the lowest degree of its range and the inverted arch goes too: 99.6 per cent of what remains is an arch.

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.

What a change of everything else leaves alone. Ode to Joy under four transformations, each drawn as its own path and labelled with its contour class. Transposition and a change of tuning leave the sign sequence identical; doubling every interval leaves it identical too, because a sign is not a size. Playing it backwards does not — 4 of 5 share the original's contour. That is the one thing here that a retrograde changes and an interval vector does not.
Fig. 7 The same five transformations on a theme whose largest interval is a whole tone. Doubling every interval turns it into a melody spanning a ninth rather than a fifth, and its contour is unchanged — which makes the point more starkly than the nursery tune does, because here the doubling changes the theme beyond recognition and the contour does not notice.

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.

What a contour costs to remember. A melody of n notes over 8 degrees carries 3 bits a note. Its contour carries fewer, and fewer than the number of distinct contours suggests, because the contours are not equally likely: at 6 notes there are 243 of them but the entropy is 6.59 bits, an effective alphabet of 96. Each further note adds 1.28 bits of contour against three of melody, so the shape keeps a stable 37 per cent of what is there however long the tune.
Fig. 8 What a contour costs to remember. A melody of n notes over eight degrees carries three bits a note; its contour carries fewer, and fewer again than the number of distinct contours suggests, because the contours are not equally likely.

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.

What is left when only the shape is kept. Of the 7,776 sequences of 5 notes over 6 degrees, there are 81 distinct contours — every possible sign pattern occurs — so an average of 96 different melodies share each one. A melody carries 12.9 bits at this length and its contour carries 6.3; remembering the shape and nothing else keeps 49 per cent of what is there. That is the price of a code that survives transposition, retuning and a change of instrument.
Fig. 9 The same count at a shorter length over fewer degrees: 7,776 sequences, 81 contours, 96 melodies to a contour. The compression ratio in bits is higher than at six notes over eight, because a shorter sequence has fewer signs to spare — which is why contour is a poor index for a fragment and a good one for a phrase, and why query-by-humming asks for a dozen notes rather than four.

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