Generator

Which chords of a key fit the key

The seven triads of the major 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.31; the second-placed chord is vi at 4.80, which is 90 per cent of it.
Which chords of a key fit the key. The seven triads of the major 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.31; the second-placed chord is vi at 4.80, which is 90 per cent of it.

Drawn above with its standard settings, which is almost never how an essay draws it: an essay states the numbers it is arguing about, so the figure a reader meets there is about that argument rather than about the drawing in general. Every option a placement passes is checked against the ones this function actually reads, because an option it does not read is silently ignored and the figure quietly draws what is above instead.

It makes a noise. 134 of its 134 placements carry sound, built from the same numbers as the drawing, offering these buttons: A scheme read with the bass cue off and a key change cheap: 36 per cent of degrees right, Alternating every eight, Alternating every two bars, Both keys at once, I – IV – V – I in C alone, I — fit 5.31, IV — fit 4.70, Rondo, ABACA, the roots in the bass: 60% read right with both cues at their strongest and 49 more.

Called by 24 essays

the blast radius of changing it

Five signals, computed separately, and no total. The five components of closure for 6 chord pairs. The first three are computed from the chords alone; the last two are properties of where the goal lands and how long it is held. There is no total column: the components are not commensurable and the ordering of these cadences depends on which is weighted.

What makes an ending an ending

Cadences are ranked. The authentic one is strong, the plagal weaker, the deceptive weaker still — and the solver here measured the quantity that ranking is usually explained by and found it says something else entirely. What survives is not a weaker version of the ranking but a different kind of object, with five components and no total.

form · Closure
The key plan is the shape. The key of a classical sonata-form movement against position in the movement, measured in steps along the chain of fifths from the home key. The positions are the proportions such a movement is described by rather than bar numbers from any one score. The furthest point is 4 steps out, sharing 3 of seven notes with home.

The key plan is the form

The large shape of a classical movement is not a shape at all, it is a journey — out to one key and back. Which key is not a matter of taste. Of the two keys that share six of their seven notes with home, only one introduces a note the home key does not use in any of its chords, and that note is the arriving key's own leading note. The departure is audible because of one accidental.

form · Key-relations
How surprising each chord is, in bits. Each step's information content, −log₂ of the probability the root-motion weights used here give it. a perfect cadence totals 6.4 bits over 3 steps; a deceptive cadence totals 7.3 bits over 3 steps; I – IV – V – vi totals 7.3 bits over 3 steps. The single most surprising move drawn is IV to V at 2.7 bits, which is 42 per cent of everything its passage spends. The eight weights are ordinal and stipulated rather than counted, so these are the numbers that ordering implies and not a measurement of any repertoire.

The chord that did not come

A deceptive cadence is described as a surprise, and the explanation offered is that the wrong chord arrived. Measured against the tonal hierarchy already in use, the wrong chord is the second best-fitting triad in the key — and two of its three voices do exactly what they would have done in the right one. The surprise is not statistical. It is one voice, and it is the bass.

harmony · Tonal-expectation
How many bars a key change takes to be heard. A twelve-bar progression that moves to G major at bar 6, read by the same correlation against all twenty-four profiles, with a window of 3, 4 and 8 bars. With 3 bars of history the new key is never the answer at all. With 4 bars of history the answer is G major from bar 7, one bar late, and it holds it from there. With 8 bars of history the answer is G major from bar 9, 3 bars late, and it holds it from there. The pivot bar is ambiguous by construction — it belongs to both keys, which is what makes it a pivot — so the lag is not a defect of the algorithm but a statement about how much evidence a key is.

How much evidence a modulation needs

Run a key-finder bar by bar over a progression that moves to the dominant at bar six. With four bars of history the answer becomes the new key at bar seven and holds. With three bars it never gets there at all, and reports E minor and B minor on the way. The window decides the lag as much as the music does.

