Manuscript Offprint
arXiv:2610.40303Symmetric Structure and Motivic Transformation in Melodies, Phrases, and Themes
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Alfredo González-Espinoza
University Libraries, Carnegie Mellon University
0000-0003-2361-1827
Preprint, 29 October 2026
Abstract. Transposition, inversion, and retrograde are fundamental operations in music theory, from Schoenberg's twelve-tone technique to Forte's set classes and Lewin's transformational theory, yet their use in melodies has rarely been quantified. We read a melodic line through the orbits and stabilizers of its windows of notes under the group generated by these operations and cyclic shift. The window entropy splits into an orbit entropy (motivic vocabulary) and a within-orbit entropy normalized by orbit size (deployment), and the group elements relating windows of one orbit give the motivic transformations. In 852 keyboard pieces spanning four centuries, at least 97% of melodies have lower orbit entropy than surrogates keeping their pitch content, spectrum, or one-step transitions (). Periods differ in vocabulary and symmetry types, forms in deployment. Recurring motifs are transposed 1.6 times more often than in random permutations of their forms, by a fifth or fourth 2.8 times more often, a preference that weakens from the Baroque to the 20th century and from Bach's fugues to Shostakovich's. Folk phrases and instrumental themes are rarely symmetric (2–10%) but 1.6–5 times more often than note rearrangements. The framework extends to any symbolic sequence with a symmetry group.
Keywords: melodic analysis, group theory, orbit entropy, computational musicology, information theory.
1 Introduction
Symmetry is one of the oldest ways we make sense of structure. We recognize that an object can be transformed (reflected, rotated, shifted) and still be, in the ways that matter, the same object. An animal's body is almost mirror-symmetric (invariant under reflection from its bilateral symmetry), and a snowflake repeats every because the ice beneath it is a hexagonal crystal. In physics, symmetry is also a principle that constrains the equations themselves. We identify it in conservation laws: equations that keep their form under shifts or translations in time and space or under rotations conserve energy, momentum, and angular momentum [1], and the symmetries of a law restrict the phenomena it can produce [2–4]. Even the concept of equilibrium can be read as a symmetry, a symmetry of time. The microscopic laws of motion run equally well backward, so at equilibrium every process occurs as often as its reverse, a molecule forming as often as it breaks apart, and nothing changes on average (or statistically) [5]. In this case, the concept of time acquires a direction, an arrow, only when this balance is broken or moved away from equilibrium. Group theory gives these observations a common language [6]. Taken together, the operations that leave an object unchanged form a group, and organizing objects by their group arranges them by structure, and not necessarily by content. For example, chemistry classifies molecules in this way, by their point group, independently of the atoms they contain. Water and sulfur dioxide, compositionally different, fall in the same class ( ) and therefore share the selection rules for infrared and Raman activity, the pattern of allowed electronic transitions, and the orbital degeneracies, all defined by the group alone [7].
Much of this recognition is related to our perceptual capacities. People detect mirror symmetry in an image rapidly, and more readily than repetition or rotation, and tend to judge symmetric faces and patterns as more attractive [8–10], a bias shared by pollinators that prefer symmetric flowers [11]. It is no surprise that we include signatures of symmetry in what we make. The tilings of the Alhambra and the prints of Escher generate endless surface from a handful of operations, and every pattern that tiles the plane by repeating in two independent directions falls into one of seventeen symmetry classes, the wallpaper groups [12]. How often each class is used or appears in a collection of works can give clues of where it comes from, as distributions over the seventeen groups separate Hellenistic, Roman, Armenian, Byzantine, Arab, and Seljuk ornament [13,14], in a long tradition of classifying cultural patterns by symmetry [15]. Music is a peculiar case, since it can apply symmetry in two dimensions at once as well, but these dimensions are of different nature, pitch and time [16]. Hearing can feel less direct than seeing; listeners recognize a transposed melody at once but recognize its inversion or retrograde poorly [17], so musical symmetry could be a matter of construction as well as perception. The time reversal concept of physics can be read in musical melodies as retrograde, and its breaking, the arrow of time, has been previously measured in scores with network theory methods [18], finding the existence of statistical irreversibility (time asymmetry) as a universal feature in melodies. Like a molecule, a melody can carry a symmetry internally. A phrase that reads the same backward, or a motif that mirrors about a pitch axis, is left unchanged by an operation, and motifs can be classified by their symmetry independently of their notes, as molecules are by their point group (Figure 1). The distribution of these symmetry types across a piece is the musical counterpart of the ornament fingerprint, with the symmetry classes of short motifs instead of plane groups.
Musicians and music theorists have long borrowed mathematical tools and methods, both to generate music, from the eighteenth-century Musikalisches Würfelspiel (musical dice game) to the first computer-composed score, the Illiac Suite [19], and Koenig's PROJECT 1 [20], and to analyze it. A motivic idea is rarely stated only once in a melody or a piece. It can be restated a step higher, turned upside down, played back to front, or displaced in time, so that we recognize “the same idea” through a disguise of transposition, inversion, retrograde, and shift. Two sets of notes that look different on the page can be one motif seen from another angle, which makes melodic material awkward to compare directly. In music theory these operations mostly relate distinct objects, and the relation is drawn either inside one melodic sequence or between sequences. Inside a sequence, developing variation and thematic transformation grow material from a basic shape [21, 22], and Schoenberg also formalized transposition, inversion, and retrograde as the operations of twelve-tone technique. Between sequences, the operations relate voices, in imitation, canon, and the subject and answer of a fugue [23], or pieces, in tune families [24], in Forte’s set classes, which gather the transposed and inverted forms of a chord [25], and in Lewin’s transformational theory, which recasts the operations as group actions

snowflake
24 operations

4 operations

