EDO and Non-EDO Generators

:: EDO Generators

A rank-2 tuning system is determined by fixing the tuned frequency ratio values of two independent basis intervals. For all the tuning systems we'll consider in this post, one of those basis vectors will be the octave, P8, which we fix to a pure frequency ratio of two, 

t(P8) = 2/1

leaving us only one free parameter. If the second basis intervals is tuned to a frequency ratio of 1, then we've defined an "EDO" tuning system, i.e. we get a tuning system that divides the Octaves into logarithmically Equal Divisions. In such a tuning sytem, every rank to interval will be tuned to a frequency ratio of the form 

2^(x / edo-divisions)

The most famous of these EDO tuning system is 12 tone equal temperament, which can be generated by tuning the diminished second, d2, to a frequency ratio of 1/1

t(d2) = 1/1

Tuning an interval to 1/1 will be called "tempering" or "tempering out" throughout this post. We temper out d2 to get 12-TET.

: How many divisons of the octave do we get out when we temper out different intervals?

For an arbitrary EDO tuning system, let's represent our intervals in Lilley's (A1, d2) basis. If we have pure octavesa nd then temper out a second basis interval, (a, b), our number of EDO divisions per octave will be:

edo_divisions = abs(a * 7 - b * 12) / gcd(a, b)

Here "abs()" is the absolute value function, and "gcd()" is the greatest common divisor of the two integers. We can substitute (a, b) = d2 = (0, 1) into this, 

edo_divisions = abs(0 * 7 - 1 * 12) / gcd(0, 1)

edo_divisions = 12/1

and as expected we find that tempering out d2 produces a 12-EDO.

: Diatonicity

Interestingly, multiple intervals can be tempered out to generate EDO tuning systems with the same number of divisions. For example, tempering out any of these intervals

(49, 26) = AAAA27

(37, 19) = AAAA20

(25, 12) = AAAA13

(13, 5) = AAAA6

(-1, 2) = dddd3

(11, 9) = dddd10

(23, 16) = dddd17

(35, 23) = dddd24

(47, 30) = dddd31

will produce a 31-EDO. There's a catch though: most of them sound awful. Intervals that you expect to be tuned nearby each other are sent flying all over the place, helter skelter. Layering a bunch of these is actually a pretty cool way to generate weird random harmonies: take a song written in terms of intervals, tune it to multiple 31-EDOs, and play them in parallel. I wouldn't say that it's good exactly, but it's cool. Crunchy.

It's only when the d2 component of the second basis vector is greater than or equal to the A1 component,

b >= a

and the d2 component is positive

b > 0

that the tuning system will have the usual order of natural intervals that we know and love from 12 TET and quarter-comma meantone and so forth:

(P1, m2, M2, m3, M3, P4, P5, m6, M6, m7, M7)

I'll call this the natural order of natural intervals. EDOs which don't mix up this order are "diatonic" over rank-2 intervals. Other than the natural intervals in their natural / diatonic order, EDO tuning systems also induce orderings over modified rank-2 intervals, the diminished and the augmented intervals. In a future post ("Orders of Modified Intervals") we'll talk about how the modified intervals like d2 and A4 are ordered in similar ways by families of EDO tuning systems.

: EDO definitions

Here are some nice diatonic EDOs, listed alongside the simplest rank-2 interval that can be tempered out to produce each one:

5-EDO: m2 = (1, 1)

7-EDO: d1 = (-1, 0)

12-EDO: d2 = (0, 1)

17-EDO: dd3 = (1, 2)

19-EDO: dd2 = (-1, 1)

22-EDO: ddd4 = (2, 3)

26-EDO: ddd2 = (-2, 1)

27-EDO: dddd5 = (3, 4)

29-EDO: dddd4 = (1, 3)

31-EDO: dddd3 = (-1, 2)

32-EDO: dddd6 = (4, 5)

33-EDO: dddd2 = (-3, 1)

37-EDO: ddddd7 = (5, 6)

39-EDO: ddddd6 = (3, 5)

40-EDO: ddddd2 = (-4, 1)

41-EDO: dddddd5 = (1, 4)

42-EDO: dddddd8 = (6, 7)

43-EDO: dddddd4 = (-1, 3)

