Lattice MOS-Fit Playground

Lattice MOS-Fit Playground

Start from a just lattice. Find the MOS scales that hold every tone of the lattice within a tolerance. An MOS is a chain of one generator with two step sizes, and equal temperaments are the MOS with one step size. The fit has three controls: the generator, the level (how many notes) and the murchana (which chain position is the 1/1). Within 2 cents counts as at least as good as 12-ET.

LEGEND

What the errors mean: 12-ET against its own lattice

Every error on this page is the distance in cents from a just tone to the nearest scale degree. For a reference, here is 12-ET fitted to the harmonics 3, 5, 7, 9 and 11. The fifth is good. The major third is poor. The harmonic seventh is bad. The tolerance slider in station 3 starts at 2 cents, which is the quality of 12-ET's fifth.

STATION 1

Choose the harmonic lattice

The lattice supplies the harmony. Its tones are the targets of the fit in station 3.

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

#ratiocents
tones
6
smallest step
—
step classes
—
exact triads P / S
—
STATION 2

Choose a generator

A generator g in octaves. The chain is g, 2g, 3g and so on, reduced to one octave. The generator and its complement 1 − g make the same scales, read from the other end.

generator, octaves
—
generator, cents
—
complement
—
MOS sizes ≤ 60
—

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, and their N values are the levels. 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. Erv drew this walk by hand as the "zig-zag pattern" on his pages.

levelNp/qET generator ¢L ¢s ¢L : s
STATION 3

Fit an MOS to the lattice

Two searches. The first table takes the station 2 generator and, for each level, finds the murchana that holds the lattice best. The second table is the free search: for each N it finds the best generator of all, with its murchana. Select a row to see the scale against the lattice, then rotate its murchana.

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. The generator g runs over 0 to 600 cents in the free search, and its complement covers the rest. The note count N is the level. 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 free 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.

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, and it reports the triads that survive so you can see the difference. The count objective (CPSFIT-003) ran offline, and its fits are station 2 presets. 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.

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).

Press Run. Large lattices at large N take a few seconds.

Selected chain

notes / level
—
generator ¢
—
largest tone error
—
tones within tolerance
—
triads kept P / S (of exact)
—
val: generator counts of the primes
—
kernel: commas the chain tempers out (under 60 cents)
—
Pin two chains to compare them on one ruler.
Scala text of the selected chain (copy it into the plugin)

No chain 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 rotates with it, and the lattice errors show which modes hold the lattice.

Compare: chain A against chain B

Staircase: the smallest largest-error at each N

free searchstation 2 generatorfamily search, first level within toleranceequal temperamentsdashed line: tolerance

Move over a point to read it. Click a point to select that chain.

Chains of the station 2 generator,

Ntypelevelmurchana (1/1 at degree)max errmean errcapturedtriads kept

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. The page highlights rows within the tolerance and lists them first.

Family search: golden, silver, bronze or equal-tempered generators

A golden generator is one whose scale-tree path alternates forever from some point. Its levels then grow like Fibonacci numbers and the step ratio L : s tends to φ. Erv listed 64 of them in 1993. The formula is g = (a + φc) / (b + φd) for the two path fractions a/b and c/d where the alternation starts. Silver uses 1 + √2 in place of φ, so the path turns every two steps: Erv's "2-zig/2-zag". Bronze uses (3 + √13) / 2. Equal temperaments are the paths that stop. This search tries every such generator up to a seed denominator bound and reports the first level that holds the lattice.

Press Run. Golden with denominators up to 36 tries about 800 generators.

generator ¢octavesseedsErv 64first level within tolmurchanamax errcapturedtriads kept

Free search: best generator for each N

Ntypelevelmurchana (1/1 at degree)generatorcentsmax errmean errcapturedtriads kept
BACKGROUND

What the mathematics says

A chain is N consecutive multiples of one generator, reduced to one octave. When the chain has exactly two step sizes it is an MOS, and N is a level of that generator. The levels are the denominators on the Stern–Brocot path toward g. Erv called this path the scale tree and drew it as a zig-zag on each of his generator pages.

Erv Wilson, "Scale Tree" and the Meru pages, 1993–1997.

An equal temperament is the MOS with one step size. N-ET is the N-note chain of the generator 1200/N cents. Treating ET as a separate category is a preference of the musician, not a fact of the mathematics. This page shows ET rows separately because some artists prefer ET.

Marcus Hobbs, 2026-10-11.

Murchana is the mode of the chain. The chain holds the lattice's 1/1 at one of its N generator positions. Moving that position by one drops a tone from one end and adds one at the other end, which rotates the step pattern. For a fifth generator at N = 7 the seven positions give the seven diatonic modes, Lydian through Locrian.

Checked on this page: meta-meantone at N = 7 gives LLLsLLs, LLsLLLs, LLsLLsL, LsLLLsL, LsLLsLL, sLLLsLL, sLLsLLL.

Inverting the generator inverts the lattice. The chain of 1 − g is the chain of g reflected about 1/1. So a lattice fits the complement generator exactly when its reflection fits g, at the mirrored murchana, with the same errors, and with proportional and subcontrary triads swapped. For a CPS built from factors F, the reflection of CPS(n, k) is CPS(n, n − k) transposed by the product of F. The transposition matters. The chain is pinned to contain the lattice's 1/1, so a transposition by an interval that is not a chain degree changes the fit. The dekany CPS(5, 3) gets different fits from CPS(5, 2) at 10 of the 20 note counts where both are feasible. One fit of a dekany solves its reflection. It does not solve its partner.