(60, 64, 67, 64, 60)
2 operations
Figure 1. Internal symmetry classifies an object independently of its identity. Left: a snowflake is left unchanged by rotations in steps of and by reflections (one mirror shown), 24 operations in all, its point group inherited from the hexagonal ice lattice. Middle: the water molecule is left unchanged by a rotation (the axis shown) and two reflection planes, its point group . This classification holds whatever atoms occupy the vertices. Right: the motif (60, 64, 67, 64, 60) (MIDI notation) reads the same forward and backward, so it is left unchanged by retrograde (F) and belongs to the musical counterpart of that symmetry class. The set of operations fixing an object (its stabilizer) sorts objects by internal symmetry, and objects sharing a class share a structural profile: spectroscopic selection rules in chemistry, transformation invariances in music. Within one group, the more operations fix an object, the fewer distinct forms it has (the orbit-stabilizer theorem).
on a generalized space, arrows between objects, and takes the interval between two objects to be the operation that carries one onto the other [26]. Mathematical music theory offers a categorical synthesis of these views [27]. Self-symmetry, an object left unchanged by an operation, is the least common documented case, as in Messiaen's modes of limited transposition [28] and the palindromes of Machaut and Haydn. Group theory holds both readings in one object, since the orbit of a motif contains its related forms and its stabilizer the operations that leave it unchanged. To capture both readings from a piece we need a statistical description of how a melodic line reuses its material, a distribution of ideas across a piece rather than a single symmetry label for the whole melody. The orbit statistics ( ) and the operations that relate recurring windows measure the first reading, and the distribution of symmetry types the second.
In the literature, the mathematics of these operations is mostly enumerative. Reiner introduced Pólya counting to music theory [29], Fripertinger extended it to intervals, chords, rows, motifs, and mosaics [30], and Fripertinger and Lackner classified the twelve-tone rows under the direct product of two dihedral groups, reporting for each row its orbit, normal form, and stabilizer class [31]. Their group is the same as ours at , and the stabilizer class they compute exactly for a cataloged row is the quantity our windowed spectrum estimates statistically for a piece. Close to the present work, Ibragimova and Nehaniv show that transposition, inversion, retrograde, and cyclic shift generate the finite group , and give closed-form recipes for constructing and counting the melodies invariant under it [32]. We adopt their orbit count, with the size of a window rather than the length of a melody. Their treatment enumerates how much symmetry is possible. We ask how often the operations relate the motifs inside real melodies, as a view of how composers develop motivic ideas, and whether themes and phrases chosen by people are symmetric more often than chance.
Earlier studies have described melodic structure computationally. Some estimate the entropy of pitch sequences with n-gram models [33], others summarize the shape of a melody through its contour [34] or extract recurring patterns and cells [35]. These descriptions compare melodic material note by note or by shape, and none treats two passages as the same idea when they differ by transposition, inversion, retrograde, or cyclic shift, the four operations at once.
Where those methods compare material note by note, we use symmetry as the organizing concept and borrow a pattern common across the quantitative sciences. Objects are grouped into equivalence classes under a relevant symmetry, each class is labeled by one canonical representative, and the distribution over representatives is measured with Shannon's entropy [36], so that a symmetry that would otherwise inflate the count of distinct objects makes them equivalent instead. Genomics counts canonical k-mers under reverse complement [37, 38], network science counts motifs up to graph isomorphism [39, 40], cheminformatics uses canonical SMILES [41, 42], and crystallography measures the information of atoms distributed over Wyckoff orbits [43]. This last case is the closest to the one presented here and has been computed across thousands of structures and followed through geological time [44, 45]. Orbit entropy also has a history in graph theory, from Rashevsky and Trucco to Mowshowitz [46–50]. There, one static graph under its own automorphism group produces one number, computed over a single partition of its vertices, and non-isomorphic graphs with the same orbit structure receive the same value [50]. Here, the action of sliding a window draws a distribution of sub-objects from one sequence under a group fixed in advance, so two pieces visiting the same orbits are still distinguished by how often they visit each.
The vocabulary of this normalization comes from statistical mechanics, where many microscopic configurations collapse onto one macroscopic label. Windows play the role of microstates and orbits of macrostates, and the analogy supplies the partition-and-count logic and the equipartition ceiling against which a measured entropy is read. The analogy does not go deeper, since consecutive windows share notes, so they are autocorrelated draws instead of an equilibrium ensemble, the orbit count grows too fast with for a thermodynamic limit, and the equal probability of the microstates within a macrostate, postulated in physics, is something that musical practice is expected to violate, a violation that measures. Windows carry no energy, and the entropy is Shannon's, in bits, an informational measure of how many motivic ideas a piece draws on and how evenly.
These ideas are drawn from a single melodic line extracted from the music, which we read at two lengths. Motifs of a few notes (from three to six), the scale of short figures and of small cells such as Schoenberg's Grundgestalt [21] and Réti's thematic process [22], and of minimalist cell-based writing, are read statistically, through sliding windows. Only at that scale does one piece repeat enough material to estimate a distribution, since the number of possible patterns grows explosively with length. Phrases and themes, the scale of fugal subjects, twelve-tone rows, and Renaissance points of imitation, are read exactly, as whole sequences that people have already delimited. Relations between sequences (imitation and canon between voices, mirror fugues, Bach's crab canon, tune families between pieces) are out of scope and can be material for future studies.
To measure how melodies reuse their ideas under these operations, we make three contributions. The first is a set of statistical symmetry measures for melodic sequences on the orbit space of , namely the orbit entropy , the deployment ratio , and the distribution of symmetry types, together with a census of the operations that relate recurring windows. The second is an implementation, the MelodyExtraction.jl and MelodicSymmetry.jl packages, validated against hand-computed examples and published results. The third is a pair of empirical tests, a windowed analysis of a solo keyboard corpus balanced by period, composer, and length against three null models and a within-orbit shuffle that keeps its vocabulary, and an exact census of phrases and themes curated by people (MTC-ANN, Essen, MTD) against rearrangements of each segment's own notes. Together they let us ask the following questions:
Do real melodies carry G-symmetric structure beyond their pitch content, spectrum and one-step transitions? Where does this structure vary across periods, forms, or composers writing in the same form? Which operations relate the recurring motifs of a line, beyond what its vocabulary implies? How often are hand-picked themes and phrases exactly symmetric, compared with chance, and by which symmetry?
2.1 Symmetry group, orbits, and stabilizers
We treat two motifs related by transposition, inversion, retrograde, or cyclic shift as the same musical idea. Formally, this identification is an equivalence relation induced by a group action. The orbit of a motif is the set of all sequences that these operations produce from it, so each orbit is one equivalence class, a single musical idea together with all its transformed forms. A group of transformations is a set of invertible operations on a set X that contains the identity e and is closed under composition and inversion. Often a few generators are enough to represent all the possible transformations. One rotation and one reflection generate the 2n symmetries of a regular n-gon, the dihedral group . We use two dihedral groups in this work, one acting on pitch and one on time (Figure 2).
(a)

(b)

Figure 2. Dihedral groups used in this work. Solid arcs are rotations, dashed lines reflection axes, dotted arcs the swaps they induce. (a) on the chromatic circle: transposes by a semitone, inverts about the 0–6 axis, and . (b) at : shifts positions cyclically, reverses them (retrograde). For even the axis passes between vertices, and .
A melodic sequence is a line of pitch classes, , with the pitch class of its -th MIDI pitch and . For a keyboard piece, is the line extracted from the score (Section 2.6); in the census, it is a phrase or theme as delimited in its corpus. A sequence is read at one of two scales depending on the type of data (piece or segment). Its windows of length , for with , are elements of and give a distribution of motifs (a melodic line in the case of pieces); the whole sequence is the case , a single window, read under (a single sequence of length , phrase or theme). A window, or any element of , is written . The tonal group acts pointwise on values and the positional group on indices, with generators
Musically, transposes by a semitone, inverts about , shifts the window cyclically, and reverses it (retrograde), with and .
The combined group has elements acting as on values and on positions,
so that . The two components act on different coordinates, what is played and when, and therefore commute (Section S1.1). Conventions for composite elements are given in Section S1.4.
Definition 1. For :
Two windows share an orbit if and only if one is a transposition, inversion, retrograde, or cyclic shift of the other, or a composition of these, so orbits partition into classes of -related motifs. The stabilizer captures the internal symmetries of . It always contains , and a palindrome such as is also fixed by . The orbit-stabilizer theorem, , relates the two. A symmetric motif has few distinct surface forms, and an asymmetric one has the maximum, . The lex-minimum labels each orbit uniquely, so two windows are -equivalent if and only if they share (Figure 3; computation in Section S1.4).
The number of orbits for windows of size m is obtained with the Cauchy–Frobenius lemma [51, 52],
where has a closed form over the cycles of (Section S1, following [32]). This gives , 163, 1,110 and 10,962 for (Table S1). is thus the number of distinct motifs of length once transposition, inversion, retrograde, and cyclic shift are identified.
2.2 Orbit entropy and deployment ratio
With the framework presented in this work, two of the questions that can be asked of the motifs of a melody are: how many distinct musical ideas the melody uses and in how many forms it states each one. The windows of a sequence , read without wrap-around (Figure 3a), are each labeled by its orbit. With windows in orbit and an estimate of its probability, the orbit entropy is
which is 0 when every window falls in one orbit and reaches the upper bound when windows spread evenly over orbits (orbital equipartition). At the positional group realizes every reordering of three positions, so orbits of three distinct pitch classes reduce to the trichord set classes under transposition and inversion. From , orbits retain melodic order and describe shape more than harmony. Both bounds on the window size come from counting. Below three notes every window is symmetric, since any pair of notes is its own retrograde inversion, and the share of windows in asymmetric orbits rises from 58% at to 95% at

overlap = m - 1 = 3
step = 1
(b)

(c)
canonical rep. (lex-min) microstate (window)

Figure 3. Windows and orbits. (a) A sequence is read through a sliding window of length (here ), giving overlapping windows. (b) partitions into orbits, each with area proportional to . Arrows map windows to the canonical representative . Asymmetric motifs (Stab = {e}) fill large orbits, while the palindrome is fixed by , as is fixed by its axis. (c) One orbit at , each window labeled by the element that maps it to .
m = 6. Beyond six notes nearly every window would be asymmetric, leaving the symmetry types little to separate, and the orbits (107,509 at m = 7) would far outnumber the few hundred windows of a typical piece, so that orbit entropy could no longer be estimated reliably.
The C major triad
is fixed only by , so its orbit holds the maximal forms at : transposed , rotated , reversed and inverted, which turns major into minor. Its canonical representative is the C minor triad, , so every major and minor triad, in any key, order, or direction, is one macrostate.
Each window is both an orbit and one surface form within it, so the surface entropy splits by the chain rule (Section S1),
(8)
with and the share of orbit 's windows that take surface form . The first term measures the motivic vocabulary, how many ideas a line draws on, and the second its deployment, how many surface forms each idea takes. The same windows give the standard entropies of a symbolic sequence as other readings of one count. Counted without symmetry they give the block, or m-gram, entropy , counted up to transposition the entropy of interval m-grams, and counted by the rank order of their pitches the permutation entropy [53]. Orbit entropy is the reading under the full group (Section S3).
The forms available to an orbit are bounded by its size. The capacity
is the within-orbit entropy reached when every form is used equally. It plays the role of the symmetry number in chemistry, which lowers a molecule's entropy by [54]. Symmetric motifs have fewer distinguishable forms, and asymmetric ones reach the maximum . The average bounds the intra-orbit term (Section S1), and the deployment ratio
is the fraction of that capacity a melodic line uses. It tends to 0 when each idea appears in a single form (rigid quotation) and to 1 when each is spread evenly over all its transformed forms.
Three idealized regimes separate the two axes (Table 1). A strict ostinato uses one form of one idea (, ), a strict canon many forms of one idea (, intra-orbit term large), and a line of many ideas, each stated once, the reverse. An ostinato whose period matches reaches because its windows are cyclic shifts of one cell. A crystal behaves alike in space. Its atoms fall into a few crystallographic orbits, and its structural complexity is the Shannon information of their distribution [43, 55], with the same polarity. In both, a more symmetric object carries less information. Real melodic lines sit between this crystal limit and equipartition (Figure 5a).
Table 1. Partition of the entropy budget under three compositional regimes.
| Regime | |||
|---|---|---|---|
| Strict ostinato | 0 | 0 | 0 |
| Strict canon | 0 | up to of that orbit | matches intra |
| Maximum motif variety | up to | 0 | matches macro |
One motive, one surface form. One motive, many surface forms.
Many motives, one surface form each.
For synthetic and short annotated lines, which are used to explore known regimes, is the plug-in frequency , the maximum-likelihood estimate. Corpus lines undersample the orbit space ( for ), so their is estimated with the Nemenman–Shafee–Bialek (NSB) estimator [56], which corrects small-sample bias (Section S2). The two estimators are never mixed within a comparison, and Laplace and Miller–Madow [57] corrections serve as checks. and its ingredients use plug-in frequencies throughout.
2.3 Symmetry types
The orbit contains information about which motif a window is, and its stabilizer says what symmetry the motif carries, e.g. the self-loop of Figure 3b. Read up to transposition, the kind of operation in Stab() organizes windows into six classes (Table 2), asymmetric (fixed only by
Table 2. Window stabilizer types and the local shape each detects. A window is symmetric if it is fixed by some reflection of the position cycle (its central axis is only the simplest case) or by a rotation; conditions hold up to a transposition . The Sketch column gives an illustrative example of one representative pitch–position contour per type, all drawn in a common frame (dots are successive notes). By analogy with molecular point groups, the asymmetric class corresponds to and the retrograde class to a -type mirror. At a single axis pairs one couple of positions, so repeated-note and neighbor figures (, ) are retrograde-type; at two couples must agree.
| Type | Stab contains | Condition (some ) | Local shape detected | Sketch |
|---|---|---|---|---|
| asymmetric | fixed by no nontrivial element | directed, non-returning motion | ||
| retrograde | literal return (arch, neighbor, turn) | |||
| RI | inversional balance (scalar / mirror) | |||
| inversion | tritone-only; degenerate, absent | |||
| translation | periodic, period | internal repetition (ostinato cell) | ||
| multiple | two or more of the above | several conditions | repeated notes, oscillation |
e), retrograde, retrograde-inversion (RI), inversion, translation, and multiple, for windows fixed by more than one kind.
Every window that has a constant-step structure or shape, such as a chromatic run, is RI-type at every : retrograde-inversion reverses the succession of intervals, which leaves a constant succession unchanged (Section S1.5). The class is the most coarse-grained of four descriptions of a stabilizer; the exact subgroup, its conjugacy class, and its abstract family are compared in the same appendix.
Counting classes over the windows of a piece gives its class profile and the stabilizer entropy
a plug-in estimate over six symbols, well sampled at any in the corpus. Because the class of a window is a function of its orbit, coarse-grains the orbit distribution. Averaging the profiles within a period, each piece weighted equally, gives that period's class composition, shown as a Muller plot, with class fractions stacked to one and joined across periods in historical order, one panel per (Figure 10). Because the symmetric share falls with by counting alone, periods are compared at fixed and against the share over all windows (Table S13). The number of distinct stabilizer subgroups each period accumulates is shown in Figure 10b, with the estimators in Section S7.8.
2.4 Relations between windows
The orbit identifies which idea a window states, and its stabilizer what symmetry the idea carries. A third question is how two statements of one idea are related. If windows and share an orbit, the operations that carry one onto the other form the coset
where brings each window to the canonical form. An asymmetric window gives one relation, and a symmetric one gives equally valid relations, each counted with weight . A relation is typed by its inversion and retrograde components, which gives five types, repetition , transposition , inversion , retrograde , and retrograde-inversion . Relations that include a cyclic shift relate windows only as rotations of each other. They are reported separately as the rotated share and left out of the types.
Every pair of windows in the same orbit whose starting positions differ by notes is counted, so overlapping windows are never compared. The distance is measured along the line and is distinct from the cyclic shift , which acts within a window. The relation profile of a piece is the share of each type among its unrotated relations, its entropy measures how evenly the types are used, and the intervals of its transpositions form the transposition spectrum. Splitting the entropy of the operations into the entropy of the types and the entropy of the interval within each type separates which kind of operation a line uses from the intervals it uses it at (Section S7.6). Profiles are taken over pairs of asymmetric windows, where the relation is unique. Over all windows, weight passes between types through the stabilizer, and every constant-step run, which is RI-symmetric (Section 2.3), would count each of its transpositions also as a retrograde-inversion. The relations of a line are the autocorrelation of its forms over the group [58], so fixes how widely they spread but not which operations they are (Section S7.6).
■ 2.5 Validation with control sequences
Before interpreting results from the corpus, we test the measures against sequences whose structure is known (Table 3). They are a period-3 ostinato, the chromatic scale, one motif in its retrograde, inversion, transposition, and RI images, and uniform-random pitch (), with four tonal melodies (Twinkle, Ode to Joy, Frère Jacques, Happy Birthday) for placement (Figure 4). These short lines use the plug-in estimator and are read as regime indicators to test our readings of the measures.
Table 3. Synthetic controls at and (MLE estimator, ceilings , bits).
| Control | (m3 / m5) | (m3 / m5) | Expected behavior |
|---|---|---|---|
| Ostinato [0,4,7] | 0.00 / 1.58 | 0.22 / 0.00 | crystal endpoint; window-dependence |
| Chromatic 0:11 | 0.00 / 0.00 | 0.58 / 0.52 | orbit entropy pitch entropy |
| Symmetry images (R, I, T, RI) | 1.99 / 3.06 | 0.39 / 0.20 | one idea, many surface forms |
| Random 0:11, | 4.06 / 8.38 | 0.69 / 0.07 | motivic-vocabulary ceiling |
The control sequences reflect the predicted endpoints (Figure 5; Table 1). The ostinato sits at the crystal limit and random pitch near the ceiling. The chromatic scale returns at every despite having high pitch-class entropy (diversity of notes), because each window is the previous one transposed by a semitone () and the line folds onto one orbit. The symmetry-images control has a small vocabulary with moderate deployment ().

note position
Figure 4. The eight example objects as pitch-position contours: four synthetic controls (ostinato, chromatic, symmetry images, random) and four tonal melodies (Twinkle, Ode to Joy, Frère Jacques, Happy Birthday).
at , at ), while random pitch has the largest vocabulary, deployed widely at () but thinly from (0.07), where its windows rarely repeat.
The crystal limit depends on window size (Figure 6). A periodic line collapses to one orbit only when is commensurate with its period . At every window is a cyclic shift of one cell, while other window sizes straddle cell boundaries, the orbit-space counterpart of a peak in the autocorrelation at lag . The phase moves the bits of the cell between the two measures. At they appear as surface variety within one orbit (, ), otherwise as separate orbits with one form each (, ). On a corpus read at fixed , a literal ostinato is therefore flagged by low or low , never by both being high.
Window profiles are exact even for short lines. At m = 3 one matching pair makes a window retrograde (Table 2), so retrograde windows dominate tonal tunes (Twinkle 88%); from m = 5 return figures (retrograde) separate from scalar motion (RI), and the chromatic scale is RI at every m (Figure S3).
2.6 Data and melody extraction
To test each of the four questions stated in the Introduction, we use four data sets, each matched to one scale of symmetry (Table 4). Statistical symmetry (windowed, given by , , and symmetry types) is measured on a balanced corpus of solo keyboard music and on a matched set of preludes and fugues. Exact symmetry of a whole sequence, under , is measured on three corpora of segments that people have already delimited as one idea (folk song phrases and instrumental themes), because a whole piece has a single orbit and offers no distribution. The control sequences of Section 2.5 complete the set.

(b)

Figure 5. (a) Motivic-entropy spectrum: when a melodic line stays in one orbit (crystal, ostinato, strict canon) and at orbital equipartition. The gap to the ceiling is the motivic compressibility. (b) Measured : synthetic controls span the interval. Annotated melodies are shown for placement only, since their short length undersamples the distribution.
(a)

