The Common-Tone Code of a Harmonic Vocabulary

A pop song typically uses only a handful of chords. Take each chord as a set of pitch classes, the twelve note names once octave is ignored (C, C♯, D, and so on). Add every subset of those chords, and the result is a simplicial complex: a family of sets closed under taking subsets, with few maximal members. Coding theorists have studied this exact object for other reasons. They use such complexes as "defining sets" to build linear error-correcting codes, and they have closed-form formulas for the code's weight distribution, meaning how many codewords have each possible count of nonzero entries. These formulas work when the complex has few maximal members. We propose to apply that machinery to music. Turning a passage into pitch-class sets (chroma abstraction, i.e. folding all octaves into twelve bins) yields a chord complex. Its code's weight distribution is an exact, cheap, key-invariant summary of how the chords share notes, a property musicians call common tones.

The scientific question is sharp and currently unanswered. Is the regularity of real harmonic vocabularies visible in their note-sharing pattern alone, once interval content is deliberately thrown away? The code view supplies a descriptor that is, by construction, blind to intervals and sensitive only to overlaps. That lets us separate two explanations of tonal regularity that are normally confounded. We then test whether the descriptor helps graph-based music models on benchmarks where they currently fall short.

Core Claim

Let a passage's vocabulary have maximal chords $A_1,\dots,A_t \subseteq \{0,\dots,11\}$. Let $\Delta$ be the complex of all their subsets, viewed as vectors in $\mathbb{F}_2^{12}$. The defining-set code sends each "probe" pitch-class set $x$ to the codeword $c(x) = (|x\cap F| \bmod 2)_{F\in\Delta}$. Inclusion–exclusion over the chords gives

$$\mathrm{wt}(c(x)) \;=\; \sum_{\emptyset\neq S\subseteq[t]} (-1)^{|S|+1}\, 2^{|A_S|-1}\,\mathbf{1}[x\cap A_S\neq\emptyset],$$

where $A_S=\bigcap_{i\in S}A_i$ is the set of notes shared by the chords in $S$. The count of probes $x$ that avoid a given family of intersections is $2^{12-|\bigcup A_S|}$.

This is the same generating-function argument as Lemma 2.1 of Optimal Few-Weight Codes From Simplicial Complexes. That paper uses complexes with few maximal elements to build optimal two- and three-weight codes over $\mathbb{F}_2+u\mathbb{F}_2$; we reuse its counting technique and change only what the complex means. The consequence is that the full weight distribution is a function of the common-tone lattice: which notes each pair, triple, and so on of chords share. It is unchanged by any relabeling of the twelve pitch classes, so transposition, inversion, and every other relabeling leave it fixed. It also has a small number of distinct values exactly when the vocabulary's overlaps are highly regular.

Our claim has two parts. First, tonal vocabularies in real corpora have fewer distinct weights and are closer to the Griesmer bound than size-matched random vocabularies. This would show that tonal regularity is partly a property of overlap combinatorics, independent of intervals. Second, higher-order overlap terms, triple intersections and beyond, carry information about musical structure that pairwise common-tone counts miss. Neither part has been tested. Few-weight constructions such as Binary LCD Codes and Self-Orthogonal Codes via Simplicial Complexes and the Weil-sum codes of Two-weight and three-weight linear codes based on Weil sums treat their sets as abstract. Music graph work has never treated a chord vocabulary as a code.

Research Program

The first component is the descriptor itself. For any time window we binarize the pitch-class content, reduce it to maximal chords, and compute the weight distribution exactly with the formula above. Real vocabularies have small $t$, so the $2^t$ intersection terms are cheap. We also record the number of distinct nonzero weights, the minimum distance, and the gap to the Griesmer bound $n\ge\sum_{i<k}\lceil d/2^i\rceil$, where $n$ is code length, $k$ dimension, and $d$ minimum distance. The same computation can be truncated at intersection order two. That truncation is the key ablation, because it reduces the descriptor to ordinary pairwise common-tone counting.

The second component places this descriptor inside heterogeneous music graphs. These are graphs whose nodes are notes and whose typed edges encode different relations, such as simultaneous onset, succession, and sustain. The descriptor never replaces exact pitch. It is attached as an attribute to window-level or phrase-level nodes, alongside the note nodes that keep register and voice.

This follows the lesson of Automatic Melody Reduction via Shortest Path Finding. That paper builds directed note graphs for monophonic melody reduction and adds "imaginary edges" between octave-equivalent notes. Its point is that chroma equivalence should supplement exact pitch, not overwrite it. We extend the idea from pairwise octave links to higher-order overlap structure. We also replace hand-tuned costs with a quantity derived algebraically, at least for this one feature.

