User:Frostburn/Geometric algebra for regular temperaments: Difference between revisions
Add notes about improving the notation so that Tenney weights are implied. Typeset some val brackets better. |
→Mapping: Remove the requirement for matrix inversion when calculating the mapping. |
||
(2 intermediate revisions by the same user not shown) | |||
Line 10: | Line 10: | ||
3D lines that pass through the origin find representation in the [[Wikipedia:Geometric Algebra|Geometric Algebra]] <math>\mathcal G(3,0)</math>. Our vals are now vectors, or points if you think projectively, in this space. | 3D lines that pass through the origin find representation in the [[Wikipedia:Geometric Algebra|Geometric Algebra]] <math>\mathcal G(3,0)</math>. Our vals are now vectors, or points if you think projectively, in this space. | ||
:<math> | :<math> \langle 5, 8, 12 \rbrack \mapsto 5e_1 + 8e_2 + 12e_3 =: \overleftarrow{5} </math> | ||
I will use the term pseudoscalar to refer to the combination of all basis vectors and denote it with ''i''. | I will use the term pseudoscalar to refer to the combination of all basis vectors and denote it with ''i''. | ||
Line 83: | Line 83: | ||
With a temperament of rank 2 the period <math>\overrightarrow{p}</math> and the generator <math>\overrightarrow{g}</math> together with n - 2 commas <math>\overrightarrow{c}_i</math> that are tempered out form a basis for the whole n-dimensional JI subgroup and can thus be inverted to produce a [[mapping]] for the temperament. | With a temperament of rank 2 the period <math>\overrightarrow{p}</math> and the generator <math>\overrightarrow{g}</math> together with n - 2 commas <math>\overrightarrow{c}_i</math> that are tempered out form a basis for the whole n-dimensional JI subgroup and can thus be inverted to produce a [[mapping]] for the temperament. | ||
Let's choose <math>\overrightarrow{p} = \overrightarrow{2/1} = [1, 0, 0></math> and <math>\overrightarrow{g} = \overrightarrow{3/2} = [-1, 1, 0> </math> as the period and generator for Meantone. In this case there's only a single comma <math>\overrightarrow{c} = \overrightarrow{81/80} = [-4, 4, 1 ></math>. | Any interval within the JI subgroup can be written as | ||
:<math> | |||
\overrightarrow{m} = x \overrightarrow{p} + y \overrightarrow{g} + z_1 \overrightarrow{c_1} + \ldots + z_{n-2} \overrightarrow{c_{n-2}} | |||
</math> | |||
The wedge product has some nice properties that allow us to extract <math>x</math> and <math>y</math>. Let's first calculate the relevant hyperwedge. | |||
:<math>\begin{align} | |||
\mathbf{H} &= \overrightarrow{p} \wedge \overrightarrow{g} \wedge \overrightarrow{c_1} \wedge \ldots \wedge \overrightarrow{c_{n-2}} \\ | |||
\mathbf{H} &= \overrightarrow{p} \wedge \overrightarrow{g} \wedge \mathbf{T}i | |||
\end{align}</math> | |||
where we've used the fact that the commas span the dual of the temperament. | |||
Finally we have | |||
:<math>\begin{align} | |||
x &= \frac{\overrightarrow{m} \wedge \overrightarrow{g} \wedge \mathbf{T}i}{\mathbf{H}} \\ | |||
y &= \frac{\overrightarrow{p} \wedge \overrightarrow{m} \wedge \mathbf{T}i}{\mathbf{H}} | |||
\end{align}</math> | |||
where the division is inverse scalar multiplication (or right multiplication by the geometric inverse. Same thing in this case where the relevant subspace attitudes align). | |||
Calculating the wedges can be computationally intensive so it's often convenient to precalculate the mapping for formal primes in the subgroup. | |||
Let's do that for meantone and choose <math>\overrightarrow{p} = \overrightarrow{2/1} = [1, 0, 0></math> and <math>\overrightarrow{g} = \overrightarrow{3/2} = [-1, 1, 0> </math> as the period and generator for Meantone. In this case there's only a single comma <math>\overrightarrow{c} = \overrightarrow{81/80} = [-4, 4, -1 ></math> so we can calculate the mapping in terms of that too, but in general we don't need to know the commas as long as we know the wedgie for the temperament. | |||
:<math>\begin{align} | |||
\overrightarrow{2/1} &= 1 \overrightarrow{p} + 0 \overrightarrow{g} + 0 \overrightarrow{c} \\ | |||
\overrightarrow{3/1} &= 1 \overrightarrow{p} + 1 \overrightarrow{g} + 0 \overrightarrow{c} \\ | |||
\overrightarrow{5/1} &= 0 \overrightarrow{p} + 4 \overrightarrow{g} - 1 \overrightarrow{c} | |||
\end{align}</math> | |||
Transposing the coefficients gives us the mapping: | |||
:<math>\begin{align} | :<math>\begin{align} | ||
\overleftarrow{p} &= < 1, 1, 0 ] \\ | \overleftarrow{p} &= < 1, 1, 0 ] \\ | ||
Line 93: | Line 118: | ||
For example <math>\overleftarrow{p} \cdot \overrightarrow{5/3} = -1</math> and <math>\overleftarrow{g} \cdot \overrightarrow{5/3} = 3</math>. Indeed <math>\frac{5}{3} \sim (\frac{2}{1})^{-1}(\frac{3}{2})^3 = \frac{27}{16}</math> in Meantone. Musically this means that the major sixth is constructed by stacking three perfect fifths and reducing by an octave. If we want to be pedantic we can calculate <math>\overleftarrow{c} \cdot \overrightarrow{5/3} = -1</math> for the final numerically correct expression <math>\frac{5}{3} = \frac{27}{16}(\frac{81}{80})^{-1}</math>. | For example <math>\overleftarrow{p} \cdot \overrightarrow{5/3} = -1</math> and <math>\overleftarrow{g} \cdot \overrightarrow{5/3} = 3</math>. Indeed <math>\frac{5}{3} \sim (\frac{2}{1})^{-1}(\frac{3}{2})^3 = \frac{27}{16}</math> in Meantone. Musically this means that the major sixth is constructed by stacking three perfect fifths and reducing by an octave. If we want to be pedantic we can calculate <math>\overleftarrow{c} \cdot \overrightarrow{5/3} = -1</math> for the final numerically correct expression <math>\frac{5}{3} = \frac{27}{16}(\frac{81}{80})^{-1}</math>. | ||
If you're worried about the potentially non-integral period ''e''<sub>1</sub>/''d'', | If you're worried about the potentially non-integral period ''e''<sub>1</sub>/''d'', the fractions in the mapping cluster on the commas so they don't matter in the end. The period and generator always get integral mappings. It should also always be possible to find a period monzo with integer components that has the same value in cents as the non-integral period, but I don't know how to find it algorithmically. | ||
== Optimizing database keys == | == Optimizing database keys == | ||
Line 112: | Line 137: | ||
:<math>\begin{align} | :<math>\begin{align} | ||
\overrightarrow{e_i} &:= e_i \log(p_i) \\ | \overrightarrow{e_i} &:= e_i \log(p_i) \\ | ||
\overleftarrow{e_i} &:= e_i / \log(p_i) | \overleftarrow{e_i} &:= e_i / \log(p_i) \\ | ||
\end{align}</math> | \end{align} | ||
\implies \overleftarrow{e_i}\overrightarrow{e_i} = 1</math> | |||
where ''p''<sub>i</sub> are the [[Just_intonation_subgroup|formal primes]] of the fractional just intonation subgroup. | where ''p''<sub>i</sub> are the [[Just_intonation_subgroup|formal primes]] of the fractional just intonation subgroup. | ||
It should be noted that the pseudoscalar relevant for tempering is <math>\prod_i \overleftarrow{e_i}</math>. | It should be noted that the pseudoscalar relevant for tempering is <math>\overleftarrow{i} := \prod_i \overleftarrow{e_i}</math>. | ||
This also gives <math>\overleftarrow{JIP}</math> a particularly nice representation as the sum of ''e''<sub>i</sub>. | This also gives <math>\overleftarrow{JIP}</math> a particularly nice representation as the sum of ''e''<sub>i</sub>. | ||
I will look into it more before turning this draft into a page in the Wiki proper. | I will look into it more before turning this draft into a page in the Wiki proper. | ||
It could also be nice to use units that make sure that all of the formulae make sense. Starting with sound frequency in Hz we identify ratios of frequencies as musically interesting such as the fifth = 660 Hz / 440 Hz. To make working with ratios easier we take the logarithm and measure pitch in cents: <math>\mathrm{fifth}_{cents} = \log_2(\frac{3}{2}) * 1200 ¢ = \log_2(3) * 1200 ¢ - \log_2(2) * 1200 ¢ = \overleftarrow{JIP} \cdot \overrightarrow{3/2}</math>. If we leave the just intonation point unit-less then monzo components will be measured in cents and val components in reciprocal cents <math>¢^{-1}</math>. |
Latest revision as of 06:35, 12 June 2022
This is a work-in-progress for my (Frostburn) thoughts about using geometric algebra to work with regular temperaments. I'm trying to write this in such a way that both geometers and musicians can follow the line of thought.
Vals
The simplest kinds of tunings only have a finite set of notes like our western 12-tone equal temperament. To understand such scales harmonically we need to know how to translate musically meaningful fractions such as 3/2 or 5/3 into numbers of steps in the scale of interest. Let's start with 5 equal divisions of the octave (the octave is the fraction 2/1). How should we represent the next prime 3/1? If 5 steps is the octave then the closest we can get to 3/1 is with 8 steps. The next prime 5/1 takes 12 steps of our 5-tone scale. These step counts are collected into a vector [math]\displaystyle{ \langle 5, 8, 12 \rbrack }[/math] known as a val where the prime factorization of intervals of interest are collected into vectors known as monzos: [math]\displaystyle{ 3/2 \mapsto \lbrack -1, 1, 0 \rangle }[/math] and [math]\displaystyle{ 5/3 \mapsto \lbrack 0, -1, 1 \rangle }[/math]. We can now use the dot product to work out how many steps we need to represent 3/2 (known as the fifth) [math]\displaystyle{ \langle 5, 8, 12 | -1, 1, 0 \rangle = 8 - 5 = 3 }[/math] steps of 5-tone equal temperament. Similarly 5/3 (known as the major sixth) equals [math]\displaystyle{ \langle 5, 8, 12 | 0, -1, 1 \rangle = 12 - 8 = 4 }[/math] steps.
Combining vals
Notice that it doesn't matter if we scale our val. [math]\displaystyle{ \langle 10, 16, 24 \rbrack }[/math] represents only 5 unique steps within 10-tone equal temperament. There is no integral monzo (that is, no rational number) that would map to an odd number of steps in this rescaled version. Because the sizes don't matter when we add vals together we're producing a sort of average. Let's take the val for 7-tone equal temperament [math]\displaystyle{ \langle 7, 11, 16 \rbrack }[/math] and add it to [math]\displaystyle{ \langle 5, 8, 12 \rbrack }[/math]. The result is [math]\displaystyle{ \langle 12, 19, 28 \rbrack }[/math] which just happens to line up with the val for our familiar 12-tone equal temperament. If we add the vals for 7-tone and 12-tone together we get [math]\displaystyle{ \langle 17, 27, 40 \rbrack }[/math] which is different from the optimal (patent) val for 17-tone equal temperament [math]\displaystyle{ \langle 17, 27, \mathbf{39} \rbrack }[/math]. By insisting that the first non-zero component of a val is positive and that all of the components are in lowest terms (GCD = 1) we get 1-wedgies which are unique identifiers of tunings.
Geometric interpretation
Because vals can be multiplied by an arbitrary scalar they represent lines that pass through the origin. Because one endpoint of the line is fixed the resulting space of interest is 2-dimensional in the case of three component vals. This is known as the val space and is isomorphic to the projective tuning space.
3D lines that pass through the origin find representation in the Geometric Algebra [math]\displaystyle{ \mathcal G(3,0) }[/math]. Our vals are now vectors, or points if you think projectively, in this space.
- [math]\displaystyle{ \langle 5, 8, 12 \rbrack \mapsto 5e_1 + 8e_2 + 12e_3 =: \overleftarrow{5} }[/math]
I will use the term pseudoscalar to refer to the combination of all basis vectors and denote it with i.
- [math]\displaystyle{ i := e1e2e3 }[/math]
I will use the term pseudovector to refer to vectors multiplied by i.
Combining vals geometrically
We can now use geometric algebraic operations to combine vals.
- [math]\displaystyle{ \begin{align} \overleftarrow{5} \wedge \overleftarrow{7} &= (5e_1 + 8e_2 + 12e_3) \wedge (7e_1 + 11e_2 + 16e_3) \\ &= (5 \times 11 - 8 \times 7)e_{12} + (5 \times 16 - 12 \times 7)e_{13} + (8 \times 16 - 12 \times 11)e_{23} \\ &= -4e_1i + 4e_2i - e_3i \\ \end{align} }[/math]
Readers familiar with monzos will recognize this as the syntonic comma 81/80 defining the Meantone temperament. Another example would be [math]\displaystyle{ \overleftarrow{7} \wedge \overleftarrow{8} = e_1i - 5e_2i + 3e_3i }[/math] looking like the monzo for the maximal diesis 250/243 defining the Porcupine temperament.
Geometric interpretation of temperaments
Let's use the vector notation with right-facing arrows for monzos.
- [math]\displaystyle{ -3e_1 + e_2 + e_3 =: \overrightarrow{15/8} }[/math]
Strictly speaking these do not belong in the algebra [math]\displaystyle{ \mathcal G(3,0) }[/math] because their size does matter, but the numerical math works out.
- [math]\displaystyle{ \overleftarrow{12} \cdot \overrightarrow{15/8} = 11 }[/math]
Indeed 15/8 (the major seventh) is worth 11 steps of 12-TET. However the commas defining temperaments do belong to the algebra. It makes no difference if you temper out 81/80 or its square 6561/6400 [math]\displaystyle{ \mapsto \overrightarrow{81/80} \cdot 2 }[/math]. You still get the Meantone temperament. As suggested by the observations above we will define rank-2 temperaments in 3 dimensions to be comma monzos interpreted as pseudovectors. Thus Meantone [math]\displaystyle{ = \overrightarrow{81/80} \cdot i }[/math]. The geometric interpretation of a temperament is therefore a plane spanned by two vals, or a line that passes through two points thinking projectively. We can project the just intonation point to such a line to find the mapping that is as close to just intonation as possible. In the case of Meantone:
- [math]\displaystyle{ (\lt 1200.0, 1901.9, 2786.3] \cdot \overrightarrow{81/80}i) (\overrightarrow{81/80}i)^{-1} \approx \lt 1202.6, 1899.3, 2787.0] }[/math]
We can then normalize the first component for pure octaves to get [math]\displaystyle{ \lt 1200.0, 1895, 2780.9] }[/math].
We're again abusing [math]\displaystyle{ \mathcal G(3,0) }[/math]. Tuning maps such as the JIP do not belong in the algebra. Their size matters. Another factor we're missing is weights. When we projected the JIP to Meantone we measured distances in cents which is not always perceptually optimal. To get a POTE tuning we would need to Tenney-weigh the JIP and inverse-weigh the coordinates of [math]\displaystyle{ \overrightarrow{81/80}i }[/math] before calculating the projection and inverse-weight the result. For the same result instead of inverse-weighing the pseudovector we could calculate Meantone [math]\displaystyle{ = \overleftarrow{5} \wedge \overleftarrow{7} }[/math] in weighted coordinates. For reference the POTE mapping vector for Meantone is [math]\displaystyle{ \lt 1200.0, 1896.2, 2785.0] }[/math]
Higher dimensions
The same math works in higher prime limits, but now the wedge product of two vals is not a pseudovector. For example in the 7-limit which is 4-dimensional (where [math]\displaystyle{ \mathcal{G}(4,0) }[/math] is the relevant algebra) [math]\displaystyle{ \overleftarrow{19} \wedge \overleftarrow{12} }[/math] is a rank-2 temperament while [math]\displaystyle{ \overrightarrow{126/125}i }[/math] is a rank-3 temperament. To combine these objects (which we might call pseudovals) into lower-ranked temperaments we use the vee product.
- [math]\displaystyle{ v \vee u := \overline{ \overline{v} \wedge \overline{u} } }[/math]
where the overline represents the Hodge dual.
To give an example we have Septimal Meantone [math]\displaystyle{ = \overleftarrow{19} \wedge \overleftarrow{12} = \overrightarrow{81/80}i \vee \overrightarrow{126/125}i }[/math] which is a bival with the numerical value:
- [math]\displaystyle{ e_{12} + 4 e_{13} + 10 e_{14} + 4 e_{23} + 13 e_{24} + 12 e_{34} }[/math]
It's already positive and in lowest terms so it's a 2-wedgie. It is of great practical use that rank-2 temperaments in higher dimensions get unique integral representations. For example they can be used as keys in a database for querying information about temperaments.
Observe how vals build temperaments by wedges in increasing rank while pseudovals do increasing damage to just intonation (representable by the pseudoscalar [math]\displaystyle{ i }[/math]) and successive vees decrease the rank of the resulting temperament. Pseudovals can be factored into vals
- [math]\displaystyle{ \overrightarrow{126/125}i = \overleftarrow{12} \wedge \overleftarrow{27} \wedge \overleftarrow{31} }[/math]
and vice versa
- [math]\displaystyle{ \overleftarrow{12} = \overrightarrow{64/63}i \vee \overrightarrow{81/80}i \vee \overrightarrow{128/125}i }[/math]
In higher dimensions with algebra [math]\displaystyle{ \mathcal{G}(n,0) }[/math] pseudovals can be factored into a wedge of [math]\displaystyle{ (n-1) }[/math] vals and vals into a vee of [math]\displaystyle{ (n-1) }[/math] pseudovals.
The projection formula for calculating the optimal tuning for a temperament (in Tenney-weighted coordinates)
- [math]\displaystyle{ \overleftarrow{TE} = \overleftarrow{JIP} \cdot \mathbf{T} / \mathbf{T} }[/math]
works for temperament [math]\displaystyle{ \mathbf{T} }[/math] of any rank in just intonation subgroups of any size and most notably without using a single matrix operation!
How the period and generator falls out of a rank-2 wedgie
In equal temperament it is obvious that the building block of any musical interval is a single scale step. In rank-2 there are two independent building blocks. The one associated with the octave is called the period and the other the generator.
Let's translate the procedure introduced in the wedgie page to the notation I'm using.
To find the period (in n dimensions). Calculate [math]\displaystyle{ d = gcd(W_{12}, W_{13}, \ldots, W_{1n}) }[/math], where [math]\displaystyle{ W_{1n} }[/math] are all of the bivector components associated with [math]\displaystyle{ e_1 }[/math] (i.e. with prime 2) of the 2-wedgie for the temperament. Your period will be 1\d in backslash notation i.e. one step of d equal divisions of the octave.
To find the generator. Solve the equation [math]\displaystyle{ c_2 W_{12} + c_3 W_{13} + \ldots + c_n W_{1n} = d }[/math] for the coefficients [math]\displaystyle{ c_2,\ldots,c_n }[/math] (using some algorithm such as the extended Euclidean algorithm). Then one valid generator for the temperament is [math]\displaystyle{ \overrightarrow{g}=c_2e_2 + c_3e_3 + \ldots + c_ne_n }[/math]. Thus (the tempered version of) the generator represents [math]\displaystyle{ q_2^{c_2} \cdots q_n^{c_n} }[/math] where 2.q2.(…).qn is the JI subgroup.
This generator might not be the most meaningful musically, but it's enough to build MOS scales for rank-2 temperaments which along with the POTE tuning is the main thing you need to compose music in the chosen temperament.
Geometric algebraic version
Given a rank-2 temperament [math]\displaystyle{ \mathbf{T} }[/math] find [math]\displaystyle{ \overrightarrow{g} }[/math] (with integer coefficients) such that
- [math]\displaystyle{ \overrightarrow{g} \cdot (e_1 \cdot \mathbf{T}) = d }[/math]
where [math]\displaystyle{ d = gcd(...(e_1 \cdot \mathbf{T})) }[/math]. The period can be expressed (non-integrally) as [math]\displaystyle{ \overrightarrow{p} = e_1 / |d| }[/math] and a valid generator is [math]\displaystyle{ \overrightarrow{g} }[/math]. Other valid generators are of the form
- [math]\displaystyle{ n \overrightarrow{p} ± \overrightarrow{g}, n \in \mathbb{Z} }[/math]
If the temperament is not expressed in lowest terms the number of divisions will miscompensate and you will end up with the wrong equave.
Mapping
An expression such as [math]\displaystyle{ \mathbf{T} = \overleftarrow{12} \wedge \overleftarrow{19} }[/math] is nice for getting the feel of a temperament: Meantone feels like what 12edo and 19edo have in common. However it's hard to figure out how a given monzo should be mapped to periods and generators.
With a temperament of rank 2 the period [math]\displaystyle{ \overrightarrow{p} }[/math] and the generator [math]\displaystyle{ \overrightarrow{g} }[/math] together with n - 2 commas [math]\displaystyle{ \overrightarrow{c}_i }[/math] that are tempered out form a basis for the whole n-dimensional JI subgroup and can thus be inverted to produce a mapping for the temperament.
Any interval within the JI subgroup can be written as
- [math]\displaystyle{ \overrightarrow{m} = x \overrightarrow{p} + y \overrightarrow{g} + z_1 \overrightarrow{c_1} + \ldots + z_{n-2} \overrightarrow{c_{n-2}} }[/math]
The wedge product has some nice properties that allow us to extract [math]\displaystyle{ x }[/math] and [math]\displaystyle{ y }[/math]. Let's first calculate the relevant hyperwedge.
- [math]\displaystyle{ \begin{align} \mathbf{H} &= \overrightarrow{p} \wedge \overrightarrow{g} \wedge \overrightarrow{c_1} \wedge \ldots \wedge \overrightarrow{c_{n-2}} \\ \mathbf{H} &= \overrightarrow{p} \wedge \overrightarrow{g} \wedge \mathbf{T}i \end{align} }[/math]
where we've used the fact that the commas span the dual of the temperament. Finally we have
- [math]\displaystyle{ \begin{align} x &= \frac{\overrightarrow{m} \wedge \overrightarrow{g} \wedge \mathbf{T}i}{\mathbf{H}} \\ y &= \frac{\overrightarrow{p} \wedge \overrightarrow{m} \wedge \mathbf{T}i}{\mathbf{H}} \end{align} }[/math]
where the division is inverse scalar multiplication (or right multiplication by the geometric inverse. Same thing in this case where the relevant subspace attitudes align).
Calculating the wedges can be computationally intensive so it's often convenient to precalculate the mapping for formal primes in the subgroup.
Let's do that for meantone and choose [math]\displaystyle{ \overrightarrow{p} = \overrightarrow{2/1} = [1, 0, 0\gt }[/math] and [math]\displaystyle{ \overrightarrow{g} = \overrightarrow{3/2} = [-1, 1, 0\gt }[/math] as the period and generator for Meantone. In this case there's only a single comma [math]\displaystyle{ \overrightarrow{c} = \overrightarrow{81/80} = [-4, 4, -1 \gt }[/math] so we can calculate the mapping in terms of that too, but in general we don't need to know the commas as long as we know the wedgie for the temperament.
- [math]\displaystyle{ \begin{align} \overrightarrow{2/1} &= 1 \overrightarrow{p} + 0 \overrightarrow{g} + 0 \overrightarrow{c} \\ \overrightarrow{3/1} &= 1 \overrightarrow{p} + 1 \overrightarrow{g} + 0 \overrightarrow{c} \\ \overrightarrow{5/1} &= 0 \overrightarrow{p} + 4 \overrightarrow{g} - 1 \overrightarrow{c} \end{align} }[/math]
Transposing the coefficients gives us the mapping:
- [math]\displaystyle{ \begin{align} \overleftarrow{p} &= \lt 1, 1, 0 ] \\ \overleftarrow{g} &= \lt 0, 1, 4 ] \\ \overleftarrow{c} &= \lt 0, 0, -1] \end{align} }[/math]
Now [math]\displaystyle{ \mathbf{T} = \overleftarrow{p} \wedge \overleftarrow{g} }[/math] and for any monzo [math]\displaystyle{ \overrightarrow{m} }[/math] we can get the number of periods as [math]\displaystyle{ \overleftarrow{p} \cdot \overrightarrow{m} }[/math] and the number of generators as [math]\displaystyle{ \overleftarrow{g} \cdot \overrightarrow{m} }[/math]. (We don't care about how many commas are needed because they're tempered out anyway.)
For example [math]\displaystyle{ \overleftarrow{p} \cdot \overrightarrow{5/3} = -1 }[/math] and [math]\displaystyle{ \overleftarrow{g} \cdot \overrightarrow{5/3} = 3 }[/math]. Indeed [math]\displaystyle{ \frac{5}{3} \sim (\frac{2}{1})^{-1}(\frac{3}{2})^3 = \frac{27}{16} }[/math] in Meantone. Musically this means that the major sixth is constructed by stacking three perfect fifths and reducing by an octave. If we want to be pedantic we can calculate [math]\displaystyle{ \overleftarrow{c} \cdot \overrightarrow{5/3} = -1 }[/math] for the final numerically correct expression [math]\displaystyle{ \frac{5}{3} = \frac{27}{16}(\frac{81}{80})^{-1} }[/math].
If you're worried about the potentially non-integral period e1/d, the fractions in the mapping cluster on the commas so they don't matter in the end. The period and generator always get integral mappings. It should also always be possible to find a period monzo with integer components that has the same value in cents as the non-integral period, but I don't know how to find it algorithmically.
Optimizing database keys
As mentioned before wedgies can be used as unique identifiers of temperaments. The geometric algebra for n-dimensional space is 2n-dimensional, but most of the wedgie components are zero and can be dropped. Additionally in the case of rank-2 temperaments there's a neat little trick that allows us to drop even more components. In the subgroup o.p2.p3.(…).pn calculate
- [math]\displaystyle{ \mathbf{T}' = \langle 1, \log_o(p_2), \log_o(p_3), \ldots, \log_o(p_n) \rbrack \wedge \langle 0, W_{12}, W_{13}, \ldots, W_{1n} \rbrack }[/math]
If the temperament is reasonably close to just intonation it can be recovered by rounding [math]\displaystyle{ \mathbf{T}' }[/math] to the nearest integer.
Examples in 2.3.5 include Meantone ~ [1, 4], Augmented ~ [3, 0] and Blackwood ~ [0, 5], Semaphore ~ [2, 1] in 2.3.7 and Miracle ~ [6, -7, -2] in 2.3.5.7.
Note that this generalizes to arbitrary rank. For example in rank 3:
- [math]\displaystyle{ \mathbf{T}' = \langle 1, \log_o(p_2), \log_o(p_3), \ldots, \log_o(p_n) \rbrack \wedge \langle \langle 0, \ldots, 0, W_{123}, W_{124}, \ldots, W_{1(n-1)n} \rbrack \rbrack }[/math]
Where [math]\displaystyle{ W_{1ij} }[/math] are the 3-wedgie components associated with e1 of a temperament [math]\displaystyle{ \mathbf{T} }[/math] and are back-filled into a 2-val. If [math]\displaystyle{ \mathbf{T} }[/math] is sufficiently good we have [math]\displaystyle{ \mathbf{T} = \mathrm{round}(\mathbf{T}') }[/math].
As an example Marvel ~ [1, 2, -2] which is just the non-two monzo components of the marvel comma reversed and with alternating signs. This makes sense: a comma's two's component can be deduced from the other components by assuming that the comma has a positive size less than the octave.
Improving the notation
It might be possible to consistently define everything so that the Tenney weighted metric is incorporated in the basis vectors. If ei are the GA basis vectors that square to 1 we can define basis vectors
- [math]\displaystyle{ \begin{align} \overrightarrow{e_i} &:= e_i \log(p_i) \\ \overleftarrow{e_i} &:= e_i / \log(p_i) \\ \end{align} \implies \overleftarrow{e_i}\overrightarrow{e_i} = 1 }[/math]
where pi are the formal primes of the fractional just intonation subgroup. It should be noted that the pseudoscalar relevant for tempering is [math]\displaystyle{ \overleftarrow{i} := \prod_i \overleftarrow{e_i} }[/math].
This also gives [math]\displaystyle{ \overleftarrow{JIP} }[/math] a particularly nice representation as the sum of ei.
I will look into it more before turning this draft into a page in the Wiki proper.
It could also be nice to use units that make sure that all of the formulae make sense. Starting with sound frequency in Hz we identify ratios of frequencies as musically interesting such as the fifth = 660 Hz / 440 Hz. To make working with ratios easier we take the logarithm and measure pitch in cents: [math]\displaystyle{ \mathrm{fifth}_{cents} = \log_2(\frac{3}{2}) * 1200 ¢ = \log_2(3) * 1200 ¢ - \log_2(2) * 1200 ¢ = \overleftarrow{JIP} \cdot \overrightarrow{3/2} }[/math]. If we leave the just intonation point unit-less then monzo components will be measured in cents and val components in reciprocal cents [math]\displaystyle{ ¢^{-1} }[/math].