45-EDO: dddddd3 = (-3, 2)

46-EDO: dddddd6 = (2, 5)

47-EDO: dddddd2 = (-5, 1)

49-EDO: ddddddd8 = (5, 7)

50-EDO: ddddddd4 = (-2, 3)

52-EDO: ddddddd10 = (8, 9)

53-EDO: ddddddd6 = (1, 5) 

The 53-EDO tuning system is used seriously in analyzing Turkish music, and I think it's a good stopping point. But if untrained humans can discriminate around 5 cents of frequency difference, then we could theoretically go up to (1200 / 5 =) 240-EDO. And if people with training can discriminate 3 cents of frequency difference in some octaves, then we could go up to (1200 / 3 = ) 400-EDO. We could go stupidly high if we wanted.

: Lax Diatonicity

There are two EDOs listed which are fairly well behaved in the sense of having

(b > a) and (b > 0)

for the tempered interval (a, b), but which are only laxly diatonic, in the sense that they collapse almost all of the intervals down to common points, such that two tuned intervals can't be said to be ordered diatonically by the "greater than" relation, ">", although they could still be said to be ordered diatonically by the "greater than or equal" relation ">=".

The first edge case: If the A1 coordinate is negative and the d2 coordinate is zero, then we get a 7-EDO tuning system in which the minor Nth and major Nths are equated (tuned to the same frequencies). For example, by tempering out any of these k-times diminished unison intervals:

(-1, 0) = d1

(-2, 0) = dd1

(-3, 0) =  ddd1

(-4, 0) =  dddd1

(-5, 0) =  ddddd1

(-6, 0) =  dddddd1

(-7, 0) =  ddddddd1

(-8, 0) =  dddddddd1

(-9, 0) =  ddddddddd1

(-10, 0) =  dddddddddd1

we get a 7-EDO tuning system in which

t(m2) = t(M2)

This doesn't reverse the natural diatonic order anywhere, but it hides some of the structure. 

The second edge case: If the interval we temper out, (a, b), has {a} and {b} equal and non-zero, then the generated tuning system is a 5-EDO: 

(1, 1) = m2

(-1, -1) = M0

(-2, -2) = A-1

(-3, -3) = AA-2

(-4, -4) = AAA-3

(-5, -5) = AAA-4

(-6, -6) = AAAA-5

(-7, -7) = AAAAA-6

(-8, -8) = AAAAA-7

(-9, -9) = AAAAAA-8

(-10, -10) = AAAAAAA-9


In the canonically defined 5-EDO created by tempering out m2, the (M0, P1, and m2) are tuned to the same value, and also (M2 ad m3) are tuned to the same value, and also (M3 and P4) are tuned to the same value. Also these equivocated sets have octave complements: (m9, P8, M7), (m7, M6), (m6, P5). Different diatonic structure is hidden here, but again, the natural order isn't strictly violated if we think of it as being ordered by ">=" instead of ">".

: What do they sound like? EDO families

The EDOs certainly don't all sound the same. 5-EDO sounds like a jungle marimba and 7-EDO sounds like a crystine alien squeezing your temples. Or something.  But that's a very subjective way to characterize these things.

To partly characterize the sounds of EDOs objectively, it's convenient to sort them by the size of their tuned perfect fifth interval, P5. When we do this, we see that 7-EDO has the flattest P5 of all the EDOs that are diatonic over rank-2 intervals while 5-EDO has the sharpest tuned P5. So there's a sense in which those are our extreme values and other EDOs fall somewhere between them in their sound. As a taste, here are just the tuned values of P5 for 5-EDO, 7-EDO, and 12-EDO (aka 12-TET):

2^(4/7)  ~ 1.4859942891369484

2^(7/12) ~ 1.4983070768766815

2^(3/5)  ~ 1.5157165665103982

Smack-dab between 5-EDO and 7-EDO, we have, (5 + 7 = ) 12-EDO, with a nice neutral P5 that's tuned quite close to the just value of 3/2. If you want your P5 tuned a little bit flat of just, then you might try (12 + 7 = ) 19-EDO. If you want your P5 tuned a little bit sharp, you might try (12 + 5) = 17-EDO. In general, adding 7 to the number of EDO divisions gives you new tuning system with a flatter P5, and adding 5 divisions gives you a sharper P5.

