back to list

Harmonic sets (which imply subgroups) for EDOs

🔗Keenan Pepper <keenanpepper@...>

12/3/2012 3:23:59 PM

Back when Igs was talking about "how to make any EDO sound like JI", I wrote this:

--- In tuning@yahoogroups.com, "Keenan Pepper" <keenanpepper@...> wrote:
>
> Okay, Igs, given that what you're really interested in is not abstract infinite groups, but tonality diamonds and chords, here's how I'd present the information:
>
> > 1-ET: 1
> > 2-ET: 5:7
> > 3-ET: 1:5, 7:9:11
> > 4-ET: 3:5:7:17
> > 5-ET: 1:3:7
> > 6-ET: 1:5:7:9
> > 7-ET: 1:3:13, or 5:9:11
> > 8-ET: 3:5:11:13
> > 9-ET: 3:7:11:13:15
> > 10-ET: 1:5:7, 1:7:13:15
> > 11-ET: 1:7:9:11:15:17
> > 12-ET: 1:3:5:7:9:15:17:19
> > 13-ET: 1:5:9:13:17:21
> > 14-ET: 5:7:9:11, or 1:3:7(:11)
> > 15-ET: 1:3:5:7:11, or simply 1:5:7:11
> > 16-ET: 1:5:7:13:19
> > 17-ET: 1:3:7:9:11:13
> > 18-ET: 3:7:11:13:15:17:27
> > 19-ET: 1:3:5:7:9:13:15
> > 20-ET: 1:7:11:13:15:19:27
> > 21-ET: 1:5:7:9:11:13(:15)
> > 22-ET: 1:3:5:7:9:11:15:17
> > 23-ET: 1:9:13:15:17:21:33
> > 24-ET: 1:3:5:9:11:13:15:17:19
> > 25-ET: 1:5:7:9:17:19

The idea is that each of these sets of harmonics defines a JI subgroup, but actually contains more information than that because it specifies which intervals you want to include in your "tonality diamond".

I've now thought of a very simple way to search for all such harmonic sets where the error of any interval in the tonality diamond is less than some threshold. It yields similar results to the above.

I'll go ahead and paste the Python code here since it's short, but formatting issues might arise so use the uploaded file if it doesn't work.

from math import *
from fractions import gcd

def harmonic_sets(edo, max_harmonic, threshold):
'''Returns all the harmonic sets for EDO using harmonics up to max_harmonic,
where all the errors in the tonality diamond are less than threshold cents'''
l = []
for flattest in range(1,max_harmonic,2):
test = lambda i: (((log(i,2)-log(flattest,2))*edo) % 1) * 1200/edo < threshold
l.append(set(filter(test, range(1,max_harmonic+1,2))))
ret = []
for s in l:
good = True
if reduce(gcd,s) != 1:
good = False
else:
for s2 in l:
if s != s2 and s.issubset(s2): good = False
if good: ret.append(sorted(s))
return sorted(ret)

The important thing is that you don't just round the harmonics and see what the worst error is (because that ignores all the other intervals in the tonality diamond). Instead, you round the harmonics and see which sets of fractional parts are within a certain distance of *each other* (rather than of 0).

Let's see what this gives us. First let's try 12edo, 19-limit, with max error 10 cents:

>>> harmonic_sets(12,19,10.)
[[1, 3, 9, 17], [15, 19]]

We already knew 12edo was a great 2.3.17 temperament (with good 1:3:9:17 chords), but this tells us that it's also a great 2.19/15 temperament (because 19/15 is close to 400 cents). Let's try 20 cent max error:

>>> harmonic_sets(12,19,20.)
[[1, 3, 5, 9, 15, 17, 19], [5, 7, 15], [7, 11], [11, 13]]

The first harmonic set seems very reasonable for 12edo and it implies the 2.3.5.17.19 subgroup. The others are weird because they're "unrooted", but 12edo is no less accurate for them.

The harmonic set Igs gave for 12edo is actually pretty high-error because it contains things like 9/7. Its error is more than 36 cents, so let's use 37 as the threshold:

>>> harmonic_sets(12,19,37.)
[[1, 3, 5, 7, 9, 15, 17, 19], [5, 7, 11, 15], [7, 11, 13], [9, 13, 17]]

