Tuning Matrices

There follows an exposition of my tuning matrices. These can be used to economically define a wide range of scales. It is a development of ratio space, as used by Euler, Fokker, Tenney, etc.

Essentially the same idea was published in a paper by C. Karp. [A Matrix Technique for Analysing Musical Tuning Systems, Acustica, Vol.4(1984) pp.209-216.] Karp uses a simpler, and IMHO inferior, notation. He also doesn't take it as far as me.

So this page might at least stand a chance of being understood by beginners, I've added an introduction to the mathematics.

First, let's start with 7-limit JI. What the hell! A frequency ratio can be expressed as:

f = 2^i * 3^j * 5^k * 7^l.

Where i, j, k and l are integers. A pitch difference p=log(f) can be expressed:

p = i*log(2) + j*log(3) + k*log(5) + l*log(7).

Some people may not understand logarithms but, don't worry, you may be able to pick up the thread later on. Sums like this can be written using a matrix product as follows:

a*b + c*d + e*f = (a c e)(b)
                         (d)
                         (f)

The b, d and f should all be enclosed in one big bracket, but I'm compromising with three little brackets in this medium. Actually, it is possible to get a big bracket:

a*b + c*d + e*f = (a c e)æbö
                         çd÷
                         èfø

But that adds to download time, and won't work with all browsers.

A pitch difference can then be written in matrix form as follows:

p = (i j k l)(log(2)) = (i j k l)H
             (log(3))             
             (log(5))             
             (log(7))             

So H is a column matrix containing logarithms of prime numbers. The number of rows is ... as many as you need. It could be described as the metric of pitch space. If you set i, j, k and l to a 4-D lattice, a pitch difference is the vector pointing from one note to the other. People who use ratio space are now on familiar ground. As this is a general way of writing pitch, H has to be octave specific. H can also be approximated as:

    (1200    )      
H = (1901.955) cents
    (2786.314)      
    (3363.826)      

You can also use an octave equivalent matrix:

    (1901.955)      
h = (2786.314) cents
    (3363.826)      

The point of H is that different scales that approximate the same ratios can be written as the same coordinates, but with a different H. So, this is a temperament-neutral way of notating intervals. You can use it to convert JI into any linear temperament. Well temperaments are different, but are intended to behave like ETs, so no problem.

The next concept to introduce is that of the basis of a scale. This is one of the smallest sets of intervals that define a scale. A basis for 5-limit JI is H with 3 rows. Another is:

(t)   (1 -2  1) 
(s) = (4 -1 -1)H
(p)   (-4 4 -1) 

This is a definition of three intervals using H. The first is a minor tone t=(1 -2 1)H which has a frequency ratio 10/9. We also have a diatonic semitone s=(4 -1 -1)H or 16/15 and a syntonic comma (-4 4 -1)H or 81/80.

Now for some precise definitions. A scale is defined on a basis using a matrix containing only integers. Each note in a scale must have a unique definition in terms of the basis. That means that no basis interval can be defined in terms of the other ones using rational multiples. A scale by this definition is a discrete vector space. Look up vector spaces to see how close the analogy is. The concept of basis of a musical scale has been defined before, although not in terms of matrices. This is all very similar to group theory. I have defined the basic dimension of a scale as the number of intervals in its basis. I think this is the same as the dimension of the vector space, but I'm not sure.

A C major scale (not the only one) can be defined using t, s and p as follows:

C   D   E   F   G   A   B   C
 t+p  t   s  t+p  t  p+t  s  

This can be written using matrices:

(C)   (5 2 3)   
(B)   (5 1 3)   
(A)   (4 1 2)   
(G)   (3 1 2)(t)
(F) = (2 1 1)(s)
(E)   (2 0 1)(p)
(D)   (1 0 1)   
(C)   (0 0 0)   

That covers JI. For temperaments, the basis is defined on H using fractions. By "temperament" I mean a scale that approximates JI using fewer notes. Temperaments can be treated like JI if you use an approximate matrix H' that pretends to be H, but is slightly different. As an example, ¼-comma meantone can be defined as follows:

     (1 0 0)    (1200)      
H' = (1 0 ¼)H = (1897) cents
     (0 0 1)    (2786)      

You can then redefine t, s and p in terms of H':

(t)   (1 -2  1)     (-1 0  ½ ) 
(s) = (4 -1 -1)H' = ( 3 0 -1¼)H
(p)   (-4 4 -1)     ( 0 0  0 ) 

You can get the last matrix using standard matrix arithmetic.

Not surprisingly, the approximate syntonic comma comes out the same as a unison in ¼-comma meantone. As t, s and p constitute a basis for JI, t and s are a basis for a negative meantone. Hence a meantone, or linear temperament, is a 2-D scale. The first two rows of H' also constitute a basis for a negative meantone, so the third row can be defined in terms of these:

     ( 1 0)  
H' = ( 0 1)H'
     (-4 4)  

This matrix is defined in a more complicated document on this site. Using it, you can approximate any 5-limit interval as a Pythagorean interval. Any negative linear temperament can be defined by the basis:

(t) = (-3  2)H'
(s)   ( 8 -5)  

Matrices can also be used to describe scales that are not even approximations of JI. Charles Lucy assures us that LucyTuning is such a scale. It uses the following basis:

(L) = (  1 ) oct
(s)   (p-2½)  2p
Now you've learnt the formalism, have a look at my application of it to linear temperaments.
home page
my microtonal documents