User:Frostburn/Geometric algebra for regular temperaments: Difference between revisions

Frostburn (talk | contribs)
Sintel bot (talk | contribs)
Fix <math> environments for MathJax v4 (align->aligned, etc.)
 
(One intermediate revision by one other user not shown)
Line 20: Line 20:
We can now use geometric algebraic operations to combine vals.
We can now use geometric algebraic operations to combine vals.
:<math>
:<math>
\begin{align}
\begin{aligned}
\overleftarrow{5} \wedge \overleftarrow{7} &= (5e_1 + 8e_2 + 12e_3) \wedge (7e_1 + 11e_2 + 16e_3) \\
\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} \\
&= (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 \\
&= -4e_1i + 4e_2i - e_3i \\
\end{align}
\end{aligned}
</math>
</math>
Readers familiar with monzos will recognize this as the syntonic comma [[81/80]] defining the [[Meantone]] temperament. Another example would be <math>\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.
Readers familiar with monzos will recognize this as the syntonic comma [[81/80]] defining the [[Meantone]] temperament. Another example would be <math>\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.
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>. Inverting the matrix <math>[\overrightarrow{p}, \overrightarrow{g}, \overrightarrow{c}]</math> gives us the mapping:
Any interval within the JI subgroup can be written as
:<math>\begin{align}
:<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{aligned}
\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{aligned}</math>
where we've used the fact that the commas span the dual of the temperament.
Finally we have
:<math>\begin{aligned}
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{aligned}</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{aligned}
\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{aligned}</math>
Transposing the coefficients gives us the mapping:
:<math>\begin{aligned}
\overleftarrow{p} &= < 1, 1, 0 ] \\
\overleftarrow{p} &= < 1, 1, 0 ] \\
\overleftarrow{g} &= < 0, 1, 4 ] \\
\overleftarrow{g} &= < 0, 1, 4 ] \\
\overleftarrow{c} &= < 0, 0, -1]
\overleftarrow{c} &= < 0, 0, -1]
\end{align}</math>
\end{aligned}</math>
Now <math>\mathbf{T} = \overleftarrow{p} \wedge \overleftarrow{g}</math> and for any monzo <math>\overrightarrow{m}</math> we can get the number of periods as <math>\overleftarrow{p} \cdot \overrightarrow{m}</math> and the number of generators as <math>\overleftarrow{g} \cdot \overrightarrow{m}</math>. (We don't care about how many commas are needed because they're tempered out anyway.)
Now <math>\mathbf{T} = \overleftarrow{p} \wedge \overleftarrow{g}</math> and for any monzo <math>\overrightarrow{m}</math> we can get the number of periods as <math>\overleftarrow{p} \cdot \overrightarrow{m}</math> and the number of generators as <math>\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>\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'', I'm pretty sure the non-integral components of the matrix inverse will fall onto the comma mapping vals so they don't matter in the end. I also believe that its always 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.
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 110: Line 135:
== Improving the notation ==
== Improving the notation ==
It might be possible to consistently define everything so that the Tenney weighted metric is incorporated in the basis vectors. If ''e''<sub>i</sub> are the GA basis vectors that square to 1 we can define basis vectors
It might be possible to consistently define everything so that the Tenney weighted metric is incorporated in the basis vectors. If ''e''<sub>i</sub> are the GA basis vectors that square to 1 we can define basis vectors
:<math>\begin{align}
:<math>\begin{aligned}
\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}
\end{aligned}
\implies \overleftarrow{e_i}\overrightarrow{e_i} = 1</math>
\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.