(b)
Figure 6. (a) as a function of window size m for the eight examples. (b) The same values against the deployment ratio , one path per example from m = 3 to m = 6 (marker size grows with m). The period-3 ostinato returns only when m is commensurate with its period (m = 3, 6). Random pitch tracks the ceiling while its falls from 0.69 toward 0.
Table 4. Data sets. : median length of the analyzed sequence in notes.
| Data set | Sequence | Number | L | Measures |
|---|---|---|---|---|
| Solo keyboard corpus (KDF) | movement | 852 | 322 | , , , symmetry types, relations |
| Prelude & Fugue set | prelude, fugue | 108 | 289 | , , , , relations |
| MTC-ANN 2.0.1 | phrase () | 1,890 | 9 | exact symmetry, |
| Essen | phrase () | 44,765 | 8 | exact symmetry, |
| MTD | theme (all ) | 2,067 | 18 | exact symmetry, |
Solo keyboard corpus. Pieces are movements of solo piano or harpsichord music from the Kunst der Fuge MIDI collection [59], a source used in several earlier corpus studies [18, 60–62]. Composers are placed in one of four periods by the median date of their works, and each period holds 213 pieces (Table 5), from composers with at least 10 eligible pieces (4 to 30 in the matched sample) and at most two movements per work. Melodies of 100 to 1198 notes are matched in length across periods, since grows with (Section S7.4.1). The corpus holds 852 pieces from 822 works by 49 composers (Section S4.1).
Table 5. Solo keyboard corpus by period (Schubert and Hummel placed in the Classical period); lengths and composer shares in Table S6.
| Period | Dates | Composers | Pieces |
|---|---|---|---|
| Baroque | before 1750 | 14 | 213 |
| Classical | 1750–1819 | 10 | 213 |
| Romantic | 1820–1889 | 14 | 213 |
| 20th century | from 1890 | 11 | 213 |
Prelude & Fugue set. To compare composers with form held fixed, we use Bach's Well-Tempered Clavier, Book I (OpenWTC edition from PDMX [63, 64]), Mendelssohn's Op. 35 and Shostakovich's Op. 87 (Kunst der Fuge), 108 pieces in which each prelude and its fugue share a number, key, and mode (Section S4.2).
Folk song phrases and musical themes. Phrases come from the Essen Folksong Collection [65] and MTC-ANN [66, 67], themes from the Musical Theme Dataset [68]. The segments were delimited by people (encoders following text lines, rhyme, or syntax [69], editors selecting complete themes [68]), so boundary placement may itself contribute to their symmetry; the corpora also differ in content (Section S4.3).
Melody extraction. Each keyboard piece is reduced to one melodic line with the :hybrid method, in which k-means on the mean pitch of note groups keeps the highest cluster [70], and the skyline method then takes its top note at each onset [71]. The k-means step is seeded from each file's name to make the selection reproducible. A register-based selector can mix voices in contrapuntal writing, where a subject/theme migrates across registers, so a complexity-based selector [72] is used as a double check. Where voices imitate one another the two selectors produce the same motifs, and 70 of 74 tests keep their conclusion with either (Section S5.3). Lines are not transposed to a common key, because transposition is already included in the operations of G, so every measure is exactly invariant under a global transposition (local key changes affect at most m - 1 windows each; Section S5.1).
2.7 Null models
We use null references to isolate structural components of our original sequences to properly evaluate the features that we quantify in them. Each null represents a different conserved structural feature that we want to include or isolate.
Windows. The orbit entropy value can be interpreted when compared against a null for the same pitch content. Each piece of the keyboard corpus is compared with 199 surrogates from each of three nulls that keep progressively more of the line. A random shuffle keeps its pitch distribution, IAAFT [73] also keeps its power spectrum (every linear autocorrelation), and a first-order Markov chain fitted to its pitch-class transitions reproduces its one-step grammar. If each null removes structure the real line has, orbit entropies should follow
For each null we record , the relative deficit , a two-sided rank p-value, and the expected share of each symmetry class. Surrogates are seeded from the file name. In the Prelude & Fugue set only IAAFT is used, which also gives .
Whole sequences. Each phrase or theme, a sequence read whole , is symmetric when its stabilizer under is non-trivial. Because the chance of symmetry depends on length, parity and the notes used, segment is compared with rearrangements (permutations) of its own notes, and is the probability that one is symmetric, obtained by counting fixed arrangements (rearranging intervals instead serves as a reference). At each length ,
with the observed number of symmetric segments and the expected number under random rearrangement of each segment's own notes, so that means more symmetry than each segment's notes give by chance. Lengths are pooled into bins for display, with exact Poisson intervals [74]; intervals that resample whole songs or works, and per-length values smoothed with an empirical-Bayes model [75], are in Sections S6 and S4.3.
Relations. The construction of the surrogates changes which orbits a line uses, so they cannot tell whether its relations are chosen or follow from its vocabulary. The within-orbit shuffle keeps the vocabulary. Each window keeps its position and orbit, and the forms that each orbit takes are reassigned among its windows at random (199 permutations per piece), which leaves , , and unchanged and alters only which form appears where. Identical forms stay identical under this null, so repetition is compared instead with forms drawn uniformly within each orbit and with the three surrogates. This null changes the relations between windows while holding every quantity on which a vocabulary claim rests, so an excess of transform-pairs over it is a statement about placement alone. For each type the observed share is compared with the expected one as O/E, per piece and over the corpus with pieces weighted equally.
2.8 Statistical analysis
We include statistical analysis for the four questions we explore in this work. The first is whether a piece has less orbit entropy than surrogate lines that keep part of its structure, its pitch distribution, its power spectrum, or its one-step transitions (Section 2.7). Its value is ranked among those of the 199 surrogates from each null, and because this is tested for every piece, the expected share of false positives is controlled across pieces [76]. The second is whether periods, forms, or composers differ. Here each piece, not each window, is one observation, and group labels are shuffled to see how often a difference as large arises by chance. Pieces by one composer resemble each other, so period labels are shuffled between composers and form labels within each composer [77]. In the Prelude & Fugue set the three composers are compared in historical order [78], and each prelude with its own fugue. The third is whether whole segments are symmetric more often than their notes allow, judged by the ratio of observed to expected counts, with intervals that resample whole songs or works. Each comparison is reported with an effect size, the probability that a piece from one group exceeds one from the other [79], and corrected across the four window sizes [80]. For relations, per-piece ratios add 0.5 to observed and expected counts, so that pieces without a given relation are kept [81,82], and composer means are shrunk toward their period mean by an empirical-Bayes model [83]. Procedures and robustness checks are in Section S6.
3 Results
The results are structured in three parts. We ask whether melodies carry more orbit structure than randomized versions of themselves (Section 3.1), where that structure varies across periods, forms, and composers who wrote in the same form (Sections 3.2 and 3.3), and which symmetries it consists of, in short windows, in the relations between them, and in whole phrases and themes (Sections 3.4, 3.5, and 3.6). In brief, melodies draw on fewer motif classes than chance but on more kinds of symmetry, periods differ in vocabulary, forms and composers in deployment, recurring motifs are transposed more often than chance, preferably by a fifth, and whole phrases and themes are symmetric more often than their notes allow. Full results with their statistical procedures are in Sections S6 and S7.
3.1 Orbit structure against surrogates
Figure 7 compares one typical piece from each period with its surrogates. In every case the real line (black) lies below all three bands, and across the corpus the orbit entropy falls below the shuffled and IAAFT surrogates in more than 99% of the 852 pieces and below the Markov surrogates, which keep the one-step transitions between notes, in 86 to 98%. The gaps between successive nulls show where this structure lies (Table 6). Keeping the power spectrum adds at most 0.08 bits, so the structure that is captured by is not necessarily reflected in the power spectrum of the same series, despite the 1/f-like spectra commonly found in music [84,85], as the time irreversibility of pieces from the same collection also indicates [18]. One-step transitions explain part of the structure, and what remains grows from 0.12 bits at m = 3 to 1.91 bits at m = 6, so the structure spans whole motifs rather than neighboring notes.
Deployment departs from chance in a direction that depends on window size. In about 80% of the pieces, real lines repeat cells of three notes literally, in fewer transformed forms than their surrogates, but restate motifs of five and six notes in more forms, transposed, inverted, or reversed. These comparisons hold piece by piece after correction for multiple testing (Section S6; Figure S4 and Table S10).
Table 6. Measured gaps between consecutive levels of Eq. (13): median over the 852 pieces, in bits. At large the first row also contains the sampling ceiling (a line of windows cannot exceed bits).
| Gap | Structure it reflects | m = 3 | m = 4 | m = 5 | m = 6 |
|---|---|---|---|---|---|
| pitch bias (key, scale, range) | 0.26 | 0.51 | 1.14 | 3.05 | |
| linear correlation (spectrum) | 0.00 | 0.04 | 0.07 | 0.08 | |
| one-step transitions | 0.38 | 0.60 | 0.89 | 0.69 | |
| beyond one-step transitions | 0.12 | 0.57 | 1.21 | 1.91 |

window size m
shuffle
markov1
iaaft
● real piece
Figure 7. Real (black) against the shuffle (gray), IAAFT (blue), and Markov-1 (yellow) nulls (bands: central 95% of 199 surrogates; dashed: median) for one typical piece per period, the piece whose IAAFT deficit at equals its period's median: Froberger, Capriccio 3; Mozart, Fugue K. 375g; Liszt, Grand Étude 4; Scriabin, Étude Op. 8 No. 6.
3.2 Vocabulary across periods, deployment across forms
Figure 8 shows how the three measures (the relative deficit of against IAAFT, , and ) change across periods and forms. Periods differ mostly over short windows. At Baroque lines are the most structured, about below their surrogates against 12 to in later periods, a difference that fades as the window grows (panel a), while the mix of symmetry types rises slowly from the Baroque to the 20th century (panel c), carried by repeated notes and oscillating figures (Section 3.4). Forms differ instead in deployment, since pieces of different forms by the same composer draw on a similar vocabulary but deploy it differently (panel b). Dances spread each motif over the fewest transformed forms (median at , against 0.28 to 0.34 for the other forms), as befits music built on literal repeats, whereas contrapuntal and free pieces, which restate their material in other keys, deploy it most widely. Across all three measures the composer (more than the period or the form) accounts for most of the variation, and these differences hold when the pieces of each composer are kept together (Section S6; Tables S8 and S9). Because of the pieces carry no form label and forms are unevenly spread across composers, the form result rests on composers who wrote in several forms (Section S4.1;


(b)

(c)


Figure 8. The three measures across periods and forms, m = 3–6. (a) Relative deficit of against IAAFT by period (vocabulary). (b) Deployment ratio by form family (deployment). (c) Symmetry-type entropy by period (mix of symmetry types). 213 pieces per period (Bar. Baroque, Cla. Classical, Rom. Romantic, 20th: 20th century); 508 labeled pieces by form (dance 65, cyclic 211, character 167, contrapuntal 35, free 30). Character: single-movement pieces (prelude, nocturne, étude, impromptu, ballade, intermezzo); cyclic: sonata, suite, partita movements. Boxes: interquartile range and median; dashed: mean. Separation tests for every measure and grouping are in Table S8.

(b)
(c)
(d)

Prelude
Fugue
Figure 9. Structure and deployment in the Prelude & Fugue set, m = 4. (a) , (b) (six symmetry classes), (c) and (d) (difference from the mean of 199 IAAFT surrogates), preludes (left) and fugues (right) by composer (n = 24, 6, 24 pieces per form). Jonckheere–Terpstra trend across composers for fugues, Holm-adjusted over m = 4–6: p = 1.0 (a), 0.014 (b), 0.002 (c), 0.035 (d).
Figure S5).
3.3 Deployment in preludes and fugues
Figure 9 compares the preludes and fugues of Bach, Mendelssohn, and Shostakovich, where key and form are fixed by design. Their fugues draw on a similar vocabulary of motifs (panel a) but differ in the mix of symmetry types (panel b) and, most clearly, in deployment (panels c and d). Bach's fugues spread each motif over the fewest transformed forms (median ), Mendelssohn's and Shostakovich's over more (0.41 and 0.42). The contrast between Bach and Shostakovich remains when each fugue is compared with its own surrogates, which at this window size also removes the effect of length, whereas Mendelssohn's high values are largely reproduced by his surrogates and rest on six fugues. Bach deploys preludes and fugues alike, while Shostakovich deploys his fugues more widely than his preludes.
3.4 Symmetry types of short windows
Most short windows are asymmetric, and more so as windows grow, as counting all windows predicts. Asymmetric orbits, 7 of 19 at m = 3, already hold 58% of all windows, a share that

(b)

Figure 10. Symmetry types by period, m = 3–6. (a) Share of windows in each symmetry class, computed per piece, averaged within each period, and stacked to one (Bar. Baroque, Cla. Classical, Rom. Romantic, 20th century). (b) Distinct symmetry subgroups found as pieces are added, by period. Lines and bands show the mean and 95% range of the rarefaction curve, diamonds and horizontal dashed lines the estimated total (Chao2) with its interval, and the vertical dashed line the common sample of 213 pieces.
reaches 95% at m = 6 (Table S13). Real windows are nevertheless more often symmetric than in lines that keep their notes in random order, increasingly with window size, and retrograde windows are about twice as common as in shuffled lines at m = 6. Melodic lines that keep only the one-step transitions reproduce most of this excess, so mirror figures in short windows come largely from stepwise motion that returns, such as neighbor notes and turns. Windows with several symmetries at once, mostly repeated notes and two-note oscillations, stay above every null and become more common over time, from 13% of windows in the Baroque to 18% in the 20th century at m = 4 (Figure 10a). Later repertoires use more repetitive figuration or patterns. Windows symmetric under inversion alone are rarer than chance.
The symmetry-type entropy summarizes this mix for each piece (Figure 8c). From m = 5 on, real lines carry a more varied mix of symmetry types than any of their surrogates, the counterpart of their lower orbit entropy, so melodies use fewer motif classes than chance but more kinds of symmetry among them. This variety grows from the Baroque to the 20th century at m = 3 and 5 (Tables S14, S15, and S8).
Figure 10b counts how many distinct symmetry subgroups, the exact sets of operations that fix a window, each period draws on as pieces are added. At m = 3 every period reaches all 58 possible subgroups. From m = 4 the curves separate, with the Baroque lowest at every window size and the 20th century nearly exhausting those possible at m = 4 and 5 (183 of 183 and 71 of 72). At m = 6, with every period sampled at 213 pieces, Baroque pieces use 169 subgroups against 262 in the 20th century, and the estimated totals (186 against 329) have intervals that do not overlap. Later repertoires thus use not only more repetition-based figuration but a wider range of symmetry types, in agreement with earlier corpus studies, in which the harmonic vocabulary of classical music grows richer [62], its key diversity rises [86], and melodies of art music become more complex [87] from the Baroque on. The curves treat pieces as independent draws, so the comparison is descriptive (Section S7.8).
3.5 Transformations between recurring motifs
Figure 11 shows results for the O/E ratio in the operations that link recurring windows. A typical piece has more than 1,000 of such pairs at m = 4, and three quarters of its windows repeat at least once. Literal repetition is 14 times more common than for forms drawn at random within each orbit and 3.4 times more than in shuffled lines, mostly reproduced by lines that keep their one-step transitions, and pieces that repeat more deploy their motifs over fewer forms. Relations that merely rotate a window, 60% of the total, are rarer than for random forms in 98% of pieces and rarer than under the within-orbit shuffle in 88%.
With vocabulary and deployment held fixed, transposition is 1.56 times more common than in random permutations of the forms, in three quarters of the pieces, and twice as common at m = 5 (Figure 11a). Retrograde-inversion is also favored (1.33), inversion is avoided (0.84), and retrograde occurs about as often as chance. The five types are used about as evenly as under the null (2.2 of a possible 2.3 bits in every period), so the preference lies in which operations a line uses, not in how many, but the intervals within transposition are not used evenly. Their entropy lies 0.30 bits below the within-orbit shuffle at four notes, about 0.45 bits in the Baroque and Classical periods against 0.21 in the Romantic and 0.13 in the 20th century, and in the fugues it falls from Bach (0.50) to Shostakovich (0.05) (Figure S16).
Transposition operations are biased toward the fifth (Figure 11b). Transpositions by a fifth or fourth make up half of all transpositions in a typical piece, nearly three times their share under the null, while thirds and sixths, semitones, and tritones are rarer, and steps, the interval of the sequence, occur as often as chance. The share of fifths falls from about 60%

(b)
Figure 11. Relations between recurring windows, m = 4, pairs of asymmetric windows. (a) Share of each relation type relative to the within-orbit shuffle, which keeps the orbit of every window and the forms each orbit takes (filled, with 90% intervals that resample composers), and relative to shuffled, IAAFT, and Markov-1 surrogates (open). T transposition, I inversion, R retrograde, RI retrograde-inversion. (b) Transposition intervals relative to the within-orbit shuffle in the keyboard corpus and in the fugues of the Prelude & Fugue set, fifth or fourth (k = 5, 7), step (2, 10), third or sixth (3, 4, 8, 9), semitone (1, 11), and tritone (6). Dashed lines mark O/E = 1.
of transpositions in the Baroque and Classical periods to 42% in the Romantic and 35% in the 20th century, and the fugues repeat this history in miniature, from 57% in Bach to 52% in Mendelssohn and 35% in Shostakovich, whose fugues transpose by semitone and tritone at more than half the chance rate, where Bach's almost never do.
Composers differ in transposition more than periods (Figure 12a). Within each period they range from 0.76 times the null for Joplin to 2.5 for Scriabin, and composer accounts for 13% of the variation between pieces, period for less than 1%, with the same pattern for inversion at every window size and Romantic composers as alike as sampling can detect at four notes. Retrograde-inversion shows the opposite pattern (Figure 12b), the only type whose use changes across periods. Baroque and Classical composers restate motifs as their retrograde inversion about 1.3 times more often than chance, Romantic composers at chance, and 20th-century composers below it (0.85), Shostakovich being the exception (1.14). A prelude and its fugue do not differ. These comparisons use the within-orbit shuffle, keep pieces by one composer together, and are corrected across window sizes (Section S7.6, Figures S9–S15).
(a) transposition

O/E (within-orbit shuffle)
(b) retrograde-inversion

O/E (within-orbit shuffle)
Figure 12. Composers relative to the within-orbit shuffle, m = 4, pairs of asymmetric windows. (a) Transposition and (b) retrograde-inversion for composers with at least 10 pieces, in the same rows (ordered by transposition), shrunk toward the period mean (filled, s.d.), with the unshrunk mean (open) and the period mean (dotted). Transposition varies more between composers than between periods (composer 13% and period 0.1% of the variance), whereas retrograde-inversion varies between periods (trend ). Romantic composers coincide after shrinkage because their between-composer variance is estimated as zero.
3.6 Symmetric phrases and themes
Figure 13 shows how often whole phrases and themes are exactly symmetric, by length. Most are not, about 6% of MTC-ANN phrases, 10% of Essen phrases, and 2% of MTD themes, and whole melodies almost never are, as counting predicts, since the share of symmetric sequences over a uniform alphabet falls from 42% at three notes to below 1% at eight. Compared with rearrangements of their own notes, however, symmetric segments are more common than chance, about 1.6 times in the folk corpora and 5 times among the MTD themes, whether notes or intervals are rearranged, and increasingly so with length, from no excess in phrases of four to six notes to about 13 times in Essen phrases of 13 to 16 notes. The kind of symmetry changes with scale. Folk phrases are symmetric mostly by mirroring (59 to 69% of their symmetric phrases), while longer segments turn to repetition, with translation, a repeated or sequenced cell, accounting for half of the symmetric MTD themes and for 55 of the 57 symmetric Essen melodies. These excesses hold when segments from the same song or work are resampled together (Section S4.3).
(a)

