Harmony and voice leading

The key-finder with no tonic

Thirteen essays of key-finding have run over twelve major collections and not twenty-four keys, so a passage in A minor is read as C. Adding the missing twelve costs almost nothing and fixes almost nothing — because the model has no tonic in it at all, and below three raised sevenths in a passage the extra states are worth exactly zero.

Assumes: The bars a key is made of · Keys are neighbours, and the map is computed

Keys are neighbours opens this ladder with a map of twenty-four keys, twelve major and twelve minor, and every rung since has drawn distances on it. The key-finder underneath them all has twelve.

It is one line. The model’s states are a key and a scale degree, and the degrees come from the major scale — so a state is a major key with a chord in it, and there is nowhere in the state space for a minor key to be. A passage in A minor is read as C major sitting on its sixth degree, which is the right collection of notes under a name no analysis would use.

That has been true since how much evidence a modulation needs and no figure has ever said so, because nearly every scheme the ladder reads is major and a defect that never fires is a defect nobody sees.

The twelve keys a key-finder has never had. Every scheme the key-finder reads, read twice: over the twelve major collections the model has always used, and over twenty-four with the harmonic minor added. The pale bar is the first and the dark one the second. On 5 of the 6 the extra twelve states change nothing a reader would see — the largest loss of certainty is 3.2 per cent, on the rondo — and no bar of any of them is renamed. The exception is the ostinato, every bar of which the twelve-collection model calls E♭ and the twenty-four-collection model calls C minor — the same seven notes, the right name. So the missing states were not costing the key-finder its answers. What they were costing is the ability to say which of a collection's seven degrees is home, and that is a different repair.
Fig. 1 Every scheme read so far, read over twelve major collections and again over twenty-four with the harmonic minor added. Five of the six change by under four per cent and by no name at all.

Adding the missing twelve

The repair is a dimension rather than a rewrite. States become a key, a collection and a degree; the emission is unchanged; the transitions are unchanged; changing collection costs what changing key costs. The state space doubles from eighty-four to one hundred and sixty-eight and everything else stays where it was.

The result on the ladder’s own material is close to nothing.

twelve collections twenty-four renamed
thirty-two-bar song 3.90 3.89 none
rondo 3.26 3.16 none
twelve-bar blues 3.80 3.78 none
verse and chorus 4.16 4.16 none
two eight-bar phrases 2.99 2.99 none
four-bar ostinato 0.00 0.00 every bar

Five of the six lose between nothing and 3.2 per cent of their mean margin and not one bar of any of them is renamed. The twelve missing collections were not costing this ladder its answers.

The sixth is the ostinato — four bars of a minor tonic chord, eight times over — and it is renamed at every bar, from E flat to C minor. That is the defect firing exactly once in the whole corpus of schemes, on the one scheme written in a minor key, and the two names are the same seven notes.

The twelve keys a key-finder has never had. Every scheme the key-finder reads, read twice: over the twelve major collections the model has always used, and over twenty-four with the harmonic minor added. The pale bar is the first and the dark one the second. On 1 of the 2 the extra twelve states change nothing a reader would see — the largest loss of certainty is 3.2 per cent, on the rondo — and no bar of any of them is renamed. The exception is the ostinato, every bar of which the twelve-collection model calls E♭ and the twenty-four-collection model calls C minor — the same seven notes, the right name. So the missing states were not costing the key-finder its answers. What they were costing is the ability to say which of a collection's seven degrees is home, and that is a different repair.
Fig. 2 The one scheme that is renamed beside the one that loses most certainty. The ostinato’s margin is zero either way — a single chord repeated has nothing to distinguish any reading of it — so what changed is the label and not the model’s confidence in it.

Why the extra states cost anything at all

The 3.2 per cent is worth a sentence, because it is a loss rather than a gain and that direction is the informative one.

A margin is the gap between the best reading and the best rival. Every state the model gains is a new rival, and a minor collection is not a distant one: C major and A harmonic minor share six of their seven pitch classes. So admitting the minor collections admits, beside each major key, a near-duplicate of it — and the gap between the winner and the field narrows.

More states therefore buy accuracy at the price of confidence, which is the trade a key-finder that keeps the order priced in the other direction when it added transitions. There the extra structure bought the ability to tell an alternation from a simultaneity and cost a factor in hypotheses. Here the extra states buy a name and cost a few per cent of a margin.