If you look at the exponents, you  might notice that 12-EDO's exponent for its tuned P5, namely 7/12, looks like a mediant-sum of the exponents for the tuned P5s of 7-EDO and 5- EDO, namely

mediant(4/7, 3/5)  = 7/12

This is not a coincidence, and in general you can say combinations of EDOs produce mediant sums between the exponents of tuned intervals, e.g. 12-EDO has a major second tuned to 2^(2/12), and 19-EDO has a major second tuned to 2^(3/19), so 31-EDO must have a major second tuned to 2^(5/31), since 2 + 3 = 5 in the numerator and and 12 + 19 = 31 in the denominator.

Between the sign posts of (5, 17, 12, 19, 7)-EDO, there are some other nice sights to see, with intermediant characteristics. Let's list them here in families with of increasingly sharp values for the tuned P5:

Family 1: Between 7 and 19-EDO, we have [47, 40, 33, 26, 52, 45]-EDO.

Family 2: Between 19 and 12-EDO, we have [50, 31, 43]-EDO.

Family 3: Between 12 and 17-EDO, we have [53, 41, 29, 46]-EDO.

Family 4: Between 17 and 5-EDO, we have[39, 49, 27, 32, 37, 42]-EDO.

I think of these as families, but I don't have great names for them. I sometime think of family 2 as "meantone", since most meantone-temperament tuning system have a tuned perfect fifth a little bit below that of 12-EDO, although meantone has a more precise definition that overlaps with this family imperfectly which we'll learn about in the future. My usual gloss for the families, in order, is "Sub-Meantone, Meantone, Pythagorean, Super-Pythagorean", but we'll find out in time that all of these names are a little wrong.


: The Big Picture Overview Of EDOs


When we temper out an interval {x}, we get an EDO tuning system where {x} is tuned to a frequency ratio of 1/1, just like the unison, P1. Consequently, the inverse of the interval,

P1 - x

is also tuned to 1/1. Also any stacks of {x} or its inverse are tuned to one, e.g.

t(5 * x) = 1/1

Also-also, any intervals separated by {x} (or the inverse of x, or stacks of these) will be mapped to the same frequency ratio as each other, e.g.

t(M3) = t(M3 + 3 * x)


This collapses the infinite 2-dimensional space of intervals to an infinite one dimensional line with finitely many intervals per octave. And you can build a keyboard or fretted stringed instrument with finitely many discrete tones per octave, so these EDO things are very popular.


:: Non Edo Generators


If you tune your octaves purely and you tune your second independent basis interval to anything other than 1/1, you'll get a non-EDO tuning system. For example, Pythagorean tuning was defined by these pure frequency ratios on the octave and the perfect fifth:

t(P8) = 2/1

t(P5) = 3/2 

And quarter-comma meantone was defined over rank-2 intervals by these pure frequency ratios on the octave and the major third:

t(P8) = 2/1

t(M3) = 5/4

These are convenient ways to memorize the tuning systems, but once they're defined, there are many more ways to define the same tuning systems. For example, Pythagorean tuning induces a frequency ratio of (81/64) on the major third, and we could just as well define Pythagorean tuning with pure octaves and t(M3) = 81/64. Likewise, quarter comma meantone induces a frequency ratio of 5^(1/4) on the Perfect Fifth, so we could define it by pure octaves and t(P5) = 5^(1/4). Not as easy for me to remember, but totally equivalent.


: Diatonicity In General Rank-2 Tuning Systems, Not Just EDOs


There are some small constraints on how you can tune the second interval in a general rank-2 tuning system. If you want to keep the natural intervals


(P1, m2, M2, m3, M3, P4, P5, m6, M6, m7, M7, P8) 


in the same order that they appear in 12-EDO, then the perfect fifth has to be tuned between the 5-EDO and 7-EDO values of the perfect 5th:


2^(4/7) < t(P5) < 2^(3/5) 


This tuning of P5 can of course either be done directly with P5 as a basis interval or indirectly by tuning a different basis interval which induces a tuned value on P5. We'll call this the general rank-2 diatonicity constraint, in contrast to the [(b > a) and (b > 0)] thing that we had just for EDOs.


