Wedgie/Archived version: Difference between revisions

Inthar (talk | contribs)
Inthar (talk | contribs)
Line 32: Line 32:


== How the period and generator falls out of a rank-2 wedgie ==
== How the period and generator falls out of a rank-2 wedgie ==
The following is a procedure for finding a period and a generator for a rank-2 regular temperament on the 2.''q''<sub>1</sub>.(…).q<sub>''n''</sub> [[JI subgroup]]. We also give a (hopefully convincing and enlightening) proof of why the procedure always works. We'll assume that the [[equave]] is the octave, but non-octave JI equaves can be substituted for the octave if needed, by substituting the appropriate JI ratio for 2/1.
The following is a procedure for finding a period and a generator for a rank-2 regular temperament on the 2.''q''<sub>1</sub>.(…).q<sub>''n''</sub> [[JI subgroup]], with basis '''2''', '''q'''<sub>1</sub>, ..., '''q'''<sub>''n''</sub> (We're writing bold letters and numbers to represent elements of the JI lattice, viewed as vectors; so, for example, 3/2 = '''3''' &minus; '''2''' in the 2.3 lattice). We also give a (hopefully convincing and enlightening) proof of why the procedure always works. We'll assume that the [[equave]] is the octave, but non-octave JI equaves can be substituted for the octave if needed, by substituting the appropriate JI ratio for 2/1.


The following assumes that:
The following assumes that:
Line 40: Line 40:


=== The procedure ===
=== The procedure ===
Consider the rank-2 temperament a&b, where a and b are two [[val]]s. Then the entries of the wedgie W corresponding to a&b are W(2, ''q''<sub>1</sub>), …, W(2, ''q''<sub>''n''</sub>), and W(''q''<sub>''i''</sub>, ''q''<sub>''j''</sub>) for ''i'' < ''j'', and the entry W(''p'', ''q'') is given by a(''p'')b(''q'') - a(''q'')b(''p'').
Consider the rank-2 temperament a&b, where a and b are two [[val]]s. Then the entries of the wedgie W corresponding to a&b are W('''2''', '''q'''<sub>1</sub>), …, W('''2''', '''q'''<sub>''n''</sub>), and W('''q'''<sub>''i''</sub>, '''q'''<sub>''j''</sub>) for ''i'' < ''j'', and the entry W('''p''', '''q''') is given by a('''p''')b('''q''') &minus; a('''q''')b('''p''').


To find the '''period''': Let ''d'' = gcd(W(2, ''q''<sub>1</sub>), …, W(2, ''q''<sub>''n''</sub>)). Then your period is 1\''d''.
To find the '''period''': Let ''d'' = gcd(W('''2''', '''q'''<sub>1</sub>), …, W('''2''', '''q'''<sub>''n''</sub>)). Then your period is 1\''d''.


To find (a JI interpretation of) the '''generator''': Solve the equation W(2, ''g'') = ''c''<sub>1</sub> W(2, ''q''<sub>1</sub>) + … ''c''<sub>''n''</sub> W(2, q<sub>''n''</sub>) = ''d'' for the coefficients ''c''<sub>1</sub>, ..., ''c''<sub>''n''</sub> (using some algorithm such as the [[Wikipedia: Extended Euclidean algorithm|extended Euclidean algorithm]]). Then one valid generator for the temperament is ''g'' = (the tempered version of) ''q''<sub>1</sub><sup>''c''<sub>1</sub></sup> … ''q''<sub>''n''</sub><sup>''c''<sub>''n''</sub></sup> (written additively, a linear combination g = ''c''<sub>1</sub>''q''<sub>1</sub> + … + ''c''<sub>''n''</sub>''q''<sub>''n''</sub>).
To find (a JI interpretation of) the '''generator''': Solve the equation W('''2''', '''g''') = ''c''<sub>1</sub>W('''2''', '''q'''<sub>1</sub>) + … ''c''<sub>''n''</sub>W('''2''', '''q'''<sub>''n''</sub>) = ''d'' for the coefficients ''c''<sub>1</sub>, ..., ''c''<sub>''n''</sub> (using some algorithm such as the [[Wikipedia: Extended Euclidean algorithm|extended Euclidean algorithm]]). Then one valid generator for the temperament is ''g'' = (the tempered version of) ''q''<sub>1</sub><sup>''c''<sub>1</sub></sup> … ''q''<sub>''n''</sub><sup>''c''<sub>''n''</sub></sup> (written additively, a linear combination '''g''' = ''c''<sub>1</sub>'''q'''<sub>1</sub> + … + ''c''<sub>''n''</sub>'''q'''<sub>''n''</sub>).


Now choosing an optimal tuning for the temperament is a matter of choosing a way to measure error from JI and minimizing the error with linear algebra. For example, the [[TE tuning|TE]] and [[POTE tuning|POTE]] tunings are based on minimizing [[TE error]], and those tunings can be found using the x31eq temperament finder.
Now choosing an optimal tuning for the temperament is a matter of choosing a way to measure error from JI and minimizing the error with linear algebra. For example, the [[TE tuning|TE]] and [[POTE tuning|POTE]] tunings are based on minimizing [[TE error]], and those tunings can be found using the x31eq temperament finder.


=== Example ===
=== Example ===
Consider the wedgie W = &lt;&lt;1 4 4|| for 2.3.5 meantone (the 12&19 temperament). We have W(2,3) = 1 and W(2,5) = 4, so d = 1, and our period is 1\1. Further, we have that 1*W(2,3) + 0*W(2,5) = 1, so ''c''<sub>1</sub> = 1, ''c''<sub>2</sub> = 0 is one solution, and we can use 3^1 * 5^0 = 3/1 as our generator.
Consider the wedgie W = &lt;&lt;1 4 4|| for 2.3.5 meantone (the 12&19 temperament). We have W('''2''', '''3''') = 1 and W('''2''', '''5''') = 4, so ''d'' = 1, and our period is 1\1. Further, we have that 1*W('''2''', '''3''') + 0*W('''2''', '''5''') = 1, so ''c''<sub>1</sub> = 1, ''c''<sub>2</sub> = 0 is one solution, and we can use 3<sup>1</sup>5<sup>0</sup> = 3/1 as our generator.


Note that -3*W(2,3) + 1*W(2,5) = -3*1 + 1*4 = 1, so ''c''<sub>1</sub> = -3, ''c''<sub>2</sub> = 1 is another solution to the equation. Thus 5/27 is also a valid generator. This octave reduces to the [[40/27]] grave fifth, which is equated to 3/2 in meantone.
Note that -3*W('''2''', '''3''') + 1*W('''2''', '''5''') = &minus;3*1 + 1*4 = 1, so ''c''<sub>1</sub> = &minus;3, ''c''<sub>2</sub> = 1 is another solution to the equation. Thus 5/27 is also a valid generator. This octave reduces to the [[40/27]] grave fifth, which is equated to 3/2 in meantone.


=== Proof (a bit technical) ===
=== Proof (a bit technical) ===
The following additionally assumes that you know what the words "basis", "linear map", and "determinant" mean.
The following additionally assumes that you know what the words "basis", "linear map", and "determinant" mean.


The period ''p'' (fraction of octave) and generator ''g'' form a basis for all the intervals of a rank-2 temperament. For example, ''p'' = 2/1 and ''g'' = 3/2 form a basis for meantone. But from a purely linear-algebra perspective, there's nothing special about the basis {''p'', ''g''}; I could have chosen another basis, for example ''p' '' = 3/1 for my "period" and ''g' '' = 2/1 for my "generator". What makes the wedgie a unique identifier for a temperament is that rather than specify a basis directly, the wedgie specifies a ''constraint'' that any basis for the temperament must satisfy: namely, that a basis e<sub>1</sub>, e<sub>2</sub> must satisfy W(e<sub>1</sub>, e<sub>2</sub>) = ±1.
The period '''p''' (fraction of octave) and generator '''g''' form a basis for all the intervals of a rank-2 temperament. For example, '''p''' = 2/1 and '''g''' = 3/2 form a basis for meantone. But from a purely linear-algebra perspective, there's nothing special about the basis {'''p''', '''g'''}; I could have chosen another basis, for example '''p'''' = 3/1 for my "period" and '''g'''' = 2/1 for my "generator". What makes the wedgie a unique identifier for a temperament is that rather than specify a basis directly, the wedgie specifies a ''constraint'' that any basis for the temperament must satisfy: namely, that a basis '''e'''<sub>1</sub>, '''e'''<sub>2</sub> must satisfy W('''e'''<sub>1</sub>, '''e'''<sub>2</sub>) = ±1.


In the language of linear algebra, the wedgie is an "alternating bilinear form" on the appropriate JI group M; this means that (ignoring sign) it acts like the operation of finding the determinant of two vectors on the appropriate quotient group M' = M/K of M, where K is the kernel of the bilinear form W. Using the fact that W = a&b where a and b are two edos (properly, rank-1 [[val]]s), you can verify that K is exactly the kernel of the rank-2 temperament, as follows. (Hence M/K' is a rank-2 lattice on which W is an alternating non-degenerate bilinear form, which justifies the intuition of viewing W as a determinant-like function.)
In the language of linear algebra, the wedgie is an "alternating bilinear form" on the appropriate JI group ''M''; this means that (ignoring sign) it acts like the operation of finding the determinant of two vectors on the appropriate quotient group ''M' '' = ''M''/''K'' of ''M'', where ''K'' is the kernel of the bilinear form W. Using the fact that W = a&b where a and b are two edos (properly, rank-1 [[val]]s), you can verify that K is exactly the kernel of the rank-2 temperament, as follows. (Hence ''M''/''K' '' is a rank-2 lattice on which W is an alternating non-degenerate bilinear form, which justifies the intuition of viewing W as a determinant-like function.)


Let K<sub>1</sub> = the kernel of the temperament (i.e. the set of commas tempered out by the temperament), and K<sub>2</sub> = ker W = {v ∈ M : W(v, w) = 0 ∀w ∈ M}. If v ∈ K<sub>1</sub>, then v is tempered out by both a and b, so W(v, w) = a(v)b(w)-a(w)b(v) = 0, and v ∈ K<sub>2</sub>. Conversely, if v ∈ K<sub>2</sub>, then W(v, w) = a(v)b(w)-a(w)b(v) = 0 for all w, which implies a(v)b(w) = a(w)b(v) (*) for all w. Since a and b both have rank 1 but a&b has rank 2, a and b are linearly independent in M* (the dual '''Z'''-module of M); so we can choose w such that a(w) = 0 but b(w) ≠ 0. Then (*) shows a(v) = 0. By the same argument, b(v) = 0. So v is in K<sub>1</sub> and K<sub>1</sub> = K<sub>2</sub>; the kernel of the temperament is exactly the intervals that the wedgie "treats as zero".
Let ''K''<sub>1</sub> = the kernel of the temperament (i.e. the set of commas tempered out by the temperament), and K<sub>2</sub> = ker W = {'''v''' ''M'' : W('''v''', '''w''') = 0 ∀'''w''' ''M''}. If '''v''' ''K''<sub>1</sub>, then '''v''' is tempered out by both a and b, so W('''v''', '''w''') = a('''v''')b('''w''') &minus; a('''w''')b('''v''') = 0, and '''v''' ''K''<sub>2</sub>. Conversely, if '''v''' ''K''<sub>2</sub>, then W('''v''', '''w''') = a('''v''')b('''w''') &minus; a('''w''')b('''v''') = 0 for all w, which implies a('''v''')b('''w''') = a('''w''')b('''v''') (*) for all w. Since a and b both have rank 1 but a&b has rank 2, a and b are linearly independent in ''M*'' (the dual '''Z'''-module of M); so we can choose '''w''' such that a('''w''') = 0 but b('''w''') ≠ 0. Then (*) shows a('''v''') = 0. By the same argument, b('''v''') = 0. So '''v''' is in ''K''<sub>1</sub> and ''K''<sub>1</sub> = ''K''<sub>2</sub>; the kernel of the temperament is exactly the intervals that the wedgie "treats as zero".


By the First Isomorphism Theorem it follows that M' is the group of intervals in the rank-2 temperament in question.
By the First Isomorphism Theorem it follows that ''M' '' is the group of intervals in the rank-2 temperament in question.


The key fact about the determinant we use here is that two integer vectors v<sub>1</sub>, v<sub>2</sub> form a basis for the rank-2 integer lattice '''Z'''<sup>2</sup> iff det(v<sub>1</sub>, v<sub>2</sub>) = ±1. So in order to find a period and generator for our temperament, we need a pair of vectors {p, g} such that W(p, g) = 1 and p is 1\d for some integer d.
The key fact about the determinant we use here is that two integer vectors '''v'''<sub>1</sub>, '''v'''<sub>2</sub> form a basis for the rank-2 integer lattice '''Z'''<sup>2</sup> iff det('''v'''<sub>1</sub>, '''v'''<sub>2</sub>) = ±1. So in order to find a period and generator for our temperament, we need a pair of vectors {'''p''', '''g'''} such that W('''p''', '''g''') = 1 and '''p''' is 1\''d'' for some integer ''d''.


Let d = gcd(W(2/1, q<sub>1</sub>), ..., W(2/1, q<sub>''n''</sub>)). This tells you that for any JI ratio v in your JI subgroup, W(2/1, v) = 2n(v) for some number n(v) [that depends linearly on v]. This equation is also true when we replace 2/1 with any JI ratio u that is equated to 2/1. This tells us that for W(p, g) = 1, we (up to some choices) need p to be an interval such that d*p is equated to 2/1, i.e. p represents 1/d of the octave.
Let ''d'' = gcd(W('''2''', '''q'''<sub>1</sub>), ..., W('''2''', '''q'''<sub>''n''</sub>)). This tells you that for any JI ratio v in your JI subgroup, W('''2''', '''v''') = 2''N''('''v''') for some number ''N''('''v''') [that depends linearly on '''v''']. This equation is also true when we replace 2/1 with any JI ratio u that is equated to 2/1. This tells us that for W('''p''', '''g''') = 1, we (up to some choices) need '''p''' to be a JI ratio such that ''d'''''p''' is equated to 2/1, i.e. '''p''' represents 1/''d'' of the octave.


Choose a basis e<sub>1</sub>, e<sub>2</sub> for the temperament group and write (the image of) 2/1 as 2/1 = k<sub>1</sub> e<sub>1</sub> + k<sub>2</sub> e<sub>2</sub>. Then:
Choose a basis '''e'''<sub>1</sub>, '''e'''<sub>2</sub> for the temperament group and write (the image of) 2/1 as 2/1 = ''k''<sub>1</sub>'''e'''<sub>1</sub> + ''k''<sub>2</sub>'''e'''<sub>2</sub>. Then:
*W(2/1, e<sub>1</sub>) = W(k<sub>2</sub> e<sub>2</sub>, e<sub>1</sub>) = -k<sub>2</sub> W(e<sub>1</sub>, e<sub>2</sub>) = -k<sub>2</sub>
*W('''2''', '''e'''<sub>1</sub>) = W(''k''<sub>2</sub>'''e'''<sub>2</sub>, '''e'''<sub>1</sub>) = &minus;''k''<sub>2</sub>W('''e'''<sub>1</sub>, '''e'''<sub>2</sub>) = &minus;''k''<sub>2</sub>
*W(2/1, e<sub>2</sub>) = W(k<sub>1</sub> e<sub>1</sub>, e<sub>2</sub>) = k<sub>1</sub> W(e<sub>1</sub>, e<sub>2</sub>) = k<sub>1</sub>.
*W('''2''', '''e'''<sub>2</sub>) = W(''k''<sub>1</sub>'''e'''<sub>1</sub>, '''e'''<sub>2</sub>) = ''k''<sub>1</sub>W('''e'''<sub>1</sub>, '''e'''<sub>2</sub>) = ''k''<sub>1</sub>.
Divisibility by d and the fact that e<sub>1</sub> and e<sub>2</sub> represent JI ratios in the 2.q<sub>1</sub>.[...].q<sub>''n''</sub> subgroup imply that k<sub>1</sub> and k<sub>2</sub> are both divisible by d, and hence 2/1 is a dth power in M' (the temperament space). Since gcd(W(2, q<sub>1</sub>), ..., W(2, q<sub>''n''</sub>)) = d, we can always find a linear combination g = c<sub>1</sub> q<sub>1</sub> + ... + c<sub>''n''</sub> q<sub>''n''</sub> such that W(2, g) = c<sub>1</sub> W(2, q<sub>1</sub>) + ... c<sub>''n''</sub> W(2,q<sub>''n''</sub>) = d using the extended Euclidean algorithm. Then since W(2, g) = W(d*p, g) = d*W(p, g) = d, we have W(p,g) = 1. Ta-da!
Divisibility by ''d'' and the fact that '''e'''<sub>1</sub> and '''e'''<sub>2</sub> represent JI ratios in the 2.''q''<sub>1</sub>.[...].''q''<sub>''n''</sub> subgroup imply that ''k''<sub>1</sub> and ''k''<sub>2</sub> are both divisible by ''d'', and hence 2/1 is a ''d''th power in '''M' ''' (the temperament space). Since gcd(W('''2''', '''q'''<sub>1</sub>), ..., W('''2''', '''q'''<sub>''n''</sub>)) = d, we can always find a linear combination ''g'' = ''c''<sub>1</sub>'''q'''<sub>1</sub> + ... + ''c''<sub>''n''</sub>'''q'''<sub>''n''</sub> such that W('''2''', '''g''') = ''c''<sub>1</sub>W('''2''', '''q'''<sub>1</sub>) + ... ''c''<sub>''n''</sub> W('''2''', '''q'''<sub>''n''</sub>) = ''d'' using the extended Euclidean algorithm. Then since W('''2''', '''g''') = W(''d'''''p''', '''g''') = ''d''W('''p''', '''g''') = ''d'', we have W('''p''', '''g''') = 1. Ta-da!


== Technical introduction ==
== Technical introduction ==