The alternation a key-finder cannot follow
Assumes: Two keys at once · How much evidence a modulation needs
The previous rung found that a key-finder cannot report two keys and does not report uncertainty either: asked about a passage in C and G simultaneously it names G at a correlation of 0.961, which is higher than the same progression in C alone. It ended by naming a rung it had pointed at and not taken — the other case, in which two keys alternate rather than sound together — and by saying exactly what was missing.
Not the machinery. The material: a passage whose alternation rate can be varied while everything else is held still, which is a construction rather than a piece — a thing this collection has built before, for the same reason: a variable cannot be varied inside a piece somebody else wrote.
The construction
Four bars of I–IV–V–I in one key, then the same four bars transposed into a key a fifth away, then back. That is the whole passage, and the one thing that varies is how many bars each block holds for.
Everything else is held. The chords are the same chords, in the same order, with the same durations. The two keys are the same distance apart at every rate. The progression is a complete cadential unit in each key, so each block is a self-contained fragment rather than a slice of an interleaving — a detail that turned out to matter: the first version of this construction indexed the progression globally, so the two keys ran through each other rather than alternating, and what it measured was interleaving.
The key-finder is unchanged from the ladder’s fourth rung: a weighted pitch-class histogram over a window of recent bars, correlated against twenty-four rotated probe-tone profiles, best first.
The rate below which nothing happens
The first number is the sharp one.
At a block of two bars the second key is never named at all. Not named late, not named weakly, not named as a related key: the entire passage — twenty-four bars, half of them in one key and half in the other — is read as a single key from beginning to end, at a window of four bars and at a window of eight.
At a window of three it is not quite true, and the exception is worth having because it is the rule’s own arithmetic showing through. A three-bar window over two-bar blocks spends most of its span inside one block, so it does resolve the second key — five times in twenty-four bars, at 77 per cent aligned — where the four-bar window, which always straddles a join, reports one key for the whole passage. The dead zone is a relation between the window and the block, not a property of two-bar blocks.
That is the previous rung’s claim, and this rung’s contribution is to say where it stops being true. At three bars the second key appears, at every window, and the boundary is between two and three for the two windows that straddle a two-bar block.
The reason is in the histogram rather than in the window. A two-bar block of a I–IV–V–I is its first two chords, I and IV, and I and IV of one key are also V and I of the key a fifth below — so a two-bar fragment of C and a two-bar fragment of G have no note in either that distinguishes them. The alternation is invisible not because it is too fast for the window but because the fragments are too short to be in a key at all.
Which means the previous rung’s finding was about the fragments and not about the rate, and the thing that was hidden was hidden by the progression rather than by the algorithm. That is a correction to a claim an earlier essay here published, and it is the kind that only appears when somebody varies the parameter.
Right, and late by half the window
The second number is the one the fourth rung set up.
How much evidence a modulation needs measured the detection lag on a single modulation: the same change of key is found two chords later with a window of eight than with a window of three, because a window carries the old key’s notes along with it. That is a measurement on one event.
Alternation makes it a measurement on a signal, and the answer is the same answer with a shape.
The lag is about half the window. At a window of eight bars the reading is best aligned with the truth when shifted back three bars; at four bars the shift is zero to two; at three, zero. That is what a rectangular window does to any changing signal — its centre of mass is half its length behind its leading edge — and it means a key-finder is not merely slow but predictably slow, by an amount its own parameter fixes. The key plan is the form on a scale of dozens of bars, where three bars of lag is nothing; on a scale of four, it is most of the unit.
The consequence for the tracking score is large. At a window of eight and a block of six bars, the raw agreement is 44 per cent — worse than chance. Shift the reading back three bars and it is 87. The finder is not wrong about that passage; it is right about the passage three bars ago, which is a different kind of failure and one that no score computed bar by bar can distinguish from being wrong. The circle is a circle and the map is not: here, too, the thing that looks like an error is a coordinate problem.
The rule, in one line
Put the three together and the ladder has a rule where it had an anecdote.
A moving key-finder with a window of W bars follows an alternation whose blocks are 2W bars or longer, at better than ninety per cent, three bars late at W = 8. Between W and 2W it is between seventy and ninety. Below W it is near chance. And below a block of three bars it reports one key whatever W is, because the fragments are not in a key.
The dead zone, and what a listener would do with it
The two-bar result deserves one more turn, because it is the only place in the sweep where the failure is total rather than graded.
A two-bar fragment of I–IV in C is the notes C, E, G, F, A. A two-bar fragment of the same progression in G is G, B, D, C, E. Between them they use seven of the twelve, which is a diatonic collection — and a diatonic collection is the object the key-finder is best at and the object that is ambiguous between two keys by construction. Every window that spans a whole cycle sees exactly that collection.
So the finder’s silence is not a failure of resolution. It is a correct report about an object that has no answer: the passage, integrated over any window longer than one block, is a diatonic set and nothing more. The information that distinguishes the keys is entirely in the order, and the order is the first thing thrown away.
A listener plainly does better than that, and the reason is not a longer window. It is that a listener hears the cadences — the V–I at the end of each block — as events rather than as pitch-class counts, and an event has a position in time. A degree is where it goes next is the same observation made about a scale rather than about a key, and it is the observation this whole ladder’s machinery cannot represent.
What it says about bitonality
The previous rung’s real question was whether a listener — or a model of one — can tell a bitonality from a fast alternation, and the answer this construction gives is unexpectedly clean.
It cannot, and neither can the pair model. A window that spans a whole cycle of the alternation contains exactly the pitch classes a simultaneity would contain, because a histogram has no order in it. So at a block of two bars with a window of eight, the histogram of the alternation and the histogram of the bitonality are the same object, and any method that reads only the histogram must give the same answer to both.
That is not a defect of the pair model. It is a statement about what a histogram is: the distinction between two keys at once and two keys in quick succession is a fact about order, and every model in this ladder discards order in its first step. A model that could tell them apart would have to be a different kind of model, and naming what kind is the ladder’s next job.
The sweep over key distance, which says the opposite
The fifth was chosen because it is the closest relation there is and therefore the hardest case, and the obvious expectation is that two keys further apart would separate at a shorter block. Running the same construction against all eleven other major keys says otherwise, twice.
| second key | steps round the circle | shared notes | first named at a block of (window 4) | aligned tracking, block 8 |
|---|---|---|---|---|
| G | 1 | 6 | 1 | 87.5% |
| F | 1 | 6 | 2 | 86.7% |
| D | 2 | 5 | 1 | 78.7% |
| B♭ | 2 | 5 | 3 | 78.7% |
| E, A♭ | 4 | 3 | 3 | 89.4% |
| E♭, A | 3 | 4 | 3 | 89.4% |
| C♯, B | 5 | 2 | 3 | 85.1%, 83.0% |
| F♯ | 6 | 2 | 3 | 89.4% |
The tritone does not separate at a shorter block. It separates at three, which is where nine of the eleven separate, and the two that separate sooner are the two nearest keys. And the tracking at a well-separated block does not improve with distance at all: it runs between 78.7 and 89.4 per cent with no trend in it, and the worst two are at two steps round the circle rather than at one.
The reason those two are worst is the useful part, and it is visible in what the finder actually names. Alternating C with D, it reports D twenty times, C eighteen — and G eight times, which is a key the passage never enters. Alternating C with B♭ it reports F seven times, likewise. A window straddling a join sees a blurred histogram, and a blurred histogram is not a bad reading of either key; it is a good reading of the key halfway between them on the circle of fifths.
That is why the tritone comes out best. C and F♯ are antipodal, so there is no key between them for the blur to fall into — the mixture is equally far from everything and the finder reverts to whichever block dominates the window. Its errors are two bars of B minor and two of F minor, which are near neither key and are read as noise rather than as an answer.
So the difficulty of an alternation is not its key distance. It is whether a third key sits between the two, and that is a property of two steps round the circle rather than of one or six. The fifth is not the hardest case; the whole-tone pair is, and it is hardest for a reason the previous rung’s framing had no place for.
Which computation produced the numbers
The passage is alternatingPassage: a roman-numeral progression, transposed by a stated number of steps round the circle of fifths, in blocks of a stated length, with each block restarting its key’s progression from the beginning.
The reading is keyReading, which is the fourth rung’s function unchanged — a window of recent bars, weighted by beats, correlated with Krumhansl and Schmuckler’s twenty-four profiles.
The tracking score is the share of bars whose reading names the major key actually sounding in that bar. The aligned score is the same thing maximised over a shift of the reading, and the shift that maximises it is reported as the lag. Searching for the best shift rather than assuming it is what turns “the finder is wrong here” into “the finder is late by this much”, and the search is bounded at twice the block length so that it cannot find a spurious alignment a whole cycle away.
Twelve blocks, so twenty-four to a hundred and ninety-two bars depending on the rate. The scores are over the whole passage including the first window’s worth of bars, where the finder has less history than its window asks for — which drags every score down by a few points and does so equally at every rate.
Whose music, and when
Rapid alternation between two keys is not a common device and where it appears it is usually a texture rather than a harmony: the ostinato bitonality of Stravinsky and Milhaud, in which one layer stays in one key while another stays in a second, is the simultaneous case; the alternating case is nearer to the sequential harmony of nineteenth-century development sections, where two-bar or four-bar units move by fifths or thirds.
The rule above says something about that repertoire which is worth stating as a prediction rather than a finding. A development section that moves its unit every two bars is, on this measurement, in no key at all as far as a histogram model is concerned — and that is a fair description of what a development section sounds like. One that moves every eight bars is in a succession of keys, three bars late.
Whether a listener’s own lag is anything like a rectangular window’s is not a question this collection can answer. What it can say is that the model’s lag is a property of the model’s window, so any listener who integrates over a longer span is later, and any listener who does not integrate at all is not doing this at all.
What the picture cannot show
The two keys are a fifth apart in every figure, and the section above runs the sweep that the rest of the essay assumed. A fifth is the closest relation there is and it is not the hardest case; the pair two steps round the circle is, and the tritone is the easiest. What the figures show is therefore a middling case rather than a worst one.
The progression is one progression. I–IV–V–I is maximally tonal and defines a key in as few chords as anything can. A progression that wandered would push every number the other way, and the two-bar result — that a fragment is not in a key — is a fact about this fragment.
The alignment search can flatter the model. Maximising over a shift is the right way to separate lateness from error, and it also guarantees the aligned score is never below the raw one. The lag values are the honest part of it; the aligned scores are upper bounds.
And nothing here is a listener. Category boundaries barely move with expectation and a key is a much larger object than a category, so whatever a listener does with an alternation, there is no reason to think it is a rectangular window over a histogram. The rule above is a rule about a published algorithm, and the algorithm’s value is that it is explicit.
Where this ladder goes next
Seven rungs. Keys are neighbours and the map is computed; the key plan is the form; three distance measures disagree; a modulation takes a measurable number of chords to detect; the circle is a circle and the map is not; two keys at once are not in the vocabulary; and now, two keys in alternation are followed above a rate the window fixes and are invisible below a block length the progression fixes.
The rung after it is the one the last section names, and it is the first in this ladder that would need a different kind of model. Every method here begins by throwing order away. A key-finder that kept it — one that scored a sequence of chords against a grammar rather than a bag of pitch classes against a profile — would be able in principle to tell an alternation from a simultaneity, and the interesting question is not whether it could but how much it would cost: the histogram model has twenty-four hypotheses and a sequence model has as many as its grammar admits. That trade, between what a model can distinguish and how many hypotheses it must carry, is the same one the pair model paid when it went from twenty-four candidates to three hundred.
Part 7 of 21
One essay in the series on Key-relations. 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.
AmbiguityBitonalityKey-findingKrumhansl schmucklerModulationPitch-class profileTonicWindow
- A tonic bought with the function key-finding, pitch-class profile, tonic
- How much of the reading arrives late ambiguity, key-finding, modulation
- The cadence as evidence key-finding, krumhansl schmuckler, pitch-class profile
- The margin the dynamic program already had ambiguity, key-finding, modulation
- Two cues meet in a corner key-finding, pitch-class profile, tonic
- A modulation and a borrowing are one number apart key-finding, modulation