Lattice Recurrence Playground

Start from a just lattice. Fill the gaps between its tones with a recurrence relation. The result has one melodic structure: an MOS, which includes equal temperaments. Work in two directions. In direction 1, seed a recurrence with the lattice and let it converge to a generator. In direction 2, fit an MOS to the lattice directly. The MOS is the answer, and no recurrence is needed.

STATION 1

Choose the harmonic lattice

The lattice supplies the harmony. Its tones become the seeds in station 3 and the targets in station 4.

The page reduces each tone to one octave and sorts them. It removes duplicates.

#ratiocentsharmonic seed
tones
6
smallest step
—
step classes
—
STATION 2

Choose the recurrence. The generator is the taste decision.

Form: H[n] = a·H[n−i] + b·H[n−j]. The ratio H[n]/H[n−1] converges to the positive root G. The generator is log2(G) in octaves.

Order lift (more seeds, same generator)

The lift multiplies the characteristic polynomial by (xk − ρk). The k extra modes decay by ρ/G per step. The transient of the base recurrence decays by |λ₂|/G per step, where λ₂ is its second largest root. The slower of the two rates controls the transient. MERU-002 measured a ladder of ρ values. A larger ρ makes the transient longer. The mean count of 2-cent triads during the transient decreases as ρ increases. A long transient does not keep the harmony.

root G
—
generator log2 G
—
generator cents
—
complement 1−g
—
seeds (order)
—
transient per step
—
steps to shrink 100×
—

How to read the chart: the axis is the note count N. A dot at N means that N consecutive generators, reduced to one octave, make a scale with exactly two step sizes, L and s. Those scales are the MOS of this generator. The page finds them by the scale tree. It walks the Stern–Brocot tree toward g. Each fraction p/q on the path is an MOS with q notes. The fraction p/q is also the equal temperament that the MOS approximates: q-ET, with p steps per generator. The table gives each MOS, its fraction, that ET's generator in cents, the two step sizes in cents, and their ratio. The generator and its complement 1 − g have the same MOS sizes, because the chain is the same scale read from the other end. Erv drew this walk by hand as the "zig-zag pattern" on each page of meruthree.pdf. For 0.238186 his page says "24 places", and the table shows the 25-note MOS with s = 2.3 cents.

N (MOS size)p/qET generator ¢L ¢s ¢L : s
STATION 3 · DIRECTION 1

Seed the recurrence with the lattice and bend it to the generator

The first terms are the lattice tones. Each new term is a sum of earlier terms. The new terms converge to the generator chain. Move the step slider to see harmony become melody.

2 cents is below the 12-ET error of 3/2 (1.96 cents) and far below its error of 5/4 (13.7 cents).

seed (lattice tone)generated tonelattice pitch class
step classes in window
—
last ratio vs G
—
window tones on lattice (rotates)
—
window dyads on lattice intervals
—
prop / subcontrary triads
—

Show the sequence

STATION 4 · DIRECTION 2

Fit an MOS to the lattice

Search generators and note counts. Keep the chains that contain every lattice tone within the tolerance. Select a row to see the scale against the lattice.

What the fit searches, in Wilson's terms. A scale here is a chain: N consecutive generators, reduced to one octave. The octave is the period, and it does not change. Three things vary. The generator g runs over 0 to 600 cents, and its complement covers the rest, because g and 1 − g make the same scale. The note count N runs from 2 to the limit you set. In the Brun model N is the level, and the "only MOS" switch keeps the N values that are levels on the scale tree. The window start is the murchana. The chain contains the lattice's 1/1 at one of its N degrees. The search tries all N positions, which is the same as trying every mode of the chain. For each N the search is exact. For a tolerance ε, each tone and each degree k allow g to lie in an interval of half-width ε/|k|. A sweep over the interval endpoints finds the first g where some window of N degrees holds every tone. A bisection on ε then finds the smallest ε that works. A final refinement moves g to minimize the largest tone error. The result for each N is the generator, the murchana, the largest error and the mean error. Equal temperaments are a separate row for each N with g = 1200/N, where the murchana does not matter.

What the fit does not do. It does not change the period. It does not place the lattice's 1/1 between two degrees. It fits tones and not triads. CPSFIT-002 in the research lane fits the triads. It uses one generator, so it is rank 2 with the octave. A lattice that needs two generators, such as a 7-limit CPS at a small N, gets a large error here. The page reports the 1/1 position for each fit so you can read the murchana directly.

