back to list

Standardising temperament mappings

🔗David C Keenan <d.keenan@uq.net.au>

3/14/2002 6:21:14 PM

Gene and Graham are using different ways of presenting both the basis
vector for a temperament and its mapping matrix. This makes it tedious to
compare temperaments generated by their respective algorithms. We should
standardise. The standard should be based on other long-standing standards
or conventions or be otherwise defensible, particularly if we are going to
publish.

We should consider equal temperaments and planar temperaments as well as
the current linear temperaments, and we need to consider both octave-based
and non-octave-based tuning systems.

I see the following issues which need to be addressed in the following order.
1. Standardising the basis vector
a. What units to use for generators
(cents vs decimal octaves vs rational octaves)
b. Choosing a canonical ordering of the generators
c. How to determine a canonical set of generators
2. Standardising the mapping matrix
3. Standardising the format for flattening the mapping matrix

Here's my take on these issues:

1a. What units to use for generators

While octaves make good sense within a program for calculating
temperaments, I think it's clear that either cents or rational octaves will
be better understood by most readers. Since a basis nearly always includes
a generator whose optimum value can't be exprtessed as a simple rational
fraction of an octave, it seems cents should be the standard unit. We might
however want to include supplementary information when the cents do not
make it obvious that there are say exactly 19 generators (or periods) to
the octave, even though this information will also be buried in the map
matrix.

1b. Choosing a canonical ordering of the generators

This can't really be addressed independenlty of 1c. "How to determine a
canonical set of generators". But something has to come first in this text.

It seems obvious that the canonical basis for an equal temperament (or more
generally an EDn where n represents an interval of equivalence) is its step
size (its period), which is the smallest generator that generates n. n is
usually the lowest prime approximated by the EDn. The generator is always a
whole number division of n.

So it seems obvious to me that the first generator to be listed for a
linear temperament should be the one that generates only the lowest prime
(usually 2). We sometimes distinguish this generator by calling it the
"period", particularly when we consider it to be generating an "interval of
equivalence" (usually at least an approximate octave, but the tritave 1:3
also has a following). In this case we consider that the number of pitches
and their spacing _within_ a single interval-of-equivalence is what
constitutes the scale, and we consider the number of
intervals-of-equivalence provided on any given instrument to be a detail
irrelevant to our calculations.

When we come to planar temperaments, it seems even more obvious that the
first generator should relate to the lowest used prime (usu. 2), then the
next generator should be related to the next higher prime (usu. 3) and the
last generator will give the rest.

1c. How to determine a canonical set of generators.

This has been partly assumed above. I suggest a generator is first found
that generates only the lowest prime (but note that in some cases the
interval of equivalence may not be related to the lowest prime, e.g. a
tritave-based scale that includes some ratios of 2) and it should be the
smallest such generator, which means that it will always be a whole-number
division of (the approximation of) that lowest prime. Then the next
generator is only what is needed to generate the next prime (in conjunction
with the first generator if necessary). i.e. we are aiming for a triangular
map matrix (an accepted canonical form). But in the end the last generator
has to pick up all the remaining primes.

At each step the generator given should be the smallest that will do the
job. So at least in the case of a linear temperament, the second generator
will always be less than half the first generator (or period).

Graham currently gives the proposed canonical generators in the proposed
order but does not give the first generator (period) in cents. Gene gives
both in cents, but not in the proposed order and the generators are not
always the smallest that will do the job.

Note that a different choice of basis vector (generators) will lead to a
different mapping matrix and make comparison tedious.

2. Standardising the mapping matrix

Consider a planar 7-limit temperament described by this set of approximations:

lg(2) ~= gen0*p2 + gen1*g2 + gen2*h2
lg(3) ~= gen0*p3 + gen1*g3 + gen2*h3
lg(5) ~= gen0*p5 + gen1*g5 + gen2*h5
lg(7) ~= gen0*p7 + gen1*g7 + gen2*h7

where lg(x) = ln(x)/ln(2)*1200, i.e. the primes in cents, and
gen0, gen1, gen2 are the generators in cents, and
p2, p3, g2, g3 etc are the integer coefficients.