And the margins the ladder has published are therefore all slightly too large, by an amount that depends on how minor-inflected the material is: 0.2 per cent on the thirty-two-bar form, 3.2 on the rondo, and everything the collection has never tried.

The passage where it should matter, and it does not

The right test is not a major scheme with twelve extra states bolted on. It is a passage that is unambiguously in a minor key, where the twelve-collection model must be wrong and the twenty-four-collection one must be right.

Build one: eight turns of i–iv–V–i in A minor, thirty-two bars, one chord a bar. The twelve-collection model reads it as C major throughout, which is the predicted failure. The twenty-four-collection model reads it as A minor throughout, which is the predicted fix.

Then take the raised seventh out.

How much leading tone a minor key needs before a model can see it. A 32-bar passage in A minor — 8 turns of i–iv–?–i — with the dominant-function bar taking the raised seventh in a rising share of them. The pale line is the mean margin of a reading over twelve major collections and the dark one of a reading over twenty-four. At no raised sevenths the two are identical to the bit, 3.38 against 3.38: a natural minor and its relative major are the same seven pitch classes and no number of collections can separate them. The minor key is first named at 3 of 8 raised and named at every bar from 6. And the confidence sags in between, to 1.72 at 4 of 8 — the extra states cost most exactly where the two readings are genuinely balanced, which is where a listener would also be undecided.
Fig. 3 The same thirty-two bars in A minor with the dominant bar taking a raised seventh in a rising share of the eight turns. At no raised sevenths the two models are identical to the last bit; the minor key is first named at three of eight and named everywhere at six.

Replace the V with a v — a minor triad on the fifth degree, which is what the natural minor gives — and the passage is still in A minor by every account a theorist would recognise. The twenty-four-collection model reads it as C major, and its mean margin is 3.38 bits, identical to the twelve-collection model’s, to the last bit the arithmetic carries.

The extra twelve states are worth exactly nothing there, and they cannot be worth anything, because a natural minor scale and its relative major are the same seven pitch classes. There is no observation that separates them. The model’s minor states are not wrong; they are unreachable.

Which is a fact about the model rather than about minor keys

That result generalises further than the sweep shows, and the generalisation is the finding this essay is really about.

A state in this model is a collection and a degree. Its emission compares a bar’s notes against the triad on that degree, and inside one diatonic collection the overlap between the triads on two degrees depends only on the difference between the degrees — a third apart share two notes, a fifth apart share one, a second apart share none, whichever pair of degrees they are. The transitions were already relative: the root-motion weights are indexed by how far the root moved, not by where it moved from.

So nothing anywhere in the model prefers degree zero. Rotate a passage’s degrees within its collection and every emission along the corresponding path is unchanged and every transition is unchanged, so the score is the same number.

The model has no tonic. What it finds is which seven-note collection the notes belong to, and it announces that collection by the name of the major key that shares it. Calling the answer a key is a convention of the printout.

That is a real property and not a bug to be patched, and this collection has said the same thing about a different object: nothing in the census knows which note is home makes exactly this point about the diatonic set’s interval content, and the same seven started later makes it about the modes.

Which chords of a key fit the key. The seven triads of the minor scale ranked by how well their notes fit the Krumhansl–Kessler probe-tone profile for that mode, taking each chord's fit as the mean of its three notes' ratings. The tonic is first, at 5.49; the second-placed chord is VI at 5.23, which is 95 per cent of it.
Fig. 4 The minor scale’s seven triads ranked by how well their notes fit the measured probe-tone profile for a minor key. The tonic is first at 5.49 and the submediant second at 5.23 — ninety-five per cent of it — which is how little a profile has to separate a minor tonic from the chord a semitone-and-a-tone below it.

The ladder already has a key-finder that can do this

There are two key-finders on this anchor and they have never been compared, because the second replaced the first without anybody saying so.

The first is a correlation: build a histogram of the pitch classes in a window and correlate it against twenty-four rotated probe-tone profiles measured on listeners. It is what how much evidence a modulation needs uses, and what two keys at once and the alternation a key-finder cannot follow run over their sweeps.

The second is the dynamic program, which arrived at a key-finder that keeps the order to answer an objection the first could not — a histogram throws the order away and cannot tell an alternation from a simultaneity — and every rung since has used it.

The first has twenty-four keys and a tonic. The second has twelve collections and none. That is not a difference in power; it is a difference in what the two think a key is, and the ladder has been quoting them side by side for six rungs.