We can represent this diatonicity constraint for other basis intervals besides P5, and the tuning-boundaries for the basis interval happen to always include a 5-EDO value and a 7-EDO value. For example, if you define a tuning system with a major sixth as your second basis interval (besides the pure octave), then to get natural intervals in the usual famous order, the tuned value will have to be in this range:


2^(3/5) < t(m6) < 2^(5/7)


You can see here that the 5-EDO version is at the bottom range now, whereas it was at the top for P5. It's very easy to figure out whether the 5-EDO value or the 7-EDO value will be at the bottom: the one that's numerically smaller will be at the bottom and the one that's numerically larger will be at the top.


Let's express the general rank-2 diatonicity constraint for a bunch of different intervals:


2^(-1/5) < t(d1) <  2^(0/7)

2^(-1/5) < t(d2) <  2^(1/7)

2^(0/5) < t(m2) < 2^(1/7)

2^(0/7) < t(A1) < 2^(1/5)

2^(0/5) < t(d3) < 2^(2/7)

2^(1/7) < t(M2) < 2^(1/5)

2^(1/7) < t(A2) < 2^(2/5)

2^(1/5) < t(m3) < 2^(2/7)

2^(1/5) < t(d4) < 2^(3/7)

2^(2/7) < t(M3) < 2^(2/5)

2^(2/7) < t(A3) < 2^(3/5)

2^(2/5) < t(P4) < 2^(3/7)

2^(2/5) < t(d5) < 2^(4/7)

2^(2/5) < t(d6) < 2^(5/7)

2^(3/7) < t(A4) < 2^(3/5)

2^(4/7) < t(P5) < 2^(3/5)

2^(4/7) < t(A5) < 2^(4/5)

2^(3/5) < t(m6) < 2^(5/7)

2^(3/5) < t(d7) < 2^(6/7)

2^(5/7) < t(M6) < 2^(4/5)

2^(5/7) < t(A6) < 2^(5/5)

2^(4/5) < t(m7) < 2^(6/7)

2^(4/5) < t(d8) < 2^(7/7)

2^(6/7) < t(A7) < 2^(6/5)


These limits are actually also true of EDO tuning systems, but "EDO and Not Necessarily EDO Tuning Systems" wasn't as catchy of a title.


In a later post, we'll talk about finer boundaries of interval basis tuning and how these boundaries influence the order of modified intervals, in contrast to natural intervals. It turns out that this is a great way to organize tuning systems into families that sound and behave similarly.


I'm not sure it's worth writing the proof here of how the 5-EDO and 7-EDO terms arise. The math can be done a few ways, but one way I like to think of it is that we're adjusting the tuned value of the minor second, either so small that it eventually equals the tuned value of the unison,


t(m2) = t(P1)


at which point we get we get a 5-EDO, or we tune the minor second so large that it equals the tuned value of the major second,


t(m2) = t(M2)


at which point we get a 7-EDO. Either way, we're losing an inequality that 12-EDO has - (P1 < m2) and (m2 < m3) respectively. Obviously the unison has a frequency ratio of (1/1), but it's a little less obvious that the m2 and M2 can't be tuned independently in a rank-2 system with pure octaves. But you've only got one free parameter after defining pure octaves, so you can't tune both. And at some point, they collide to give you 7-EDO.


Maybe I'll put in a short proof:


...


The exponents of frequency ratios for 5-EDO and 7-EDO are pretty easy to figure out by hand, if you ever want to quickly figure out the upper and lower bounds to which a rank-2 an interval can be tuned while preserving the usual order of natural intervals. For an interval (a, b) in the (A1, d2) basis, the 7-EDO frequency ratio is

t((a, b)) = 2^(b/7)


and the 5-EDO frequency ratio is 


t((a, b)) = 2^((a - b) / 5) 

.


:: Comparing The Diatonicity Constraints


I claimed in the first section that if you can get an EDO tuning system with the usual order of natural interval if you take a basis interval (a, b) and temper it out


t((a, b)) = 1


provided that the d2 component is greater than or equal to the A1 component and the d2 component is positive

b >= a

b > 0

In the second section, I claimed that for all rank 2-tuning systems with pure octaves, you get the usual tuned order of natural intervals if you tune your second basis interval between the 5-EDO and 7-EDO values for the interval,