I've used "p"s for the gen0 coefficients to remind us that this is the
generator we sometimes distinguish by calling it the period.

There are various ways to express this in matrix form depending on whether
our vectors are rows or columns. Since it is much easier to deal with row
vectors in text, I propose we use:

[If you're viewing this from Yahoo's dumb web interface, you'll need to
click either Reply, or Message index then Expand Messages, to see it
formatted properly.]

[lg(2) lg(3) lg(5) lg(7)] ~=

[gen0 gen1 gen2] [p2 p3 p5 p7]
[g2 g3 g5 g7]
[h2 h3 h5 h7]

The canonical choice and ordering of generators should always result in the
lower triangle being all zeros, as follows.

[gen0 gen1 gen2] [p2 p3 p5 p7]
[0 g3 g5 g7]
[0 0 h5 h7]

An equal temperament looks like

[lg(2) lg(3) lg(5) lg(7)] ~=

[gen0] [p2 p3 p5 p7]

3. Standardising the format for flattening the mapping matrix

For 7-limit linear temperaments

[lg(2) lg(3) lg(5) lg(7)] ~=

[gen0 gen1] [p2 p3 p5 p7]
[0 g3 g5 g7]

we currently have flattenings:

Gene
[[0, g3, g5, g7], [p2, p3, p5, p7]]

Graham
[(p2, 0), (p3, g3), (p5, g5), (p7, g7)]

The most obvious flattening of the above matrix is neither of these. I
suggest we use:

[[p2 p3 p5 p7] [0 g3 g5 g7]]

(Why not omit the ","s?)

It is particularly easy to find the most important information in this
format. The number of periods per octave (p2) is at the start and the
numbers of generators in the other primes are at the end. These are the
only factors that affect the complexity of an octave-equivalent tuning. In
fact, in the common case of an octave period, we often abbreviate the map
to just [g3 g5 g7].

Can anyone see any problem with these proposals? If not, I'd appreciate it
if Graham and Gene would both implement them, where they haven't already.

Regards,
-- Dave Keenan
Brisbane, Australia
http://dkeenan.com

🔗genewardsmith <genewardsmith@juno.com>

3/14/2002 7:13:23 PM

--- In tuning-math@y..., David C Keenan <d.keenan@u...> wrote:

> Gene and Graham are using different ways of presenting both the basis
> vector for a temperament and its mapping matrix.

I wish I had checked what Graham did before coding, but I am inclined to think I want a different standard mapping anyway, since I have what seems like a good, general method convention suitable for planar and higher temperaments also.

> I see the following issues which need to be addressed in the following order.
> 1. Standardising the basis vector

What's the basis vector?

🔗dkeenanuqnetau <d.keenan@uq.net.au>

3/14/2002 7:26:30 PM

--- In tuning-math@y..., "genewardsmith" <genewardsmith@j...> wrote:
> --- In tuning-math@y..., David C Keenan <d.keenan@u...> wrote:
>
> > Gene and Graham are using different ways of presenting both the
basis
> > vector for a temperament and its mapping matrix.
>
> I wish I had checked what Graham did before coding, but I am
inclined to think I want a different standard mapping anyway, since I
have what seems like a good, general method convention suitable for
planar and higher temperaments also.
>
> > I see the following issues which need to be addressed in the
following order.
> > 1. Standardising the basis vector
>
> What's the basis vector?

The list of generators. Sorry.

🔗graham@microtonal.co.uk

3/15/2002 5:02:00 AM

In-Reply-To: <3.0.6.32.20020314182114.00b2f6f0@uq.net.au>
David C Keenan wrote:

> 1a. What units to use for generators
>
> While octaves make good sense within a program for calculating
> temperaments, I think it's clear that either cents or rational octaves
> will
> be better understood by most readers. Since a basis nearly always
> includes
> a generator whose optimum value can't be exprtessed as a simple rational
> fraction of an octave, it seems cents should be the standard unit. We
> might
> however want to include supplementary information when the cents do not
> make it obvious that there are say exactly 19 generators (or periods) to
> the octave, even though this information will also be buried in the map
> matrix.

