back to list

Optimizing generalized keyboards

🔗Herman Miller <hmiller@IO.COM>

3/6/2008 7:02:56 PM

I've been playing with generalized keyboard layouts for regular temperaments, and it occurs to me there ought to be some way to specify desired properties mathematically and optimize for them. One thing I've found useful is to take a portion of the harmonic series, e.g. 4 5 6 7 8 9, and find the layout that keeps those notes relatively close together. Take 7-limit meantone for an example

[<1, 2, 4, 7], <0, -1, -4, -10]>

4/4 : [0, 0>
5/4 : [2, -4>
6/4 : [1, -1>
7/4 : [5, -10>
8/4 : [1, 0>
9/4 : [2, -2>

You can see that this spans a 6x11 area of the keyboard. Now I can describe a keyboard layout by giving the coordinates of the generators. Take the Wicki layout, slanted to fit on a square lattice: the octave is at (1, 2) and the fourth at (0, 1). Now with a little matrix magic, I can calculate the mapping of 4-5-6-7-8-9 in this layout and see how much space it takes up.

| 0 0 | | 0 0 |
| 2 -4 | | 2 0 |
| 1 -1 | | 1 2 | | 1 1 |
| 5 -10 | x | 0 1 | = | 5 0 |
| 1 0 | | 1 2 |
| 2 -2 | | 2 2 |

This ends up as a 6x3 area, which is clearly better than 6x11. Similarly for the Bosanquet:

| 0 0 | | 0 0 |
| 2 -4 | | 2 0 |
| 1 -1 | | 5 -2 | | 3 -1 |
| 5 -10 | x | 2 -1 | = | 5 0 |
| 1 0 | | 5 -2 |
| 2 -2 | | 6 -2 |

You can see this takes up a little more space (7x3). The question I have is: is there any way other than trial and error to find the transformation which results in the smallest area on the keyboard? Excluding the degenerate case of all notes being mapped to (0, 0), naturally.

For some applications, it could also be useful to optimize for the narrowest keyboard area: the smallest in one dimension or the other (regardless of the size in the other dimension).

🔗Graham Breed <gbreed@gmail.com>

3/6/2008 7:40:38 PM

Herman Miller wrote:
> I've been playing with generalized keyboard layouts for regular > temperaments, and it occurs to me there ought to be some way to specify > desired properties mathematically and optimize for them. One thing I've > found useful is to take a portion of the harmonic series, e.g. 4 5 6 7 8 > 9, and find the layout that keeps those notes relatively close together. > Take 7-limit meantone for an example

This is the kind of thing the X System team are looking at. Do you have an X_System.pdf anywhere? As I don't think it's formally published yet I should be careful about saying what I know about it.

> You can see this takes up a little more space (7x3). The question I have > is: is there any way other than trial and error to find the > transformation which results in the smallest area on the keyboard? > Excluding the degenerate case of all notes being mapped to (0, 0), > naturally.

It's a short vectors in a lattice problem. You could try LLL reduction.

> For some applications, it could also be useful to optimize for the > narrowest keyboard area: the smallest in one dimension or the other > (regardless of the size in the other dimension).

Scalar complexity is an area, and the parametric badness that comes out of it is a kind of generalized area. But I'll wait until some X System stuff comes out before I explore the relationship further.

Graham

🔗Carl Lumma <carl@lumma.org>

3/6/2008 11:02:32 PM

At 07:40 PM 3/6/2008, Graham wrote:
>Herman Miller wrote:
>> I've been playing with generalized keyboard layouts for regular
>> temperaments, and it occurs to me there ought to be some way to specify
>> desired properties mathematically and optimize for them. One thing I've
>> found useful is to take a portion of the harmonic series, e.g. 4 5 6 7 8
>> 9, and find the layout that keeps those notes relatively close together.
>> Take 7-limit meantone for an example
>
>This is the kind of thing the X System team are looking at.
> Do you have an X_System.pdf anywhere? As I don't think
>it's formally published yet I should be careful about saying
>what I know about it.
>
>> You can see this takes up a little more space (7x3). The question I have
>> is: is there any way other than trial and error to find the
>> transformation which results in the smallest area on the keyboard?
>> Excluding the degenerate case of all notes being mapped to (0, 0),
>> naturally.
>
>It's a short vectors in a lattice problem. You could try
>LLL reduction.

In fact I'd guess it would tend to come out of good temperaments
just with Gene's approach

http://web.archive.org/web/20060622003749/http://66.98.148.43/~xenharmo/bosanquet.html

Paul Erlich and Igliashon Jones also did some work in this
area.

-Carl

🔗Herman Miller <hmiller@IO.COM>

3/7/2008 7:01:55 PM

Graham Breed wrote:
> Herman Miller wrote:
>> I've been playing with generalized keyboard layouts for regular >> temperaments, and it occurs to me there ought to be some way to specify >> desired properties mathematically and optimize for them. One thing I've >> found useful is to take a portion of the harmonic series, e.g. 4 5 6 7 8 >> 9, and find the layout that keeps those notes relatively close together. >> Take 7-limit meantone for an example

> It's a short vectors in a lattice problem. You could try > LLL reduction.

Well, the vectors I'm trying to optimize aren't all linearly independent of each other. It occurs to me though that a brute force search might not be as bad as it seems. All the useful layouts can be found through a traversal of the scale tree, and each can be quickly evaluated.

🔗Graham Breed <gbreed@gmail.com>

3/9/2008 7:46:13 PM

Herman Miller wrote:
> Graham Breed wrote:
>> Herman Miller wrote:
>>> I've been playing with generalized keyboard layouts for regular >>> temperaments, and it occurs to me there ought to be some way to specify >>> desired properties mathematically and optimize for them. One thing I've >>> found useful is to take a portion of the harmonic series, e.g. 4 5 6 7 8 >>> 9, and find the layout that keeps those notes relatively close together. >>> Take 7-limit meantone for an example
> >> It's a short vectors in a lattice problem. You could try >> LLL reduction.
> > Well, the vectors I'm trying to optimize aren't all linearly independent > of each other. It occurs to me though that a brute force search might > not be as bad as it seems. All the useful layouts can be found through a > traversal of the scale tree, and each can be quickly evaluated.

A layout can be defined by two linearly independent vectors. But yes, the two dimensional case isn't so difficult once you've chosen your temperament class :P

Let us know if you come up with a badness formula.

Graham