perception · Key-relations
A model that cannot say two keys does not say it is unsure. I – IV – V – I played in C major and in a second major key at the same time, with the second key moved round the circle of fifths. For each separation: the correlation the standard key-finder gives its single best answer, and the correlation reached by the best PAIR of key profiles — a hypothesis the finder does not have. The pair recovers both keys that are sounding at every separation, 7 of 7. The single answer names neither of them at 4 of the 7, and its confidence does not fall when it is wrong: at four steps apart it reports E minor at r = 0.886, against 0.959 for the same progression in one key.

Two keys at once

Every key figure so far assumes one key is sounding, and the standard key-finder has no value it can return that means two. Play one progression in C and the same progression a major third away at the same time, and the model does not report uncertainty: it reports E minor, at a correlation of 0.886, against 0.959 for the same progression in one key. It is as confident as it ever is, and neither key it names is being played. Give it the missing hypothesis — pairs of key profiles rather than single ones — and it recovers both keys at every separation, all seven of seven.

harmony · Key-relations
How fast two keys can alternate before the finder stops following. The share of bars a moving key-finder names correctly, once its reading is shifted back by its own lag, against how many bars each key holds for. One line per window. Below a block of three bars the second key is never named at all — 2 of the sweep's readings report a single key for the whole passage — and above about twice the window the tracking is over ninety per cent. The lag itself is about half the window: 0 bars at a window of 3, 0 bars at a window of 4, 3 bars at a window of 8.

The alternation a key-finder cannot follow

Two keys sounding together are not in the key-finder's vocabulary, and an earlier essay ended by pointing at the other case and saying what was missing: a passage whose alternation rate can be varied while everything else is held still. Built, it gives a rule with three numbers in it — the second key is never named below a block of three bars, the tracking clears ninety per cent above twice the window, and the reading is late by half the window throughout.

harmony · Key-relations
The test a histogram cannot pass. Two passages built from the same two keys: one takes them in turn and the other sounds them together. Over a window long enough to hold both, their pitch-class histograms are 98.6 per cent alike, so they are very nearly the same object to a profile model — and it names two keys in both. The ordered model names up to four for the alternation and one for the simultaneity, because a simultaneity has no sequence in it that any single key's grammar will not fit.

A key-finder that keeps the order

Every key-finding model until now begins by throwing order away — a histogram over a window, correlated against twenty-four profiles — and the thing that most obviously declares a key is an ordered pair of chords. A model that keeps the order costs 84 states and 7,056 transitions against 24 hypotheses and none, and what it buys is the one test a histogram was said not to pass: two keys in turn and two keys at once have histograms 98 per cent alike, and are two different sequences.

harmony · Key-relations
Two passages, one note apart, and opposite cadences. Two passages that share eight bars drawn from the six pitch classes C major and G major have in common, and differ only in their last three bars: one cadences in C and one in G, and the single note that separates them is an F against an F sharp. The cadence evidence names C for the first and G for the second, by 9 to 3 and 6 to 4. The profile model names E minor for both, with correlations differing in the third decimal.

The cadence as evidence

Every model so far infers a key from a bag of notes, and the thing that most obviously declares a key is a cadence — an ordered pair of chords in which the order is the whole content. The essays on closure built a five-component cadence vector long before this and nobody has used it for this. Two passages differing in one note, one cadencing in C and one in G, get opposite answers from the ordered pairs and the same answer from the profile.

harmony · Progression
The one number the ordered key-finder was tuned on. For each rate of alternation between two keys, the cost of changing key at which the model stops hearing two keys and starts hearing borrowed chords in one. The threshold rises with the period — 0.95 at 1 bar, 0.95 at 2 bars, 0.95 at 4 bars, 2.00 at 8 bars, 3.50 at 16 bars — so the parameter and the rate trade off against each other exactly. The value tuned earlier, 2.2, sits above every threshold on this axis, which means its verdict about fast alternation was a consequence of the tuning rather than a finding about the music. Filled means the model names two keys; hollow means it names one and calls the rest borrowings.