The third component tests robustness to the main weakness of audio chroma. Overtones inject energy at the fifth and major third above sounding notes, as described in On the Mathematics of Music: From Chords to Fourier Analysis. We simulate this structured corruption on symbolic chroma and measure how far the weight distribution moves. Corrupting a chord adds specific notes, which changes particular intersections, so this movement can be predicted analytically and checked empirically.

Baselines

The naive reference point is a pitch-class histogram: twelve-bin chroma averaged over the window and made key-invariant by maximizing over the twelve rotations. Any structural descriptor must beat it.

The strongest interval-aware competitor is the discrete Fourier transform magnitudes over the twelve pitch classes, together with the interval-class content of the vocabulary. This captures interval structure that our descriptor deliberately discards. If it explains everything ours explains, the overlap hypothesis fails. The two will be computed on identical windows, with identical downstream classifiers and identical hyperparameter search budgets.

The key ablation is the pairwise-truncated descriptor. It isolates whether the higher-order terms, the part only the code-theoretic formula supplies cheaply, matter at all. Beating the ablation means a statistically reliable gain from the full descriptor over the truncated one under matched settings. We will use bootstrap confidence intervals across songs.

For the graph experiment, the strongest existing method is AutoSchA: Automatic Hierarchical Music Representations via Multi-Relational Node Isolation. It runs a directed relational graph convolutional network with node-isolation pooling and reports roughly 75% depth classification accuracy on the expert Schenkerian dataset. We will retrain its architecture on the same splits, with and without the descriptor as an added node attribute and with the same tuning budget. Counting as a win requires exceeding our reproduced AutoSchA number, not only the published one.

On POP909 we found no reported number for classifying phrase types from harmonic features alone. Hierarchical Symbolic Pop Music Generation with Graph Neural Networks reports 88.7% phrase-type reconstruction accuracy, but that is a generative reconstruction measure on a different task. We will cite it as context only and not as a comparable baseline.

Why not just…?

Why not just count common tones between pairs of chords? This is the most serious threat. Pairwise counts are the order-two truncation of our formula and are easier to explain. Higher-order terms record, for example, whether three chords share one pivot note, as opposed to sharing different notes pairwise. Whether this matters musically is an empirical question. The pairwise ablation is built into every experiment for that reason. If truncation loses nothing, we will report that the code view is a derivation tool rather than a modeling gain, and the regularity hypothesis is then restated at order two.

Why not just use Fourier coefficients of pitch-class sets, which already measure tonal regularity? They do, but through intervals. Our descriptor's invariance under every pitch relabeling is a deliberate feature: it asks whether regularity survives once intervals are removed. The comparison and the combination of the two are run explicitly. A result where Fourier features fully subsume ours is a clean negative answer, not a failure of the experiment.

Why not just let a graph neural network learn chord structure from raw note features? A learned model may well match or beat us on accuracy, and AutoSchA already learns from pitch features. Our claim is not that hand-built features beat learning. It is that an exact, invariant measurement answers a scientific question learning cannot answer directly. The added-attribute experiment tests whether the measurement also carries signal the learned model misses. Note that the descriptor cannot help with transposition invariance, since the Schenkerian dataset is already augmented across all twelve keys.

Proposed Experiments

The decisive test of the first claim uses POP909's chord and phrase annotations (POP909: A Pop-Song Dataset for Music Arrangement Generation). We compute the chord complex of each phrase and compare its number of distinct weights and its Griesmer gap against a null model. The null draws random vocabularies matching each phrase in chord count and chord sizes, which preserves size statistics but randomizes overlaps. Because the descriptor is relabeling-invariant, permuting pitch classes is no null at all; only resampling overlaps is. The claim survives if real vocabularies are significantly more regular than the null. It fails if they are indistinguishable.

A second null, which samples vocabularies matched in interval-class content, tells us whether any excess regularity is merely inherited from intervals. For contrast in style, we repeat the analysis on Nottingham folk melodies. These are monophonic, so we use windowed melodic pitch collections.

The second claim is tested in two settings. One is section labeling and repeated-phrase retrieval on POP909, comparing histogram, Fourier, truncated, and full descriptors under the same classifier. The other is AutoSchA-style depth prediction on the expert Schenkerian dataset (A New Dataset, Notation Software, and Representation for Computational Schenkerian Analysis), with windowed descriptors attached to note nodes.

The robustness check applies simulated overtone corruption at increasing strengths. It measures descriptor stability, measured as distance between weight distributions, against the stability of the Fourier baseline.

A clear outcome either way is publishable. Either overlap combinatorics carries a tonal signature beyond intervals and beyond pairwise counts, or the most natural bridge between few-weight coding and harmony is shown to reduce to known music-theoretic features.