arXiv:2610.40303physics.soc-phOct 2026

Manuscript Offprint

arXiv:2610.40303

Symmetric Structure and Motivic Transformation in Melodies, Phrases, and Themes

Alfredo González-Espinoza

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

agonzal3@andrew.cmu.edu

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 m=3−6m = 3-6 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 (m≥4m \geq 4). 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 60∘60^{\circ} 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 ( C2vC_{2v}) 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

Figure

snowflake

Stab=D6hStab = D_{6h}

24 operations

Figure

H2OH_{2}O

Stab=C2vStab = C_{2v}

4 operations

Figure

(60, 64, 67, 64, 60)

Stab=⟨F⟩Stab = \langle F \rangle

2 operations

Figure 1. Internal symmetry classifies an object independently of its identity. Left: a snowflake is left unchanged by rotations in steps of 60∘60^{\circ} and by reflections (one mirror σ\sigma shown), 24 operations in all, its point group D6hD_{6h} inherited from the hexagonal ice lattice. Middle: the water molecule H2OH_{2}O is left unchanged by a rotation (the C2C_{2} axis shown) and two reflection planes, its point group C2vC_{2v}. 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 ( Horbit,ηH_{orbit}, \eta) 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 m=12m = 12, 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 G=D12×DmG = D_{12} \times D_m, and give closed-form recipes for constructing and counting the melodies invariant under it [32]. We adopt their orbit count, with mm 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 log⁡2K(m)\log_{2} K(m) against which a measured entropy is read. The analogy does not go deeper, since consecutive windows share m−1m - 1 notes, so they are autocorrelated draws instead of an equilibrium ensemble, the orbit count grows too fast with mm 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 η\eta 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 G=D12×DmG = D_{12} \times D_m, namely the orbit entropy HorbitH_{orbit}, the deployment ratio η∈[0,1]\eta \in [0, 1], 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?

References (42)