A modulation and a borrowing are one number apart

The key-finder that keeps the order has one tuned parameter, and said so. Sweep it and the parameter turns out to be the whole verdict: below a threshold the model hears two keys alternating, above it one key with borrowed chords. The threshold rises with how slowly the keys alternate — and the value it chose sits above every threshold in range, so its finding about fast alternation was a consequence of the tuning.

scales · Key-relations
Two kinds of evidence, each measured against its own chance. Every key as a point: across, how many standard deviations its cadence count is above what the same bars resampled would give; up, the same for its pitch-class profile correlation. The winner on cadences is key C at 6.2 standard deviations and on profile C at 1.1, and they agree. Standard deviations above chance are the same unit whatever produced them, which is the commensuration this figure is for — and it costs something: it assumes the two chances are equally interesting, which is a weighting in disguise. The obvious null does not work at all for one of the two: shuffling the bars leaves a pitch-class histogram exactly as it was, so its spread is zero and every key scores nothing against it.

A count and a correlation

Cadence evidence is a count of ordered pairs and profile evidence is a correlation with a template, and the cadence essay refused to total them because they are not in the same units. Score each against its own chance and they are — standard deviations above chance are the same unit whatever produced them. Then the trouble moves: the obvious null does nothing at all to one of the two, because shuffling the bars leaves a pitch-class histogram exactly as it was.

harmony · Progression
How surprising each chord is, in bits. Each step's information content, −log₂ of the probability the root-motion weights used here give it. a perfect cadence totals 6.4 bits over 3 steps; a deceptive cadence totals 7.3 bits over 3 steps; I – IV – V – vi totals 7.3 bits over 3 steps. The single most surprising move drawn is IV to V at 2.7 bits, which is 42 per cent of everything its passage spends. The eight weights are ordinal and stipulated rather than counted, so these are the numbers that ordering implies and not a measurement of any repertoire.

Surprise is a number

The chord that did not come was described rather than measured. Its measure is the information content of what did arrive, and a model of the probability has been to hand since the key-finding essays — eight root-motion weights, ordinal and stipulated. Reading them as a distribution prices a deceptive cadence at 2.71 bits against a perfect one's 1.85, and turns up the fact that the largest of the eight had never been read by anything.

harmony · Tonal-expectation
The passage built so the two statistics disagree. A body of chords diatonic to C major, of growing length, ended by a ii–V–I in G. The bag of notes says one key and the ordered pair says the other, which is the case the earlier figures never contained. The line is the cadence evidence for G, and under the axis is what each reading actually names at each length. The cadence reading holds G up to a body of 6 bars and is overturned at 8, so one explicit cadence is worth about that many bars of profile evidence — and it is overturned by the body's OWN incidental root motions rather than by the histogram at all. That is the finding the earlier essay could not have: on real material the two statistics cannot be varied independently, because lengthening the profile evidence adds cadence evidence too, for a third key.

The passage built to make them disagree

A cadence count and a key-profile correlation have been put on one scale and run on a passage where the two agree, which tells nobody anything. Building one where they disagree — the notes of one key and the cadences of another — measures the exchange rate at about six bars per cadence, and finds something the agreement case concealed: the two statistics cannot be varied independently, because lengthening the profile evidence adds cadence evidence too, for a third key.

harmony · Progression
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 thirty-two-bar AABA. The mean margin is 1.14 bits and 13 of 32 bars are inside one bit of a rival reading, which is where a listener would be genuinely undecided. The reading itself names C, E, B, D, G; the margin says what that naming is worth, and at the weakest bar — bar 31, C over F — it is worth 0.07.

The margin the dynamic program already had

Nine earlier essays produce a single best reading, and the passages worth arguing about are the ones where two readings are nearly equally good. What is needed for that has been inside the model from early on: 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 printing it turns every analysis here into a measurement of ambiguity.

