User:Frostburn/Geometric algebra for regular temperaments

Revision as of 13:20, 19 May 2022 by Frostburn (talk | contribs) (Decomposition: Add some decomposition examples and hand waving.)

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{ \lt 5, 8, 12 ] }[/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 [ -1, 1, 0 \gt }[/math] and [math]\displaystyle{ 5/3 \mapsto [ 0, -1, 1 \gt }[/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{ \lt 5, 8, 12 | -1, 1, 0 \gt = 8 - 5 = 3 }[/math] steps of 5-tone equal temperament. Similarly 5/3 (known as the major sixth) equals [math]\displaystyle{ \lt 5, 8, 12 | 0, -1, 1 \gt = 12 - 8 = 4 }[/math] steps.

Combining vals

Notice that it doesn't matter if we scale our val. [math]\displaystyle{ \lt 10, 16, 24 ] }[/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{ \lt 7, 11, 16 ] }[/math] and add it to [math]\displaystyle{ \lt 5, 8, 12 ] }[/math]. The result is [math]\displaystyle{ \lt 12, 19, 28 ] }[/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{ \lt 17, 27, 40 ] }[/math] which is different from the optimal (patent) val for 17-tone equal temperament [math]\displaystyle{ \lt 17, 27, \mathbf{39} ] }[/math].

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{ \lt 5, 8, 12 ] \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] with the numerical value:

[math]\displaystyle{ e_{12} + 4 e_{13} + 10 e_{14} + 4 e_{23} + 13 e_{24} + 12 e_{34} }[/math]

I do not yet know the significance of these numbers, but it is of great practical use that rank-2 temperaments in higher dimensions get unique integral representations (up to scalar multiplication). Because these values can be made canonical 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 decomposed 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!

Decomposition

In equal temperament it is obvious that the building block of any musical interval is a single scale step, it's not immediately obvious what intervals in higher rank temperaments are made out of. We can wedge two vals together but the factorization is not unique. What we need are two vals that are as simple as possible.

Let's return to three dimensions (or two thinking projectively). Meantone can be decomposed into:

[math]\displaystyle{ \lt 0, 1, 4 ] \wedge \lt 1, 0, -4] }[/math]

As tunings these would be a division of 5/1 into 4 equal parts each representing a 3/1, while the other is the octave "divided" into a single unit. Let's call these vals [math]\displaystyle{ \overleftarrow{v_0} }[/math] and [math]\displaystyle{ \overleftarrow{v_1} }[/math]. Any val [math]\displaystyle{ \overleftarrow{v} }[/math] that supports Meantone can be expressed as a linear combination of these two vals and thus the number of scale steps for a given monzo is

[math]\displaystyle{ \begin{align} n &= \overleftarrow{v} \cdot \overrightarrow{m} \\ &= (p\overleftarrow{v_0} + q\overleftarrow{v_1}) \cdot \overrightarrow{m} \\ &= p(\overleftarrow{v_0} \cdot \overrightarrow{m}) + q(\overleftarrow{v_1} \cdot \overrightarrow{m}) \end{align} }[/math]

With a lot of hand waving we can say that 3/1 and 2/1 generate the Meantone temperament. Any frequency/pitch from an interval tuned to a specific version of meantone has a counterpart composed of only 3/1 and 2/1 in the same tuning with the same frequency/pitch.

Another example might be Blackwood [math]\displaystyle{ = e_3 \wedge \overleftarrow{5} }[/math] where the generators are 5/1 (based on [math]\displaystyle{ e_2 }[/math]) and one step of the octave divided into 5 equal parts (denoted in backslash notation as 1\5). It is impossible to find an integral val with a first component larger than zero but smaller than 5.

A similar thing happens with Augmented [math]\displaystyle{ = e_2 \wedge \overleftarrow{3} }[/math], but now the generators are 3/1 and 1\3.

Something without a split octave and a 5/1 generator would be Dicot [math]\displaystyle{ = \lt 0, 2, 1] \wedge \lt 1, 1, 2] }[/math].

There are more musically useful ways to express these generators (the one related to the octave is usually called the period), but observations like this should be enough to make software that finds some generators with brute force and uses those to build MOS scales for rank 2 temperaments which is what the user most likely cares about.