This generator's chains against the lattice appear in the first table. The free search below it finds the best generator for each N.

Press Run. The search is exact: for each N it finds the generator that minimizes the largest lattice error (interval sweep, bisection on the tolerance). Large lattices at large N take a few seconds.

No fit selected.

Move the slider to rotate the mode. Each step drops one tone from one end of the chain and adds one at the other end. The step pattern below the slider rotates with it, and the lattice errors show which modes hold the lattice.

Chains of the station 2 generator,

Ntypelevelmurchana (1/1 at degree)max errmean errcaptured

Free search: best generator for each N

Every N is listed with the generator that makes the largest lattice error as small as possible at that N. The max error column is that smallest possible error, so it is often above the tolerance. A row above the tolerance says that no chain of N notes holds the lattice any closer. Rows within the tolerance are highlighted and come first. The mean error is the average over the lattice tones at the same generator.

Ntypelevelmurchana (1/1 at degree)generatorcentsmax errmean errcaptured
BACKGROUND

What the mathematics says

A recurrence H[n] = a·H[n−i] + b·H[n−j] with positive a and b has exactly one positive root G. The ratio H[n]/H[n−1] converges to G. The generator is log2(G), measured in octaves.

Erv Wilson, Fig 12, 23 July 1997: 193 recurrences with G = (1 + G^(j−i))^(1/j).

The ratio converges only when G is strictly larger than every other root. For positive a and b, this is true only when i and j have no common factor. Erv's Fig 12 lists only such pairs. For j ≤ 10, it lists 31 pairs, and 31 is the number of coprime pairs.

Checked against the scan on 2026-10-10.

When i and j share a factor d, the sequence splits into d interleaved chains. The ratio H[n]/H[n−1] does not converge. Example: H[n] = H[n−2] + H[n−4] is two Fibonacci sequences. The consecutive ratio alternates between two values that sum to the Fibonacci generator.

Counterexample to "H[n] = H[n−1] + H[n−2] implies H[n] = H[n−2] + H[n−4]": the eighth Fibonacci term is 8, and 3 + 1 is 4.

The seeds do not change the generator. Any seeds that are not orthogonal to the dominant mode converge to the same G. The recurrence sets the melody. The seeds set the harmony. Erv seeded his own recurrences with harmonic material. Example: 192, 336, 588, 1029, a chain of 7/4, into 4·H[n−4] + H[n−1].

Erv Wilson, meta-slendro 2, 10 Dec 1997, and the LLSLS page, 4 Oct 1997.

A generator g and its complement 1 − g make the same MOS. The chain ratio is different: 2^g or 2^(1−g). Erv's 0.238186 recurrence, 4·H[n−3] − 2·H[n−2] = H[n], diverges forward because a complex root pair has modulus 1.84 and the real root is 1.18. Erv wrote "converges left". The forward form is H[n] = H[n−1] + 2·H[n−3]. It converges to 1.69562, which is 2 divided by 1.17951.

Erv Wilson, P.21b, 25 Aug 1997. Sloane M2419: 1, 1, 1, 3, 5, 7, 13, 23, 37, 63, 109.

Sums, differences, and every k-th term of a solution are solutions of a recurrence with the same limit. Erv recorded this: every difference-tone series of a sequence approaches the limit chain. This closure is the basis for seeding. The Lucas identity F[n] = 3·F[n−2] − F[n−4] is one case of it.

Erv Wilson, P.21c and P.21d, 25–26 Aug 1997.

To use more seeds than the order j, raise the order. Multiply the characteristic polynomial by (x^k − ρ^k). This adds k seeds. If ρ is smaller than G, the extra modes decay by ρ/G per step. If ρ equals G, the extra modes never decay, and the sequence keeps parallel chains. Station 2 does this with the lift control.

Scratch runs 2026-10-08: hexany seeds, ρ = 0.5 reach two step sizes by step 18, ρ = 1.5 do not by step 27.

Recurrences converge at very different speeds. The speed is the ratio of the second largest root to G. Fibonacci shrinks its transient by 0.38 per step, so 5 steps reduce it 100 times. Erv's 4·H[n−8] + 8·H[n−9] shrinks by 0.992 per step and needs about 600 steps. A slow recurrence keeps the seed harmony for a long time. This is a second control, next to ρ.

The page computes the root moduli with the Durand–Kerner method. See the "transient per step" value in station 2.

