back to list

Complex number meantone conversion argument function

🔗Gene Ward Smith <gwsmith@svpal.org>

6/22/2003 11:13:12 PM

In case anyone else wants to mess with this, here is Maple code for
the "argument", -6 < arg <= 6, of a set of 12-equal note-classes. This
is the basic function which gets the job done, and as you can see,
it's not complicated.

arg := proc (s)
# meantone conversion argument function
# "s" is set or list of octave-reduced notes
local i, u, w;
if nops(s) = 0 then RETURN(0) fi;
u := 0;
w := (3^(1/2) + I)/2;
for i to nops(s) do u := u+w^(7*s[i]) od;
u := simplify(u);
if u = 0 then RETURN(0) fi;
u:=evalf(6*Im(ln(u))/Pi);
if abs(u - round(u)) < 0.00001 then
u := round(u) fi;
u end:

🔗Gene Ward Smith <gwsmith@svpal.org>

6/23/2003 1:15:40 AM

--- In tuning-math@yahoogroups.com, "Gene Ward Smith" <gwsmith@s...>
wrote:
> In case anyone else wants to mess with this, here is Maple code for
> the "argument", -6 < arg <= 6, of a set of 12-equal note-classes. This
> is the basic function which gets the job done, and as you can see,
> it's not complicated.

There's no need for messing with raising to the 7th power if we start
with the right root of unity, and a symmetric chord should not return
zero, which confuses it with C; so this returns "sym":

arg := proc (s)
# meantone conversion argument function
# "s" is set or list of octave-reduced notes
local i, u, w;
if nops(s) = 0 then RETURN(sym) fi;
u := 0;
w := -(3^(1/2) + I)/2;
for i to nops(s) do u := u+w^s[i] od;
u := simplify(u);
if u = 0 then RETURN(sym) fi;
u:=evalf(6*Im(ln(u))/Pi);
if abs(u - round(u)) < 0.00001 then
u := round(u) fi;
u end: