Erv Wilson's keyboard mapping system
I wrote a somewhat detailed Xenharmonikon article called Another look at Wilson's keyboard mapping system discussing the maths behind Erv Wilson's keyboard mappings. This page summarizes the key equations from the article.
Lattice bases
The keys on the keyboard are labeled by pairs of integers $(x, y)$, their $x$ and $y$ coordinates. The set of all these integer pairs is called a lattice. For two lattice points $(a, b)$ and $(c, d)$, if we can write any lattice point $(x, y)$ as
with integer $p$ and $q$, we say $(a, b)$ and $(c, d)$ form a basis for the lattice. Two points $(a, b)$ and $(c, d)$ form a basis if and only if
Scale degree mapping
One way to map a scale is by always going up $s$ scale degrees when moving one key along a row, and $t$ scale degrees when moving one key up a column, for some step sizes $s$ and $t$.
If we choose scale degrees $m$ and $n$ which we want to form a basis on the keyboard, we can solve for $s$ and $t$. Say the basis is $(a, b)$, $(c, d)$. The conditions that scale degree $m$ is mapped to $(a, b)$ and scale degree $n$ is mapped to $(c, d)$ give two equations
which we can solve for the step sizes $s$ and $t$ to give
where $\Delta = ad - bc = \pm 1$.
Now say we want the step sizes to be positive, so scale degree (and so pitch) increases along a row and up a column. This gives the conditions
If $\Delta = -1$, $c > 0$, and $d > 0$, these conditions are equivalent to
For a given $m/n$, Wilson's Gral method finds all bases $(a, b)$, $(c, d)$ with
- $\Delta = ad - bc = -1$
- $a/c < m/n < b/d$
- $a, b, c, d \geq 0$
The Gral method is a binary search for the fraction $m/n$, starting with the interval $[0/1, 1/0]$ and 'bisecting' each interval $[a/c, b/d]$ with the mediant $(a+b)/(c+d)$. Each interval $[a/c, b/d]$ we encounter in the search has $ad - bc = -1$, so $(a, b)$, $(c, d)$ form a basis, and $a/c < m/n < b/d$ since $m/n$ is in each search interval.
For example, if we want scale degrees $m = 11$ and $n = 19$ to be mapped to a basis on the keyboard, we can apply the Gral method to 11 and 19:
| Left | Right | Mediant | $a$ | $b$ | $c$ | $d$ | $s$ | $t$ |
|---|---|---|---|---|---|---|---|---|
| 0/1 | 1/0 | 1/1 | 0 | 1 | 1 | 0 | 19 | 11 |
| 1/1 | 1/2 | 0 | 1 | 1 | 1 | 8 | 11 | |
| 1/2 | 2/3 | 1 | 1 | 2 | 1 | 8 | 3 | |
| 2/3 | 3/5 | 1 | 2 | 2 | 3 | 5 | 3 | |
| 3/5 | 4/7 | 1 | 3 | 2 | 5 | 2 | 3 | |
| 4/7 | 7/12 | 4 | 3 | 7 | 5 | 2 | 1 | |
| 7/12 | 11/19 | 4 | 7 | 7 | 12 | 1 | 1 |
Here Left and Right are the endpoints of the search interval; a blank means the same value as the row above (this lets you see at a glance which endpoint moved to form each row). The Mediant column is the mediant of the search interval. The columns $a$, $b$, $c$, $d$ give the basis $(a,b)$, $(c,d)$ corresponding to the search interval $[a/c,b/d]$. The columns $s$ and $t$ give the resulting step sizes (for which $as+ bt = g$ and $cs + dt = h$).
The row with mediant 4/7, for example, tells us that mapping the scale by going up 2 scale degrees when moving along a row and 3 scale degrees when moving up a column will place scale degree 11 at $(1, 3)$ and scale degree 19 at $(2, 5)$. Wilson describes each basis as a different keyboard named with the mediant, so the basis $(1, 3)$, $(2, 5)$ is called the 4/7 keyboard.
Harmonic template mapping
A harmonic template shows where each octave-reduce harmonic maps onto the keyboard. For example:
* * 7/4 * 2/1
11/8 * * * *
* * * 3/2 *
* * 5/4 * *
* * * * *
* * 1/1 * *
A given ratio is then mapped to the keyboard by writing it as a product of the octave-reduced harmonics, and moving by the step in the template for each factor. This can be written using matrix multiplication; for a given ratio, collecting the exponents of each octave-reduced harmonic in its factorization into a vector $V$, the ratio is mapped to a position $X = (x, y)$ on the keyboard with
where $A$ is the matrix representing the harmonic template.
For the example harmonic template above, the matrix $A$ is
where the columns are the $x$ and $y$ coordinates of $2/1$, $3/2$, $5/4$, $7/4$, and $11/8$ in the harmonic template. The ratio $15/8 = 3/2 \cdot 5/4$ has the vector of exponents $V = [0, 1, 1, 0, 0]$, and is so mapped to
that is to $x = 1$, $y = 5$.
Erv Wilson's harmonic templates are equivalent to, and predate, rank-2 mappings in regular temperament theory.
Chain position and keyboard coordinates
Chain position
Given a basis $(a, b)$, $(c, d)$, we can write any key $(x, y)$ on the keyboard as
with integer $p$ and $q$. We can write this as
and solve for $(p, q)$, giving
where $\Delta = ad - bc = \pm 1$ since $(a, b)$, $(c, d)$ is a basis. Call $(p, q)$ the chain coordinates of $(x, y)$ with respect to basis $(a, b)$, $(c, d)$.
Chain coordinates can often be interpreted musically. For example, say the fifth of the scale is mapped to $(a, b)$ and the octave to $(c, d)$. Then $p$ gives the position of a key $(x, y)$ in a chain of fifths on the keyboard, and $q$ gives the number of octaves moved.
When the octave is at $(c, d)$, the chain coordinate $p$ corresponding to $(a, b)$ is called the chain position.
Modulus
Modulus is an extension of scale degree to a two dimensional keyboard. Given a basis $(a, b)$, $(c, d)$ we can assign modulus $m$ to $(a, b)$ and $n$ to $(c, d)$. Then the modulus for $(x, y)$ is defined as $r = mp + nq$, where $(p, q)$ are the chain coordinates of $(x, y)$. The chain position $p$ and modulus $r$ form coordinates for the keyboard, since
which can be inverted to give
Modulus allows us to represent scale tones which come in multiple inflections with different pitches. For example, you could map a 22-tone scale to modulus twelve, viewing it as a 12-tone scale in which ten of the notes come in two inflections.
Notation
Say the fifth is at $(a, b)$ on the keyboard and the octave at $(c, d)$. Pick a step $(e, f)$ to represent a 'comma' on the keyboard — this we pick for our convenience, but good choices are often where say $81/80$ or $64/63$ would be mapped by the harmonic template. Then if we can write a key at $(x, y)$ as
where $u$, $v$, and $w$ are integers, we can use the number of fifths $u$ and number of commas $w$ to define a notation.
The number of fifths $u$ determines the start of the note name according to
| Fifths | … | −3 | −2 | −1 | 0 | +1 | +2 | +3 | +4 | +5 | +6 | +7 | … |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Name | … | E♭ | B♭ | F | C | G | D | A | E | B | F♯ | C♯ | … |
Here chain positions from $-1$ through $+5$ are named as F, C, G, D, A, E, B, and the pattern continues by adding a $\sharp$ to go up 7 fifths or a $\flat$ to go down seven fifths. The note name is then completed by adding $w$ slashes, where $w$ is the number of commas. We use a forward slash / if $w$ is positive or a backslash \ if $w$ is negative.
If the fifth is at $(a, b)$ and the octave is at $(c, d)$, $ad - bc$ gives the number of chains of fifths the keyboard will be split into. This is useful since it tells us how many slashes will be required in the notation.
The Gral method and moments of symmetry
The Gral method finds all moments of symmetry (MOS) formed when stacking a generator of pitch $g$ cents within a period of pitch $h$ cents. Applying the Gral method to $g$ and $h$, each interval $[a/c, b/d]$ found gives a MOS with $n = c + d$ notes, where the generator is at scale degree $m = a + b$; call this an $m/n$ MOS.
- The step sizes $s = -d g + b h$ and $t = c g - a h$ are the MOS step sizes.
- The MOS has $c$ steps of $s$ and $d$ steps of $t$.
- The interval $[a/c, b/d]$ gives the range of $g/h$ which will produce an $m/n$ MOS when stacking.
For example, take $g = 707.22$ cents and $h = 1200$ cents:
| Left | Right | Mediant | a | b | c | d | s | t |
|---|---|---|---|---|---|---|---|---|
| 0/1 | 1/0 | 1/1 | 0 | 1 | 1 | 0 | 1200.00 | 707.22 |
| 1/1 | 1/2 | 0 | 1 | 1 | 1 | 492.78 | 707.22 | |
| 1/2 | 2/3 | 1 | 1 | 2 | 1 | 492.78 | 214.44 | |
| 2/3 | 3/5 | 1 | 2 | 2 | 3 | 278.34 | 214.44 | |
| 3/5 | 4/7 | 1 | 3 | 2 | 5 | 63.90 | 214.44 | |
| 4/7 | 7/12 | 4 | 3 | 7 | 5 | 63.90 | 150.54 | |
| 7/12 | 10/17 | 7 | 3 | 12 | 5 | 63.90 | 86.64 | |
| 10/17 | 13/22 | 10 | 3 | 17 | 5 | 63.90 | 22.74 | |
| 13/22 | 23/39 | 10 | 13 | 17 | 22 | 41.16 | 22.74 | |
| 23/39 | 33/56 | 10 | 23 | 17 | 39 | 18.42 | 22.74 | |
| 33/56 | 56/95 | 33 | 23 | 56 | 39 | 18.42 | 4.32 |
The row with mediant 10/17, for example, tells us that we get a 17 note MOS with 12 steps of 63.90 cents and 5 steps of 86.64 cents. The corresponding search interval $[7/12, 3/5]$ tells us that any generator $g$ between $1200 \cdot 7/12 = 700$ cents and $1200 \cdot 3/5 = 720$ cents will give a 10/17 MOS.
Naren Ratan, 2026