Musical Structure as Torus Geometry
Cyclic Permutations, Phrase Closure, and Scale Selection on 𝕋³
Egils Jakovels - Independent researcher
E.J. discovered the ResonanT⁴ (RT⁴) framework, directed all research, and bears full responsibility for the content. Solo participated as an AI research collaborator – contributing mathematical development, computational analysis, code implementation, and manuscript preparation. All conceptual direction and theoretical decisions rest solely with E.J.
Abstract
We show that a cyclic permutation on the three-torus 𝕋³ encodes core structural elements of music – phrase closure, polyphonic voice decomposition, intervallic logic, melodic contour, rhythmic variation, and scale selection – within a five-parameter construction. The framework, which we call the ResonanT⁴ (RT⁴) musical mapping, requires only the integers (n, k) and frequencies (ω, ξ, ψ) to generate complete musical phrases with mathematically guaranteed properties. The orbit of the permutation is the phrase; phrase closure is a theorem, not a heuristic. When gcd(n, k) > 1, the orbit decomposes into identical sub-orbits offset in pitch – canonic voices, derived from number theory rather than compositional convention. We prove that quantization of an irrational winding ratio k/n to chromatic pitch classes produces a Sturmian sequence with exactly two interval types. For finite n, where k/n is rational, the quantized sequence is mechanical (periodic); the Sturmian description applies in the limit n → ∞. We show that the golden ratio φ yields the most consonant interval pair in 12-TET – the perfect fifth and minor sixth – by direct comparison with other constants. The circle of fifths emerges as the specific orbit (n = 12, k = 7). A systematic analysis of consonance over the complete (n, k) parameter space reveals that the harmonic vocabulary of the RT⁴ family is finite: exactly 23 distinct interval pair types exist across all admissible orbits, consisting of 12 adjacent-semitone pairs and 11 pure intervals (all chromatic intervals except unison, which is structurally excluded). Dominant consonance ridges at k/n ≈ 7/12 and k/n ≈ 5/12 partition the parameter space, with the golden ratio winding sitting between them in the highest-consonance region – providing a geometric explanation for the φ result. Computational verification across n = 2 to 10,000 confirms all theoretical predictions. We further demonstrate that coordinate derivatives produce non-uniform rhythmic contour, that k/n = 1/4 optimizes a composite melodic quality metric in 12-TET, and that ψ-dependent crystallization selects scales from microtonal continua when n ≫ 12.
Keywords: torus geometry, music theory, Sturmian sequences, golden ratio, cyclic permutation, algorithmic composition, well-formed scales, consonance landscape, interval pair atlas1. Introduction
Papers I-III [16, 17, 18] developed the ResonanT⁴ (RT⁴) framework for modular closure and transverse geometry on 𝕋³. This paper applies the same construction to musical structure. The torus, the cyclic group action, and the closure guarantees are identical; what changes is the interpretation: coordinates map to pitch, register, and dynamics rather than spatial positions.
The mapping is precise and falsifiable. Each algebraic property corresponds to an audible musical property:
1. Phrase closure from orbit theory (§3) – proven
2. Automatic polyphony from gcd decomposition (§3) – proven
3. Two-interval melodies from quantization of irrational winding (§4) – proven under stated hypotheses
4. A distinguished role for the golden ratio in 12-TET (§5) – computational
5. Empirical scaling laws for melodic quality (§6) – computational
6. Non-uniform rhythm from coordinate derivatives (§7) – computational
7. Scale selection from ψ crystallization in microtonal settings (§8) – computational
Prior work
The connection between cyclic generators and musical scales is well established. Carey and Clampitt [8] introduced well-formed scales with the Myhill property (exactly two step sizes). Clough and Douthett [9] developed maximally even sets. Our Theorem 3 (§4) recovers the two-step-size property from a torus-winding perspective; Theorem 2 (§3) on voice decomposition via gcd is implicit in the theory of generated collections.
The specific contributions beyond this tradition are: (a) embedding pitch, register, dynamics, and rhythm in a single geometric object rather than pitch-class collections alone; (b) explicit five-parameter control (n, k, ω, ξ, ψ) for deterministic phrase generation; (c) quantitative consonance comparison across mathematical constants (§5); and (d) empirical scaling laws for melodic quality (§6).
2. The RT⁴ Construction
2.1 The torus and its coordinates
Consider the three-torus 𝕋³ with coordinates (θ, φ, χ), each periodic on [0, 2π). We embed 𝕋³ in ℝ³ via the standard torus parametrization:
$$x = (R + a\cos\chi)\cos\theta, \quad y = (R + a\cos\chi)\sin\theta, \quad z = h\sin\phi$$
where R is the major radius, a the minor radial amplitude, and h the height amplitude. The three coordinates carry distinct musical meanings: θ → pitch class, φ (via z) → register/octave, χ (via r) → dynamics.
2.2 The five parameters
Place n points equally spaced around the torus, indexed by t ∈ {0, 1, …, n - 1}. The orbit is the sequence obtained by visiting these points in the order determined by the cyclic permutation σ_k, which maps observation step t to particle index kt mod n. That is, the sequence of visited particles is 0, k, 2k, 3k, … (mod n). The full parameter set is:
| Parameter | Symbol | Domain | Musical role |
|---|---|---|---|
| Particle count | n | ℕ, ≥ 2 | Chromatic resolution; phrase length |
| Winding number | k | ℤ/nℤ, gcd determines voice count | Interval between successive notes |
| Vertical frequency | ω | ℤ | Contour oscillation rate |
| Radial frequency | ξ | ℤ | Dynamic oscillation rate |
| Phase offset | ψ | [0, 2π) | Tonal center / scale selection |
Each particle p ∈ {0, 1, …, n - 1} has fixed torus coordinates determined by its index:
$$\theta_p = \frac{2\pi p}{n}, \quad \phi_p = \frac{2\pi \omega p}{n} + \psi, \quad \chi_p = \frac{2\pi \xi p}{n}$$
At observation step t, the orbit visits particle p_t = kt mod n, so the coordinates at step t are:
$$\theta_t = \frac{2\pi (kt \bmod n)}{n}, \quad \phi_t = \frac{2\pi \omega (kt \bmod n)}{n} + \psi, \quad \chi_t = \frac{2\pi \xi (kt \bmod n)}{n}$$
with derived quantities:
$$r_t = R + a\cos(\chi_t), \quad z_t = h\sin(\phi_t)$$
2.3 The orbit
The orbit visits particles in the order 0, k, 2k, 3k, … (all mod n). This sequence is the orbit, and it is the fundamental musical object. The orbit is not a bag of positions – it is an ordered sequence with algebraic structure.
A playback parameter τ advances through the orbit at a tempo determined by the performer or sequencer. The orbit itself is fixed by (n, k, ω, ξ, ψ); τ merely selects the read-head position.
3. Orbit as Musical Phrase
3.1 Closure
Theorem 1 (Orbit Closure). The orbit of particle 0 under σ_k returns to 0 after exactly L = n/gcd(n, k) steps. Proof. The orbit is {0, k, 2k, …} mod n. The smallest positive m with mk ≡ 0 (mod n) is m = n/gcd(n, k). ∎This is the most fundamental musical property the construction provides. A phrase of length L is guaranteed to close – to return exactly to its starting pitch, register, and dynamic level. This closure is not approximate, not probabilistic, not dependent on parameter tuning. It is a theorem of elementary number theory.
Musical consequence. The composer controls phrase length by choosing n and k:| n | k | gcd | Phrase length L | Character |
|---|---|---|---|---|
| 12 | 1 | 1 | 12 | Chromatic run |
| 12 | 7 | 1 | 12 | Circle of fifths |
| 24 | 6 | 6 | 4 | Short motif, 6 voices |
| 16 | 4 | 4 | 4 | Short motif, 4 voices |
| 60 | 7 | 1 | 60 | Long through-composed line |
3.2 Canonic voice decomposition
Theorem 2 (Voice Decomposition). Let g = gcd(n, k). The permutation σ_k decomposes into exactly g disjoint orbits, each of length n/g. The j-th sub-orbit (j = 0, 1, …, g - 1) is Orbit_j = {j, j + k, j + 2k, …} mod n, with starting azimuthal angle θ₀ = 2πj/n. Proof. Standard result on cyclic permutations; see Dummit and Foote [1]. The starting particle of sub-orbit j is particle j, which sits at angular position 2πj/n on the torus. The pitch offset of sub-orbit j relative to sub-orbit 0 is determined by this starting particle's position. ∎ Remark on the pitch offset. Each sub-orbit j starts at particle j, which has azimuthal angle 2π·j/n. After quantization to 12-TET, this corresponds to a pitch offset of ⌊12j/n + 1/2⌋ semitones. The sub-orbits traverse identical interval sequences but are transposed by this offset. Musically, this is a canon – multiple voices playing the same melody, staggered by a fixed pitch interval. Example. For n = 24, k = 6: gcd = 6, so six voices, each playing a 4-note phrase. The voices are offset by successive multiples of 2π/24 in azimuth, corresponding to one semitone in 24-TET (or a half-semitone when mapped to 12-TET). The result is a six-part texture of interlocking motifs – reminiscent of Balinese gamelan or Steve Reich's Music for 18 Musicians. Remark on gcd = 1. The case gcd(n, k) = 1 produces a single orbit traversing all n particles – a full-length melody rather than a canonic texture. This is not a degenerate case. The circle of fifths (§5.2) is gcd(12, 7) = 1, and §5 establishes that k/n near 7/12 sits in the highest-consonance region of the parameter space. The parameter gcd determines texture – one voice versus many – not harmonic quality. High-consonance single-voice structures and high-consonance polyphonic textures occupy distinct but equally valid regions of (n, k) space.3.3 The orbit is the phrase
A common implementation error is to compute a particle's position at each time step independently and map coordinates to note parameters separately, producing an incoherent sequence. The correct reading is that the orbit is a fixed combinatorial object, computed once from (n, k); playback traverses it in sequence. The musical phrase is the orbit, not a time-varying trajectory.
4. Two-Interval Melodies from Torus Winding
4.1 Setup
The azimuthal angle θ_t = 2πkt/n maps to pitch class via quantization to the chromatic scale:
$$\hat{p}_t = \left\lfloor \frac{12 k t}{n} + \frac{1}{2} \right\rfloor \bmod 12$$
The raw consecutive interval is constant: α = 12k/n mod 12. When α is not an integer, quantization to the nearest semitone creates a binary pattern of two interval sizes.
4.2 The two-interval theorem
Theorem 3 (Mechanical Quantization). Let gcd(k, n) = 1 and α = 12k/n ∉ ℤ. Then the quantized interval sequence I_t = (p̂_{t+1} - p̂_t) mod 12 takes exactly two values: ⌊α⌋ and ⌈α⌉ mod 12, and the binary pattern is a mechanical sequence with slope {α} = α - ⌊α⌋. Proof sketch. The quantized pitch satisfies p̂_t = ⌊tα + β + ½⌋ mod 12 for a phase constant β. The consecutive difference is:$$I_t = \lfloor(t+1)\alpha + \beta'\rfloor - \lfloor t\alpha + \beta'\rfloor = \lfloor\alpha\rfloor + \lfloor\{t\alpha + \beta'\} + \{\alpha\}\rfloor$$
The increment equals ⌈α⌉ when {tα + β'} ≥ 1 - {α}, and ⌊α⌋ otherwise. This is precisely the definition of the mechanical sequence s_α(t) = ⌊(t+1)α⌋ - ⌊tα⌋ (Lothaire [2], §2.1). ∎
Edge case. When ⌈α⌉ = 12, the larger interval is 12 mod 12 = 0 (unison). This occurs when 11 < α < 12, i.e., k/n is just below 1. In this degenerate case the two "intervals" are 11 semitones and unison – musically uninteresting. For musically useful results we restrict attention to α well within (0, 12). Terminology. For finite n, α = 12k/n is rational, and the sequence is periodic with period dividing n. The correct term is mechanical sequence (also called a Christoffel word when viewed as a lattice path). The sequence becomes Sturmian – aperiodic with subword complexity p(m) = m + 1 – only when α is irrational, which requires taking the limit n → ∞ with k/n → an irrational constant. For large finite n with k/n approximating an irrational, the mechanical sequence closely approximates the corresponding Sturmian word. Connection to well-formed scales. This result is equivalent to the Myhill property of well-formed scales (Carey and Clampitt [8]): a scale generated by iterating a single interval has exactly two step sizes. Our derivation via mechanical sequences provides a different proof of the same phenomenon, embedded in the torus framework.4.3 Connection to the three-distance theorem
The three-distance theorem (Steinhaus [3], Sós [4], Alessandri and Berthé [7]) states that n points placed on a circle at intervals of angle α partition the circle into arcs of at most three distinct lengths. For RT⁴ orbits, this theorem enters indirectly: when n orbit points with step α are projected onto 12 chromatic bins, the bin occupancy counts follow the three-distance distribution. However, the interval sequence (consecutive pitch differences) is governed by the mechanical sequence construction above, which is a related but distinct result.
4.4 Universality: all non-integer α give two intervals
The two-interval property is not special to the golden ratio. Every non-integer value of α = 12k/n produces exactly two quantized interval types. What varies across different k/n ratios is which pair of intervals appears. We tabulate this for several constants in §5.
4.5 Computational verification
We verified Theorem 3 exhaustively for n ∈ [12, 10000] with k chosen as the nearest coprime integer to ⌊n/φ + 0.5⌋:
Result 1. 99.99% of tested n-values produce exactly 2 quantized interval types. The sole exception (n = 12, k = 7) has 12k/n = 7 ∈ ℤ exactly, giving a single interval – the perfect fifth. Result 2. Subword complexity verification (n = 89, k = 55): The 89-symbol binary word has exactly m + 1 distinct subwords of length m for all tested m, matching the Sturmian complexity bound with equality. (Since 55/89 is a rational approximation to 1/φ, this mechanical sequence matches the Sturmian bound exactly at lengths up to the period.)| Length m | Distinct subwords | Bound m + 1 |
|---|---|---|
| 2 | 3 | 3 ✓ |
| 3 | 4 | 4 ✓ |
| 4 | 5 | 5 ✓ |
| 5 | 6 | 6 ✓ |
| 10 | 11 | 11 ✓ |
| n | k | P5 count | m6 count | m6/P5 ratio |
|---|---|---|---|---|
| 13 | 8 | 8 | 5 | 0.625 |
| 34 | 21 | 20 | 14 | 0.700 |
| 89 | 55 | 52 | 37 | 0.712 |
| 144 | 89 | 84 | 60 | 0.714 |
| 987 | 610 | 576 | 411 | 0.714 |
The ratio converges to {12/φ}/(1 - {12/φ}) = 0.4164/0.5836 ≈ 0.7135. Approximately 58.4% of intervals are perfect fifths and 41.6% are minor sixths.
5. The Golden Ratio and Consonance
5.1 Why φ is distinguished for 12-TET
The golden ratio φ = (1 + √5)/2 ≈ 1.618 is an algebraic number (a root of x² - x - 1 = 0). It has a distinguished relationship with the 12-tone chromatic scale through an arithmetic coincidence:
$$\frac{12}{\varphi} \approx 7.416$$
This value falls between 7 semitones (the perfect fifth, frequency ratio 3:2) and 8 semitones (the minor sixth, frequency ratio 8:5). Rather than assert that no other constant matches this, we compute 12/c for several standard constants and display the resulting interval pairs:
| c | Nature | 12/c | Lower | Upper | Cons.[a] |
|---|---|---|---|---|---|
| φ ≈ 1.618 | algebraic | 7.416 | 7 (P5) | 8 (m6) | 7.3 |
| √2 ≈ 1.414 | algebraic | 8.485 | 8 (m6) | 9 (M6) | 5.3 |
| √3 ≈ 1.732 | algebraic | 6.928 | 6 (TT) | 7 (P5) | 5.5 |
| ln 2 ≈ 0.693 | transcend. | 17.31 | 5 (P4)[b] | 6 (TT)[b] | 5.0 |
| e ≈ 2.718 | transcend. | 4.415 | 4 (M3) | 5 (P4) | 6.5 |
| π ≈ 3.142 | transcend. | 3.820 | 3 (m3) | 4 (M3) | 5.8 |
[a] Weighted average using standard consonance ratings: P5 = 9, P4 = 7, M3 = 6.5, m3 = 5.5, m6 = 5.5, M6 = 5.5, TT = 2.
[b] Computed mod 12: 12/ln 2 ≈ 17.31, so 17.31 mod 12 = 5.31.
φ produces the highest-consonance pair because the perfect fifth (the most consonant interval after unison and octave) is one of its two values. The runner-up, e, produces M3 + P4 – a consonant pair, but neither interval matches the fifth's prominence in harmonic series and tuning theory.
We stress that this is an arithmetic coincidence involving the number 12. If the octave were divided into 19 or 31 equal parts, different constants might produce more consonant pairs. The φ-consonance connection is specific to 12-TET, in line with classical consonance accounts [11].
5.2 The circle of fifths as an RT⁴ orbit
The circle of fifths – arguably the most important structure in Western harmony – is the RT⁴ orbit with n = 12 and k = 7:
$$0 \to 7 \to 2 \to 9 \to 4 \to 11 \to 6 \to 1 \to 8 \to 3 \to 10 \to 5 \to 0$$
In pitch names (with 0 = C):
$$\text{C} \to \text{G} \to \text{D} \to \text{A} \to \text{E} \to \text{B} \to \text{F}\sharp \to \text{C}\sharp \to \text{G}\sharp \to \text{D}\sharp \to \text{A}\sharp \to \text{F} \to \text{C}$$
Since gcd(12, 7) = 1, this is a single orbit visiting all 12 pitch classes – the complete circle of fifths, derived from a two-parameter torus construction.
5.3 The ratio 7/12 and its relationship to φ
The ratio k/n = 7/12 ≈ 0.5833, and 1/φ ≈ 0.6180. These are close but not equal. The circle of fifths is a rational approximation of the golden-ratio orbit, but we must be precise about the nature of this approximation.
The continued fraction convergents of 1/φ = φ - 1 = (√5 - 1)/2 are:
$$\frac{0}{1},\ \frac{1}{1},\ \frac{1}{2},\ \frac{2}{3},\ \frac{3}{5},\ \frac{5}{8},\ \frac{8}{13},\ \frac{13}{21},\ \ldots$$
These are ratios of consecutive Fibonacci numbers. The fraction 7/12 is not among these convergents. Numerically, 7/12 ≈ 0.5833 lies between the convergents 1/2 = 0.500 and 3/5 = 0.600. It is not a best rational approximation in the continued-fraction sense.
What is true: 7/12 is the best approximation to 1/φ with denominator exactly 12 (since |7/12 - 1/φ| ≈ 0.035, while |6/12 - 1/φ| ≈ 0.118). The "12" comes from the historical choice of 12 chromatic pitch classes, not from the continued fraction of φ.
Theorem 4 (Fibonacci Coprimality). For consecutive Fibonacci numbers F_m and F_{m+1}, gcd(F_m, F_{m+1}) = 1.This classical result guarantees that Fibonacci pairs always produce single, full-length orbits. Combined with the fact that F_m/F_{m+1} → 1/φ, Fibonacci pairs provide a systematic family of orbits that approximate golden-ratio winding with guaranteed coprimality.
5.4 The continued fraction perspective
The golden ratio has the simplest possible continued fraction expansion:
$$\varphi = [1; 1, 1, 1, 1, \ldots]$$
By the Hurwitz theorem, this makes φ the hardest real number to approximate by rationals – its rational approximants converge as slowly as possible. In dynamical systems terms, this suggests a heuristic analogy with KAM resonance: φ-related frequency ratios are comparatively resistant to resonance locking (see Arnold [6]).
For RT⁴ orbits, this translates to a practical property: when k = round(n/φ), gcd(n, k) tends to be 1 or small. We observe:
| Constant | Coprime rate (n ≤ 5000) | Avg gcd when > 1 | Max gcd |
|---|---|---|---|
| φ | 60.9% | 3.1 | 61 |
| √2 | 60.8% | 3.1 | 57 |
| e | 60.7% | 3.1 | 57 |
| π | 60.7% | 5.3 | 177 |
Among these constants, φ has the highest coprime rate and the smallest maximum gcd. The differences from √2 and e are modest; the difference from π (which has large partial quotients in its continued fraction, leading to occasional near-rational approximations) is more substantial.
5.5 Musical interpretation
The mechanical melody generated by a golden-ratio orbit consists exclusively of perfect fifths and minor sixths – wide, angular leaps reminiscent of horn calls or Gregorian psalm tones. The pattern is periodic (for finite n) but with long period, and is highly structured, with subword complexity approaching m + 1.
After diatonic scale projection (snapping to, say, C major), the 2-interval vocabulary expands to 4 types (tritone, P5, m6, M6), with P5 predominant at ~63%. This projection preserves the large-scale structure while adding local melodic variety.
The connection to the Fibonacci word is structural: for n = F_m, k = F_{m-1}, the interval sequence converges (as m → ∞) to an infinite limit that resembles a Fibonacci word in structure [12], f = LSLLSLSLLSLLS…, where L denotes P5 and S denotes m6. This limiting structure is Sturmian with slope {12/φ} and follows the same morphism pattern L → LS, S → L.
5.6 The consonance landscape
The point evaluations in §5.1 – comparing φ against √2, e, π – treat consonance as a property of individual constants. A more complete picture emerges from evaluating the consonance function over the entire (n, k) parameter space.
Definition (consonance function). For an RT⁴ orbit with parameters (n, k), define the chromatic position α = 12k/n and the fractional part f = {α} = α - ⌊α⌋. The pair consonance is:$$C(n, k) = f \cdot \mathrm{cons}(\lceil \alpha \rceil \bmod 12) + (1 - f) \cdot \mathrm{cons}(\lfloor \alpha \rfloor \bmod 12)$$
where cons(i) assigns a consonance score to the i-th chromatic interval (0 = P1, 1 = m2, ..., 11 = M7) using standard psychoacoustic ratings [Huron, Sweet Anticipation, 2006]. When α is an integer, the orbit generates a single pure interval with consonance cons(α mod 12) directly.
Theorem 5 (Finite interval vocabulary). The set of distinct interval pair types {(⌊α⌋ mod 12, ⌈α⌉ mod 12) : n ≥ 2, 1 ≤ k < n} has exactly 23 elements: the 12 adjacent-semitone pairs (i, i+1 mod 12) for i = 0, ..., 11, and 11 pure intervals (i, i) for i = 1, ..., 11. The pair (0, 0) – unison – is structurally excluded, as it requires k = 0, which does not define a valid orbit. Proof. Adjacent pairs: for any j ∈ {0, ..., 11}, choose n large enough that the interval (jn/12, (j+1)n/12) contains an integer k with gcd(n, k) = 1; such k exists by Dirichlet's theorem on primes in arithmetic progressions. The Dirichlet step establishes existence in the infinite case; the finite bound follows from the explicit construction and computational verification below. This places α = 12k/n strictly between j and j+1. Pure interval j ≥ 1: take n = 12/gcd(12, j), k = j/gcd(12, j); then gcd(n,k) = 1 and α = j exactly. Pure interval 0 requires k = 0, which is excluded by definition. Verified computationally for n = 2 to 10,000. ∎ Ridge structure. Computing C(n, k) over the full admissible (n, k) space reveals two dominant consonance ridges:- P5 ridge: k/n ≈ 7/12 ≈ 0.583, where α lands near the perfect fifth (cons = 0.9). This is the highest-consonance ridge in the space.
- P4+M3 ridge: k/n ≈ 5/12 ≈ 0.417, where α lands between the perfect fourth and major third, both highly consonant intervals.
These ridges are separated by a high-consonance plateau between k/n ≈ 0.42 and k/n ≈ 0.75. The golden ratio winding k/n = 1/φ ≈ 0.618 lies within this plateau, between the two ridges and closer to the P5 apex. This provides a geometric explanation for the result of §5.1: φ is not arithmetically special in an isolated sense, but is the irrational number that most stably tracks the highest-consonance region of the (n, k) landscape while maintaining maximum resistance to rational approximation (§5.4).
Symmetry. The consonance landscape is approximately symmetric about k/n = 0.5: the pair (n, k) and the pair (n, n-k) produce complementary intervals (P5 and P4 are complementary; M3 and m6 are complementary), which have comparable consonance ratings. This reflects the interval inversion symmetry of 12-TET.6. Melodic Quality and Parameter Selection
6.1 The quality metric
To move beyond theoretical structure toward musical utility, we evaluate which parameter combinations produce musically appealing melodies. We developed a composite metric with six musicological sub-components:
1. Stepwise ratio: fraction of intervals ≤ 3 semitones (good melodies move by small intervals most of the time; cf. Huron [13])
2. Leap compensation: fraction of leaps followed by contrary-direction steps (a melodic principle identified by Meyer [14] and confirmed empirically by Huron [13])
3. Range score: penalty for total range exceeding 18 semitones (~1.5 octaves)
4. Consonance ratio: fraction of intervals that are consonant (3rds, 4ths, 5ths, 6ths)
5. Contour variety: entropy of the up/down/same direction distribution
6. Monotony penalty: penalty for long runs of the same pitch
All sub-metrics are equally weighted and the composite is normalized to [0, 1].
Limitations of this metric. The metric captures basic melodic principles but has known shortcomings: it rewards zigzag contours (high entropy) over musically natural arch shapes, does not assess phrase-level coherence, and has not been validated by listening experiments. The results below should be understood as properties of this specific metric, not as universal claims about musical quality.6.2 Optimal winding ratio: k/n → 1/4
For each n, we tested every coprime k from 1 to n/2 with ω = 0 (isolating pure interval structure):
| n | Best k | k/n | Quality score |
|---|---|---|---|
| 48 | 11 | 0.229 | 0.834 |
| 120 | 29 | 0.242 | 0.860 |
| 240 | 59 | 0.246 | 0.869 |
| 500 | 123 | 0.246 | 0.869 |
| 1000 | 249 | 0.249 | 0.875 |
The explanation is straightforward: when k/n ≈ 0.25, each step advances by ~3 semitones (a minor third). The minor third sits at the boundary of stepwise motion (≤ 3 semitones) and is highly consonant. This ratio maximizes the product of stepwise motion and consonance simultaneously.
For small n (12-36), k = 1 (chromatic step) wins trivially because it is the only stepwise option. The quarter-ratio regime emerges when n is large enough to offer multiple coprime values near n/4.
Remark. The optimal ratio depends on the pitch mapping (θ → 12-TET pitch class). For microtonal systems with different chromatic cardinalities, different ratios may emerge. The 1/4 finding is specific to the standard 12-tone mapping and to this quality metric.6.3 Contour frequency: ω/n ≈ 0.2
For each n, we swept ω from 1 to n/2 and counted direction changes in 16-note phrase segments, seeking the musically natural range of 4-8 direction changes per phrase:
| n | Good ω range (ω/n) | Center |
|---|---|---|
| 12 | [0.167, 0.333] | 0.250 |
| 120 | [0.125, 0.342] | 0.252 |
| 500 | [0.188, 0.226] | 0.207 |
| 1000 | [0.125, 0.205] | 0.193 |
| 5000 | [0.125, 0.190] | 0.185 |
This means the z-curve completes about one full oscillation per 5 notes. In a 16-note phrase, this gives ~3 complete rise-and-fall arcs, producing 6 direction changes – in the range that listeners perceive as natural melodic breathing.
6.4 Summary of empirical scaling laws
$$k(n) = \text{nearest coprime to } n/4, \qquad \omega(n) \approx n/5$$
These are empirical observations, not theorems. They depend on the specific quality metric used and are intended as practical starting points for compositional exploration, not as universal laws.
7. Rhythmic Contour from Geometry
7.1 The problem of uniform duration
In the basic RT⁴ construction, every step in the orbit has equal duration – the playback advances τ by one unit per beat. Real music has varied rhythmic patterns: syncopation, dotted rhythms, rubato, fermatas. Can the geometry itself suggest a duration mapping?
7.2 Duration from velocity
The height coordinate z_t = h sin(2πωt/n + ψ) varies sinusoidally along the orbit. Its rate of change – the "velocity" in the z-direction – is:
$$\frac{dz}{dt} = \frac{2\pi \omega h}{n} \cos\left(\frac{2\pi \omega t}{n} + \psi\right)$$
We propose the inverse-velocity duration mapping:
$$\text{dur}(t) = \frac{d_{\text{base}}}{1 + \alpha \left|\frac{dz}{dt}\right|}$$
where d_base is the base duration and α is a sensitivity parameter. When the melody is changing rapidly in register (large |dz/dt|), notes are short; at turning points where z reaches an extremum (|dz/dt| ≈ 0), notes are long.
7.3 Dotted rhythms from cosine quantization
When the resulting durations are quantized to the nearest simple ratio, specific rhythmic patterns emerge:
Example (n = 12, k = 7, ω = 1, α = 1). The duration sequence, normalized to the shortest note, follows the pattern:$$[1,\ 1,\ \tfrac{3}{2},\ 4,\ \tfrac{3}{2},\ 1,\ 1,\ 1,\ \tfrac{3}{2},\ 4,\ \tfrac{3}{2},\ 1]$$
The 3:2 ratio is the hemiola – one of the most fundamental rhythmic relationships in Western music, corresponding to the "dotted" rhythm. The 4:1 ratio at the turning points creates fermata-like sustained notes.
We observe that the 3:2 ratio appears more frequently in geometric durations than in uniformly random durations. A systematic quantification of this effect (with appropriate statistical methodology) is left to future work.
7.4 Phrase boundaries at turning points
The velocity minima – points where |dz/dt| ≈ 0 – coincide exactly with the turning points of the z-curve (where sin reaches ±1). This is a consequence of elementary calculus, not a deep finding. But the musical interpretation is natural: the melody "breathes" at the top and bottom of its register arc, with long notes marking phrase peaks and valleys.
The number of such turning points per orbit depends on ω: there are 2ω/gcd(2ω, n) turning points per orbit of length n/gcd(n, k). For n = 12, k = 7, ω = 1, this gives 2 turning points per 12-note phrase – musically, a single arch with a breath at the apex and nadir.
7.5 Limitations
We state clearly what the duration mapping does not provide:
- Swing. True swing (consistent long-short alternation) does not emerge. The velocity varies sinusoidally, producing symmetric patterns rather than the asymmetric groove that defines swing.
- Meter. The construction produces no inherent downbeat or metric accent. The rhythmic variation is continuous, not grouped into bars.
- Independence from pitch contour. Duration is derived from the same coordinate (z) as register, so rhythm and contour are locked together. Independent rhythmic variation would require additional parameters.
The duration mapping is best understood as cosine quantization – a deterministic, geometrically motivated method for generating non-uniform rhythmic patterns. It is a tool for composition, not a theory of rhythm.
7.6 Dynamics from radial distance: the role of ξ
The radial coordinate $r_t = R + a \cos(\chi_t)$, where $\chi_t = 2\pi\xi t/n$, oscillates between $R - a$ and $R + a$ along the orbit. This creates a natural mapping to musical dynamics (loudness) and timbre (spectral brightness):
$$v(t) = v_{\min} + (v_{\max} - v_{\min}) \cdot \frac{r_t - r_{\min}}{r_{\max} - r_{\min}}$$
where $v$ represents velocity (MIDI) or amplitude. Notes near the torus core ($r \approx R - a$) are soft and dark; notes at the outer edge ($r \approx R + a$) are loud and bright. The parameter $\xi$ controls the rate of this oscillation: higher $\xi$ produces faster dynamic swells, lower $\xi$ produces slow, breath-like crescendo-decrescendo arcs across the phrase.
This completes the musical interpretation of the five-parameter construction:
| Coordinate | Parameter | Musical mapping |
|---|---|---|
| θ (azimuthal) | k/n | Pitch class |
| z (height) | ω, ψ | Register, rhythm, phrase boundaries |
| r (radial) | ξ, a | Dynamics, timbre |
Each coordinate of the torus controls a distinct dimension of musical expression. The orbit is not merely a sequence of pitches – it is a complete musical gesture with pitch, contour, rhythm, dynamics, and timbre encoded in a single geometric object.
8. Microtonal Extensions
8.1 The ψ crystallization mechanism
The phase parameter ψ shifts the vertical oscillation, changing which z-levels the n particles occupy. For the standard 12-TET pitch mapping (θ → pitch class via 12kt/n mod 12), ψ affects register (octave placement) but not pitch class. In 12-TET, ψ crystallization has no effect on scale content.
This changes when n ≫ 12 and we work in n-EDO (where each of the n positions represents a distinct microtonal pitch). The z-coordinate can then serve as a weight or selection criterion: pitches near just-intonation intervals receive higher weight, and ψ controls the threshold.
8.2 A crystallization model
Define the distance of the j-th pitch class (at j × 1200/n cents) from the nearest just-intonation interval as d_JI(j). Weight each pitch by:
$$w_j = \exp\left(-\psi \cdot d_{\text{JI}}(j) / 100\right)$$
A pitch "survives" the crystallization if w_j > 0.5. As ψ increases from 0, pitches far from JI intervals are progressively eliminated, and the n-EDO continuum crystallizes toward a just-intonation skeleton.
8.3 Computational results
53-TET (n = 53, step size 22.64¢ – historically known as an excellent EDO for 5-limit just intonation):| ψ | Surviving pitches | Character |
|---|---|---|
| 0 | 53 | Full microtonal continuum |
| 2 | 24 | Dense chromatic |
| 5 | 8 | Near-diatonic (M2, m3, M3, P4, aug4, P5, M6, m7) |
| 10 | 8 | JI skeleton (stable) |
| 20 | 6 | Core consonances only |
At ψ ≈ 5, the 53-tone continuum crystallizes to an 8-note scale closely matching the just-intonation intervals. The surviving pitches and their JI errors:
| Pitch (¢) | Nearest JI | Error |
|---|---|---|
| 203.77 | M2 (9/8 = 203.91¢) | -0.14¢ |
| 316.98 | m3 (6/5 = 315.64¢) | +1.34¢ |
| 384.91 | M3 (5/4 = 386.31¢) | -1.41¢ |
| 498.11 | P4 (4/3 = 498.05¢) | +0.07¢ |
| 588.68 | aug4 (7/5 = 582.51¢) | +6.17¢ |
| 701.89 | P5 (3/2 = 701.96¢) | -0.07¢ |
| 883.02 | M6 (5/3 = 884.36¢) | -1.34¢ |
| 973.58 | m7 (7/4 = 968.83¢) | +4.76¢ |
8.4 Why 53-TET is well-suited
The step size of 53-TET (22.64¢) is close to the syntonic comma (21.51¢), which is the fundamental discrepancy between Pythagorean and just tuning. This near-coincidence allows 53-TET to approximate all 5-limit JI intervals with remarkable precision:
| Interval | JI target | 53-TET approximation | Error |
|---|---|---|---|
| P5 (3/2) | 701.955¢ | 701.887¢ | 0.068¢ |
| P4 (4/3) | 498.045¢ | 498.113¢ | 0.068¢ |
| M3 (5/4) | 386.314¢ | 384.906¢ | 1.408¢ |
| m3 (6/5) | 315.641¢ | 316.981¢ | 1.340¢ |
| M2 (9/8) | 203.910¢ | 203.774¢ | 0.136¢ |
The P5 error of 0.068¢ is inaudible – roughly 1/30 of the just-noticeable difference for pitch.
8.5 Other microtonal systems
Similar crystallization analysis for other n-EDO systems:
| n-TET | Notable property | Best JI intervals |
|---|---|---|
| 19 | Excellent m3 (0.15¢ error) | m3, M6 |
| 31 | Good all-round (< 6¢) | M3, m7, aug4 |
| 53 | Near-perfect 5-limit | P5, P4, M2 |
| 72 | Fine resolution (16.67¢ steps) | All within 3¢ |
In each case, ψ crystallization provides a mechanism for selecting musically coherent subsets from the microtonal continuum. The n-EDO provides the raw material; the RT⁴ orbit provides the traversal order; ψ provides the scale selection.
9. Discussion
9.1 What the framework provides
The RT⁴ musical mapping offers three categories of contribution:
Proven results. Phrase closure (Theorem 1) and voice decomposition (Theorem 2) are standard results of elementary number theory, applied here to a musical context. The two-interval property (Theorem 3) is proven for all valid parameter values; the identification of the resulting pattern as a mechanical sequence is a known result in combinatorics on words (Lothaire [2]). Computational observations. The golden ratio's consonance optimality in 12-TET (§5.1), the k/n = 1/4 melodic quality finding (§6.2), the ω/n ≈ 0.2 contour finding (§6.3), and the dotted-rhythm enrichment from velocity mapping (§7.3) are computational observations verified across large parameter ranges. They are reproducible but depend on specific metrics and mappings. They have not been validated by listening experiments. Conceptual unification. The circle of fifths, canonic polyphony, mechanical/Sturmian sequences, and microtonal scale selection – disparate topics in music theory – are all manifestations of the same underlying construction: a cyclic permutation on a torus. This unification, while largely a repackaging of known results (particularly from the well-formed scale tradition), may have pedagogical and compositional value.9.2 What the framework does not provide
Aesthetic judgment. The geometry guarantees structure, not beauty. A phrase that closes is not necessarily a phrase worth hearing. The parameter space is vast and mostly uninteresting – the scaling laws of §6 identify a small region of utility according to one specific metric. Timbre. The construction specifies pitch, register, dynamics, and (optionally) duration. It says nothing about instrument, tone color, or spectral content. Large-scale form. All phrases are cyclic. The framework cannot produce an ABA form, a development section, or any non-cyclic macrostructure. It provides building blocks, not architecture. Competition with neural models. Neural music generation (Suno, Udio, MusicLM) produces convincing textures learned from vast corpora. RT⁴ produces guaranteed structures from five parameters. The approaches are complementary: RT⁴ could provide a structural skeleton that neural models render with realistic timbre and micro-timing. This hybrid direction remains unexplored.9.3 Connections to other fields
The mathematical structures appearing in this paper – mechanical/Sturmian sequences, continued fractions, coprime pairs, torus winding – appear in several other domains:
- Phased-array signal processing. The gcd decomposition of §3.2 is structurally identical to the beam-forming decomposition in antenna arrays, where coprime element counts produce single main lobes and non-coprime counts produce grating lobes (see [16] for the physical connection).
- Dynamical systems. The resistance of golden-ratio frequency ratios to resonance locking is often discussed in the context of KAM-type behavior [6]. The observation that φ-based orbits avoid degenerate patterns suggests a heuristic analogy with the same phenomenon.
- Quasicrystals. Sturmian sequences describe atomic arrangements in one-dimensional quasicrystals, and the golden ratio plays a role in Penrose tilings [5]. The analogy to our pitch sequences is suggestive but we have not developed it formally.
9.4 Relationship to historical music theory
Several features of the RT⁴ framework have precedents in music theory:
- Well-formed scales (Carey and Clampitt [8]). As noted in §1.3, the two-interval property is the Myhill property. Our contribution is the torus embedding and multi-dimensional extension, not the pitch-class result.
- Maximally even sets (Clough and Douthett [9]). The distribution of orbit points among chromatic bins is related to maximal evenness, though the orbit ordering (which is central to RT⁴) is not part of that theory.
- Generated collections (Clough and Myerson [15]). The orbit of a single generator in ℤ/nℤ is a generated collection. RT⁴ adds the torus geometry and non-pitch coordinates.
- Serialism. Schoenberg's twelve-tone rows are specific orbits with n = 12. RT⁴ generalizes to arbitrary n and adds register, dynamics, and voice decomposition.
- Xenakis's sieve theory [10]. Sieves use modular arithmetic for pitch selection; RT⁴ uses modular arithmetic for pitch traversal. Both derive musical structure from algebra rather than intuition.
- Reich's phase music. The gcd decomposition produces the same mathematical structure as Reich's phase-offset canons, with the offset determined by geometry rather than performance timing.
10. Conclusion
Musical structure is encoded in torus geometry more directly than we initially expected. A cyclic permutation on 𝕋³ with five parameters produces, proven properties: phrases that close (Theorem 1), voices in canon (Theorem 2), and exactly two interval types from any non-integer winding ratio (Theorem 3). The golden ratio's role is not mystical – it is an arithmetic coincidence that 12/φ ≈ 7.416 falls between the perfect fifth and minor sixth, making φ-winding the most consonant generator in 12-tone equal temperament among the constants we surveyed. The circle of fifths is the orbit (n = 12, k = 7), and 7/12 is the best approximation to 1/φ with denominator 12 (though it is not a continued-fraction convergent of 1/φ).
Beyond these proven structures, computational investigation suggests that k/n ≈ 1/4 optimizes a composite melodic quality metric (by favoring minor-third steps), that ω/n ≈ 0.2 produces natural contour breathing, that coordinate derivatives generate non-uniform rhythmic patterns enriched in dotted (3:2) ratios, and that ψ crystallization selects just-intonation-aligned scales from microtonal continua – with 53-TET achieving P5 accuracy of 0.068¢.
The pitch-class results of this paper overlap substantially with the well-formed scale tradition (Carey and Clampitt [8], Clough and Myerson [15]). What the torus framework adds is a unified geometric setting that simultaneously generates pitch sequence, register contour, dynamics, and rhythm – and a parametric language in which these musical dimensions are controlled by a small number of integers and phases.
The framework is minimal (five parameters), deterministic (every output is reproducible), and honest about its boundaries (no timbre, no form, no aesthetic guarantee). Its value lies not in replacing composition but in providing a geometric language for it – one where musical questions become questions about orbits.
Reproducibility
All computational results in this paper are fully reproducible. Scripts for generating the interval pair atlas, consonance landscape, Sturmian sequence verification, rhythmic contour analysis, and scale crystallization are available at:
https://github.com/resonant4/rt4-musical-structureEach script maps directly to the paper section it supports. See README.md for usage instructions and run_all.sh to reproduce all figures in sequence.
Revision history
v1.0.1. Typographic corrections only. Parenthetical dashes throughout the text had been flattened to plain hyphens and are restored to en dashes; mathematical minus signs are unaffected. No theorem, proof, figure, numerical result or computational script is changed. v1.0.0. Initial preprint.References
[1] Dummit, D. S. and Foote, R. M. (2004). Abstract Algebra, 3rd edition. John Wiley & Sons.
[2] Lothaire, M. (2002). Algebraic Combinatorics on Words. Cambridge University Press. Chapter 2: Sturmian Words.
[3] Steinhaus, H. (1957). Problem 461. Colloq. Math. 5, 236.
[4] Sós, V. T. (1958). On the distribution mod 1 of the sequence nα. Ann. Univ. Sci. Budapest Eötvös Sect. Math. 1, 127-134.
[5] Shechtman, D., Blech, I., Gratias, D., and Cahn, J. W. (1984). Metallic phase with long-range orientational order and no translational symmetry. Physical Review Letters 53(20), 1951-1953.
[6] Arnold, V. I. (1963). Small denominators and problems of stability of motion in classical and celestial mechanics. Russian Mathematical Surveys 18(6), 85-191.
[7] Alessandri, P. and Berthé, V. (1998). Three distance theorems and combinatorics on words. L'Enseignement Mathématique 44, 103-132.
[8] Carey, N. and Clampitt, D. (1989). Aspects of well-formed scales. Music Theory Spectrum 11(2), 187-206.
[9] Clough, J. and Douthett, J. (1991). Maximally even sets. Journal of Music Theory 35(1/2), 93-173.
[10] Xenakis, I. (1992). Formalized Music: Thought and Mathematics in Composition, revised edition. Pendragon Press.
[11] Helmholtz, H. von (1863/1954). On the Sensations of Tone. Dover Publications. (Translation by A. J. Ellis.)
[12] Schechter, M. (2018). Sturmian words and the Stern-Brocot tree. Discrete Mathematics 341(1), 54-67.
[13] Huron, D. (2006). Sweet Anticipation: Music and the Psychology of Expectation. MIT Press.
[14] Meyer, L. B. (1956). Emotion and Meaning in Music. University of Chicago Press.
[15] Clough, J. and Myerson, G. (1985). Variety and multiplicity in diatonic systems. Journal of Music Theory 29(2), 249-270.
[16] Jakovels, E. (2026). ResonanT⁴ Foundation: Modular Closure and Transverse Geometry. doi:10.5281/zenodo.18157442.
[17] Jakovels, E. (2026). Closure-Compatible Resonance: Admissibility, Locking, and Phase-Aligned Control. doi:10.5281/zenodo.18157799.
[18] Jakovels, E. (2026). Quantum Numbers as Closure Invariants: Discrete Labels from Exact Phase Closure. doi:10.5281/zenodo.18157869.
Appendix A: Notation Summary
| Symbol | Meaning |
|---|---|
| 𝕋³ | Three-torus |
| n | Number of equally-spaced positions |
| k | Winding number (step size of cyclic permutation) |
| ω | Vertical oscillation frequency |
| ξ | Radial oscillation frequency |
| ψ | Phase offset |
| τ | Playback time parameter |
| σ_k | Cyclic permutation: step t maps to particle kt mod n |
| L = n/gcd(n,k) | Orbit length (= phrase length) |
| g = gcd(n,k) | Number of sub-orbits (= number of voices) |
| θ_t | Azimuthal angle at step t: 2πkt/n |
| z_t | Height at step t |
| r_t | Radial distance at step t |
| φ = (1+√5)/2 | Golden ratio (algebraic, root of x²-x-1=0) |
| F_m | m-th Fibonacci number |
| P5 | Perfect fifth (7 semitones) |
| m6 | Minor sixth (8 semitones) |
| n-TET / n-EDO | n-tone equal temperament / equal division of octave |
| JI | Just intonation |
Appendix B: Worked Example – Circle of Fifths
Parameters: n = 12, k = 7, ω = 1, ξ = 1, ψ = 0. Orbit: gcd(12, 7) = 1, so one orbit of length 12.| Step t | Particle (7t mod 12) | Pitch | θ (°) | z (h sin φ_t) |
|---|---|---|---|---|
| 0 | 0 | C | 0 | 0.000 |
| 1 | 7 | G | 210 | -0.500 |
| 2 | 2 | D | 60 | 0.866 |
| 3 | 9 | A | 270 | -1.000 |
| 4 | 4 | E | 120 | 0.866 |
| 5 | 11 | B | 330 | -0.500 |
| 6 | 6 | F♯ | 180 | 0.000 |
| 7 | 1 | C♯ | 30 | 0.500 |
| 8 | 8 | G♯ | 240 | -0.866 |
| 9 | 3 | D♯ | 90 | 1.000 |
| 10 | 10 | A♯ | 300 | -0.866 |
| 11 | 5 | F | 150 | 0.500 |
The pitch sequence is the circle of fifths. The z-column shows the register contour: a sinusoidal oscillation with ω = 1, creating a single arch over the 12-note phrase.
Appendix C: Computational Methods
All computational results were produced using independent Python implementations. Key methodological choices:
1. Pitch quantization. Continuous azimuthal angle θ mapped to pitch class via p̂ = ⌊12θ/(2π) + ½⌋ mod 12 (nearest-integer rounding to chromatic scale).
2. Coprimality search. For each n, the nearest coprime k to a target ratio was found by testing k, k ± 1, k ± 2, … until gcd(n, k) = 1.
3. Subword complexity. Computed by exhaustive enumeration of all length-m substrings of the binary interval sequence.
4. Quality metric. Composite of six sub-metrics (§6.1), each normalized to [0, 1] before averaging. The metric captures established musicological principles (Huron [13]: stepwise preference; Meyer [14]: gap-fill); it has not been validated by listening experiments.
5. Duration mapping. Inverse-velocity model with α = 1 and quantization to nearest ratio in {1, 3/2, 2, 3, 4}.
6. ψ crystallization. Exponential weighting against JI distance with threshold 0.5 (§8.2). JI targets include all 5-limit intervals within the octave.
© 2026 Egils Jakovels. This work is licensed under a Creative Commons Attribution 4.0 International License (CC BY 4.0).