Some generators have no exact recurrence. The generator √2 − 1 = 0.414214 is a scale-tree generator: 1/2, 2/5, 5/12, 12/29, 29/70. The number 2^(√2−1) is transcendental, so no integer recurrence reaches it. The closest two-term recurrence up to order 12 is 8·H[n−9] + 7·H[n−10] at +0.04 cents. The pure fourth 4/3 is 0.99 cents above it.

Erv Wilson, ".414213562374 sequence", 22 Dec 1996: "my answer to Yasser, at about 1950".

The exact recurrences for the five favourite generators: 0.238186 is H[n−1] + 2·H[n−3] read as the complement. 0.328173 is H[n−1] + H[n−7], Fig 12 entry 12. 0.415227 is 4·H[n−8] + 8·H[n−9], 0.23 cents above 4/3. 0.418935 is H[n−1] + 32·H[n−4], the octave-shifted form of 2L⁴ = L³ + 4. The meta-meantone fifth 695.63 cents is 2·H[n−3] + 2·H[n−4], from the condition that 1, G⁴/4, G is a 4:5:6 proportional triad.

Search over H[n] = a·H[n−i] + b·H[n−j], j ≤ 12, coefficients to 128, coprime (i, j).
OPTIONS

Next lines of research

  1. Score the transient with the frozen scorers. Run station 3 as a Python experiment. At each step, score the window with triads v1.1.0 (P, S counts) and melodic v0.1.0 (gap entropy, constant structure, propriety). Plot harmony against melody over time. The crossing point is the bend step. Compare generators on the same seeds.
  2. The ρ control, measured (MERU-002, 2026-10-10). MERU-002 tested three recurrences and 32 values of ρ. The lock step and the chain step increase with ρ, as the decay law says. The mean count of proportional triads at 2 cents during the transient decreases from about 4 to less than 2 as ρ increases. Interval retention never exceeds 3 of 21 pairs. ρ sets how long the sequence stays off the chain. It does not keep the sequence near the lattice. Harmony persists with exact seeding of slow recurrences, not with the lift.
  3. Fit the triads, not the tones (CPSFIT-002, 2026-10-10). CPSFIT-002 minimized the largest deviation of any hexany triad in the chain, instead of the largest tone error. All 12 triads then survive at 2 cents in a 22-note chain of 193.908 cents, with one tone at 2.22 cents. The tone fit needed a 31-note chain. The worst-triad objective still loses to the count at 18 to 21 notes. There the miracle chain has the smaller worst triad, and the orwell chain keeps more triads. A count objective is the next fork.
  4. Fit first, then seed. Take each row of station 4 that captures every lattice tone. Seed its recurrence with the lattice tones in chain-aligned octaves. Measure how small the transient is. Hypothesis: if the lattice is already in the MOS, the recurrence fills the gaps with almost no transient.
  5. Extend the fit search to rank 2 and rank 3. A chain of one generator is rank 2 with the octave. Many CPS lattices need two generators. Search pairs (g1, g2) and a note count, and keep the lattice within tolerance. This is the D'Alessandro method applied to a general seed.
  6. Catalog the two-term recurrences by their MOS. For every recurrence in Fig 12 and the search, list its scale tree and its proportional triads at each MOS level. Find the recurrences whose MOS at small N contains a hexany or a tetrad. Those are the natural bridges.
  7. Test subtraction recurrences. Erv's 4·H[n−3] − 2·H[n−2] diverges forward. Find the full set of integer recurrences with a given G as a root, including negative coefficients, and sort them by whether G is dominant. The non-dominant ones can still run backward.
  8. Use slow recurrences as near-persistent harmony. Erv's order-9 and order-10 recurrences keep their transient for hundreds of steps. Seed a slow recurrence with a lattice. Test whether the scale stays on the lattice over a playable range, and only drifts to the MOS far above and below that range.
  9. Generator to recurrence, earmarked as a separate task. Given a generator, find the integer recurrences whose dominant root is 2 to that power. Erv did this by hand with his "integer log2 mods". Build it as a regeneratable task with its own receipts, and make a Manim video of the search. This playground does not need it: once an MOS holds the lattice, the MOS is the answer.
  10. Hear it. Export the window at each step as a Scala file. Audition the bend from hexany to MOS in the plugin. The ear decides where the transient stops sounding like the lattice.
HANDOFF

Prompt for the next session

This text describes the current state of the page in plain language. Copy it into Claude to continue the work.