back to list

12 equal to meantone conversion algorithm

🔗Gene Ward Smith <gwsmith@svpal.org>

6/21/2003 10:35:21 PM

It seems to me that a pretty good start on this could be done
algorithmically, and that in any event the result would be
interesting and listenable. The method I've been pondering would
definately not solve any 128/125 drift problem; one may regard that
as a bug or a feature.

Given a set of octave reduced note classes, we can represent each
element as a unit vector or equivalently, a complex number of
absolute value one. Raise these to the seventh power to get a set of
complex numbers organized around a circle of fifths, then add all of
the complex numbers (sum_i z_i^7); if the result is zero, return
zero; otherwise divide by the absolute value to get another number of
absolute value unity. This is the 12-equal midpoint.

We now take the previous chord's 12-equal midpoint and find which
side of it the new midpoint it is closest to (with a tiebreaker if
needed.) We add that on to the previous chord's meantone midpoint,
which is a real number, not a number mod 1 or 12 or 2 pi or 360
(however you are measuring a circle) to get the meantone midpoint of
the new chord. If the new chord has a 12-equal midpoint of zero, we
add zero and simply use the old midpoint. The first chord has a
meantone midpoint equal to its 12-equal midpoint, allowing us to
start the recursion (if the first chord is an augmented triad or
diminished seventh, we probably need to go to the first unambiguous
chord and work backwards and forwards.)

We now take a range of +-6 around the meantone midpoint, and use it
to decide how to map the 12 note classes to meantone for this chord,
using the previous midpoint as a tiebreaker if needed.

I'm actually thinking of trying to code this in C, despite the fact
that I've written only in Maple for the last 15 years, but of course
if I could con someone into doing it for me that would be even
better. I think it would be a wonderful addition to Scala and Ada
would be just fine as a language to write it in; Python also springs
to mind as a good language. :)

🔗Carl Lumma <ekin@lumma.org>

6/22/2003 12:59:35 PM

Pretty simple, compared to this:

http://lumma.org/stuff/adaptive.txt

-Carl

🔗wallyesterpaulrus <wallyesterpaulrus@yahoo.com>

6/22/2003 5:47:35 PM

how does this compare with dave keenan's ideas:

http://www.uq.net.au/~zzdkeena/Music/AdaptiveMeantone.htm

?

--- In tuning-math@yahoogroups.com, "Gene Ward Smith" <gwsmith@s...>
wrote:
> It seems to me that a pretty good start on this could be done
> algorithmically, and that in any event the result would be
> interesting and listenable. The method I've been pondering would
> definately not solve any 128/125 drift problem; one may regard that
> as a bug or a feature.
>
> Given a set of octave reduced note classes, we can represent each
> element as a unit vector or equivalently, a complex number of
> absolute value one. Raise these to the seventh power to get a set of
> complex numbers organized around a circle of fifths, then add all of
> the complex numbers (sum_i z_i^7); if the result is zero, return
> zero; otherwise divide by the absolute value to get another number
of
> absolute value unity. This is the 12-equal midpoint.
>
> We now take the previous chord's 12-equal midpoint and find which
> side of it the new midpoint it is closest to (with a tiebreaker if
> needed.) We add that on to the previous chord's meantone midpoint,
> which is a real number, not a number mod 1 or 12 or 2 pi or 360
> (however you are measuring a circle) to get the meantone midpoint of
> the new chord. If the new chord has a 12-equal midpoint of zero, we
> add zero and simply use the old midpoint. The first chord has a
> meantone midpoint equal to its 12-equal midpoint, allowing us to
> start the recursion (if the first chord is an augmented triad or
> diminished seventh, we probably need to go to the first unambiguous
> chord and work backwards and forwards.)
>
> We now take a range of +-6 around the meantone midpoint, and use it
> to decide how to map the 12 note classes to meantone for this chord,
> using the previous midpoint as a tiebreaker if needed.
>
> I'm actually thinking of trying to code this in C, despite the fact
> that I've written only in Maple for the last 15 years, but of course
> if I could con someone into doing it for me that would be even
> better. I think it would be a wonderful addition to Scala and Ada
> would be just fine as a language to write it in; Python also springs
> to mind as a good language. :)

🔗Gene Ward Smith <gwsmith@svpal.org>

6/22/2003 8:33:46 PM

