The note that has a length
Assumes: A melody is a walk, not a set · The shape that survives everything else
The melody ladder opened by declaring that a tune is a path rather than a set, and then drew five essays of paths that had no time in them.
That is not a figure of speech. The three tunes this collection carries are stored as lists of pairs — a pitch and a number of beats — and every statistic the ladder computed reads the first number of each pair and discards the second. A step from a minim to a minim and a step from a semiquaver to a semiquaver were one event in the histogram. A contour class was computed over the notes in order, with no account of how long each of them lasted.
The ladder said so when it closed, and named the debt. This essay pays it, and one of the three things it found was a bug.
The durations were there all along
Worth being precise about the shape of the omission, because it is the kind that leaves no trace. The data was never incomplete. Nothing had to be measured, transcribed or looked up: the second column was entered with the first, is printed in every figure that draws a stave, and was simply not read.
Written out on a stave, a tune’s notes carry their lengths as part of the notation — the one dimension the stave is a ruler for is not this one and every figure in this ladder before this rung threw them away — which is the omission the whole essay is about, and it is an omission in the analysis rather than in the source.
Two things follow from that, and they point in opposite directions. The good one is that nothing has to be re-collected: every figure below is a re-reading of data the ladder already had, so there is no new source of error and no new corpus problem beyond the one the ladder already recorded. The bad one is that an omission of this kind is completely invisible from inside. A statistic computed over the wrong column of a table renders perfectly, has a plausible value, and is checked by nothing — which is the same shape as the three stable wrong measurements this ladder found while it was being written, and is the reason the debt was written down rather than left as an intention.
Counting by the clock
The first statistic to redo is the one the ladder is built on: how often each size of step occurs.
The disagreements are between three and seven percentage points, which is not enormous and is not nothing. The tempting next move is to claim a direction — that long notes are approached by step, that phrase endings are conjunct, and that counting by time therefore makes a melody look smoother than counting by note does. That is wrong, and the way it is wrong is the same mistake this essay finds in the streaming figure four sections below.
Summing the steps of two semitones or fewer gives the conjunct fraction of each tune under both weightings:
| by count | by time | |
|---|---|---|
| Ode to Joy | 100.0% | 100.0% |
| Twinkle | 90.2% | 87.0% |
| Frère Jacques | 64.5% | 60.0% |
Time-weighting makes these tunes look less conjunct, not more, on the two of the three where the number can move at all. Ode to Joy cannot move: every one of its intervals is already two semitones or fewer, so it is 100 per cent conjunct under any weighting and tests nothing. On the other two the leaps gain — Twinkle’s fourth and fifth both rise, by 1.9 and 1.4 points, and Frère Jacques’ minor third rises by 3.4.
The reason is the direction along the table, and it is exactly the confusion this essay was written to catch. The weighting assigns each interval the duration of the note it leaves. A long note at the end of a phrase is therefore credited to the interval departing from it — which is the jump back up to the start of the next phrase, not the step that arrived at the cadence. The reasoning about approach is about the note arrived at; the measure is about the note left. They are off by one along the tune, in the same sense and for the same reason as the streaming bug below.
There is an obvious repair available, which is to weight each interval by the note it arrives at instead — the weighting the “approached by step” reasoning actually describes. Running all three weightings side by side:
| conjunct fraction | by count | by the note left | by the note arrived at | by the mean of the two |
|---|---|---|---|---|
| Ode to Joy | 100.0% | 100.0% | 100.0% | 100.0% |
| Twinkle | 90.2% | 87.0% | 91.5% | 89.2% |
| Frère Jacques | 64.5% | 60.0% | 59.7% | 59.8% |
The repair does not repair it. Under the arrival weighting Twinkle does become more conjunct, by 1.3 points, exactly as the reasoning predicts — and Frère Jacques becomes less conjunct, by 4.8, which the reasoning forbids. Two tunes, two directions, under the weighting chosen to produce one direction. Frère Jacques’ long notes are at the ends of its short phrases and the note after each of them begins a new phrase a fourth away, so both of its neighbours are leaps and no choice of which side to credit can make the tune look smoother.
So the honest statement is the one without a direction in it. The two histograms are measurements of two different things, they differ by several points, and which one an argument wants depends on whether the argument is about events or about the sound. What cannot be said from three tunes is which way the difference goes in general, because on these three it goes both ways under every weighting tried, and one of the three is degenerate.
The contour, which moves a great deal
The second statistic is the one the third rung is entirely about: the sign sequence.
A contour is normally taken over the notes in order. A listener does not receive notes in order at a constant rate; they receive them in time, and the amount of time a given pitch is present is the duration of the note. So there are two contours available and they are not the same object.
Forty-four of a hundred and one is a big number and it needs the right reading. The clock-sampled contour has a run of equal signs wherever a long note is held, which is a different object from the shape a listener keeps, because a held pitch sampled twice produces no change; so the disagreements are concentrated at exactly the notes that carry the rhythm, and they are mostly of the form “a step, by note” against “no change, then a step, by clock”.
That is worth stating as a general property rather than a curiosity. Sampling by clock inserts repetitions wherever the music slows down. A contour taken that way is therefore partly a rhythm profile, which is either the intended measurement or a contamination, depending on the question.
The nine-way class surviving all three is the reassuring half, and it is the same finding the shape rung reached under four other transformations: whatever contour is measuring, it is coarse enough not to care. The census of a quarter of a million sequences that produced the arch result is a census over note-indexed contours, and the result would survive being redone the other way because it is a statement about classes.
There is a third contour available and it is worth naming even though nothing here computes it. A listener does not sample at a constant rate either: attention is not uniform in time, and what is retained of a passage is weighted toward its boundaries. A contour weighted by attention would differ from both of the two above, and there is no principled way to build one from a score.
The figure that did use the durations, and used the wrong one
There is exactly one place in the ladder where the second column was read, and it is the first rung’s headline figure: whether an interval holds together as one stream depends on how fast the notes are coming, and how fast they are coming is a duration.
The gap between the onset of note i and the onset of note i + 1 is the duration of note i — the note being left. The figure was reading the duration of note i + 1, the note being arrived at.
That is an off-by-one along the tune. It is wrong on every interval whose two notes have different lengths, which is seven of Ode to Joy’s twenty-nine, eleven of Twinkle’s forty-one and ten of Frère Jacques’ thirty-one.
The verdict moves on zero of the hundred and one intervals, and the reason it moves on none is the same reason the first rung’s conclusion holds: these tunes are made almost entirely of steps, and a step of one or two semitones is far below the coherence boundary at every rate a tune uses. The bug is real, it has been fixed where it was rather than worked around here, and its effect is nil — which is a statement about the tunes and not about the code.
It is worth saying what would have been needed to make it visible. The boundary rises steeply with the repetition time, from about 4.4 semitones at sixty milliseconds to 14.5 at a hundred and sixty; a tune with wide leaps whose notes alternate between very short and very long would put intervals on both sides of it, and the two readings would then disagree about whether the line splits. Nothing in this collection’s corpus does that. A trill against a held note does, and that is a texture rather than a melody.
Three tones inside a small span are heard as one line and the same three with one displaced by an octave split into two — so where a tune’s leaps are decides whether it is one stream, and a leap onto a long note is a different proposition from a leap onto a short one.
The general lesson is worth extracting, because this collection will hit it again. A quantity that a model reads from a table has a direction along the table, and an off-by-one along that direction is not a type error. It produces numbers of the right magnitude in the right units, and the only things that catch it are a symmetry check or a case where the two readings disagree loudly. Here there was neither: the tunes are too smooth to disagree and the quantity has no symmetry to violate. It was found by writing a second function that computes both readings and prints the difference, which is now kept as the check rather than deleted.
What the null models still do not have
The other half of the ladder is the walk, and the walk has no time in it at all — not the wrong time, none.
Adding durations to the walk would not be hard, and the reason not to is worth stating: the walk exists to be the dullest thing that could produce the observation, and every parameter added to it weakens that. A walk with a duration distribution has two distributions fitted to the data instead of one, and the argument that a bounded walk reproduces post-skip reversal gets correspondingly less impressive.
But the corpus statistics the walk is compared against are themselves note-indexed, so the comparison is at least consistent. The debt this leaves is not the model; it is that nobody knows whether the published reversal figures are note-weighted or time-weighted, because no paper says, and on these three tunes the difference between the two is several points.
And a bar of eight with a weight on each position is what a metrical reading supplies: a note on a strong beat is heard as more important than one on a weak beat regardless of its length, which is a third weighting the distributions here do not have.
Read as a rate rather than as a sequence, the same steps sit far below the boundary at which a succession becomes a texture — so nothing in this essay is near the region where durations stop being durations.
Which computation produced the numbers
The time-weighted histogram assigns each interval the duration of the note it leaves and divides by the total time of all the intervals — which is the whole tune minus its last note. The by-count histogram divides by the number of intervals. Both are computed from the same list of pairs in the same function, so the two columns cannot drift apart.
The three-weighting table is the same sum with the index shifted: the note left is row i, the note arrived at is row i + 1, and the mean is the average of the two inter-onset intervals. Writing all three was the point rather than choosing between them. The off-by-one this essay found in the streaming figure was found the same way — by computing both readings and printing the difference — and the conjunctness claim was wrong for want of the same two lines. A quantity indexed along a sequence should be computed both ways by default and the difference reported, because the cost of doing so is one line and the cost of not doing so is a number that renders correctly and means something else.
The clock-sampled contour takes as many samples as the tune has notes, at equal intervals over the tune’s whole duration, and reads the pitch sounding at each. That choice of sample count is what makes the two sequences the same length and therefore comparable position by position.
It was previously recorded here that sampling more finely changes the count of disagreements and not their location. That is not something this function can be asked. Above one sample per note it resamples the note-indexed contour as well, to keep the two sequences the same length, so a denser comparison is between two resamplings rather than between a note contour and a clock contour — the disagreement fraction duly falls, from 44 per cent of positions at one sample a note to about 16 at eight, and the fall is a property of the resampling and not of the tunes. Testing the claim properly needs a different function, one that maps each differing sample back to the note sounding there and compares the sets of notes implicated. That is not written, and the claim is withdrawn rather than restated.
The streaming comparison runs both readings side by side and reports the number of intervals whose tone repetition time differs and the number whose verdict differs. The second is zero on all three tunes at 120 beats a minute, and it stays zero at 60 and at 200.
The tempo of 120 beats a minute is a stated default and every duration in seconds scales with it. The step histogram does not depend on it at all, because it is a ratio of times.
What the picture cannot show
Three tunes is not a corpus, and this essay’s numbers are less robust than the ladder’s earlier ones rather than more, because a time weighting is dominated by a handful of long notes and there are perhaps six of them in the whole collection. Every percentage here could move several points on a fourth tune — and the section on conjunctness above shows the corpus is not merely small but inconsistent: the sign of the effect differs between the two tunes on which it can be measured at all. A quantity whose direction is not settled by the whole corpus cannot be reported as a tendency, and the honest use of these figures is as a demonstration that the two weightings differ rather than as an estimate of how.
The stored durations are notated, not performed. A minim in the table is exactly twice a crotchet, and no performance has ever done that — the deviations from the grid are the groove and they are of the order of tens of milliseconds, which is comparable to the effects being measured here at fast tempi. A time-weighted statistic taken from a score is a statistic about a score.
There are no rests. All three tunes are stored as continuous runs of notes, so a note’s duration and the gap to the next onset are the same number. In real music they are not, and the distinction matters for exactly the boundary question the phrase ladder is about.
The clock-sampled contour is one of many. Sampling at the note rate is a choice; sampling at a fixed number of milliseconds is another, and the psychological present has a width that would be a third and better-motivated one. The figure uses the first because it is the one that produces two sequences of equal length, which is what makes them comparable at all.
And nothing here weights by loudness or by metrical position, both of which are at least as good candidates for “how much this note counts” as duration is. Duration was chosen because it was the number already in the table.
The ladder from here
This rung paid the first of the three debts the ladder recorded. The next pays the second: contour survives every transformation because it is what a listener retains, and the compression the census measured is the same quantity as the memory load — so the question of what part of a tune is kept can be asked as an information count rather than as an intuition.
Part 6 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.
The objects named here
The third way in, after the field and the series: the things themselves, and every essay that touches each one.
ContourDurationInter-onset intervalMelodic intervalNull modelQuantisationStreamingTemporal coherence
- The leap that pays itself back contour, melodic interval, null model
- A note lasts until the next one starts duration, inter-onset interval
- A scale is committed to how long its instrument rings melodic interval, null model
- A voice is a stream, and the ear decides which streaming, temporal coherence
- The ear builds objects, and sometimes offers a choice streaming, temporal coherence
- The smoothness is in the skips melodic interval, null model