Now the first result is identical to what Igs came up with.

Here's all the results for 10 cent max error, 21-limit:

1edo: 1,
2edo: 1, 3:17,
3edo: 1, 3:19, 15:19,
4edo: 1:19, 3:17,
5edo: 1:7, 13:15,
6edo: 1:9, 3:17:19, 15:19,
7edo: 1, 5:11, 7:17, 9:11, 19:21,
8edo: 1:19, 3:11:17, 5:13,
9edo: 1, 3:7:13:19, 11:15, 15:19,
10edo: 1:7:13:15, 3:17:21,
11edo: 1:11:15:17, 7:9, 7:17, 13:19,
12edo: 1:3:9:17:19, 15:19,
13edo: 1:11, 1:13:21, 5:9:13:17, 5:9:17:19,
14edo: 1, 3:7:17, 5:11:19:21, 7:9, 9:11:19:21, 13:15,
15edo: 1:7, 1:11, 3:5:11:21, 3:5:19, 9:13:15, 15:19,
16edo: 1:7:19, 3:11:17, 5:13:21, 15:17,
17edo: 1:3:9:13, 3:9:11:13, 5:15:17, 7:11,
18edo: 1:9:21, 3:7:13:17:19, 11:15, 15:19,
19edo: 1:3:5, 3:5:9:15, 7:9:13:15, 7:13:21, 11:17:19,
20edo: 1:7:13:15, 1:13:19, 3:17:21, 5:9, 7:11:15,
21edo: 1:7:15, 1:7:17, 3:19:21, 5:11:13, 5:13:17, 9:11:13, 15:19,
22edo: 1:3:15:17, 1:5:11:15:17, 3:7:9, 3:7:17, 13:19, 19:21,
23edo: 1:9:15:17:21, 1:13:17:21, 3:5:7:11, 7:11:19, 15:19,
24edo: 1:3:9:11:17:19, 1:13:19, 5:13:15, 13:15:19,
25edo: 1:5:7:17:19, 3:11:13:15, 5:7:9:17:19,

And here's all the results for 20 cent max error:

1edo: 1,
2edo: 1, 3:17, 5:7,
3edo: 1:5, 3:15:19, 7:11,
4edo: 1:19, 3:5:17, 5:7, 11:13,
5edo: 1:3:21, 1:7, 11:19, 13:15, 13:17,
6edo: 1:5:9, 3:15:17:19, 5:7, 7:11,
7edo: 1:3, 1:13, 5:9:11, 7:17, 7:19:21,
8edo: 1:19, 3:5:11:13:17, 5:7, 7:9,
9edo: 1:5, 1:11, 3:7:11:15:19, 3:7:13:15:19, 5:17,
10edo: 1:3:13:17:21, 1:7:13:15, 5:7:15, 9:11, 11:19,
11edo: 1:7:9:15:17, 1:7:11:15:17, 3:5, 5:13, 7:9:13:19,
12edo: 1:3:5:9:15:17:19, 5:7:15:21, 7:11:21, 11:13,
13edo: 1:5:9:13:17:21, 1:5:11:13:17:21, 1:11:15, 3:7, 5:9:13:17:19,
14edo: 1:3:17, 1:13, 3:7:9:17, 5:7:9:11:19:21, 5:15:19:21, 7:9:11:17, 13:15,
15edo: 1:3:5:11:21, 1:7:11, 3:5:11:19:21, 3:5:15:19, 3:9:15:19, 7:17, 9:13:15:19, 9:13:17,
16edo: 1:5:7:19, 1:5:13:19, 3:5:11:13:17:21, 3:11:15:17, 7:9:19,
17edo: 1:3:7:9:11:13, 1:3:19, 5:7:17:21, 5:15:17:19, 5:15:17:21,
18edo: 1:5:9:21, 1:9:11:21, 3:5:7:13:17, 3:7:11:15:19, 3:7:13:15:17:19, 9:11:15:21,
19edo: 1:3:5:9:13:15, 1:11:19, 3:5:7:9:13:15, 7:9:13:15:21, 11:17:19,
20edo: 1:3:13:17:19:21, 1:7:11:13:15:19, 3:5:9, 3:5:17, 5:7:9:11:15,
21edo: 1:3:7:15:19:21, 1:5:7:13:15:17, 5:7:11:13:17, 5:9:11:13:17,
22edo: 1:3:5:7:9:15:17, 1:3:5:7:11:15:17, 5:11:13, 7:9:13:19:21, 11:13:19,
23edo: 1:9:13:15:17:21, 1:9:15:17:19:21, 3:5:7:11:19, 3:5:13, 7:9:11:15:19,
24edo: 1:3:5:9:11:13:15:17:19, 1:3:7:9:11:17, 3:7:9:11:17:21, 5:7:15:21,
25edo: 1:3:15:21, 1:5:7:9:17:19, 1:5:15:21, 3:9:11:13, 3:11:13:15:21, 7:9:11:13:17:19,