Yes, that all sounds right. I'm tempted to say that the period size in
cents should be the supplement if the "octave" size in cents and number of
divisions thereof are known. But it doesn't really matter as both things
are there.

> So it seems obvious to me that the first generator to be listed for a
> linear temperament should be the one that generates only the lowest
> prime
> (usually 2). We sometimes distinguish this generator by calling it the
> "period", particularly when we consider it to be generating an
> "interval of
> equivalence" (usually at least an approximate octave, but the tritave
> 1:3
> also has a following). In this case we consider that the number of
> pitches
> and their spacing _within_ a single interval-of-equivalence is what
> constitutes the scale, and we consider the number of
> intervals-of-equivalence provided on any given instrument to be a detail
> irrelevant to our calculations.

So you mean (periodSize, generatorSize) for this datum?

> 1c. How to determine a canonical set of generators.
>
> This has been partly assumed above. I suggest a generator is first found
> that generates only the lowest prime (but note that in some cases the
> interval of equivalence may not be related to the lowest prime, e.g. a
> tritave-based scale that includes some ratios of 2) and it should be the
> smallest such generator, which means that it will always be a
> whole-number
> division of (the approximation of) that lowest prime. Then the next
> generator is only what is needed to generate the next prime (in
> conjunction
> with the first generator if necessary). i.e. we are aiming for a
> triangular
> map matrix (an accepted canonical form). But in the end the last
> generator
> has to pick up all the remaining primes.

That assumes the "primes" are in order, and the first identified as an
equivalence interval. What should we do for things like
tritave-equivalent scales? It does make sense to always list the primes
in the same order.

> At each step the generator given should be the smallest that will do the
> job. So at least in the case of a linear temperament, the second
> generator
> will always be less than half the first generator (or period).

...

> Note that a different choice of basis vector (generators) will lead to a
> different mapping matrix and make comparison tedious.

I'd prefer to choose a generator less than the period such that the first
element of the map is positive. That's much more robust. It means the
scale can be identified by the mapping-by-generators and the number of
periods to an octave, with the generator and octave sizes as almost free
parameters.

> There are various ways to express this in matrix form depending on
> whether
> our vectors are rows or columns. Since it is much easier to deal with
> row
> vectors in text, I propose we use:
>
> [If you're viewing this from Yahoo's dumb web interface, you'll need to
> click either Reply, or Message index then Expand Messages, to see it
> formatted properly.]
>
> [lg(2) lg(3) lg(5) lg(7)] ~=
>
> [gen0 gen1 gen2] [p2 p3 p5 p7]
> [g2 g3 g5 g7]
> [h2 h3 h5 h7]

I'd prefer that the other way around, so that the units are always to the
right of the values. i.e.

[-1 1][lg(2) lg(3)] = 0.585 octaves = 702 cents

instead of

[lg(2) lg(3)][-1 1] = octaves 0.585 = cents 702

For that to work with matrix multiplication, [lg(2) lg(3)] would have to
be transposed, and there's a knock-on effect with the mapping.

I much prefer listing octaves first, because then they can be indexed as
zero and the octave-equivalent case uses indices from 1.

> The most obvious flattening of the above matrix is neither of these. I
> suggest we use:
>
> [[p2 p3 p5 p7] [0 g3 g5 g7]]
>
> (Why not omit the ","s?)

Actually, that's how I used to do it, but I won't re-write the program so
it works naturally again. Those ","s are because I'm using Python's
default stringification of sequences. Some versions used Numeric arrays,
so no commas. I'm going to have to write a proper HTML formatting routine
anyway, so I can tackle this as part of that. Should be a good project
for the weekend if we're agreed.

Graham

🔗dkeenanuqnetau <d.keenan@uq.net.au>

3/15/2002 7:00:03 AM

--- In tuning-math@y..., graham@m... wrote:
> In-Reply-To: <3.0.6.32.20020314182114.00b2f6f0@u...>
> David C Keenan wrote:
> So you mean (periodSize, generatorSize) for this datum?