--- In tuning-math@yahoogroups.com, "wallyesterpaulrus"
<wallyesterpaulrus@y...> wrote:
> how does this compare with dave keenan's ideas:
>
> http://www.uq.net.au/~zzdkeena/Music/AdaptiveMeantone.htm

Thanks for pointing this out. They are similar in both using a
sliding window. Despite the fact that I use complex numbers, my
algorithm is actually simpler and more straightforward. If we did the
ascending chromatic scale example, using my method we simply get
ascending diatonic semitones; hence we do not arrive back in the key
of C, but we don't experience any irregularities.

🔗Gene Ward Smith <gwsmith@svpal.org>

6/22/2003 9:08:59 PM

--- In tuning-math@yahoogroups.com, "Gene Ward Smith" <gwsmith@s...>
wrote:

> Thanks for pointing this out. They are similar in both using a
> sliding window. Despite the fact that I use complex numbers, my
> algorithm is actually simpler and more straightforward. If we did
the
> ascending chromatic scale example, using my method we simply get
> ascending diatonic semitones; hence we do not arrive back in the
key
> of C, but we don't experience any irregularities.

I should point out that this is only true if the chromatic scale is
not harmonized. My algorithm, while very simple, does not work on the
crude level of note-for-note, but is based on note-sets. If the
chromatic passage was harmonized in a way which leads back to C, for
instance by C-A-D-cm-C-F-D-G-fm-F-C7-G7-C, back to C we would come.

🔗Graham Breed <graham@microtonal.co.uk>

6/23/2003 2:27:09 AM

Gene Ward Smith wrote:

> I should point out that this is only true if the chromatic scale is > not harmonized. My algorithm, while very simple, does not work on the > crude level of note-for-note, but is based on note-sets. If the > chromatic passage was harmonized in a way which leads back to C, for > instance by C-A-D-cm-C-F-D-G-fm-F-C7-G7-C, back to C we would come.

I also have some code for 12-equal to meantone conversions, and I managed to write it without using complex numbers! It's at http://x31eq.com/gesualdo.zip

I don't know how out of date that is, but I do have a more recent version on my Revo. One difference is that I have found passages in Gesualdo that it doesn't convert correctly. There's a total of 3 wrong chords. From what I remember, these can be resolved by using a different gamut depending on whether he used a Bb in the key signature.

The gamut restrictions could possible be removed by using a flexible key center. Take everything relative to the average number of steps on the spiral of fifths, calculated recursively as

total(n) = k*total(n-1) + note
number(n) = k*number(n-1) + 1
center(n) = total(n)/number(n)

Then, k=0 means it calculates each new chord looking at only the previous chord, and k=1 makes it remember all previous chords equally, which will give very conservative results. I didn't implement this for the Gesualdo program, because it isn't a rule he was likely to follow, but it might work for an automated tuning program.

Graham

🔗Gene Ward Smith <gwsmith@svpal.org>

6/23/2003 3:52:34 AM

--- In tuning-math@yahoogroups.com, Graham Breed <graham@m...> wrote:

> I don't know how out of date that is, but I do have a more recent
> version on my Revo. One difference is that I have found passages
in
> Gesualdo that it doesn't convert correctly. There's a total of 3
wrong
> chords. From what I remember, these can be resolved by using a
> different gamut depending on whether he used a Bb in the key
signature.

You think you have problems. I just tried my algorithm on Schumann's
Foreign Lands and Peoples. The fact that it didn't end up in the same
key it started with wasn't as disturbing as the obvious clinkers. Of
course, I imagine Renaissance music is easier to covert to meantone!

🔗Manuel Op de Coul <manuel.op.de.coul@eon-benelux.com>

6/23/2003 4:49:59 AM

Have a look at this too:
http://www.ai.univie.ac.at/cgi-bin/tr-online?number+2001-12

Manuel

🔗Gene Ward Smith <gwsmith@svpal.org>

6/23/2003 10:58:24 PM

--- In tuning-math@yahoogroups.com, "Gene Ward Smith" <gwsmith@s...>
wrote:

> You think you have problems. I just tried my algorithm on
Schumann's
> Foreign Lands and Peoples. The fact that it didn't end up in the
same
> key it started with wasn't as disturbing as the obvious clinkers.

I screwed up; the Schumann in fact presents zero difficulties for
conversion to meantone so far as I can determine. You can find a
31-equal version and the midi I retuned here:
.
.
.
/tuning-math/files/31%20equal/fore.mid

/tuning-math/files/originals/sr15-1.mid