Note that sometimes only a very small set containing 1 exists, but a much fuller set beginning with 3 or 5 is possible. An example is 8edo which has only 1:19 containing 1, but 3:5:11:13:17 if you allow 1 to be omitted.

On the other hand, if this is *not* the case, the harmonic sets omitting small numbers can probably be dismissed as "weird, rootless" ones no one will ever use.

Keenan

🔗cityoftheasleep <igliashon@...>

12/3/2012 4:30:47 PM

Well howdy-do, I figured there had to be a way to formalize it somehow. Thanks for going to the trouble, Keenan! They do come out very close, though I make judgment calls occasionally to include higher-error approximations if they either a) greatly expand the versatility of the temperament or b) don't perturb the otherwise-low average error too much.

Is there a way to check for average error on the diamond, rather than max error? Or is that a PITA?

I wish I knew enough about programming to do something with the code.

You are right, though; I might want to omit the 7 identity from 12-ET. I omit it from 24-ET, after all....

-Igs

--- In tuning@yahoogroups.com, "Keenan Pepper" <keenanpepper@...> wrote:
>
> Back when Igs was talking about "how to make any EDO sound like JI", I wrote this:
>
> --- In tuning@yahoogroups.com, "Keenan Pepper" <keenanpepper@> wrote:
> >
> > Okay, Igs, given that what you're really interested in is not abstract infinite groups, but tonality diamonds and chords, here's how I'd present the information:
> >
> > > 1-ET: 1
> > > 2-ET: 5:7
> > > 3-ET: 1:5, 7:9:11
> > > 4-ET: 3:5:7:17
> > > 5-ET: 1:3:7
> > > 6-ET: 1:5:7:9
> > > 7-ET: 1:3:13, or 5:9:11
> > > 8-ET: 3:5:11:13
> > > 9-ET: 3:7:11:13:15
> > > 10-ET: 1:5:7, 1:7:13:15
> > > 11-ET: 1:7:9:11:15:17
> > > 12-ET: 1:3:5:7:9:15:17:19
> > > 13-ET: 1:5:9:13:17:21
> > > 14-ET: 5:7:9:11, or 1:3:7(:11)
> > > 15-ET: 1:3:5:7:11, or simply 1:5:7:11
> > > 16-ET: 1:5:7:13:19
> > > 17-ET: 1:3:7:9:11:13
> > > 18-ET: 3:7:11:13:15:17:27
> > > 19-ET: 1:3:5:7:9:13:15
> > > 20-ET: 1:7:11:13:15:19:27
> > > 21-ET: 1:5:7:9:11:13(:15)
> > > 22-ET: 1:3:5:7:9:11:15:17
> > > 23-ET: 1:9:13:15:17:21:33
> > > 24-ET: 1:3:5:9:11:13:15:17:19
> > > 25-ET: 1:5:7:9:17:19
>
> The idea is that each of these sets of harmonics defines a JI subgroup, but actually contains more information than that because it specifies which intervals you want to include in your "tonality diamond".
>
> I've now thought of a very simple way to search for all such harmonic sets where the error of any interval in the tonality diamond is less than some threshold. It yields similar results to the above.
>
> I'll go ahead and paste the Python code here since it's short, but formatting issues might arise so use the uploaded file if it doesn't work.
>
>
>
> from math import *
> from fractions import gcd
>
> def harmonic_sets(edo, max_harmonic, threshold):
> '''Returns all the harmonic sets for EDO using harmonics up to max_harmonic,
> where all the errors in the tonality diamond are less than threshold cents'''
> l = []
> for flattest in range(1,max_harmonic,2):
> test = lambda i: (((log(i,2)-log(flattest,2))*edo) % 1) * 1200/edo < threshold
> l.append(set(filter(test, range(1,max_harmonic+1,2))))
> ret = []
> for s in l:
> good = True
> if reduce(gcd,s) != 1:
> good = False
> else:
> for s2 in l:
> if s != s2 and s.issubset(s2): good = False
> if good: ret.append(sorted(s))
> return sorted(ret)
>
>
>
> The important thing is that you don't just round the harmonics and see what the worst error is (because that ignores all the other intervals in the tonality diamond). Instead, you round the harmonics and see which sets of fractional parts are within a certain distance of *each other* (rather than of 0).
>
> Let's see what this gives us. First let's try 12edo, 19-limit, with max error 10 cents:
>
> >>> harmonic_sets(12,19,10.)
> [[1, 3, 9, 17], [15, 19]]
>
> We already knew 12edo was a great 2.3.17 temperament (with good 1:3:9:17 chords), but this tells us that it's also a great 2.19/15 temperament (because 19/15 is close to 400 cents). Let's try 20 cent max error:
>
> >>> harmonic_sets(12,19,20.)
> [[1, 3, 5, 9, 15, 17, 19], [5, 7, 15], [7, 11], [11, 13]]
>
> The first harmonic set seems very reasonable for 12edo and it implies the 2.3.5.17.19 subgroup. The others are weird because they're "unrooted", but 12edo is no less accurate for them.
>
> The harmonic set Igs gave for 12edo is actually pretty high-error because it contains things like 9/7. Its error is more than 36 cents, so let's use 37 as the threshold:
>
> >>> harmonic_sets(12,19,37.)
> [[1, 3, 5, 7, 9, 15, 17, 19], [5, 7, 11, 15], [7, 11, 13], [9, 13, 17]]
>
> Now the first result is identical to what Igs came up with.
>
> Here's all the results for 10 cent max error, 21-limit:
>
> 1edo: 1,
> 2edo: 1, 3:17,
> 3edo: 1, 3:19, 15:19,
> 4edo: 1:19, 3:17,
> 5edo: 1:7, 13:15,
> 6edo: 1:9, 3:17:19, 15:19,
> 7edo: 1, 5:11, 7:17, 9:11, 19:21,
> 8edo: 1:19, 3:11:17, 5:13,
> 9edo: 1, 3:7:13:19, 11:15, 15:19,
> 10edo: 1:7:13:15, 3:17:21,
> 11edo: 1:11:15:17, 7:9, 7:17, 13:19,
> 12edo: 1:3:9:17:19, 15:19,
> 13edo: 1:11, 1:13:21, 5:9:13:17, 5:9:17:19,
> 14edo: 1, 3:7:17, 5:11:19:21, 7:9, 9:11:19:21, 13:15,
> 15edo: 1:7, 1:11, 3:5:11:21, 3:5:19, 9:13:15, 15:19,
> 16edo: 1:7:19, 3:11:17, 5:13:21, 15:17,
> 17edo: 1:3:9:13, 3:9:11:13, 5:15:17, 7:11,
> 18edo: 1:9:21, 3:7:13:17:19, 11:15, 15:19,
> 19edo: 1:3:5, 3:5:9:15, 7:9:13:15, 7:13:21, 11:17:19,
> 20edo: 1:7:13:15, 1:13:19, 3:17:21, 5:9, 7:11:15,
> 21edo: 1:7:15, 1:7:17, 3:19:21, 5:11:13, 5:13:17, 9:11:13, 15:19,
> 22edo: 1:3:15:17, 1:5:11:15:17, 3:7:9, 3:7:17, 13:19, 19:21,
> 23edo: 1:9:15:17:21, 1:13:17:21, 3:5:7:11, 7:11:19, 15:19,
> 24edo: 1:3:9:11:17:19, 1:13:19, 5:13:15, 13:15:19,
> 25edo: 1:5:7:17:19, 3:11:13:15, 5:7:9:17:19,
>
> And here's all the results for 20 cent max error:
>
> 1edo: 1,
> 2edo: 1, 3:17, 5:7,
> 3edo: 1:5, 3:15:19, 7:11,
> 4edo: 1:19, 3:5:17, 5:7, 11:13,
> 5edo: 1:3:21, 1:7, 11:19, 13:15, 13:17,
> 6edo: 1:5:9, 3:15:17:19, 5:7, 7:11,
> 7edo: 1:3, 1:13, 5:9:11, 7:17, 7:19:21,
> 8edo: 1:19, 3:5:11:13:17, 5:7, 7:9,
> 9edo: 1:5, 1:11, 3:7:11:15:19, 3:7:13:15:19, 5:17,
> 10edo: 1:3:13:17:21, 1:7:13:15, 5:7:15, 9:11, 11:19,
> 11edo: 1:7:9:15:17, 1:7:11:15:17, 3:5, 5:13, 7:9:13:19,
> 12edo: 1:3:5:9:15:17:19, 5:7:15:21, 7:11:21, 11:13,
> 13edo: 1:5:9:13:17:21, 1:5:11:13:17:21, 1:11:15, 3:7, 5:9:13:17:19,
> 14edo: 1:3:17, 1:13, 3:7:9:17, 5:7:9:11:19:21, 5:15:19:21, 7:9:11:17, 13:15,
> 15edo: 1:3:5:11:21, 1:7:11, 3:5:11:19:21, 3:5:15:19, 3:9:15:19, 7:17, 9:13:15:19, 9:13:17,
> 16edo: 1:5:7:19, 1:5:13:19, 3:5:11:13:17:21, 3:11:15:17, 7:9:19,
> 17edo: 1:3:7:9:11:13, 1:3:19, 5:7:17:21, 5:15:17:19, 5:15:17:21,
> 18edo: 1:5:9:21, 1:9:11:21, 3:5:7:13:17, 3:7:11:15:19, 3:7:13:15:17:19, 9:11:15:21,
> 19edo: 1:3:5:9:13:15, 1:11:19, 3:5:7:9:13:15, 7:9:13:15:21, 11:17:19,
> 20edo: 1:3:13:17:19:21, 1:7:11:13:15:19, 3:5:9, 3:5:17, 5:7:9:11:15,
> 21edo: 1:3:7:15:19:21, 1:5:7:13:15:17, 5:7:11:13:17, 5:9:11:13:17,
> 22edo: 1:3:5:7:9:15:17, 1:3:5:7:11:15:17, 5:11:13, 7:9:13:19:21, 11:13:19,
> 23edo: 1:9:13:15:17:21, 1:9:15:17:19:21, 3:5:7:11:19, 3:5:13, 7:9:11:15:19,
> 24edo: 1:3:5:9:11:13:15:17:19, 1:3:7:9:11:17, 3:7:9:11:17:21, 5:7:15:21,
> 25edo: 1:3:15:21, 1:5:7:9:17:19, 1:5:15:21, 3:9:11:13, 3:11:13:15:21, 7:9:11:13:17:19,
>
> Note that sometimes only a very small set containing 1 exists, but a much fuller set beginning with 3 or 5 is possible. An example is 8edo which has only 1:19 containing 1, but 3:5:11:13:17 if you allow 1 to be omitted.
>
> On the other hand, if this is *not* the case, the harmonic sets omitting small numbers can probably be dismissed as "weird, rootless" ones no one will ever use.
>
> Keenan
>