Yes.

> That assumes the "primes" are in order, and the first identified as
an
> equivalence interval. What should we do for things like
> tritave-equivalent scales? It does make sense to always list the
primes
> in the same order.

Ah yes. Thanks for reminding me. I forgot to make it explicit that I
always want the primes to be ordered from smallest to largest
(from left to right or top to bottom).

For tritave-equivalent scales having no ratios of even numbers,
there's no problem. If it has 2s in it I'd say the canonical matrix
should still put the 2s first. However there's nothing to stop you
_also_ giving a non-canonical one where you order it 3, 2, 5, 7 to
put the interval of equivalence first, so long as you make this
explicit. It's probably a good idea to make the "target"(?) vector
(list of logs of primes) explicit anyway, particularly when we start
doing things like 2, 5, 7.

> > At each step the generator given should be the smallest that will
do the
> > job. So at least in the case of a linear temperament, the second
> > generator
> > will always be less than half the first generator (or period).
...
> I'd prefer to choose a generator less than the period such that the
first
> element of the map is positive. That's much more robust. It means
the
> scale can be identified by the mapping-by-generators and the number
of
> periods to an octave, with the generator and octave sizes as almost
free
> parameters.

I don't understand what you mean by "more robust". Whatever
conventions we settle on to give a unique form will allow an
octave-based temperament to be identified by the mapping-by-generators
and the number of periods to an octave. Why would my proposal of
generator less than half period, fail to do this.

Your program currently agrees with my proposal. It always gives a
generator less than half the period. Are you proposing to change that?

I assume you understood I meant "smallest with GCD(row) = 1", so no
degeneracy.

> > There are various ways to express this in matrix form depending on
> > whether
> > our vectors are rows or columns. Since it is much easier to deal
with
> > row
> > vectors in text, I propose we use:
> >
> > [If you're viewing this from Yahoo's dumb web interface, you'll
need to
> > click either Reply, or Message index then Expand Messages, to see
it
> > formatted properly.]
> >
> > [lg(2) lg(3) lg(5) lg(7)] ~=
> >
> > [gen0 gen1 gen2] [p2 p3 p5 p7]
> > [g2 g3 g5 g7]
> > [h2 h3 h5 h7]
>
> I'd prefer that the other way around, so that the units are always
to the
> right of the values. i.e.
>
> [-1 1][lg(2) lg(3)] = 0.585 octaves = 702 cents
>
> instead of
>
> [lg(2) lg(3)][-1 1] = octaves 0.585 = cents 702
>
> For that to work with matrix multiplication, [lg(2) lg(3)] would
have to
> be transposed, and there's a knock-on effect with the mapping.

Well yes, and the effect is that _everything_ has to be transposed.
All the vectors will be colums and the matrix will be higher than it
is wide.

I'm quite used to using row vectors carrying units and coming _before_
the transformation matrix in computer graphics. The vectors may be in
pixels or millimeters but it doesn't seem at all strange to put the
thing to be transformed first, followed by the desired transformation.
As in

[x' y' z' 1] = [x y z 1] [ cos(a) sin(a) 0 0]
[-sin(a) cos(a) 0 0]
[ 0 0 1 0]
[ 0 0 0 1]

(Rotation of a point about the z axis thru an angle a). This is
straight out of a textbook.

It seems Gene agrees with me on this. The only problem I have with his
format is that he's been puting the period (or fractional-octave
generator) last. (and the minimum generator size thing)

> I much prefer listing octaves first, because then they can be
indexed as
> zero and the octave-equivalent case uses indices from 1.

At least you and I agree on that.

> > The most obvious flattening of the above matrix is neither of
these. I
> > suggest we use:
> >
> > [[p2 p3 p5 p7] [0 g3 g5 g7]]
> >
> > (Why not omit the ","s?)
>
> Actually, that's how I used to do it, but I won't re-write the
program so
> it works naturally again.

How can this flattening be "natural" to you if you would have the
mapping matrix be higher than it is wide? But I guess I shouldn't
complain if you agree with me on the flattening. :-)