The correlation gets the case the dynamic program cannot. Give it the histogram of i–iv–v in A minor — the natural-minor form, no raised seventh anywhere — and it names A minor at a correlation of 0.853, with E minor second at 0.647 and C major only third at 0.615. The same notes that leave the dynamic program with nothing to go on leave the correlation with a comfortable margin.

The reason is the shape of a profile. A probe-tone profile is a measured rating for each of the twelve pitch classes, and it is not flat: the tonic is rated highest, the fifth and third next, and the notes outside the scale lowest. Rotating it to A and rotating it to C give two different vectors over the same seven notes, and a histogram in which A is common and B is rare correlates better with the first.

The unevenness is the tonic. The dynamic program’s emission is a set overlap — a chord’s notes against a triad’s, shared over union — and a set has no shape. What was lost when the model gained its transitions was every gradation inside the collection.

The cost is small in the correlation’s own terms. Under the profiles, giving A 15.8 per cent of a passage’s total note weight is enough for the collection to be named A minor rather than C major, against 14.3 per cent for C to be named C major — so the relative minor is very nearly as cheap a tonic as the relative major, which is why the correlation finds it so easily.

Why nobody noticed for six rungs

A defect that fires once is a defect nobody sees, and it is worth saying exactly where the once was.

Of the six schemes the ladder reads, one is written in a minor key throughout — the ostinato — and one has a minor episode, the rondo’s third section. The ostinato exists as a control: it is the case every measure of musical structure in this collection has to be able to report as structureless, so nobody reads its key names. The rondo’s episode is eight bars out of forty, and at the key cost the ladder tunes to, the model does not modulate on the rondo at all.

So the twelve missing collections have never produced a wrong answer that anybody was looking at. They produced E flat where C minor was meant, once, on a figure whose subject is that its margin is zero.

That is the general shape of the failure this collection keeps finding, and it is worth naming as a shape: a model with an unstated restriction, material that never tests it, and a gate that reads every number for consistency without ever asking whether the number is of the right thing.

What the raised seventh is actually doing

Once the model is understood as a collection-finder, the sweep reads differently. The raised seventh is not a stylistic detail that helps a minor reading along; it is the only observation in the whole apparatus that can distinguish a minor key from its relative major, because it is the only note that is in one collection and not the other.

A harmonic minor scale on A shares six of seven pitch classes with C major. The seventh is G sharp, and it appears in exactly two of the seven triads — the dominant and the leading-note chord. Every other bar of a minor passage is evidence for the relative major just as strongly as for the minor key.

So the threshold is a threshold in the count of raised sevenths and not in their share. Over eight turns the minor key is first named at three of them; over twelve turns, still at three.

How much leading tone a minor key needs before a model can see it. A 48-bar passage in A minor — 12 turns of i–iv–?–i — with the dominant-function bar taking the raised seventh in a rising share of them. The pale line is the mean margin of a reading over twelve major collections and the dark one of a reading over twenty-four. At no raised sevenths the two are identical to the bit, 3.78 against 3.78: a natural minor and its relative major are the same seven pitch classes and no number of collections can separate them. The minor key is first named at 3 of 12 raised and named at every bar from 11. And the confidence sags in between, to 2.55 at 5 of 12 — the extra states cost most exactly where the two readings are genuinely balanced, which is where a listener would also be undecided.
Fig. 5 The same construction lengthened to forty-eight bars and twelve turns. The threshold is still three raised sevenths, not a quarter of them, so what the model needs is a fixed amount of the one distinguishing observation rather than a proportion of the passage.

Three bars carrying G sharp are enough to overturn twenty-nine bars that are not. That is a strong statement about how little evidence a mode is, and it is the mirror of how much evidence a modulation needs, which counted bars for a key change and found the number in the same range.

And the certainty sags in the middle. At four raised sevenths of eight the mean margin falls to 1.72 bits against the twelve-collection model’s 3.60 — a loss of more than half — because that is where the two readings are genuinely balanced. The extra states cost most precisely where a listener would also be undecided, which is the behaviour a confidence measure ought to have and the ladder has not previously been able to show.

Which computation produced the numbers

The general dynamic program is the ladder’s own with two dimensions added: a collection index beside the key, and a per-bar attention weight that the bars a key is made of uses and this essay leaves at one throughout. At a single collection and full attention it reproduces the published margins bar for bar, and every figure here asserts that it does before drawing anything.