🔗Keenan Pepper <keenanpepper@...>

12/3/2012 6:50:04 PM

--- In tuning@yahoogroups.com, "cityoftheasleep" <igliashon@...> wrote:
>
> Well howdy-do, I figured there had to be a way to formalize it somehow. Thanks for going to the trouble, Keenan! They do come out very close, though I make judgment calls occasionally to include higher-error approximations if they either a) greatly expand the versatility of the temperament or b) don't perturb the otherwise-low average error too much.
>
> Is there a way to check for average error on the diamond, rather than max error? Or is that a PITA?

Well, you can make anything have an arbitrarily low average error by adding more and more really accurate high harmonics. So, the upshot is it's a PITA.

Keenan

🔗cityoftheasleep <igliashon@...>

12/3/2012 7:48:18 PM

--- In tuning@yahoogroups.com, "Keenan Pepper" <keenanpepper@...> wrote:

> Well, you can make anything have an arbitrarily low average error by adding more and more really accurate high harmonics. So, the upshot is it's a PITA.
>

What if you kept the cut-off at the 21st harmonic? Would that still make it a PITA?

-Igs

🔗Wolf Peuker <wolfpeuker@...>

12/4/2012 4:33:13 AM

Hello Keenan and Igs,

thanks for the Python code and the results, and talk :-)