2^((a - b) / 5)    # 5-EDO

2^(b / 7)           # 7-EDO


Are these notions of diatonicity compatible? Yes, indeed, and I'll prove it.


First the claim: if you tune an interval (a, b) to a frequency ratio of 1, and {b < a}, then no matter the interval, the value 1 will be within the range of the 5-EDO and 7-EDO limits.


Next a sketch of the proof: When {a < b}, the 5-EDO term will be less than 1/1 and the 7-EDO term will be more than 1/1. So 1 will be in the accepted range. Therefore the specific constraint that we defined for EDO tuning systems is a special case of the more general constraint for all rank-2 tuning systems.


And here's the proof: First, If {a < b}, then {a - b < 0}, so the exponent of the 5-EDO term

2^((a - b)/ 5) 


is negative and the whole thing is less than one.


Second, if {b > 0}, then 2^(b/7) is greater than 1. Proof complete. Tombstone emoji. Mic drop.


:: Worked example of rank-2 EDO tuning with Cramer's Rule:


Someone on the Xenharmonic discord asked how to convince a friend that the pitches B and C are tuned to the same step of 5-EDO. We haven't talked about pitches yet, but I'm going to share my response anyway, because we've gone over most of it and it's nice to iterate on the material.


We start with rank-2 intervals in some basis. We've used (A1, d2) and (P5, P8), but the Xenharmonic really like using intervals associated with prime harmonics for bases, e.g. (P8, P12) for rank-2 intervals, so we'll use that here. Some coordinates:


P1 = (0, 0)

m2 = (8, -5)

M2 = (-3, 2)

m3 = (5, -3)

M3 = (-6, 4)

P4 = (2, -1)

P5 = (-1, 1)

m6 = (7, -4)

M6 = (-4, 3)

m7 = (4, -2)

M7 = (-7, 5)

P8 = (1, 0)


Now we tune our intervals in the 5-EDO tuning system. With rank-2 intervals, 5-EDO is defined by tuning the octave purely, t(P8) = 2/1, and tempering out the minor second, t(m2) = 1/1. To tune an arbitrary interval like M7 using those facts, we need to re-express the target interval in terms of P8 and m2.

Let's give variable names to the components of our basis intervals:


    basis_1 = (a, b) = P8 =(1, 0)

    basis_2 = (c, d) = m2 =(8, -5)


If we have an interval (m, n) in the (P8, P12) basis, we can use Cramer's rule to re-express it with coordinates (x, y) in the (P8, m2) basis. The rank-2 change of basis formula looks like this:

    x = (dm - cn) / (ad - bc)

    y = (an - bm) / (ad - bc)


If we substitute in our values of (a, b) = (1, 0) and(c, d) = (8, -5) from our basis vectors, we specifically get a change of basis formula from (P8, P12) to (P8, m2):

    x = (-5 * m - 8 * n) / (-5)

    y = (1 * n - 0 * m) / (-5)


Now we can get to work. What are the coordinates (x, y) for M7 in the (P8, m2) basis, which we had defined by (m, n) = (-7, 5) in the (P8, P12) basis? Just plug in {m} and {n}:

    x = (-5 * -7 - 8 * 5) / (-5) = 1

    y = (1 * 5 - 0 * -7) / (-5) = -1


So M7 = (x, y) = (1, -1) in the (P8, m2) basis. This has the meaning that

    M7 = 1 * P8 + -1 * m2


Analogously, since we know tuned frequency ratios for our basis vectors, we can also now find the tuned frequency ratio for M7. The coefficients just become exponents:

    t(M7) = t(P8)^1 * t(m2)^-1

    t(M7) = (2)^1 * (1)^-1 = 2


And we see that M7 (i.e. a B over C) is tuned to the same frequency ratio, 2/1, as P8 (i.e. C of the next octave). 


If you write a program to do the basis conversion and tuning, you can quickly find intervals for every step, e.g.

    ^0: P1, m2, d3

    ^1: A1, M2, m3, d4

    ^2: A2, M3, P4, d5, d6

    ^3: A3, A4, P5, m6, d7

    ^4: A5, M6, m7, d8

    ^5: A6, M7, P8