scales · Key-relations
How much of the reading comes from what has not happened yet. Every margin reported earlier is two-sided: the best path through a key at a bar is the best score into it plus the best score onward from it, and the second half uses bars a listener has not heard. Dropping that term is one line, because the dynamic program already had both halves separately. The mean margin falls from 3.90 bits with hindsight to 1.79 without it, so 54 per cent of this passage's certainty is retrospective. The two passes never disagree about which key is best here, so the hindsight buys confidence rather than a different answer. This is the quantity every earlier essay has assumed and none has measured.

How much of the reading arrives late

Every margin reported earlier is two-sided: the best path through a key at a bar is the score into it plus the score onward from it, and the second half uses bars a listener has not heard. Dropping that term is one line. On a thirty-two-bar song it removes more than half the certainty, and on a passage built to be ambiguous it changes the key named at nine bars out of eleven.

scales · Key-relations
A listener has a quarter of an analyst's confidence and the same answer. The mean margin between a passage's best two key readings, against how many bars a listener's memory of the evidence takes to halve. The two-sided reading — the one that uses bars that have not happened yet — sits at 3.90; the forward pass with perfect recall at 1.79; a forward pass whose evidence halves every 6.6 bars at 1.00. The dots' size is how often that reading names the same key as the two-sided one: 100 per cent at perfect recall and 81 at a one-bar half-life. So forgetting costs a great deal of confidence and very little accuracy — the key is robust and the certainty is not.

The listener who forgets

Setting an analyst's reading of a key against a listener's measures what arrives late. Both passes assume perfect recall of their own half — which is as wrong going forward as knowing the future is going back. Put a decay on the forward pass and a listener with a memory of a few bars keeps a quarter of the confidence and nine tenths of the answers.

harmony · Key-relations
Which bars the key is decided by, and which bars it is believed on. Every bar of a 32-bar scheme removed in turn, with what its absence costs. The column is how far the passage's mean margin falls without that bar — how much of the model's certainty it supplies. The dot is how many bars are then read as a different key — how much of the answer it supplies. The 18 bars an analysis would point at — a section opening or closing, a dominant, the chord a dominant resolves to — average 0.079 bits of certainty and 0.50 bars moved; the 14 ordinary bars average 0.047 and 0.07. So the structural bars carry 1.7 times as much certainty as the ordinary ones, and 7.0 times of the answer. Those are different quantities, and the second is the one an analysis is about: an ordinary bar can carry a great deal of a passage's certainty and none of its reading.

The bars a key is made of

A discount that treats every bar alike is the wrong shape for a memory, so take each bar away in turn and see what it was worth. The bars an analysis points at carry seven times as much of the answer as the ordinary ones and slightly less of the certainty — and a memory built only of them reads the passage worse than a memory with no structure in it at all.

harmony · Key-relations
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.

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.

harmony · Key-relations
The mixture at which the chain acquires a tonic. Eight turns of i–iv–v–i in A minor, natural throughout, read at every mixture of the two emissions: nought is the original set overlap against the triad on each degree, one is the measured probe-tone profile rotated to each candidate key. The blocks along the top are the name the model gives, the line below is how far ahead of its best rival that name is. Below a mixture of 0.55 every bar is called C major, which is the collection and not the key; at and above it every bar is called A minor. The margin collapses to 0.33 bits at the crossing and recovers to 4.56 — higher than the 3.38 it started at, because a profile has an opinion about this passage and an overlap does not.

A tonic bought with the function

Putting the measured probe-tone profile inside the ordered key-finder is one term, and it does what was predicted: the natural-minor passage is named A minor at every bar instead of C major. It also does two things nobody predicted. It renames a scheme that has been read in the wrong key at every bar since the day it was written, and it destroys the chord's function while it is buying the key.