Am 04.12.2012 03:50, schrieb Keenan Pepper:
> --- In tuning@yahoogroups.com, "cityoftheasleep" <igliashon@...> wrote:
>>
>> Well howdy-do, I figured there had to be a way to formalize it somehow. Thanks for going to the trouble, Keenan! They do come out very close, though I make judgment calls occasionally to include higher-error approximations if they either a) greatly expand the versatility of the temperament or b) don't perturb the otherwise-low average error too much.
>>
>> Is there a way to check for average error on the diamond, rather than max error? Or is that a PITA?
>
> Well, you can make anything have an arbitrarily low average error by adding more and more really accurate high harmonics. So, the upshot is it's a PITA.

What does PITA mean? Anything to be definded in the xenwiki? [1]

Thanks in advance,
Wolf

[1] http://xenharmonic.wikispaces.com/search/view/PITA

🔗Wolf Peuker <wolfpeuker@...>

12/4/2012 6:43:31 AM

Am 04.12.2012 13:33, schrieb Wolf Peuker:
>
> What does PITA mean? Anything to be definded in the xenwiki? [1]

Probably not ;-)

http://www.urbandictionary.com/define.php?term=PITA
...sorry, but this isn't so easy for a non-native speaker.

Best,
Wolf

🔗genewardsmith <genewardsmith@...>