CPSFIT-003, experiments/lattice, 2026-10-11. The exact reflection reproduced every rung of CPS(5, 2) with P and S swapped. This corrects the earlier claim on this page that one fit solves both dekanies.

Counting the triads changes the answer. With the number of exact lattice triads within 2 cents as the objective, the best generator agrees with the tone fit at no N up to 22, and with the worst-triad fit only where every triad already survives. The hexany keeps 10 of 12 from N = 16: the miracle generator moved to 116.68 cents, with one tone out at 5.2 cents. At N = 18 to 21 the chain of 77.82 cents keeps 10 of 12, where miracle kept 6 and orwell kept 8. The dekany 1·3·5·7·9 fits a schismatic chain of fourths at N = 26, 498.07 cents, keeping 32 of its 41 triads, and reaches 37 at N = 35. The frozen scorer counts triads of the image, so it can exceed the lattice's count when the tempering creates new ones. The page reports the lattice's count.

CPSFIT-003, experiments/lattice, 2026-10-11. Gate G-032 is the ear check.

The free search gives a staircase of smallest errors. For the hexany it is 18.85 cents at N = 11 and 13.73 at N = 12 to 14. It is 4.82 at N = 15, 4.77 at 16 to 17 and 3.27 at 18. It is 2.57 at N = 19 to 21, 1.37 at 22 to 30 and 0.74 at 31. Every optimum from N = 11 up is a val: an integer mapping of the primes 3, 5, 7 to generator counts. The N = 15 fit at 502.86 cents is a septimal meantone and is Erv's 0.418935 generator to 0.14 cents. The N = 22 fit at 193.79 cents has kernel 2401/2400 and 3136/3125. No equal temperament below 73 notes holds the hexany within 2 cents.

CPSFIT-001, experiments/lattice, 2026-10-10.

Fitting tones is not fitting triads. A prime mistuned in all three tones of a triad cancels in the mean condition. So a chain with large tone errors can keep triads. A chain with small tone errors can lose them. At N = 22 the tone fit keeps 10 of the hexany's 12 triads at 2 cents. Minimizing the worst triad instead moves the generator to 193.91 cents, keeps all 12, and lets one tone out to 2.22 cents. The worst triad is still not the count: at N = 18 to 21 the chain with the smaller worst triad keeps fewer triads. This page reports tones and triads side by side.

CPSFIT-001 and CPSFIT-002, experiments/lattice, 2026-10-10.

A golden generator is a noble number: its scale-tree path alternates forever from some point. The formula is g = (a + φc) / (b + φd) for the two path fractions where the alternation starts. The levels then grow like Fibonacci numbers. The step ratio L : s tends to φ at every level, so the MOS looks the same at every depth. Erv listed 64 of them in 1993, with the path of each. This page regenerates all 64 from the formula. Silver generators use 1 + √2 and turn every two steps, which is Erv's 2-zig/2-zag page, and √2 − 1 is the pure silver number. Equal temperaments are the paths that stop.

Erv Wilson, "64 Golden Generators for Two-Interval Patterns (MOS)", 1993, with his calculator program. Verified 2026-10-11: 64 of 64 reproduced.

Erv's recurrence generators, which he found by optimizing proportional and subcontrary triads, sit next to golden generators. 0.418935 is 0.09 cents from the golden generator seeded by 18/43 and 13/31. 0.415227 is 0.07 cents from one. Meta-meantone is 0.11 cents from one. 0.328173 is 0.17 cents from one. 0.238186 is 0.61 cents from one. The harmonic search and the melodic search nearly agree on where the good generators are.

Measured 2026-10-11 against all noble numbers with seed denominators up to 60.

The hexany needs the primes 3, 5 and 7, which is rank 4 with the octave. One generator and the octave is rank 2. So the hexany fits a rank-2 chain only with error, or only at a large N where the chain's commas vanish. A fit with two generators is rank 3 and is the natural next search.

Open question. See the options below.
OPTIONS

Next lines of research

  1. Count the triads instead of the worst one: done (CPSFIT-003). The count fits are station 2 presets. Open follow-ups: sweep the 20 cent tone cap (5, 10, 20) as a control, because the small-N optima sit on the cap, and let the chain origin float (a transposition-free fit), which restores the CPS(n, k) and CPS(n, n − k) symmetry. Gate G-032 decides both.
  2. Rank 3. Search two generators and a note count, and keep the lattice within tolerance. The hexany, the dekany and the eikosany need this below N = 22. This is the D'Alessandro method applied to a general seed.
  3. Fit the subsets. Fit each hexany inside the eikosany separately, then ask which chain holds the most of the fifteen at once. The subset doctrine says the music lives in the subsets.
  4. Quotient the ties. When an N-chain of g holds the lattice, the 2N-chain of g/2 holds it too with the same errors. Report one representative per family so the staircase reads cleanly.
  5. Golden and silver fits (new). For each lattice, find the golden generator with the smallest level that holds it. Compare that level with the free search. If a golden generator holds the lattice at a level close to the free optimum, the fit is both harmonic and self-similar. That is the whole point.
  6. Hear the fits. Export the selected chain as Scala text, load it in the plugin, and listen to the lattice tones inside the chain. Gates G-029 and G-031 wait on this for the hexany at N = 15 and N = 22.
  7. Murchana as a performance control. A chain that holds the lattice at one murchana holds a transposed copy of it at the others. Map the murchana to a controller and play the lattice through its modes.
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.