(b)
Figure 13. Exact symmetry of whole sequences by length bin. (a) Share of symmetric segments (bars) and the share expected from each segment's own notes in random order (black tick). (b) Enrichment within each bin, with exact Poisson 95% interval [74]. The dotted line marks . Bins with fewer than ten segments, fewer than 0.1 expected or no observed symmetric segments are omitted from (b). Per-length estimates are in Figure S18.
4 Discussion
We developed a framework that reads a melodic line through the orbits and stabilizers of its short windows under transposition, inversion, retrograde, and cyclic shift, and splits the entropy of the windows, as statistical mechanics separates macrostates from microstates, into how many motifs a line draws on and how widely it transforms each. Control sequences fall where this reading interprets them, a strict ostinato at the crystal limit and a random line near the equipartition ceiling. Real melodies sit between the two limits. Nearly every piece draws on fewer motif classes than surrogates that keep its pitches, spectrum, or one-step transitions, a gap that widens with window size (Section 3.1), and from five notes on it uses a more varied mix of symmetry types than chance, as if composers reused few ideas and varied them by transformation. The same deficit appears under other readings: block entropy, which uses a smaller group, and permutation entropy, which uses a different one, also fall below the surrogates. Neither splits the count into vocabulary and deployment, so neither can trace a difference to its source; only the orbit decomposition assigns differences between periods to vocabulary and differences between forms to deployment (Section S3).
Most windows and whole sequences are asymmetric, as counting predicts (sorting all the permutations by their symmetry group and selecting randomly a symmetry type with a dice weighted by its proportion), since each added note is another condition a symmetry must satisfy (e.g., a window of three notes reads the same backwards when its outer notes agree, one of five notes only when two pairs agree) [29, 30], so the finding lies in the departure from counting. In short windows the excess of mirror figures over shuffled lines comes largely from one-step transitions, stepwise motion that returns, such as neighbor notes and turns. Repetition-based symmetry, in contrast, exceeds every null and grows from the Baroque to the 20th century, although it covers only 13 to 18% of windows at four notes. Whole phrases and themes are rarely symmetric (2 to 10%) but 1.6 to 5 times more often than their own notes allow, by mirroring in folk songs and by repetition in instrumental themes. Their null reorders the notes, and so breaks the steps. Short folk mirrors are therefore likely stepwise returns, since folk phrases move by step and trace arches [88], whereas palindromes of 13 to 16 notes need an exact order and should survive a null that keeps each phrase's steps [89, 90], a test left for future work.
Periods differ in vocabulary and symmetry types, forms and composers in how they deploy their motifs (Sections 3.2 and 3.3). Baroque lines are the most structured over three notes and draw on the fewest symmetry subgroups, and later repertoires add repetitive figuration and a wider range of symmetry types, the same direction as in the harmonic vocabulary and key diversity of the repertoire [62, 86]. With form held fixed, deployment separates composers, and Bach's fugues spread each motif over fewer forms than Shostakovich's. The relations between motifs add how ideas are restated. Composers differ in how often they transpose, and the preference for the fifth interval weakens from the Baroque to the 20th century and from Bach's fugues to Shostakovich's, where transposition intervals are spread almost as by chance. Retrograde-inversion is the one relation that follows the periods, and since it reads a motif's intervals backwards, turning a major broken chord into a minor one, its excess fits the alternating major and minor figuration of Baroque and Classical sequences and its decline parallels that of the fifth. The distributions of the seventeen wallpaper groups separate the cultures that produced an ornament [13, 14], while the mix of window symmetry types changes only mildly over four centuries (Figure 10). In melody, style seems to lie less in which symmetries occur than in how figuration repeats and how motifs are related. Counts of symmetry classes also depend on how they are implemented, as successive studies of the Alhambra show [91, 92].
Counting also makes precise a long-standing view in music theory, that symmetry operations act mainly as relations between distinct objects [25,26,93], from motivic development [21,22] to tune families [24], with self-symmetry rare and marked [28]. By the orbit-stabilizer theorem an asymmetric motif has the most forms, so its inversion is a new object, as the major and minor triads, the chiral trichords, are of each other [94], and as a chiral molecule is of its mirror image. Transposition, the relation listeners recognize most readily, is the one favored beyond chance, while inversion and retrograde, recognized poorly [17,95], sit at the surrogate level. Accidental transform-pairs between asymmetric motifs are already present in the surrogates at their expected rate, and such accidents would enrich every relation alike; the enrichment is instead specific to transposition, which chance among asymmetric figures does not produce. The null that isolates these choices keeps a line's vocabulary and deployment, holds each window's position fixed, and resamples only which form of its orbit appears there, so the test reports how motifs are related with which motifs are used held constant. In Lewin's terms these relations are intervals between motifs, and the census gives their distribution over a corpus and not within a single work. The excess symmetry of protein complexes has been explained by generative processes that favor short descriptions [96,97], and composition and oral transmission, which work with short rules such as repeat, answer, and mirror, would likewise predict more excess symmetry in more formulaic repertoires.
The framework presented in this work reads one extracted line at a time, in equal temperament and without rhythm. The choice of line has little effect on the conclusions. Two selectors, one reading register and one information content, return the same line in only 40 to 47% of pieces with several tracks, yet 70 of 74 tests keep their conclusion with either, and in fugues both lines carry the subject (Section S5.3). The keyboard corpus is balanced by period, composer, and length but not by form, with periods and forms assigned from metadata, and all corpora come from digitized Western repertoire. The census segments were cut by people, who may favor the symmetry easiest to recognize, and the census corpora differ in content as well as in how they were cut. Relations between voices and pieces, as in canon and fugue [23], serial rows [98], and tune families [24], are the natural next count. Reading durations as well as pitches would separate rhythmic variants, though by counting alone nearly every segment would then be asymmetric, so the count of relations between segments would matter more than their self-symmetry. At six notes, 1,122 of the 10,962 orbits never occur in the corpus, inversion-type orbits in larger proportion, and whether they are avoided or only undersampled remains open, as does the rise of windows with several symmetries at once, which stay above every null.
Nothing in the orbit decomposition is specific to pitch classes. It needs an alphabet, a group of operations that identify a figure with its transforms, and a window short enough that its patterns recur. Changing any of the three poses the same question of a new system. For example, with the seven scale degrees and diatonic transposition, a tonal sequence that moves a figure up by step, turning a major second into a minor one, falls into one orbit instead of several, so the deficit measured here could be split into chromatic and diatonic parts. With onset and rest as the alphabet and the rotations of the cycle as the group, a timeline together with its rotations forms a necklace, the orbit named by the geometry of rhythm [99], and a nontrivial stabilizer marks the rhythms whose onset pattern repeats under a rotation shorter than the cycle. Outside music, time and amplitude reversal act on the ordinal patterns of a time series [53], and the reverse complement acts on a DNA strand, where the near-equal counts of complementary bases within one strand [100] are exactly within-orbit equipartition, at a window of one. In each case orbits, stabilizers, and relations between windows are defined exactly as above, and only the nulls must be rebuilt for the question asked. What carries over is the separation reported above, between how many distinct ideas a sequence uses and how widely it transforms each, a distinction a single entropy cannot draw.
Acknowledgments
I thank Gustavo Martínez-Mekler and Eduardo García Castrejón for valuable feedback during the conceptual development of this work. I am grateful to the open-source and open-science communities whose freely shared software, data, and documentation made this work possible.
Data Availability
Sources: Kunst der Fuge MIDI files (https://www.kunstderfuge.com); OpenWTC from PDMX [64] (dataset CC BY 4.0; the 24 scores used are CC0, none flagged with a license conflict); MTC-ANN 2.0.1 (CC BY-NC-SA 3.0); the Essen Folksong Collection (CC BY-SA 4.0); and the Musical Theme Dataset, which states no license (the CC BY 4.0 of [68] covers the article) and is used as distributed at https://www.audiolabs-erlangen.de/resources/MIR/MTD, not redistributed. Selection lists, extracted melodic lines, and all derived tables will be deposited in a public archive with a persistent identifier upon journal publication and are available from the author on request.
Code Availability
The analysis uses two Julia packages written for this study, MelodicSymmetry.jl (group action, orbits, stabilizers, and entropies; https://github.com/spiralizing/MelodicSymmetry.jl) and MelodyExtraction.jl (melody extraction; https://github.com/spiralizing/MelodyExtraction.jl), and the scripts and notebooks that produce every table and figure (https://github.com/spiralizing/SymmetryEntropiesInMelodies). All code is released under the MIT License, will be made public upon journal publication, and is available from the author on request.
Use of LLM disclosure
We used VSCode with GitHub Copilot (Claude Sonnet 4.6) as auto-complete assistant to write most of the code in the functions of the packages MelodicSymmetry.jl and MelodyExtraction.jl, and the Notebooks for the computations and plots in this work. Claude Code with Opus 4.8 was used to build tests and documentation for the packages. Claude Code with Claude Opus 5.5 was used to write most of the code for the statistical analyses reported in the Supplementary Information, to create and modify the TikZ diagrams, and to organize text and tables in the Supplementary Information. All code and documentation generated with LLMs was reviewed, tested, and modified prior to publication.
References
[1] Emmy Noether. Invariante variationsprobleme. Nachrichten von der Gesellschaft der Wissenschaften zu Göttingen, Mathematisch-Physikalische Klasse, pages 235–257, 1918.
[2] Pierre Curie. Sur la symétrie dans les phénomènes physiques, symétrie d'un champ électrique et d'un champ magnétique. Journal de Physique Théorique et Appliquée, 3(1):393–415, 1894.
[3] Eugene P. Wigner. Symmetries and Reflections: Scientific Essays of Eugene P. Wigner. Indiana University Press, Bloomington, 1967. Edited by W. J. Moore and M. Scriven.
[4] David J. Gross. The role of symmetry in fundamental physics. Proceedings of the National Academy of Sciences, 93(25):14256–14259, 1996.
[5] Lars Onsager. Reciprocal relations in irreversible processes. I. Physical Review, 37(4):405–426, 1931.
[6] Hermann Weyl. Symmetry. Princeton University Press, 1952.
[7] F. Albert Cotton. Chemical Applications of Group Theory. Wiley, 3 edition, 1990.
[8] Johan Wagemans. Characteristics and models of human symmetry detection. Trends in Cognitive Sciences, 1(9):346–352, 1997.
[9] Matthias Sebastian Treder. Behind the looking-glass: A review on human symmetry perception. Symmetry, 2(3):1510–1543, 2010.
[10] Gillian Rhodes, Fiona Proffitt, Jonathon M. Grady, and Alex Sumich. Facial symmetry and the perception of beauty. Psychonomic Bulletin & Review, 5(4):659–669, 1998.
[11] Anders Pape Møller. Bumblebee preference for symmetrical flowers. Proceedings of the National Academy of Sciences, 92(6):2288–2292, 1995.
[12] Branko Grünbaum and G. C. Shephard. Tilings and Patterns. W. H. Freeman, 1987.
[13] Mehmet Erbudak. Symmetry analysis of the floor ornaments of the San Marco cathedral in Venice. Heliyon, 5(3):e01320, 2019.
[14] Mehmet Erbudak and Selim Onat. The role of the Greco-Roman practice as a progenitor of the Armenian and Eastern Roman ornamental art. arXiv preprint, arXiv:2011.10973, 2020.
[15] Dorothy K. Washburn and Donald W. Crowe. Symmetries of Culture: Theory and Practice of Plane Pattern Analysis. University of Washington Press, Seattle, 1988.
[16] Vi Hart. Symmetry and transformations in the musical plane. In Proceedings of Bridges 2009: Mathematics, Music, Art, Architecture, Culture, pages 169–176. Tarquin, 2009. Available at https://archive.bridgesmathart.org/2009/.
[17] W. Jay Dowling. Recognition of melodic transformations: Inversion, retrograde, and retrograde inversion. Perception & Psychophysics, 12(5):417–421, 1972.
[18] Alfredo González-Espinoza, Gustavo Martínez-Mekler, and Lucas Lacasa. The arrow of time across five centuries of classical music. Phys. Rev. R, 033166:1–16, 2020.
[19] Lejaren A. Hiller and Leonard M. Isaacson. Experimental Music: Composition with an Electronic Computer. McGraw-Hill, New York, 1959.
[20] Gottfried Michael Koenig. PROJECT 1. Electronic Music Reports, 2:32–46, 1970. Institute of Sonology, Utrecht.
[21] Arnold Schoenberg. Style and Idea. Philosophical Library, 1950.
[22] Rudolph Reti. The Thematic Process in Music. Macmillan, 1951.
[23] Alfred Mann. The Study of Fugue. Rutgers University Press, New Brunswick, NJ, 1958.
[24] Samuel P. Bayard. Prolegomena to a study of the principal melodic families of British-American folksong. Journal of American Folklore, 63(247):1–44, 1950.
[25] Allen Forte. The Structure of Atonal Music. Yale University Press, 1973.
[26] David Lewin. Generalized Musical Intervals and Transformations. Yale University Press, 1987.
[27] Guerino Mazzola. The Topos of Music. Birkhäuser, 2002.
[28] Olivier Messiaen. Technique de mon langage musical. Alphonse Leduc, Paris, 1944.
[29] David L. Reiner. Enumeration in music theory. The American Mathematical Monthly, 92(1):51–54, 1985.
[30] Harald Fripertinger. Enumeration in musical theory. Beiträge zur elektronischen Musik 1, Institut für Elektronische Musik, Hochschule für Musik und darstellende Kunst, Graz, 1992. Available at https://imsc.uni-graz.at/fripertinger/.
[31] Harald Fripertinger and Peter Lackner. Tone rows and tropes. Journal of Mathematics and Music, 9(2):111–172, 2015.
[32] Olga Ibragimova and Chrystopher L. Nehaniv. Algebraic applications in investigation of musical symmetry. In Springer Proceedings in Mathematics & Statistics, pages 47–59. Springer, 2025.
[33] Marcus T. Pearce. The construction and evaluation of statistical models of melodic structure in music perception and composition. PhD thesis, City University London, 2005.
[34] Mark A. Schmuckler. Melodic contour similarity using folk melodies. Music Perception, 28(2):169–194, 2010.
[35] Darrell Conklin. Representation and discovery of vertical patterns in music. In Music and Artificial Intelligence, pages 32–42. Springer, 2002.
[36] Claude E. Shannon. A mathematical theory of communication. Bell System Technical Journal, 27(3):379–423, 1948.
[37] Roland Wittler. General encoding of canonical k-mers. Peer Community Journal, 3:e87, 2023.
[38] Guillaume Marçais, C. S. Elder, and Carl Kingsford. k-nonical space: sketching with reverse complements. Bioinformatics, 40(11):btae629, 2024.
[39] R. Milo, S. Shen-Orr, S. Itzkovitz, N. Kashtan, D. Chklovskii, and U. Alon. Network motifs: Simple building blocks of complex networks. Science, 298(5594):824–827, 2002.
[40] Zhihong Zhang, Dongdong Chen, Lu Bai, Jianjia Wang, and Edwin R. Hancock. Graph motif entropy for understanding time-evolving networks. IEEE Transactions on Neural Networks and Learning Systems, 34(4):1651–1665, 2023.
[41] David Weininger. Smiles, a chemical language and information system. Journal of Chemical Information and Computer Sciences, 28(1):31–36, 1988.
[42] Yuan Wang, Hanna Geppert, and Jürgen Bajorath. Shannon entropy-based fingerprint similarity search strategy. Journal of Chemical Information and Modeling, 49(7):1687–1691, 2009.
[43] Sergey V. Krivovichev. Topological complexity of crystal structures: quantitative approach. Acta Crystallographica Section A, 68(3):393–398, 2012.
[44] Sergey V. Krivovichev. Which inorganic structures are the most complex? Angewandte Chemie International Edition, 53(3):654–661, 2014.
[45] Sergey V. Krivovichev, Vladimir G. Krivovichev, and Robert M. Hazen. Structural and chemical complexity of minerals: correlations and time evolution. European Journal of Mineralogy, 30(2):231–236, 2018.
[46] Nicolas Rashevsky. Life, information theory, and topology. Bulletin of Mathematical Biophysics, 17(3):229–235, 1955.
[47] Ernesto Trucco. A note on the information content of graphs. Bulletin of Mathematical Biophysics, 18(2):129–135, 1956.
[48] Abbe Mowshowitz. Entropy and the complexity of graphs: I. an index of the relative complexity of a graph. Bulletin of Mathematical Biophysics, 30(1):175–204, 1968.
[49] Abbe Mowshowitz. Entropy and the complexity of graphs: IV. entropy measures and graphical structure. Bulletin of Mathematical Biophysics, 30(4):533–546, 1968.
[50] Matthias Dehmer and Abbe Mowshowitz. A history of graph entropy measures. Information Sciences, 181(1):57–78, 2011.
[51] Augustin-Louis Cauchy. Mémoire sur les arrangements que l'on peut former avec des lettres données. In Exercices d'analyse et de physique mathématique, volume 3, pages 151–252. Bachelier, Paris, 1845.
[52] F. G. Frobenius. Ueber congruenzen nach einem aus zwei endlichen gruppen gebildeten doppelmodul. Journal für die reine und angewandte Mathematik, 101:273–299, 1887.
[53] C. Bandt and B. Pompe. Permutation entropy: A natural complexity measure for time series. Physical Review Letters, 88(17):174102, 2002.
[54] Donald A. McQuarrie. Statistical Mechanics. University Science Books, Sausalito, CA, 2000.
[55] Sergey V. Krivovichev. Structural complexity and configurational entropy of crystals. Acta Crystallographica Section B, 72(2):274–276, 2016.
[56] I. Nemenman, F. Shafee, and W. Bialek. Entropy and inference, revisited. In Advances in Neural Information Processing Systems (NIPS), 2002.
[57] George A. Miller. Note on the bias of information estimates. In H. Quastler, editor, Information Theory in Psychology: Problems and Methods, pages 95–100. Free Press, 1955.
[58] Persi Diaconis. Group Representations in Probability and Statistics, volume 11 of IMS Lecture Notes–Monograph Series. Institute of Mathematical Statistics, Hayward, CA, 1988.
[59] Kunst der Fuge. Kunst der fuge: Classical music in MIDI files. https://www.kunstderfuge.com/. Accessed 2021.
[60] Alfredo González-Espinoza, Hernán Larralde, Gustavo Martínez-Mekler, and Markus Müller. Multiple scaling behaviour and nonlinear traits in music scores. Royal Society Open Science, 4(12), 2017.
[61] Doheum Park, Juhan Nam, and Juyong Park. Novelty and influence of creative works, and quantifying patterns of advances based on probabilistic references networks. EPJ Data Science, 9(1), 2020.
[62] Marc Serra-Peralta, Joan Serrà, and Álvaro Corral. Heaps' law and vocabulary richness in the history of classical music harmony. EPJ Data Science, 10(1):40, Aug 2021.
[63] Kimiko Ishizaka and MuseScore. The open well-tempered clavier. https://www.welltemperedclavier.org/, 2015.
[64] Phillip Long, Zachary Novack, Taylor Berg-Kirkpatrick, and Julian McAuley. PDMX: A large-scale public domain MusicXML dataset for symbolic music processing. In ICASSP 2025 – IEEE International Conference on Acoustics, Speech and Signal Processing, pages 1–5, 2025.
[65] Helmut Schaffrath. The Essen folksong collection in the Humdrum Kern format. Technical report, Center for Computer Assisted Research in the Humanities (CCARH), Stanford University, 1995. D. Huron, ed.
[66] Peter van Kranenburg, Berit Janssen, and Anja Volk. The Meertens tune collections: The annotated corpus (MTC-ANN) versions 1.1 and 2.0.1. Meertens Online Reports 2016-1, Meertens Institute, Amsterdam, 2016.
[67] Peter van Kranenburg. Melodic features for Meertens tune collections and ESSEN folksong collection (version 1.1), 2019.
[68] Frank Zalkow, Stefan Balke, Vlora Arifi-Müller, and Meinard Müller. MTD: A multimodal dataset of musical themes for MIR research. Transactions of the International Society for Music Information Retrieval, 3(1):180–192, 2020.
[69] Peter van Kranenburg, Martine de Bruin, Louis P. Grijp, and Frans Wiering. The Meertens tune collections. Meertens Online Reports 2014-1, Meertens Institute, Amsterdam, 2014.
[70] G. Ozcan, C. Isikhan, and A. Alpkocak. Melody extraction on midi music files. In Proc. Seventh IEEE International Symposium on Multimedia (ISM 2005), pages 414–422, 2005.
[71] W. Chai and B. Vercoe. Melody retrieval on the web. In Proc. SPIE 4673, Multimedia Computing and Networking 2002, pages 226–242, 2001.
[72] S. T. Madsen and G. Widmer. A complexity-based approach to melody track identification in midi files. In Proc. IJCAI Workshop on Artificial Intelligence and Music (Music-AI), IJCAI-07, 2007.
[73] T. Schreiber and A. Schmitz. Improved surrogate data for nonlinearity tests. Physical Review Letters, 77(4):635–638, 1996.
[74] F. Garwood. Fiducial limits for the Poisson distribution. Biometrika, 28(3/4):437–442, 1936.
[75] David Clayton and John Kaldor. Empirical Bayes estimates of age-standardized relative risks for use in disease mapping. Biometrics, 43(3):671–681, 1987.
[76] Yoav Benjamini and Yosef Hochberg. Controlling the false discovery rate: A practical and powerful approach to multiple testing. Journal of the Royal Statistical Society: Series B (Methodological), 57(1):289–300, 1995.
[77] Stuart H. Hurlbert. Pseudoreplication and the design of ecological field experiments. Ecological Monographs, 54(2):187–211, 1984.
[78] A. R. Jonckheere. A distribution-free k-sample test against ordered alternatives. Biometrika, 41(1/2):133–145, 1954.
[79] Norman Cliff. Dominance statistics: Ordinal analyses to answer ordinal questions. Psychological Bulletin, 114(3):494–509, 1993.
[80] Sture Holm. A simple sequentially rejective multiple test procedure. Scandinavian Journal of Statistics, 6(2):65–70, 1979.
[81] J. B. S. Haldane. The estimation and significance of the logarithm of a ratio of frequencies. Annals of Human Genetics, 20(4):309–311, 1956.
[82] F. J. Anscombe. On estimating binomial response relations. Biometrika, 43(3/4):461–464, 1956.
[83] Carl N. Morris. Parametric empirical Bayes inference: theory and applications. Journal of the American Statistical Association, 78(381):47–55, 1983.
[84] R. F. Voss and J. Clarke. 1/f noise in music and speech. Nature, 258:317–318, 1975.
[85] D. J. Levitin, P. Chordia, and V. Menon. Musical rhythm spectra from bach to joplin obey a 1/f power law. Proceedings of the National Academy of Sciences, 109(10):3716–3720, 2012.
[86] A. González-Espinoza and J. B. Plotkin. Quantifying the evolution of harmony and novelty in Western classical music. PLoS ONE, 21(8):e0356548, 2026.
[87] John M. McBride, Nahie Kim, Yuri Nishikawa, Mekhmed Saadakeev, Marcus T. Pearce, and Tsvi Tlusty. Information and motor constraints shape melodic diversity across cultures, 2024.
[88] David Huron. The melodic arch in Western folksongs. Computing in Musicology, 10:3–23, 1996.
[89] Stephen F. Altschul and Bruce W. Erickson. Significance of nucleotide sequence alignments: A method for random sequence permutation that preserves dinucleotide and codon usage. Molecular Biology and Evolution, 2(6):526–538, 1985.
[90] Dan Kandel, Yossi Matias, Ron Unger, and Peter Winkler. Shuffling biological sequences. Discrete Applied Mathematics, 71(1–3):171–185, 1996.
[91] Branko Grünbaum, Zdenka Grünbaum, and Geoffrey C. Shephard. Symmetry in Moorish and other ornaments. Computers and Mathematics with Applications, 12B(3-4):641–653, 1986.
[92] Branko Grünbaum. What symmetry groups are present in the Alhambra? Notices of the American Mathematical Society, 53(6):670–673, 2006.
[93] Dmitri Tymoczko. A Geometry of Music: Harmony and Counterpoint in the Extended Common Practice. Oxford University Press, New York, 2011.
[94] John Rahn. Basic Atonal Theory. Longman, New York, 1980.
[95] Carol L. Krumhansl. Cognitive Foundations of Musical Pitch. Oxford University Press, New York, 1990.
[96] David S. Goodsell and Arthur J. Olson. Structural symmetry and protein function. Annual Review of Biophysics and Biomolecular Structure, 29:105–153, 2000.
[97] Iain G. Johnston, Kamaludin Dingle, Sam F. Greenbury, Chico Q. Camargo, Jonathan P. K. Doye, Sebastian E. Ahnert, and Ard A. Louis. Symmetry and simplicity spontaneously emerge from the algorithmic nature of evolution. Proceedings of the National Academy of Sciences, 119(11):e2113883119, 2022.
[98] Milton Babbitt. Twelve-tone invariants as compositional determinants. The Musical Quarterly, 46(2):246–259, 1960.
[99] Godfried T. Toussaint. The Geometry of Musical Rhythm: What Makes a “Good” Rhythm Good? CRC Press, Boca Raton, FL, 2013.
[100] Rivka Rudner, John D. Karkas, and Erwin Chargaff. Separation of B. subtilis DNA into complementary strands. III. Direct analysis. Proceedings of the National Academy of Sciences of the USA, 60(3):921–922, 1968.
Supplementary Information
Contents
S1 Mathematical details 34
S1.1 Commutativity of tonal and positional components 34
S1.2 Entropy chain rule and the intra-orbit bound 34
S1.3 Closed form for in the orbit-counting lemma 34
S1.4 Group-action conventions and canonicalization 34
S1.5 Stabilizer levels and retrograde-inversion 35
S2 Entropy estimation: the NSB estimator 35
S3 Orbit entropy among other entropy measures 36
S4 Data 37
S4.1 Construction of the solo keyboard corpus 37
S4.2 Prelude & Fugue set 38
S4.3 Census corpora 39
S5 Melody extraction 39
S5.1 Melody extraction methods 39
S5.2 Implementation 39
S5.3 Extraction consistency: hybrid versus complexity 39
S6 Statistical procedures 40
S7 Supplementary results 42
S7.1 Control sequences 42
S7.2 Orbit structure against surrogates 42
S7.3 Vocabulary across periods, deployment across forms 44
S7.4 Deployment in preludes and fugues 47
S7.5 Symmetry types of short windows 51
S7.6 Transformations between recurring motifs 52
S7.7 Symmetric phrases and themes 59
S7.8 Symmetry-subgroup richness 61
S1 Mathematical details
S1.1 Commutativity of tonal and positional components
Theorem 1 (Commutativity of tonal and positional components). For any and any , .
Proof. acts on values and on indices, so for every .
S1.2 Entropy chain rule and the intra-orbit bound
For the projection , , and a window drawn from the empirical distribution,
with (surface variety), (orbit variety), and (within-orbit variety),
has support , so
and, averaging over ,
with equality iff every visited orbit is uniformly deployed.
S1.3 Closed form for in the orbit-counting lemma
A window is fixed by iff it is constant on each cycle of with a value fixed by , so
with the number of cycles of , which in Eq. (6) gives in closed form [S1].
S1.4 Group-action conventions and canonicalization
The generators of Eq. (1) satisfy and , so ; likewise and in . Composite elements are read by functional composition, first and then ,
that is, inversion through the pitch axis at . Pitch classes are indexed from . Ibragimova and Nehaniv [S1] index them 1–12 with , the same action with another origin.
Canonicalization. The 48m images (tonal part , then , in either order by Theorem 1) are compared lexicographically, and the minimum is the canonical representative , which assigns and labels the orbit in one pass. up to is in Table S1.
Table S1. Total orbit count for .
| 3 | 4 | 5 | 6 | 7 | 8 | |
|---|---|---|---|---|---|---|
| 19 | 163 | 1,110 | 10,962 | 107,509 | 1,126,566 |
S1.5 Stabilizer levels and retrograde-inversion
A stabilizer is read at four levels (Table S2), the exact subgroup, its conjugacy class, shared by all windows of an orbit (6 classes at , 21 at ), its abstract family (, , ), and its class, used in the main text. Conjugation in acts on each dihedral factor separately and keeps rotations and reflections apart, so the class is a function of the conjugacy class and hence of the orbit. Class and family are not nested (58 subgroups, 19 orbits at ).
Table S2. Stabilizers of four motifs at (), with the number of surface forms . Elements are written (inversion, transposition, retrograde, cyclic shift).
| Motif | Non-identity elements of Stab | Family | Class | Forms | |
|---|---|---|---|---|---|
| (0, 4, 7) | none | 1 | trivial | asymmetric | 144 |
| (0, 1, 2) | 2 | retrograde-inversion | 72 | ||
| (0, 6, 0) | 4 | multiple | 36 | ||
| (0, 4, 8) | 6 | multiple | 24 |
Retrograde windows detect return figures (arches, neighbors, turns), and RI windows inversional balance, . Retrograde-inversion reverses the order of the intervals, so every constant-step window, such as , is RI-type at every (Figure S1).

Figure S1. Retrograde-inversion returns a flat-rise-flat shape or contour to itself. Retrograde flips the contour in time (dashed vertical axis), inversion flips it in pitch (dashed horizontal axis), and transposition moves it back into place. The three operations together amount to a half-turn rotation of the contour, so any contour that looks the same rotated by is fixed by retrograde-inversion. Every constant-step sequence (chromatic when step is one) is such a contour.
S2 Entropy estimation: the NSB estimator
The plug-in estimate , with , is biased downward when (Table S1) and returns 0 for a piece that visits one orbit. We use the Nemenman–Shafee–Bialek (NSB) estimator [S2, S3]. A symmetric Dirichlet prior of concentration over the orbits,
(S7) gives the Dirichlet-multinomial evidence
and, at fixed , the posterior mean entropy in nats [S4]
with the digamma function. The hyperprior
makes the induced prior on the entropy approximately uniform on , and the estimate is the posterior mean
converted to bits by . It does not collapse to 0 under sparse sampling and gives a posterior variance. Since the correction depends on the alphabet size, the support is fixed at the exact orbit count (Eq. (6)), not at the number of observed orbits.
S3 Orbit entropy among other entropy measures
Readings of one count. Each reading is the entropy of a quotient of the window space (Table S3), the block (-gram) entropy of pitch classes (, Eq. (8)), the interval -gram entropy (up to transposition, as in -gram models of melody [S5]), and (up to ). Permutation entropy [S6] counts rank orders of pitch height, with repeated notes as ties (weak orderings of items). The first three are nested, . The entropy rate is the conditional entropy of an order- model [S7]. Each entropy is estimated with NSB over its own .
Table S3. Readings of the windows of a line and their numbers of states .
| Reading | Windows equal when | Group | at |
|---|---|---|---|
| block (-gram) | identical | ||
| interval -gram | equal up to transposition | ||
| orbit | equal up to T, I, R, cyclic shift | ||
| permutation | same rank order (ties kept) | order-preserving maps |
Hierarchy and sampling. Medians at are 8.38 bits (block), 7.25 (interval), 5.47 (orbit), and 5.08 (permutation) (Figure S2a). Transposition removes 1.1–1.7 bits from the block entropy and the rest of another 1.2–2.3 (). At a typical piece visits 0.8% of the pitch-class 4-grams, 7% of the interval 3-grams, 37% of the orbits, and 65% of the rank patterns, with NSB corrections of 1.02, 0.62, 0.22, and 0.15 bits (Figure S2b). The group keeps the entropy estimable as windows grow.

(b)
(c)
Figure S2. Orbit entropy among other entropy measures, keyboard corpus. (a) Median entropy normalized by (bands: interquartile range), (b) NSB correction to the plug-in estimate, and (c) partial rank correlation with (length removed), for windows of notes.
Agreement and separation. Partial rank correlations with (length removed) are 0.85–0.95 (interval), 0.68–0.89 (block), and 0.35–0.89 (permutation, ) (Figure S2c). Tests are in Table S4. Block entropy is plus the deployment term (Eq. (8)), so its form and fugue differences come from deployment, which isolates. Neither nor the relations between motifs (Section S7.6) has a counterpart in readings that discard the forms within an orbit.
Table S4. Entropy readings compared at , keyboard corpus (Prelude & Fugue set for the fugue trend). Periods: Kruskal–Wallis with composers permuted between periods (Holm over ; values at where they differ); ordered trend as Spearman . Forms: Kruskal–Wallis with labels permuted within composers. Variance: adjusted of ranks for period, composer beyond period, and form beyond composer. Fugue trend: Jonckheere–Terpstra, Bach to Shostakovich. Last column: share of pieces significantly below / above their IAAFT surrogates after Benjamini–Hochberg control. Bold: . All values for in Data/entropy_comparison_stats.csv; permutations are independent of Table S8, so may differ in the third decimal.
| Measure | Periods p (ρ) | Forms p | Variance | Fugue p | Below / above (%) |
|---|---|---|---|---|---|
| block | 1.00 (+0.13) | 0.026 | 0.02 / 0.31 / 0.02 | 0.021 | 98 / 0 |
| interval | 1.00 (+0.11) | 0.437 | 0.02 / 0.28 / 0.01 | 0.526 | 99 / 0 |
| orbit | 0.187 (+0.16); 0.001 at m = 3 | 1.00 | 0.04 / 0.22 / 0.01 | 0.864 | 97 / 0 |
| permutation | 1.00 (+0.03) | 0.144; 0.040 at m = 3 | 0.00 / 0.18 / 0.01 | 0.376 | 91 / 1 |
| rate | 1.00 (+0.02) | 0.001 | 0.00 / 0.34 / 0.02 | 0.080 | 96 / 0 |
| η | 1.00 (-0.04) | 0.001 | 0.00 / 0.19 / 0.02 | 0.002 | 27 / 42 |
| 0.869; 0.005 at m = 3 | 0.435; 0.012 at m = 3 | 0.00 / 0.11 / 0.01 | 0.011 | 9 / 23 |
S4 Data
S4.1 Construction of the solo keyboard corpus
The source is the Kunst der Fuge collection of about 18,000 MIDI files [S8], the same collection used in earlier corpus studies [S9–S12]. It was curated to balance periods, composers, and melody lengths in three scripted stages (corpus_build/). Candidates: only piano or harpsichord programs (GM 0–7); no vocal, ensemble, organ, four-hand, or arrangement words in the title; at most two note-bearing channels or a keyboard-genre title (keyboard fugues are often encoded one voice per channel); one file per duplicated title. Periods: median year of composition per composer, binned at 1750, 1820, and 1890; Schubert and Hummel placed in Classical. Pieces: multi-movement files split at movement-index markers ((2), II, No. 2), else at a silence of beats coinciding with a meter or key change, with notes per segment (Beethoven Op. 106 4, Chopin Op. 25 12, Liszt's Sonata 1). Movements share a work only in multi-movement works; each piece of a collection is its own work. Sample: melodies extracted with seeded :hybrid; ; pieces per work; composers with eligible pieces; equal quotas per period in six log- bins, round-robin over composers, per composer, fixed seed (Table S5). Limitations: heuristic classification; dating per composer; form labels unknown for of pieces; Telemann, Mattheson, Gade, and Krebs end below ten pieces. Curation check: on an earlier, unbalanced set of 1,131 solo piano pieces in of pieces at , as on the present corpus (98.9–99.9%).
Table S5. Composers (pieces).
| Baroque | Bach 24, Handel 22, D. Scarlatti 22, Couperin 21, d'Anglebert 20, Dandrieu 20, Froberger 17, Corrette 12, Jollage 12, Jacquet de La Guerre 11, Rameau 11, Krebs 9, Mattheson 8, Telemann 4 |
|---|---|
| Classical | Beethoven 30, Mozart 30, Haydn 28, Schubert 23, A.-L. Couperin 22, Cramer 20, Clementi 18, L. Mozart 17, Hummel 14, Soler 11 |
| Romantic | Chopin 20, Alkan 19, Raff 19, Schumann 19, Brahms 18, Fauré 18, Liszt 18, Tchaikovsky 17, Saint-Saëns 13, Albéniz 12, Dvořák 11, Grieg 11, Mendelssohn 10, Gade 8 |
| 20th century | Busoni 30, Debussy 30, Scriabin 30, Joplin 20, Pozzoli 17, Ravel 17, Shostakovich 17, Satie 16, Bartók 13, Godowsky 13, Janáček 10 |
Table S6. Solo keyboard corpus by period. “Top” is the share of the period’s pieces by its most represented composer; Schubert and Hummel are placed in the Classical period.
| Period | Dates | Composers | Pieces | Works | , median (IQR) | Top |
|---|---|---|---|---|---|---|
| Baroque | before 1750 | 14 | 213 | 208 | 301 (186–577) | 11% |
| Classical | 1750–1819 | 10 | 213 | 193 | 322 (184–584) | 14% |
| Romantic | 1820–1889 | 14 | 213 | 209 | 317 (173–561) | 9% |
| 20th century | from 1890 | 11 | 213 | 212 | 327 (179–563) | 14% |
| Total | 49 | 852 | 822 | 322 (179–571) |
S4.2 Prelude & Fugue set
108 pieces: Bach WTC I from OpenWTC in PDMX [S13,S14], split at the fugue’s first measure (no clean split edition in Kunst der Fuge); Mendelssohn Op. 35 and Shostakovich Op. 87 from Kunst der Fuge. Extraction is fixed to seeded :hybrid (the method changes by bits). In Op. 35 No. 6 (prelude) a 28-note secondary track was removed (melody notes); fugue results are unchanged.
S4.3 Census corpora
Essen [S15] and MTC-ANN 2.0.1 [S16] are read through MTCFeatures [S17]; a phrase is a run of notes with one phrase index, kept if (1,890 and 44,765 phrases). MTD [S18]: 2,067 themes from MusicXML, top note under simultaneities, all (no license stated; used as distributed, not redistributed). Boundaries were set by people, Essen encoders mostly following text lines [S19], MTC transcribers rhyme and syntax [S20], and MTD editors complete themes. Null: for each segment, the exact probability that a random rearrangement of its notes (or of its intervals, from the same first note) has a non-trivial stabilizer under , by counting fixed arrangements per prime-order element (first-order bound above arrangements: 113 MTD segments, overcount ). Enrichment with , per exact , smoothed by a Gamma–Poisson model with parity-specific prior means (the null itself favors even lengths, so expected counts are computed per exact length before pooling) [S21], shown where . The main-text figure pools exact lengths into bins (4–6, 7–9, 10–12, 13–16, 17–24, 25–41), with an exact Poisson interval [S22]; pooling replaces the smoothing, whose estimates fall below one at lengths with no symmetric segment and small (MTD, and 11).
S5 Melody extraction
S5.1 Melody extraction methods
Skyline [S23] keeps the highest note at each onset and truncates it at the next onset. The revised variant [S24] first drops notes mostly covered by other voices. :hybrid [S25] clusters the note groups (MIDI tracks, MusicXML parts) by mean pitch with k-means, keeps the highest cluster, and applies skyline. :complexity [S26] keeps the group with the largest summed entropy of pitch, interval, and duration, regardless of register, and applies skyline. All analyses use :hybrid, and :complexity is the check of Section S5.3. Lines are not transposed to a common key (e.g. with the Center of Effect [S27]). , and the symmetry types are invariant under a global transposition, and a local key change alters at most windows.
S5.2 Implementation
The pipeline is implemented in Julia with MelodicSymmetry.jl and MelodyExtraction.jl, developed for this study and tested by a sweep over every group element (Theorem 1), hand-computed stabilizers, and published worked examples [S1]. Stabilizer and canonical representative cost per window (48m group elements, each), so a line of N windows costs ; is exact in BigInt through Eq. (S5).
S5.3 Extraction consistency: :hybrid versus :complexity
Agreement. Each piece was also reduced with :complexity and with plain skyline, which agree by construction for the 393 single-track keyboard pieces. In the 459 multi-track pieces :hybrid and :complexity return the identical line in 40% (two tracks 61%, four or more 21%, dances 63%, contrapuntal and free 27–30%), and in 47% of the Prelude & Fugue set (fugues 43%, preludes 52%). Disagreeing selectors keep a different track and share no notes in 73% of cases.
Distance between the two lines. The Jensen–Shannon divergence of the orbit distributions is scaled from 0, between the two halves of the extracted line, to 1, to another piece by the same composer, at equal length. Where the selectors disagree, the other line lies at 0.54 at m = 4 (dances 0.86, cyclic 0.64, contrapuntal -0.33), at -0.19 to 0.02 in fugues (m = 3–6), whose voices share the subject, and at 0.69–0.75 in preludes, where it is the accompaniment. The scale resolves best at m = 3–4.
Sensitivity. Over multi-track pieces at the median change is 0.05 bits in , 0.008 in , and 0.02 bits in (rank correlations between selectors 0.77, 0.81, 0.63), and 0.26, 0.038, and 0.10 where the lines differ. These are below the period differences in (0.40 bits between medians) and the form differences in (0.12), but comparable to the period differences in and at .
Robustness. Every main-text test was rerun on the 578 keyboard and 51 Prelude & Fugue pieces with identical lines, and on the :complexity line of every piece with IAAFT nulls on the same seeds. In each reading 70 of 74 tests keep their conclusion and 92–97% of pieces stay significantly below IAAFT. With :complexity lines the period trend in becomes significant at m = 4, the form difference in the IAAFT deficit at m = 6, and the fugue trend in at m = 6, while the form difference in at m = 3 is lost (Table S8). On identical lines only Prelude & Fugue tests change, by loss of power (one Mendelssohn and two Shostakovich fugues keep their line). The fugue trend and the Shostakovich fugue–prelude gap hold with :complexity lines.
S6 Statistical procedures
Inference is rank- or permutation-based, with an effect size for every test. Pieces are the observations, and dependence is respected by permuting or resampling whole clusters (composers, songs, works) [S28]. Table S7 lists the procedure behind each result.
Equivalence. A non-significant difference is not evidence of equality. Similarity claims are read from intervals against the negligible band [S29]; intervals wider than the band (e.g. , Bach versus Shostakovich, ) are reported as no detectable difference.
Reproducibility. The script behind each table and figure is listed in the repository README (Data accessibility). Surrogates are seeded from each file name; permutation seeds are fixed in each script.
Table S7. Procedure behind each result. KW: Kruskal–Wallis; JT: Jonckheere–Terpstra; BH: Benjamini–Hochberg; : Cliff's delta.
| Question | Data | Test | Multiplicity | Effect size |
|---|---|---|---|---|
| Lower than nulls (§3.1) | piece | rank of among 199 surrogates (two-sided); sign test across pieces | BH over pieces | , |
| Periods (§3.2) | piece | KW; period labels permuted between composers (9,999); ordered trend as Spearman , same permutation; measures , , | Holm over | ; with composer-bootstrap 90% CI |
| Forms (§3.2) | labeled piece | KW; form labels permuted within composers (9,999); also as residual on ; and against IAAFT | Holm over | ; |
| Where measures vary (§3.2) | piece | adjusted of ranks on period, composer, form (descriptive) | — | variance share |
| Composers, form fixed (§3.3) | piece | one-sided JT (50,000 permutations); exact Wilcoxon signed-rank for fugue–prelude pairs | Holm over per measure | with 90% stratified-bootstrap CI |
| Symmetry types (§3.4) | piece | class share ranked among 199 surrogates per null; sign test; period trend as Spearman with periods permuted between composers | BH over pieces | of class shares |
| Relations (§3.5) | piece | against the within-orbit shuffle (Haldane–Anscombe); KW and Spearman trend with composers permuted between periods; composers permuted within periods; JT and Wilcoxon in the P&F set; operation entropy per within-orbit shuffle, period trend and JT on the interval deficit | Holm over ; BH over pieces | corpus , composer-bootstrap 90% CI; adjusted |
| Other entropy measures (§S3) | piece | NSB per reading; periods and forms as above; JT on fugues; rank among 199 IAAFT surrogates | Holm over ; BH over pieces | partial , adjusted , share below / above surrogates |
| Extraction (§S5.3) | piece | identity, Jaccard overlap, and orbit JSD against a noise floor and a different-music ceiling; every test rerun on pieces with identical lines and with :complexity lines | as in each test | share of tests with unchanged conclusion |
| Whole sequences (§3.6) | segment | exact under note shuffle (interval shuffle as check) | — | , Garwood and song/work-bootstrap 95% CI |
S7 Supplementary results
S7.1 Control sequences


asymmetric
retrograde
retro_inversion
multiple
inversion
translation
Figure S3. Window stabilizer-type profiles of the annotated melodies and controls at m = 3 and m = 5. At m = 3 short palindromes dominate; at m = 5 the types separate return figures (retrograde), scalar or mirror motion (RI) and directed subjects (asymmetric).
S7.2 Orbit structure against surrogates
Real versus null lines. With BH control over the 852 pieces, 93–98% are significantly below the shuffle and IAAFT nulls at m = 3–6, and 26, 72, 83, and 87% below Markov-1 [S30]. The full ordering of Eq. (13) holds piece by piece in 87–90% of pieces at and in 36% at m = 3, where the Markov null nearly reproduces the real line (Figure S4).


Figure S4. Relative deficit of the 852 corpus pieces under shuffle, IAAFT, and Markov-1 surrogates (199 each), ; labels give the share of pieces below their null.
S7.3 Vocabulary across periods, deployment across forms
Separation tests (Table S8; panels not in Figure 8 in Figure S5). Forms differ in the deficit and in only when pieces are treated as independent, and lose the effect once labels are permuted within composers. The form effect on survives at every , with or without removed.
Table S8. Separation of periods and forms for each measure. Periods: Kruskal–Wallis with period labels permuted between composers (Holm over ), , and the ordered trend Baroque 20th century as Spearman with composers permuted as blocks (Holm in parentheses). Forms: Kruskal–Wallis with form labels permuted within composers (Holm over ), . Bold: . Pairwise in Data/cluster_tests.csv. Not retained with :complexity lines (Section S5.3).
| Measure | Periods | Forms | ||||
|---|---|---|---|---|---|---|
| trend () | ||||||
| deficit vs IAAFT | 3 | 0.003 | 0.06 | +0.19 (0.010) | 1.000 | 0.00 |
| 4 | 1.000 | 0.02 | +0.10 (0.599) | 1.000 | 0.01 | |
| 5 | 1.000 | 0.01 | +0.09 (0.599) | 1.000 | 0.05 | |
| 6 | 1.000 | 0.00 | +0.05 (0.599) | 0.175 | 0.10 | |
| 3 | 0.002 | 0.09 | +0.22 (0.008) | 1.000 | 0.00 | |
| 4 | 0.191 | 0.04 | +0.16 (0.161) | 1.000 | 0.01 | |
| 5 | 0.265 | 0.04 | +0.14 (0.182) | 1.000 | 0.04 | |
| 6 | 0.498 | 0.02 | +0.10 (0.239) | 0.573 | 0.10 | |
| 3 | 1.000 | -0.00 | +0.03 (1.000) | 0.003 | 0.06 | |
| 4 | 1.000 | 0.00 | -0.04 (1.000) | < 0.001 | 0.08 | |
| 5 | 0.698 | 0.02 | -0.08 (1.000) | < 0.001 | 0.07 | |
| 6 | 1.000 | 0.01 | -0.02 (1.000) | 0.001 | 0.03 | |
| 3 | 0.005 | 0.06 | +0.18 (0.015) | 0.04 | ||
| 4 | 0.868 | 0.00 | +0.08 (0.288) | 0.442 | 0.02 | |
| 5 | 0.008 | 0.05 | +0.22 (0.002) | 0.442 | 0.03 | |
| 6 | 0.868 | 0.01 | +0.07 (0.288) | 0.442 | 0.02 | |
| , length removed | 3 | — | — | — | < 0.001 | 0.14 |
| 4 | — | — | — | < 0.001 | 0.11 | |
| 5 | — | — | — | < 0.001 | 0.08 | |
| 6 | — | — | — | < 0.001 | 0.03 | |
| vs IAAFT | 3 | 1.000 | 0.00 | — | < 0.001 | 0.11 |
| 4 | 1.000 | 0.01 | — | < 0.001 | 0.13 | |
| 5 | 1.000 | 0.00 | — | < 0.001 | 0.08 | |
| 6 | 1.000 | 0.00 | — | < 0.001 | 0.03 | |
Variance shares (Table S9). Composer has the largest share for every measure. (Table S10) is nearly length-free only at (Section S7.4.1). Within each period dances have the lowest (Table S11).
Table S9. Where the measures vary: share of rank variance explained (adjusted of a least-squares fit on ranks) by period, composer, composer beyond period, form (labeled pieces), and form beyond composer. Descriptive; composers are nested in periods.
| Measure | period | composer | composer | period | form | form | composer | |
|---|---|---|---|---|---|---|
| deficit | 3 | 0.06 | 0.17 | 0.10 | 0.00 | 0.02 |
| 4 | 0.02 | 0.22 | 0.21 | 0.01 | 0.00 | |
| 5 | 0.01 | 0.26 | 0.25 | 0.05 | -0.00 | |
| 6 | 0.00 | 0.30 | 0.30 | 0.10 | 0.00 | |
| 3 | 0.09 | 0.21 | 0.13 | 0.00 | 0.02 | |
| 4 | 0.04 | 0.26 | 0.22 | 0.01 | 0.01 | |
| 5 | 0.04 | 0.28 | 0.25 | 0.04 | 0.01 | |
| 6 | 0.02 | 0.32 | 0.30 | 0.10 | 0.01 | |
| 3 | -0.00 | 0.21 | 0.21 | 0.06 | 0.02 | |
| 4 | 0.00 | 0.20 | 0.19 | 0.08 | 0.02 | |
| 5 | 0.02 | 0.20 | 0.18 | 0.07 | 0.03 | |
| 6 | 0.01 | 0.18 | 0.17 | 0.03 | 0.02 | |
| , length removed | 3 | 0.00 | 0.23 | 0.23 | 0.14 | 0.03 |
| 4 | 0.02 | 0.20 | 0.18 | 0.11 | 0.04 | |
| 5 | 0.05 | 0.19 | 0.14 | 0.08 | 0.05 | |
| 6 | 0.02 | 0.15 | 0.13 | 0.03 | 0.04 | |
| 3 | 0.06 | 0.14 | 0.08 | 0.04 | 0.03 | |
| 4 | 0.00 | 0.11 | 0.11 | 0.02 | 0.01 | |
| 5 | 0.05 | 0.18 | 0.13 | 0.03 | -0.00 | |
| 6 | 0.01 | 0.12 | 0.12 | 0.02 | 0.00 | |
| 3 | 0.00 | 0.19 | 0.19 | 0.11 | 0.04 | |
| 4 | 0.01 | 0.18 | 0.17 | 0.13 | 0.04 | |
| 5 | 0.00 | 0.16 | 0.16 | 0.08 | 0.04 | |
| 6 | 0.00 | 0.18 | 0.17 | 0.03 | 0.03 |
Table S10. Deployment ratio against 199 IAAFT surrogates per piece: medians of the real , the null mean, and ; percentage of pieces significantly above / below the null after Benjamini–Hochberg control; Spearman of and with .
| above / below (%) | ||||||
|---|---|---|---|---|---|---|
| 3 | 0.501 | 0.576 | -0.071 | 4 / 80 | +0.76 | -0.38 |
| 4 | 0.284 | 0.265 | +0.016 | 42 / 27 | +0.76 | -0.15 |
| 5 | 0.170 | 0.096 | +0.063 | 76 / 3 | +0.66 | +0.35 |
| 6 | 0.107 | 0.044 | +0.058 | 81 / 2 | +0.58 | +0.54 |
Table S11. Deployment ratio by form within each period: Cliff's of the other labeled forms against dances (positive: dances lower), with the -value of a Kruskal–Wallis test over all forms with form labels permuted within composers (9,999 permutations). Bold: .
| Period | composers with ≥ 2 forms | dances | ||||
|---|---|---|---|---|---|---|
| Baroque | 5 | 19 | +0.36 (0.240) | +0.36 (0.180) | +0.43 (0.212) | +0.32 (0.098) |
| Classical | 8 | 23 | +0.72 (< 0.001) | +0.47 (0.011) | +0.41 (0.035) | +0.17 (0.119) |
| Romantic | 10 | 12 | +0.05 (0.657) | +0.16 (0.672) | +0.20 (0.541) | +0.23 (0.655) |
| 20th century | 5 | 11 | +0.35 (0.314) | +0.56 (0.043) | +0.62 (0.015) | +0.67 (0.009) |

(b)

(c)

Figure S5. Panels complementing Figure 8, . (a) by period (213 pieces each). (b) Relative deficit of against IAAFT and (c) by form family (508 labeled pieces). Tests in Table S8.
S7.4 Deployment in preludes and fugues
Tests at are in Table S12, at every in Figure S7, and paired values in Figure S8. At still depends on length (Section S7.4.1), so these sizes point the same way but carry no claims. is taken over the six classes of Table 2; over stabilizer conjugacy classes the fugue trend is the same (Holm at ).
Table S12. Prelude & Fugue tests at . Fugue trend: one-sided Jonckheere–Terpstra, Bach < Mendelssohn < Shostakovich, Holm over . : Cliff's delta with 90% stratified-bootstrap interval. Paired: exact Wilcoxon signed-rank on fugue–prelude .
| Test | Result |
|---|---|
| Fugue trend, | ; ; ; ; |
| of fugue | ; |
| Paired fugue–prelude, | ; Mendelssohn 0.94; Shostakovich 0.002 |
| Interaction trend, | |
| with fugue/prelude length ratio |
S7.4.1 Length dependence of the deployment ratio
is a plug-in estimate and grows with melody length: in the Prelude & Fugue set , , at , also within composers (Figure S6); is length-free only at (). Hence the length-matched corpus, on which period differences in largely vanish ( medians ), while and stay near length-flat (, ).

length L (notes)
length L (notes)
length L (notes)
Bach prelude
Bach fugue
Mendelssohn prelude
Mendelssohn fugue
Shostakovich prelude
Shostakovich fugue
Figure S6. (top) and (bottom) against melody length, Prelude & Fugue set, ; : Spearman correlation with .

Figure S7. of preludes and fugues by composer, ; titles give the Jonckheere–Terpstra fugue trend (Holm over ).

Figure S8. Paired prelude and fugue of each number, (top) and (bottom), ; thick line: medians; : exact Wilcoxon signed-rank test on .
S7.5 Symmetry types of short windows
Counting baseline over all windows for Figure 10a: Table S13.
Table S13. Share of windows per stabilizer class (%): uniform alphabet (u, all windows) and the range of the four period means in the corpus (real).
| class | ||||||||
|---|---|---|---|---|---|---|---|---|
| u | real | u | real | u | real | u | real | |
| asymmetric | 58.3 | 41.3–47.7 | 63.9 | 42.2–47.3 | 93.2 | 74.4–82.4 | 94.9 | 70.7–76.2 |
| retrograde | 20.8 | 33.3–35.4 | 13.9 | 24.0–27.2 | 3.4 | 13.0–17.3 | 2.2 | 11.6–14.0 |
| retro-inversion | 16.7 | 16.2–16.8 | 12.5 | 12.0–13.1 | 3.4 | 4.1–5.5 | 2.1 | 5.2–5.8 |
| inversion | 0 | 0 | 4.6 | 2.0–2.6 | 0 | 0 | 0.5 | 0.3–0.4 |
| translation | 0 | 0 | 0 | 0 | 0 | 0 | 0.1 | 0.7–1.1 |
| multiple | 4.2 | 2.3–6.7 | 5.1 | 12.7–17.7 | 0.1 | 0.5–2.8 | 0.3 | 4.0–8.4 |
Against nulls. Class shares against each piece's surrogates are in Table S14. The retrograde excess over shuffled lines grows with and nearly vanishes against Markov-1. The multiple class (repeated notes, oscillations) exceeds every null, and its rise across periods holds with composers permuted as blocks ( against Markov-1, , at , and , at ). Inversion windows are below every null.
Table S14. Observed over expected share of windows per symmetry class (pieces weighted equally), against 199 surrogates per piece.
| Class | shuffle | IAAFT | Markov-1 | |||
|---|---|---|---|---|---|---|
| retrograde | 1.20 | 2.36 | 1.07 | 1.74 | 0.99 | 1.16 |
| RI | 1.10 | 2.25 | 1.21 | 2.11 | 1.10 | 1.53 |
| inversion | 0.59 | 0.77 | 0.67 | 0.77 | 0.58 | 0.86 |
| multiple | 2.12 | 8.18 | 1.65 | 4.44 | 1.12 | 1.80 |
Symmetry-type entropy. (Eq. (11)) is at or slightly below the nulls at and above every null from (Table S15). It rises across periods at and 5 only, possibly because at odd the multiple class holds almost only repeated notes, whereas at even two-note oscillations, common in every period, also enter it (not tested). Its correlation with () does not affect the length-matched periods but weakens the comparison of forms.
Table S15. of real lines against 199 surrogates per piece: median of in bits, with the percentage of pieces significantly above / below the null after Benjamini–Hochberg control in parentheses.
| Null | ||||
|---|---|---|---|---|
| shuffle | -0.06 (15/29) | +0.10 (34/9) | +0.22 (49/3) | +0.56 (80/1) |
| IAAFT | -0.09 (12/36) | +0.07 (23/9) | +0.10 (33/11) | +0.45 (70/2) |
| Markov-1 | -0.01 (0/0) | -0.06 (4/20) | +0.07 (20/2) | +0.19 (39/3) |
S7.6 Transformations between recurring motifs
Definition. The typing map is a homomorphism of onto , so the four non-repetition types compose like the elements of the Klein four-group, and the rotated flag is read separately. The members , of a relation coset (Eq. (12)) share one type only when the stabilizer holds no inversion or retrograde, which is why profiles are taken over pairs of asymmetric windows. If the windows of an orbit take forms , their relations are , so the relation distribution of a line is the autocorrelation of its form distribution over [S31]. A line with relates each motif only to itself, and a line with spreads its relations evenly, so bounds the spread of relations but does not fix their types.
Nulls. The within-orbit shuffle permutes, within each orbit, the forms of its windows, which keeps every orbit, the number of windows in each form, , , and . Under uniform forms each window takes a form drawn uniformly from its orbit. Its expectation is analytic, a rotated share of (observed shares in Figure S13) and, among unrotated relations, 1/48 repetition, 11/48 transposition, and 12/48 each of inversion, retrograde, and retrograde-inversion. The surrogates are those of Section 2.7, with the same seeds. Profiles over all windows dilute retrograde-inversion (Figure S14).
Model. The corpus of a type is the mean observed over the mean expected share, pieces weighted equally, with a composer-bootstrap interval (Table S16). Per piece, uses pair counts plus 0.5 [S32, S33], since of pieces lack a given type and dropping them would bias comparisons upward. Periods are compared by Kruskal–Wallis and the ordered Spearman trend with composers permuted between periods, and composers by permuting pieces between composers of one period, Holm-adjusted over . Composer means are shrunk toward the period mean by a normal-normal empirical-Bayes model with moment-estimated between-composer variance [S34], which is zero for Romantic composers at (Figures 12 and S11, open markers unshrunk).
Results (Table S16; Figures S9–S12). Composers differ within periods for transposition and inversion at every (Holm ), for retrograde-inversion at , and for retrograde at . Composer explains of the rank variance of transposition and inversion, period at most . Across periods only retrograde-inversion differs, declining from the Baroque to the 20th century ( to , Holm ), as does the share of fifths among transpositions ( at every ; Figure S10). In the fugues the fifth share falls from Bach to Shostakovich (Jonckheere-Terpstra, Holm at ). Paired fugue–prelude differences are not significant except for transposition in Shostakovich at (Holm ). After Benjamini–Hochberg control few single pieces depart from the within-orbit shuffle (none at , above for transposition at ), so the results rest on pooling pieces.
Table S16. Relation types against the within-orbit shuffle, pairs of asymmetric windows: corpus with composer-bootstrap interval and, in parentheses, the percentage of pieces above the null.
| m | transposition | inversion | retrograde | retrograde-inversion |
|---|---|---|---|---|
| 3 | 1.10 [1.06, 1.14] (54) | 0.90 [0.88, 0.92] (41) | 1.00 [0.98, 1.02] (54) | 1.21 [1.18, 1.23] (79) |
| 4 | 1.56 [1.47, 1.66] (75) | 0.84 [0.80, 0.88] (36) | 0.97 [0.94, 1.01] (46) | 1.33 [1.28, 1.39] (71) |
| 5 | 2.00 [1.86, 2.15] (76) | 0.75 [0.70, 0.80] (30) | 1.06 [1.01, 1.11] (46) | 1.38 [1.31, 1.46] (66) |
| 6 | 3.17 [2.92, 3.44] (73) | 0.57 [0.51, 0.64] (22) | 0.84 [0.77, 0.92] (30) | 1.17 [1.06, 1.29] (48) |


keyboard vs within-orbit shuffle
keyboard vs shuffle
keyboard vs Markov-1
keyboard vs IAAFT
Figure S9. Relation types relative to the within-orbit shuffle (filled, 90% composer-bootstrap interval) and to the shuffle, IAAFT, and Markov-1 surrogates (open), m = 3–6, pairs of asymmetric windows.


keyboard vs within-orbit shuffle Bach fugues
Shostakovich fugues
Mendelsohn fugues
Figure S10. Transposition intervals relative to the within-orbit shuffle, keyboard corpus and Prelude & Fugue fugues by composer, m = 3–6.

Figure S11. Composer means of each relation type relative to the within-orbit shuffle, m = 4, shrunk toward the period mean (filled, s.d.) with the unshrunk mean (open) and the period mean (dotted). Composers are ordered by transposition in every panel.


lag between windows
transposition
inversion
lag between windows
retrograde
retro-inversion
Figure S12. Rate of each relation type per pair relative to the within-orbit shuffle, by the distance between the starts of the two windows, grouped in doubling ranges , , (every integer counted). Every rate exceeds one because rotated relations are rarer than under the null, so types are compared within a distance range.


× within-orbit shuffle (me
Figure S13. Share of relations that include a cyclic shift, per piece by period (boxes), with the median under the within-orbit shuffle (cross) and the uniform expectation (dashed).


O all windows
asymmetric windows
Figure S14. Retrograde-inversion relative to the within-orbit shuffle over all windows (open) and over asymmetric windows only (filled), by period. Over all windows, transpositions of constant-step runs are also counted as retrograde-inversions, which dilutes the comparison.

Figure S15. Repetition relative to uniform forms and to the three surrogates, m = 3–6, with 90% composer-bootstrap intervals. The within-orbit shuffle keeps repetition by construction.
Entropy of the operations. Over the 48 unrotated operations the chain rule gives
with over pairs of asymmetric windows and . Each is invariant under transposing the whole line, which shifts by 0 or by twice the transposition. Every term is computed in each of the 199 within-orbit shuffles and averaged, so observed and expected values rest on the same pairs (Figure S16). stays at the shuffle at every , and lies below it in 70–88% of pieces at . lies below only at , since at larger transposition (eleven intervals) replaces repetition (one), so it is not reported alone. The transposition-interval deficit, shuffle minus observed , falls across periods and across the fugues from Bach to Shostakovich (Jonckheere–Terpstra at , at , not at ).
(a)

(b)
(c)

Figure S16. Entropy of the operations relating windows, m = 4, pairs of asymmetric windows. (a) Type entropy and interval entropy within each type, observed and under the within-orbit shuffle (median and interquartile range over pieces). (b) Deficit of the transposition intervals, shuffle minus observed , by period (boxes) with composer medians (dots). (c) The same deficit in the Prelude & Fugue set, fugues (squares) and preludes (circles) by composer, with medians as bars.
S7.7 Symmetric phrases and themes
Class shares and the interval-shuffle check are in Figures S17 and S18. Clustering. The census null treats segments as independent trials with their own , but segments of one song or work are dependent and may repeat literally. Resampling whole songs (Essen, MTC-ANN) or works (MTD) gives [1.34, 2.02] (MTC-ANN), 1.59 [1.54, 1.64] (Essen), and 5.08 [3.01, 9.74] (MTD). Keeping each literally repeated phrase once per song changes by at most (Essen, ). Per-bin intervals match the Garwood intervals for Essen and MTC-ANN but are much wider for long MTD themes ( : [16.6, 1136]).

Figure S17. Share of segments with each exact symmetry class, per census corpus.

Figure S18. Enrichment under the note-shuffle (filled) and interval-shuffle (open) nulls, per exact length (log scale; dashed line: no enrichment).
S7.8 Symmetry-subgroup richness
Exact stabilizer subgroups are counted as species and pieces as samples, as harmonic vocabulary was counted on the same corpus [S12]. For N pieces, is the number of pieces containing subgroup , the number of subgroups observed, and the number found in exactly k pieces. Since observed richness grows with sampling effort, periods are compared at a common effort k by incidence rarefaction [S35, S36],
and total richness is estimated by Chao2 [S37, S38],
Rarefaction bands are the 2.5–97.5th percentiles over 200 random piece orders (without replacement). They vanish at and are not intervals for the total. Chao2 intervals are log-normal, with ,
and percentile bootstrap over resamples of pieces with replacement [S39–S41], which agree except at small , where the analytic interval is preferred. Both estimators are the case of Chao et al. [S42]. Six-class curves saturate at , so curves use exact subgroups, (Figure 10b). Pieces are treated as independent, so pieces by one composer are not kept together and the comparison between periods is descriptive.
Supplementary References
[S1] Olga Ibragimova and Chrystopher L. Nehaniv. Algebraic applications in investigation of musical symmetry. In Springer Proceedings in Mathematics & Statistics, pages 47–59. Springer, 2025.
[S2] I. Nemenman, F. Shafee, and W. Bialek. Entropy and inference, revisited. In Advances in Neural Information Processing Systems (NIPS), 2002.
[S3] I. Nemenman. Coincidences and estimation of entropies of random variables with large cardinalities. Entropy, 13(12):2013–2023, 2011.
[S4] D. H. Wolpert and D. R. Wolf. Estimating functions of probability distributions from a finite set of samples. Physical Review E, 52(6):6841–6854, 1995.
[S5] Darrell Conklin and Ian H. Witten. Multiple viewpoint systems for music prediction. Journal of New Music Research, 24(1):51–73, 1995.
[S6] C. Bandt and B. Pompe. Permutation entropy: A natural complexity measure for time series. Physical Review Letters, 88(17):174102, 2002.
[S7] James P. Crutchfield and David P. Feldman. Regularities unseen, randomness observed: levels of entropy convergence. Chaos, 13(1):25–54, 2003.
[S8] Kunst der Fuge. Kunst der fuge: Classical music in MIDI files. https://www.kunstderfuge.com/. Accessed 2021.
[S9] Alfredo González-Espinoza, Hernán Larralde, Gustavo Martínez-Mekler, and Markus Müller. Multiple scaling behaviour and nonlinear traits in music scores. Royal Society Open Science, 4(12), 2017.
[S10] Alfredo González-Espinoza, Gustavo Martínez-Mekler, and Lucas Lacasa. The arrow of time across five centuries of classical music. Phys. Rev. R, 033166:1–16, 2020.
[S11] Doheum Park, Juhan Nam, and Juyong Park. Novelty and influence of creative works, and quantifying patterns of advances based on probabilistic references networks. EPJ Data Science, 9(1), 2020.
[S12] Marc Serra-Peralta, Joan Serra, and Álvaro Corral. Heaps' law and vocabulary richness in the history of classical music harmony. EPJ Data Science, 10(1):40, Aug 2021.
[S13] Kimiko Ishizaka and MuseScore. The open well-tempered clavier. https://www.welltemperedclavier.org/, 2015.
[S14] Phillip Long, Zachary Novack, Taylor Berg-Kirkpatrick, and Julian McAuley. PDMX: A large-scale public domain MusicXML dataset for symbolic music processing. In ICASSP 2025 – IEEE International Conference on Acoustics, Speech and Signal Processing, pages 1–5, 2025.
[S15] Helmut Schaffrath. The Essen folksong collection in the Humdrum Kern format. Technical report, Center for Computer Assisted Research in the Humanities (CCARH), Stanford University, 1995. D. Huron, ed.
[S16] Peter van Kranenburg, Berit Janssen, and Anja Volk. The Meertens tune collections: The annotated corpus (MTC-ANN) versions 1.1 and 2.0.1. Meertens Online Reports 2016-1, Meertens Institute, Amsterdam, 2016.
[S17] Peter van Kranenburg. Melodic features for Meertens tune collections and ESSEN folksong collection (version 1.1), 2019.
[S18] Frank Zalkow, Stefan Balke, Vlora Arifi-Müller, and Meinard Müller. MTD: A multimodal dataset of musical themes for MIR research. Transactions of the International Society for Music Information Retrieval, 3(1):180–192, 2020.
[S19] Belinda Thom, Christian Spevak, and Karin Höthker. Melodic segmentation: Evaluating the performance of algorithms and musical experts. In Proceedings of the International Computer Music Conference (ICMC), pages 65–72, Gothenburg, Sweden, 2002.
[S20] Peter van Kranenburg, Martine de Bruin, Louis P. Grijp, and Frans Wiering. The Meertens tune collections. Meertens Online Reports 2014-1, Meertens Institute, Amsterdam, 2014.
[S21] David Clayton and John Kaldor. Empirical Bayes estimates of age-standardized relative risks for use in disease mapping. Biometrics, 43(3):671–681, 1987.
[S22] F. Garwood. Fiducial limits for the Poisson distribution. Biometrika, 28(3/4):437–442, 1936.
[S23] A. L. Uitdenbogerd and J. Zobel. Manipulation of music for melody matching. In Proc. ACM Multimedia, pages 235–240, 1998.
[S24] W. Chai and B. Vercoe. Melody retrieval on the web. In Proc. SPIE 4673, Multimedia Computing and Networking 2002, pages 226–242, 2001.
[S25] G. Ozcan, C. Isikhan, and A. Alpkocak. Melody extraction on midi music files. In Proc. Seventh IEEE International Symposium on Multimedia (ISM 2005), pages 414–422, 2005.
[S26] S. T. Madsen and G. Widmer. A complexity-based approach to melody track identification in midi files. In Proc. IJCAI Workshop on Artificial Intelligence and Music (Music-AI), IJCAI-07, 2007.
[S27] Elaine Chew. Towards a Mathematical Model of Tonality. PhD thesis, Massachusetts Institute of Technology, 2000. Spiral Array model; Center of Effect Generator (CEG).
[S28] Stuart H. Hurlbert. Pseudoreplication and the design of ecological field experiments. Ecological Monographs, 54(2):187–211, 1984.
[S29] Jeanine Romano, Jeffrey D. Kromrey, Jesse Coraggio, and Jeff Skowronek. Appropriate statistics for ordinal level data: Should we really be using t-test and Cohen's d for evaluating group differences on the NSSE and other surveys? In Annual Meeting of the Florida Association of Institutional Research, 2006.
[S30] Yoav Benjamini and Yosef Hochberg. Controlling the false discovery rate: A practical and powerful approach to multiple testing. Journal of the Royal Statistical Society: Series B (Methodological), 57(1):289–300, 1995.
[S31] Persi Diaconis. Group Representations in Probability and Statistics, volume 11 of IMS Lecture Notes–Monograph Series. Institute of Mathematical Statistics, Hayward, CA, 1988.
[S32] J. B. S. Haldane. The estimation and significance of the logarithm of a ratio of frequencies. Annals of Human Genetics, 20(4):309–311, 1956.
[S33] F. J. Anscombe. On estimating binomial response relations. Biometrika, 43(3/4):461–464, 1956.
[S34] Carl N. Morris. Parametric empirical Bayes inference: theory and applications. Journal of the American Statistical Association, 78(381):47–55, 1983.
[S35] Robert K. Colwell, Chang Xuan Mao, and Jing Chang. Interpolating, extrapolating, and comparing incidence-based species accumulation curves. Ecology, 85(10):2717–2727, 2004.
[S36] Nicholas J. Gotelli and Robert K. Colwell. Quantifying biodiversity: procedures and pitfalls in the measurement and comparison of species richness. Ecology Letters, 4(4):379–391, 2001.
[S37] Anne Chao. Estimating the population size for capture-recapture data with unequal catchability. Biometrics, 43(4):783–791, 1987.
[S38] Anne Chao and Chun-Huo Chiu. Species richness: estimation and comparison. Wiley StatsRef: Statistics Reference Online, pages 1–26, 2016.
[S39] A. C. Davison and D. V. Hinkley. Bootstrap Methods and their Application. Cambridge University Press, Cambridge, 1997.
[S40] Bradley Efron and Robert J. Tibshirani. An Introduction to the Bootstrap. Chapman & Hall, New York, 1993.
[S41] Bryan F. J. Manly. Randomization, Bootstrap and Monte Carlo Methods in Biology. Chapman & Hall/CRC, Boca Raton, 3 edition, 2007.
[S42] Anne Chao, Nicholas J. Gotelli, T. C. Hsieh, Elizabeth L. Sander, K. H. Ma, Robert K. Colwell, and Aaron M. Ellison. Rarefaction and extrapolation with Hill numbers: a framework for sampling and estimation in species diversity studies. Ecological Monographs, 84(1):45–67, 2014.