> Those ","s are because I'm using Python's
> default stringification of sequences.

Fair enough.

🔗graham@microtonal.co.uk

3/15/2002 7:27:00 AM

In-Reply-To: <a6t29j+cdq0@eGroups.com>
dkeenanuqnetau wrote:

> I don't understand what you mean by "more robust". Whatever
> conventions we settle on to give a unique form will allow an
> octave-based temperament to be identified by the mapping-by-generators
> and the number of periods to an octave. Why would my proposal of
> generator less than half period, fail to do this.

The generator might get larger, in which case it would be incorrectly
described. If you set the first non-zero element of the generator mapping
to be positive, the mapping is uniquely described regardless of the size
of the generator.

Actually, it looks like I use this convention when comparing temperaments
for equivalence, but not for display.

> Your program currently agrees with my proposal. It always gives a
> generator less than half the period. Are you proposing to change that?

The one for generating linear temperaments from equal temperaments does.
But the one for generating linear temperaments from unison vectors
doesn't. Some generators are a lot bigger than the period because they
become larger on optimization. So I'll have to change that program to
adjust the mapping after optimization.

> I assume you understood I meant "smallest with GCD(row) = 1", so no
> degeneracy.

Um what if there's contorsion?

> > Actually, that's how I used to do it, but I won't re-write the
> program so
> > it works naturally again.
>
> How can this flattening be "natural" to you if you would have the
> mapping matrix be higher than it is wide? But I guess I shouldn't
> complain if you agree with me on the flattening. :-)

It's natural for the program because it holds the mapping as a list of
pairs. It used to be a pair of lists, which makes it easier to do some
multiplications. This way, it can be generated by looping through the
primes and adding pairs. Also, it's consistent with how I've always done
the mapping by step sizes. So I won't be changing the library's internal
format, but can change the display the CGI uses.

Graham

🔗dkeenanuqnetau <d.keenan@uq.net.au>

3/15/2002 8:01:09 AM

--- In tuning-math@y..., graham@m... wrote:
> In-Reply-To: <a6t29j+cdq0@e...>
> dkeenanuqnetau wrote:
>
> > I don't understand what you mean by "more robust". Whatever
> > conventions we settle on to give a unique form will allow an
> > octave-based temperament to be identified by the
mapping-by-generators
> > and the number of periods to an octave. Why would my proposal of
> > generator less than half period, fail to do this.
>
> The generator might get larger, in which case it would be
incorrectly
> described. If you set the first non-zero element of the generator
mapping
> to be positive, the mapping is uniquely described regardless of the
size
> of the generator.

You seem to be talking about what your program is doing internally.
I don't care about that. I'm talking about what we present to people,
irrespective of how it is generated. The important thing to me, is
what will be most immediately meaningful or useful to musicians or
composers. If your optimiser comes out with a generator that is
between 0.5 and 1 period you can always subtract it from the period,
or if it is between 1 and 1.5 periods you can subtract a period from
it etc., and adjust the matrix accordingly.

But the questions is, "Is this the most meaningful generator?". It
could be argued for example in Pajara/Paultone that a generator which
is a fourth or fifth may be more meaningful than the one of 108 cents.
But it isn't clear to me how you would generalise that to cases where
there isn't a fourth or fifth among the possible generator values. It
just looks too messy to me.

However Gene seems like he might be favouring a fourth when one exists
in such cases. What rule are you using there Gene?

> The one for generating linear temperaments from equal temperaments
does.
> But the one for generating linear temperaments from unison vectors
> doesn't. Some generators are a lot bigger than the period because
they
> become larger on optimization. So I'll have to change that program
to
> adjust the mapping after optimization.

OK.

> > I assume you understood I meant "smallest with GCD(row) = 1", so
no
> > degeneracy.
>
> Um what if there's contorsion?

I'm still confused about that.

...
>So I won't be changing the library's
internal
> format, but can change the display the CGI uses.

Sure.

But don't bother changing anything yet. One point is to have the same
format from both you and Gene, and Gene is still thinking about it.