harmony · Key-relations
Every question is answered in a corner, not on a ridge. The degree share times the minor share, over the plane of two cues: how much of the emission is the probe-tone profile, across, and how much a bass note is worth, down, with every chord's root in the bass and a bass rule that rewards the triad rooted on the bass. It runs from 0% at a profile share of 0 and a bass weight of 0 to 87% at 0.6 and 1.5. Bass 0: 0%, 0%, 0%, 0%, 41%, 32%, 46%. Bass 0.25: 0%, 0%, 0%, 0%, 52%, 55%, 44%. Bass 0.5: 0%, 0%, 0%, 0%, 68%, 62%, 51%. Bass 1: 0%, 0%, 0%, 0%, 78%, 77%, 77%. Bass 1.5: 0%, 0%, 0%, 0%, 87%, 80%, 86%. Bass 2: 0%, 0%, 0%, 0%, 87%, 87%, 87%.

Two cues meet in a corner

The profile finds a key's tonic and the bass finds a chord's degree, and until now each was swept with the other held at nothing. Swept together across 42 settings, the plane they make is not the ridge that was predicted. The tonic is a step in one direction, at a profile share of 0.55, and the bass cannot move it; the degree is a slope in the other, rising to 89 per cent as the bass is weighted, and the profile barely touches it. Every question is answered only in a corner of the plane — and the one place the two cues overlap is the one piece of music both can rescue.

scales · Key-relations
The ninety per cent was a ceiling. The share of 188 scheme bars read right on both key and degree with a bass note worth 1.5, for three bass lines — every chord's root, a line moving to the nearest chord tone, every chord's fifth — and two ways of using the bass: rewarding the triad rooted on it, or any triad containing it. Wide bars are with no profile in the emission, narrow bars with the profile alone. root line, root rule: 89% and 86%; root line, member rule: 60% and 29%; smooth line, root rule: 68% and 46%; smooth line, member rule: 61% and 47%; sixfour line, root rule: 3% and 17%; sixfour line, member rule: 52% and 30%. The reading with no bass at all is 47%.

A bass line is not a list of roots

Every bass note the key-finder has been given was its chord's root, and under that line a bass cue reads 89 per cent of scheme bars on the right degree. Give the same chords an economical bass that moves to the nearest chord tone, as a keyboard reduction would, and nearly half of them are inverted. The cue that rewards the triad rooted on the bass then reads 68 per cent at best and worse as it is trusted more; the cue that rewards any triad containing the bass cannot be fooled and stops at 61. The same inverted line does one thing the roots never did: it puts the leading note of each new key at the bottom, and finds the rondo's modulations.

scales · Key-relations
Given the bar in octaves, the cue gets the degree back. How often the reading names the right scale degree, against how much the bass cue is worth, under three rules for what a bass note rewards. the bass is the root: 68 per cent at best; the bass is some chord tone: 67 per cent at best; the bar in octaves: 92 per cent at best; the bass is the root, on a root line: 89 per cent at best. The published cue rewards the triad rooted on the bass, which is right only when the chord is in root position; rewarding any triad containing the bass is right always and rewards three chords a bar instead of one. The third rule is not a bass cue at all — given the bar voiced in octaves a listener knows which three pitch classes are sounding, and that names the chord outright. It reaches 92 per cent on a real line against the published cue's 68 on the same line, and the dashed curve is what that cue manages on a line made entirely of roots — 89 per cent.

Given the bar in octaves, the degree comes back

A bass note is a bare pitch class in the usual figure, and a register in any realisation anybody plays. Voice each bar in octaves and a listener knows which three pitch classes are sounding and which is at the bottom, which names the chord outright — and the rule that uses it reads the right scale degree in 92 per cent of bars on a real bass line, against 68 for the published cue on the same line and 89 for that cue on a line made entirely of roots. The question was whether the register recovers the 89. It recovers it and passes it.