The minor collection is the harmonic minor. That is a choice and it is the choice the result is about: the natural minor is a rotation of the major scale and gives the model nothing, and the melodic minor differs from the major only in its third, which is a stronger cue than the seventh and would make the threshold lower. Sweeping the third as well as the seventh is one more parameter and it has not been run.

The key cost is 2.2, the value the ladder tunes to in a modulation and a borrowing are one number apart, so that the model is unwilling to change collection and the naming has to be earned.

The probe-tone figure is the ladder’s first rung and is a different instrument entirely — a correlation against measured listener ratings, which does have twenty-four profiles in it — and it is here to show that the two halves of this anchor have never used the same key model.

How sure the reading is, bar by bar. Every earlier essay reports one best reading. A dynamic program that finds a best path has, by construction, the best score into every state at every bar — so the gap between the best reading and the best reading in any other key is already computed and has never been printed. Here it is, in bits, for the rondo, ABACA. The mean margin is 3.26 bits and 0 of 40 bars are inside one bit of a rival reading, which is where a listener would be genuinely undecided. The reading itself names C; the margin says what that naming is worth, and at the weakest bar — bar 1, C over G — it is worth 1.80.
Fig. 6 The rondo’s margin bar by bar at the key cost used here, over the twelve major collections. Its middle episode is written in A minor and is read as C at every bar of it — the failure this essay is about, in the one place it has been drawn and not noticed.

Where the account stops

It cannot say what a tonic is. Adding a term that prefers degree zero would give the model a tonic, and there is no principled value for it: it would be a prior on which degree a passage rests on, and this collection has no count of that.

It cannot use a bass line. The strongest cue to a tonic is which note is in the bass at the cadence, and every bar here is a set of pitch classes with no register in it. A chord is a register is the collection’s account of what that discards.

It cannot hear the difference a listener hears. A minor key and its relative major do not sound alike, and the difference is not in the collection. It is in which chord the phrases end on, how long the tonic is held, and where the melody rests — none of which is a pitch-class histogram or a triad match.

And it cannot say the sweep’s passage is music. Eight identical turns of i–iv–V–i is a construction built to isolate one variable, and a real minor piece varies the dominant, borrows from the parallel major and cadences differently every time.

The seven chords of a key, by distance from home. Each triad of the harmonic minor scale placed at a radius equal to how far its voices must move from the tonic chord. The chords that feel closest to home are the ones that are closest, in the plain arithmetic sense.
Fig. 7 The chords of A harmonic minor placed by how far their voices must move from the tonic triad. The dominant is a major triad because of the raised seventh, and that raised seventh is the single pitch class this whole essay turns on.

Where this ladder goes next

Fourteen rungs in: a map of key distance under three metrics that disagree, a count of the evidence a modulation needs, two keys sounded together and two alternating, an ordered model beside a histogram, a tuned key cost, a margin at every bar, hindsight separated from what a listener could have, a memory, a measurement of which bars the answer sits in, and now the state space itself.

What is owed after this is the weighted emission, and it is a debt this collection can pay in full out of what it already holds rather than one waiting on a corpus. The dynamic program’s emission scores a bar by set overlap, which is why it has no tonic; the correlation scores a histogram against a measured profile, which is why it has one. Putting the profile inside the dynamic program is one substitution — score a bar’s notes against the profile rotated to each candidate key instead of against the triad on each degree — and it would give the ordered model the tonic the histogram model has had since the first rung.

The prediction is stateable and would falsify the substitution if wrong: the profile-weighted dynamic program should name A minor on the natural-minor passage above at every one of its thirty-two bars, where the triad-matching one names C major at all of them and cannot do otherwise. It should also lose margin on major material, because a graded emission separates fewer states than a binary one. If it does the first without the second, the profile is doing something other than what is claimed here.

Two smaller things go with it and neither needs a corpus either. The schemes are encoded as pitch-class sets with no bass, and the bass note at a cadence is the strongest tonic cue a listener has — the root an ear supplies is the collection’s account of where a root comes from and it is not in this model at all. And the minor collection here is the harmonic minor by a choice this essay makes and does not test; the melodic minor differs from the major in its third as well as its seventh, and a third is a stronger cue than a seventh, so the threshold of three would fall and the sweep does not say how far.

Part 14 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.

The objects named here

The third way in, after the field and the series: the things themselves, and every essay that touches each one.

Hidden markov modelKey-findingKey-relationsLeading toneModulationProbe-toneScale degreeTonic