Godtone
Joined 17 December 2020
→Novation Launchpad Pro MK3 isomorphic keyboard code: allow changing mode by specifying a higher tonic (tonic>0) or specifying a number of gens to go down (tonic<0 where -tonic is the number of gens down) |
→My Python 3 code: add function for providing an odd-limit interpretation of an EDO (for now only supporting patent vals) |
||
| Line 1,159: | Line 1,159: | ||
def print_scale(scale): | def print_scale(scale): | ||
print('\n'.join([ striv(x) for x in scale ])) | print('\n'.join([ striv(x) for x in scale ])) | ||
def interpret_edo(edo,ol=17,sg=[],no=[],add=[],styler=lambda x,relerr: striv(x) if abs(relerr) < 1/2 else '*'+striv(x)+'*'): | |||
print(edo,'EDO interpretation') | |||
if not sg: | |||
sg = lim(ol) | |||
odds = [odd for odd in range(1,ol+1,2) if in_subgroup(odd,sg) and odd not in no] + add | |||
sedo = 0 | |||
for x in sorted( odd_lim(1,[],odds), key=lambda x: steps(x,ed(edo)) ): | |||
sedoofx = pval(x,ed(edo)) | |||
relerr = steps(x,ed(edo)) - sedoofx | |||
if sedoofx!=sedo: | |||
sedo = sedoofx | |||
print('\n'+str(sedo)+'\\'+str(edo)+': '+styler(x,relerr),end='') | |||
else: | |||
print(', '+styler(x,relerr),end='') | |||
print() | |||
</syntaxhighlight> | </syntaxhighlight> | ||