12/4/2012 3:20:05 PM

--- In tuning@yahoogroups.com, "Keenan Pepper" <keenanpepper@...> wrote:

> > Is there a way to check for average error on the diamond, rather than max error? Or is that a PITA?
>
> Well, you can make anything have an arbitrarily low average error by adding more and more really accurate high harmonics. So, the upshot is it's a PITA.

Are you computing max error from an edo or a val?

🔗Keenan Pepper <keenanpepper@...>

12/4/2012 6:00:03 PM

--- In tuning@yahoogroups.com, "genewardsmith" <genewardsmith@...> wrote:
> Are you computing max error from an edo or a val?

Neither, I guess. Every harmonic (1/1, 2/1, 3/1...) is expressible as a number of EDO steps plus a fractional part. These fractional parts naturally lie on a circle; this code finds sets of harmonics that lie in small regions on that circle.

Keenan

🔗cityoftheasleep <igliashon@...>

12/4/2012 8:57:31 PM

So, after an in-depth comparison between my findings and yours, I noticed that in most cases where they don't match, it's because I opted to include an additional harmonic or two that, while it raised max error above the 20-cent cut-off, it did so only by a few cents and only for a couple intervals in the diamond. There were a few cases where I allowed error up to about 36 cents for the sake of versatility in constructing larger chords (though I also give higher-accuracy but smaller sets, as well), and some of those I amended by removing the lower-accuracy harmonics. There were also quite a few cases, especially the 5n-ETs, where your set was better at including important consonances while excluding less-accurately tuned ones--for example, 1:3:21 does a better job on 5-ET than 1:3:7, since it loses the 7/6 and 12/7 that are not well-represented. Overall, very helpful, and I'll be sure to credit you in the paper that eventually comes out of this.

-Igs

--- In tuning@yahoogroups.com, "Keenan Pepper" <keenanpepper@...> wrote:
>
> --- In tuning@yahoogroups.com, "cityoftheasleep" <igliashon@> wrote:
> >
> > Well howdy-do, I figured there had to be a way to formalize it somehow. Thanks for going to the trouble, Keenan! They do come out very close, though I make judgment calls occasionally to include higher-error approximations if they either a) greatly expand the versatility of the temperament or b) don't perturb the otherwise-low average error too much.
> >
> > Is there a way to check for average error on the diamond, rather than max error? Or is that a PITA?
>
> Well, you can make anything have an arbitrarily low average error by adding more and more really accurate high harmonics. So, the upshot is it's a PITA.
>
> Keenan
>