back to list

TOP observation

🔗Herman Miller <hmiller@IO.COM>

3/5/2007 7:54:49 PM

This may have some obvious mathematical explanation, but it seems potentially useful if it turns out to be correct. If there's some problem with the idea, a counterexample or two would be appreciated.

Take a 7-limit rank 2 temperament, for example lemba, with a wedgie of

<<6, -2, -2, -17, -20, 1]]

From this you can derive a set of commas with one of the elements in each comma equal to zero.

[17, -2, -6, 0>
[10, -1, 0, -3> (simplified from [20, -2, 0, -6>)
[1, 0, 2, -2>
[0, 1, 20, -17>

Now you can find the TOP errors of each comma using a relatively simple procedure:

[17, -2, -6, 0> -3.57
[10, -1, 0, -3> -0.42
[1, 0, 2, -2> 3.11
[0, 1, 20, -17> 3.74

But guess what? The TOP error of lemba is 3.74! I've tried this with a few other temperaments and it always seems to work out that the TOP error of the temperament is the same as the largest absolute value of the TOP errors of its 3-element commas. Is this generally the case? Can this be extended in the obvious way to 11-limit or higher limit temperaments? If so, this seems like a useful procedure for determining the TOP tuning for a temperament (no need for specialized mathematical software and understanding of how to set up a linear programming problem).

🔗Graham Breed <gbreed@gmail.com>

3/6/2007 12:03:06 AM

On 06/03/07, Herman Miller <hmiller@io.com> wrote:

<snip>

> But guess what? The TOP error of lemba is 3.74! I've tried this with a
> few other temperaments and it always seems to work out that the TOP
> error of the temperament is the same as the largest absolute value of
> the TOP errors of its 3-element commas. Is this generally the case? Can
> this be extended in the obvious way to 11-limit or higher limit
> temperaments? If so, this seems like a useful procedure for determining
> the TOP tuning for a temperament (no need for specialized mathematical
> software and understanding of how to set up a linear programming problem).

I think it should always be true for a worst-case comma. I don't know
if you can expect that comma to be one of the results of a simple
comma-finding algorithm. It'd be very handy if it did, so perhaps
I'll start looking for counter-examples one of these days.

Graham

🔗Herman Miller <hmiller@IO.COM>

3/8/2007 7:00:08 PM

Graham Breed wrote:
> On 06/03/07, Herman Miller <hmiller@io.com> wrote:
> > <snip>
> >> But guess what? The TOP error of lemba is 3.74! I've tried this with a
>> few other temperaments and it always seems to work out that the TOP
>> error of the temperament is the same as the largest absolute value of
>> the TOP errors of its 3-element commas. Is this generally the case? Can
>> this be extended in the obvious way to 11-limit or higher limit
>> temperaments? If so, this seems like a useful procedure for determining
>> the TOP tuning for a temperament (no need for specialized mathematical
>> software and understanding of how to set up a linear programming problem).
> > I think it should always be true for a worst-case comma. I don't know
> if you can expect that comma to be one of the results of a simple
> comma-finding algorithm. It'd be very handy if it did, so perhaps
> I'll start looking for counter-examples one of these days.

I think I have some idea why it works, and why it should work for any rank 2 temperament. The TOP tunings I've calculated agree with Gene's figures from the old list of 114 linear 7-limit temperaments with at most a difference of 0.000002 cents (and that could be a floating point precision issue).

Any rank 2 temperament can be represented as a plane in "val" space. The TOP tuning is a point on this plane which is a certain distance away from the JI point; in TOP space, this means it is a point on the surface of an n-dimensional cube (or hypercube) with a particular size. There will always be a way to find a projection of the cube such that the TOP tuning is at a corner of the projected cube! If it is on an edge, project it along the axis parallel to the edge, and so on for faces, etc.

This means that if you test all the possible projections into 3-dimensional space, at least one of the projections will have the TOP point on a corner of the cube (others may have it on an edge or a face). In that case, finding the TOP point reduces to the problem of finding the TOP error of a single comma with 3 prime factors, which is easily solved. The comma is tempered to zero, so its TOP error is just its "length" as defined by the TOP metric. (I forget who first pointed this out, but I think it was either Graham Breed, Paul Erlich, or Dave Keenan.)

The only temperaments that might not have the TOP point on a corner of a projected cube that I can think of are ones that are degenerate in some way, missing one of the prime factors in their commas (which could be treated as a lower-dimensional case to begin with).

Now that you have the maximum TOP error of the temperament, you can find the TOP tuning for those three primes, and fairly easily solve for the tuning of the remaining primes from the generator mapping or the other commas of the temperament. Not as simple as the pseudoinverse method, but still something that a relatively small function in a programming language could handle without much trouble. Actually it might be about as easy if you have to write your own matrix inverse.

Does this all make sense, mathematically?

🔗Graham Breed <gbreed@gmail.com>

3/9/2007 2:14:02 AM

On 09/03/07, Herman Miller <hmiller@io.com> wrote:
> Graham Breed wrote:
> > On 06/03/07, Herman Miller <hmiller@io.com> wrote:
> >
> > <snip>
> >
> >> But guess what? The TOP error of lemba is 3.74! I've tried this with a
> >> few other temperaments and it always seems to work out that the TOP
> >> error of the temperament is the same as the largest absolute value of
> >> the TOP errors of its 3-element commas. Is this generally the case? Can
> >> this be extended in the obvious way to 11-limit or higher limit
> >> temperaments? If so, this seems like a useful procedure for determining
> >> the TOP tuning for a temperament (no need for specialized mathematical
> >> software and understanding of how to set up a linear programming problem).
> >
> > I think it should always be true for a worst-case comma. I don't know
> > if you can expect that comma to be one of the results of a simple
> > comma-finding algorithm. It'd be very handy if it did, so perhaps
> > I'll start looking for counter-examples one of these days.
>
> I think I have some idea why it works, and why it should work for any
> rank 2 temperament. The TOP tunings I've calculated agree with Gene's
> figures from the old list of 114 linear 7-limit temperaments with at
> most a difference of 0.000002 cents (and that could be a floating point
> precision issue).

It could also be that the TOP tuning isn't always uniquely specified.

> Any rank 2 temperament can be represented as a plane in "val" space. The
> TOP tuning is a point on this plane which is a certain distance away
> from the JI point; in TOP space, this means it is a point on the surface
> of an n-dimensional cube (or hypercube) with a particular size. There
> will always be a way to find a projection of the cube such that the TOP
> tuning is at a corner of the projected cube! If it is on an edge,
> project it along the axis parallel to the edge, and so on for faces, etc.

A plausible TOP tuning will always be a corner of some kind. This is
how the Simplex algorithm for linear programming works. But there are
a lot of corners.

> This means that if you test all the possible projections into
> 3-dimensional space, at least one of the projections will have the TOP
> point on a corner of the cube (others may have it on an edge or a face).
> In that case, finding the TOP point reduces to the problem of finding
> the TOP error of a single comma with 3 prime factors, which is easily
> solved. The comma is tempered to zero, so its TOP error is just its
> "length" as defined by the TOP metric. (I forget who first pointed this
> out, but I think it was either Graham Breed, Paul Erlich, or Dave Keenan.)

Dave Keenan found something for odd limits, Paul Erlich
(independently) adapted it to Tenney-weighted prime limits.

> The only temperaments that might not have the TOP point on a corner of a
> projected cube that I can think of are ones that are degenerate in some
> way, missing one of the prime factors in their commas (which could be
> treated as a lower-dimensional case to begin with).

It has to be a corner of something (or not uniquely defined).

> Now that you have the maximum TOP error of the temperament, you can find
> the TOP tuning for those three primes, and fairly easily solve for the
> tuning of the remaining primes from the generator mapping or the other
> commas of the temperament. Not as simple as the pseudoinverse method,
> but still something that a relatively small function in a programming
> language could handle without much trouble. Actually it might be about
> as easy if you have to write your own matrix inverse.
>
> Does this all make sense, mathematically?

I still don't see how you know it's one of the commas you can easily
calculate. How simple is it? Simplex is non-polynomial, but
generally fast for that. All pairs of primes would be cubic time.
Least squares is linear time for rank 2, and you don't need a library.
It may be you're duplicating Simplex inefficiently, or that you've
found a reason Simplex can be beaten in this case.

Graham

🔗Gene Ward Smith <genewardsmith@coolgoose.com>

3/9/2007 10:49:49 AM

--- In tuning-math@yahoogroups.com, "Graham Breed" <gbreed@...> wrote:

> I still don't see how you know it's one of the commas you can easily
> calculate. How simple is it?

I didn't follow Herman's argument, but I think what is going on is
this: given a rank r tuning, you have enough freedom to give r+1 of the
primes the same relative error. One choice of primes and error signs
(that is, one choice of whether the error tends flat or sharp) will
belong to the actual minimax relative error, ie the TOP tuning. A comma
involving only those r+1 primes with the appropriate signs (that is, in
the numerator or denominator depending on the sign) will achieve the
maximum of relative error for TOP.

🔗Herman Miller <hmiller@IO.COM>

3/9/2007 6:13:03 PM

Graham Breed wrote:

> I still don't see how you know it's one of the commas you can easily
> calculate. How simple is it? Simplex is non-polynomial, but
> generally fast for that. All pairs of primes would be cubic time.
> Least squares is linear time for rank 2, and you don't need a library.
> It may be you're duplicating Simplex inefficiently, or that you've
> found a reason Simplex can be beaten in this case.

It could very well be that there's an easier way to calculate TOP tunings, but I haven't seen an explanation that I can understand.

The number of commas I need to calculate goes up pretty rapidly with the number of primes -- only 4 in the case of 7-limit, but 10 for 11-limit, 20 for 13-limit, etc. Still it's better than brute force converging on the solution by trying many different possible generator values around what's likely to be the TOP tuning.

🔗Graham Breed <gbreed@gmail.com>

3/9/2007 6:22:44 PM

On 10/03/07, Herman Miller <hmiller@io.com> wrote:
> Graham Breed wrote:
>
> > I still don't see how you know it's one of the commas you can easily
> > calculate. How simple is it? Simplex is non-polynomial, but
> > generally fast for that. All pairs of primes would be cubic time.
> > Least squares is linear time for rank 2, and you don't need a library.
> > It may be you're duplicating Simplex inefficiently, or that you've
> > found a reason Simplex can be beaten in this case.
>
> It could very well be that there's an easier way to calculate TOP
> tunings, but I haven't seen an explanation that I can understand.

Indeed!

This may be the easiest in terms of code, but not most efficient in
terms of operations. Still, in practical terms, removing a library
may speed things up. I think most of the time in my TOP searches is
spent in the interface with the C library.

> The number of commas I need to calculate goes up pretty rapidly with the
> number of primes -- only 4 in the case of 7-limit, but 10 for 11-limit,
> 20 for 13-limit, etc. Still it's better than brute force converging on
> the solution by trying many different possible generator values around
> what's likely to be the TOP tuning.

I think I've just worked it out. The number of commas is generally

n! / (r+1)!(n-r-1)!

for n primes and a rank r temperament. For rank 2, that simplifies to

n(n-1)(n-2) / 6

The complexity of the whole algorithm is this times the number of
primes, because for each comma you need to run over the primes to get
the error. So the whole thing is quartic or O(n**4) in complexity.
That's big, but should be manageable.

Graham

🔗Carl Lumma <ekin@lumma.org>

3/9/2007 8:43:13 PM

At 06:13 PM 3/9/2007, you wrote:
>Graham Breed wrote:
>
>> I still don't see how you know it's one of the commas you can easily
>> calculate. How simple is it? Simplex is non-polynomial, but
>> generally fast for that. All pairs of primes would be cubic time.
>> Least squares is linear time for rank 2, and you don't need a library.
>> It may be you're duplicating Simplex inefficiently, or that you've
>> found a reason Simplex can be beaten in this case.
>
>It could very well be that there's an easier way to calculate TOP
>tunings, but I haven't seen an explanation that I can understand.
>
>The number of commas I need to calculate goes up pretty rapidly with the
>number of primes -- only 4 in the case of 7-limit, but 10 for 11-limit,
>20 for 13-limit, etc.

I didn't think it went up that fast.

-Carl

🔗Graham Breed <gbreed@gmail.com>

3/9/2007 9:25:39 PM

On 10/03/07, Carl Lumma <ekin@lumma.org> wrote:
> At 06:13 PM 3/9/2007, you wrote:

> >The number of commas I need to calculate goes up pretty rapidly with the
> >number of primes -- only 4 in the case of 7-limit, but 10 for 11-limit,
> >20 for 13-limit, etc.
>
> I didn't think it went up that fast.

It's a combinatorics problem. For rank 2, you need a comma for each
case where all but 3 primes have zero coefficients. So the number of
commas is the number of ways of choosing 3 from n primes. Naturally,
for the 5-limit this is 1. If it were a single entry of zero in each
case that'd be much nicer.

The magic number 3 here is r+1 where r is the rank.

Graham

🔗Gene Ward Smith <genewardsmith@coolgoose.com>

3/9/2007 9:27:35 PM

--- In tuning-math@yahoogroups.com, Carl Lumma <ekin@...> wrote:

> >The number of commas I need to calculate goes up pretty rapidly with
the
> >number of primes -- only 4 in the case of 7-limit, but 10 for 11-
limit,
> >20 for 13-limit, etc.
>
> I didn't think it went up that fast.

The number of triprime commas is going to be n choose 3 = n(n-1)(n-2)/6,
which is cubic polynomial growth. Which could be a lot worse; the
number of corners of a hypercube is exponential growth.