scales · Key-relations
A sharper cue is worth nothing to a reading that will follow it anywhere. How often the reading names the right scale degree, against how much it costs to change key, at a bass worth 1.5 on a real bass line. the bass is the root: 20 per cent at a key cost of 0.5 and 68 at 4; the bass is some chord tone: 47 per cent at a key cost of 0.5 and 59 at 4; the bar in octaves: 46 per cent at a key cost of 0.5 and 91 at 4; roots, and a line of roots: 49 per cent at a key cost of 0.5 and 91 at 4. Where a key change is cheap the rule that names the chord outright reads no better than the rule that names three — 46 against 47 per cent — because a reading that will move key for one bar's evidence follows a sharp cue wherever it points. The sharper cue's whole advantage appears only once the reading is reluctant enough to stay put, and by a key cost of 2.2 it is 31 points ahead.

A sharper cue is worth nothing to a reading that moves

The rule that names the chord outright reads 92 per cent of scale degrees right where the published bass cue reads 68 — at the key cost these readings have always been run at. Sweep that cost and the advantage is not a property of the cue. Where a change of key is cheap the sharp rule reads 46 per cent and the vaguest rule 47, because a reading that will move key on one bar's evidence follows a sharp cue wherever it points. The cue's whole value is borrowed from the model's reluctance to be moved.

scales · Key-relations
The two parameters are not one, and the reason is a ceiling. The plane of the two parameters these readings have been swept one at a time: how much weight the bass cue carries, against what a change of key costs. Every cell is how often the reading names the right scale degree, and the lines are the contours of equal share. along the 50 per cent contour the product of the two coordinates runs from 0.10 to 0.50; along the 60 per cent contour the product of the two coordinates runs from 0.43 to 1.84; along the 70 per cent contour the product of the two coordinates runs from 0.66 to 2.56; along the 80 per cent contour the product of the two coordinates runs from 1.85 to 4.91; along the 90 per cent contour the product of the two coordinates runs from 2.71 to 15.20. If the two multiplied cleanly those products would be constant and the contours would be hyperbolae. They are not: every contour turns upward and then vertical, because past a bass weight of about 3 more of the cue buys nothing at all and only reluctance is left to buy anything with. The key cost has an interior best, at 3 on this grid, where the reading names 93 per cent of degrees — so a reading that will not change key at all is worse than one that will, which no sweep of a single parameter had found.

The two parameters turn out to have a ceiling between them

The essay before this one asked whether the bass cue's weight and the cost of changing key are one quantity with two names, and said the test was a contour: if they multiply, the curves of equal degree share are hyperbolae. They are not. Along the ninety per cent contour the product of the two runs from 2.7 to 15.2, because past a bass weight of about one and a half the reading saturates and more cue buys nothing. And the sweep finds something no single-parameter sweep here could: the key cost has a best value, and a reading that will never change key is worse than one that will.

scales · Key-relations
The ceiling is thirteen bars, and every one of them has a name. Every bar of the six schemes read by the key-finder at a key cost of 3 and a bass weight of 3, with the chord in every bar given exactly — no segmentation is involved. 175 of 188 bars have both the key and the degree right, 93.1 per cent. The misses: 7 in the thirty-two-bar song's bridge, where the chain III7 is read in E major, III7 is read in E major, VI7 is read in E major, VI7 is read in D major, II7 is read in D major, II7 is read in D major, V7 is read in D major; 4 bars of the rondo's A minor episode read as C major; 2 next to a change of key; and 0 of any other kind.

The ceiling is thirteen bars with names

The key-finder's two cues stop buying anything at about 93 per cent of scheme bars read right, and the obvious suspect was the chord segmentation feeding it. The reading was never given a segmentation: every bar arrives with its true chord. What the ceiling is made of can be listed instead, and it is thirteen bars of 188 — seven in a bridge of secondary dominants, four in a minor episode whose chords C major also owns, and two at the edges of a modulation. No weight of any cue moves one of them.

scales · Key-relations

All figures · What can be heard