Constrained tuning/Analytical solution to constrained Euclidean tunings: Difference between revisions

From Xenharmonic Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 24: Line 24:
<math>\displaystyle P = WV^+VW^{-1} = W(AW)^+A</math>
<math>\displaystyle P = WV^+VW^{-1} = W(AW)^+A</math>


== Trivially constrained tuning ==
== CFE tuning ==
Let us start with CFE tuning (<u>c</u>onstrained <u>F</u>rob<u>e</u>nius tuning) since its weighter is the identity matrix and the constraint is simply the octave.  
Let us start with CFE tuning (<u>c</u>onstrained <u>F</u>rob<u>e</u>nius tuning) since its weighter is the identity matrix and the constraint is simply the octave.  


As a concrete example, consider septimal meantone, whose mapping is
Denote the constraint by B<sub>C</sub>. In the case of CFE, it is the octave:  
 
<math>\displaystyle
A =
\begin{bmatrix}
1 & 0 & -4 & -13 \\
0 & 1 & 4 & 10
\end{bmatrix}
</math>
 
Denote the constraint by B<sub>C</sub>. In this case, it is the octave:  


<math>\displaystyle B_{\rm C} = [ \begin{matrix} 1 & 0 & 0 & 0 \end{matrix} \rangle</math>
<math>\displaystyle B_{\rm C} = [ \begin{matrix} 1 & 0 & 0 & 0 \end{matrix} \rangle</math>
Line 43: Line 33:
but it works as long as it is the first ''r'' elements of the subgroup basis.  
but it works as long as it is the first ''r'' elements of the subgroup basis.  


We will also denote the projection map by P. For septimal meantone,
We will denote the projection map by P. The goal is to work out the constrained projection map P<sub>C</sub>, which also satisfies
 
<math>\displaystyle
P = \frac{1}{446}
\begin{bmatrix}
117 & 146 & 116 & -61 \\
146 & 186 & 160 & -38 \\
116 & 160 & 176 & 92 \\
-61 & -38 & 92 & 413
\end{bmatrix}
</math>
 
The goal is to work out the constrained projection map P<sub>C</sub>, which also satisfies


<math>\displaystyle  
<math>\displaystyle  
Line 80: Line 58:
Both P<sub>C</sub><sup>+</sup>B<sub>C</sub> and PB<sub>C</sub> are the same slice of the first ''r'' columns of P.
Both P<sub>C</sub><sup>+</sup>B<sub>C</sub> and PB<sub>C</sub> are the same slice of the first ''r'' columns of P.


With the first ''r'' rows and columns removed, the remaining part in the mapping will be dubbed the minor of A, denoted A<sub>M</sub>. For septimal meantone, it is
With the first ''r'' rows and columns removed, the remaining part in the mapping will be dubbed the minor, denoted A<sub>M</sub>. The minor of the projection map
 
<math>\displaystyle A_{\rm M} = \begin{bmatrix} 1 & 4 & 10\end{bmatrix}</math>
 
That forms a projection map filling the bottom-right section of P<sub>C</sub><sup>+</sup> as
 
<math>\displaystyle
A_{\rm M}^+A_{\rm M} = \frac{1}{117}
\begin{bmatrix}
1 & 4 & 10 \\
4 & 16 & 40 \\
10 & 40 & 100
\end{bmatrix}
</math>
 
In fact,


<math>\displaystyle  
<math>\displaystyle P_{\rm M} = A_{\rm M}^+ A_{\rm M} </math>
P_{\rm C}^+ =
\begin{bmatrix}
117/446 & 0 & 0 & 0 \\
146/446 & 1/117 & 4/117 & 10/117 \\
116/446 & 4/117 & 16/117 & 40/117 \\
-61/446 & 10/117 & 40/117 & 100/117
\end{bmatrix}
</math>


Hence,
forms an orthogonal projection map filling the bottom-right section of P<sub>C</sub><sup>+</sup>.
 
<math>\displaystyle
P_{\rm C} = \frac{1}{117}
\begin{bmatrix}
117 & 146 & 116 & -61 \\
0 & 1 & 4 & 10 \\
0 & 4 & 16 & 40 \\
0 & 10 & 40 & 100
\end{bmatrix}
</math>


In general, if B<sub>C</sub> is the first ''r'' elements of the subgroup basis, then P<sub>C</sub> is of the form
In general, if B<sub>C</sub> is the first ''r'' elements of the subgroup basis, then P<sub>C</sub> is of the form
Line 128: Line 73:
</math>
</math>


If there is a weight, such as CTE tuning, the weight should be applied to the map and the constraint:  
== Otherwise normed tuning ==
If there is a weight, such as CTE tuning, the weight should be applied to the map and the constraint first:  


<math>\displaystyle  
<math>\displaystyle  
V = AW \\
\begin{align}
M_{\rm C} = W^{-1}B_{\rm C}
V &= AW \\
M_{\rm C} &= W^{-1}B_{\rm C}
\end{align}
</math>
</math>


Line 170: Line 118:


<math>\displaystyle  
<math>\displaystyle  
A_S = AS \\
\begin{align}
(B_{\rm C})_S = S^{-1}B_{\rm C}
A_S &= AS \\
(B_{\rm C})_S &= S^{-1}B_{\rm C}
\end{align}
</math>
</math>


Line 181: Line 131:


<math>\displaystyle  
<math>\displaystyle  
V = AW \\
\begin{align}
M_{\rm C} = W^{-1}B_{\rm C}
V &= AW \\
M_{\rm C} &= W^{-1}B_{\rm C}
\end{align}
</math>
</math>


Line 194: Line 146:


<math>\displaystyle  
<math>\displaystyle  
V_S = VS_W \\
\begin{align}
(M_{\rm C})_S = S_W^{-1}M_{\rm C}
V_S &= VS_W \\
(M_{\rm C})_S &= S_W^{-1}M_{\rm C}
\end{align}
</math>
</math>


Line 201: Line 155:


<math>\displaystyle P_{\rm C} = WS (P_{\rm C})_{WS} S^{-1} W^{-1}</math>
<math>\displaystyle P_{\rm C} = WS (P_{\rm C})_{WS} S^{-1} W^{-1}</math>
== Example ==
Let us try tuning septimal meantone to CFE.
Its mapping is
<math>\displaystyle
A =
\begin{bmatrix}
1 & 0 & -4 & -13 \\
0 & 1 & 4 & 10
\end{bmatrix}
</math>
The projection map is
<math>\displaystyle
\begin{align}
P &= A^+A \\
&= \frac{1}{446}
\begin{bmatrix}
117 & 146 & 116 & -61 \\
146 & 186 & 160 & -38 \\
116 & 160 & 176 & 92 \\
-61 & -38 & 92 & 413
\end{bmatrix}
\end{align}
</math>
The minor of the mapping is
<math>\displaystyle A_{\rm M} = \begin{bmatrix} 1 & 4 & 10\end{bmatrix}</math>
and the minor projection map is
<math>\displaystyle
\begin{align}
P_{\rm M} &= A_{\rm M}^+A_{\rm M} \\
&= \frac{1}{117}
\begin{bmatrix}
1 & 4 & 10 \\
4 & 16 & 40 \\
10 & 40 & 100
\end{bmatrix}
\end{align}
</math>
In fact,
<math>\displaystyle
P_{\rm C}^+ =
\begin{bmatrix}
117/446 & 0 & 0 & 0 \\
146/446 & 1/117 & 4/117 & 10/117 \\
116/446 & 4/117 & 16/117 & 40/117 \\
-61/446 & 10/117 & 40/117 & 100/117
\end{bmatrix}
</math>
Hence,
<math>\displaystyle
P_{\rm C} = \frac{1}{117}
\begin{bmatrix}
117 & 146 & 116 & -61 \\
0 & 1 & 4 & 10 \\
0 & 4 & 16 & 40 \\
0 & 10 & 40 & 100
\end{bmatrix}
</math>

Revision as of 18:05, 27 July 2022

Preliminaries

The projection map is useful in a lot of ways. We will work extensively with the projection map in the course of solving constrained tunings.

First, it manifests itself as a form of tuning map. Its columns represent tunings of formal primes in terms of monzos. The tuning map in the logarithmic scale can be obtained by multiplying the projection map by the JIP on the left.

[math]\displaystyle{ \displaystyle T = JP }[/math]

where T is the tuning map, J the JIP, and P the projection map.

The projection map multipled by a temperament map on the left yields its tempered monzos. In particular, if A is the temperament map of P, then

[math]\displaystyle{ \displaystyle AP = A }[/math]

Second, the projection map multipled by a monzo list on the right yields the tunings of the list in terms of monzos. In particular, if B is the comma list of P, then

[math]\displaystyle{ \displaystyle PB = O }[/math]

For any Euclidean aka L2 tunings, the weighted projection map is

[math]\displaystyle{ \displaystyle P_W = V^+V }[/math]

where V = AW is the weighted val list of the temperament. Removing the weight, it is

[math]\displaystyle{ \displaystyle P = WV^+VW^{-1} = W(AW)^+A }[/math]

CFE tuning

Let us start with CFE tuning (constrained Frobenius tuning) since its weighter is the identity matrix and the constraint is simply the octave.

Denote the constraint by BC. In the case of CFE, it is the octave:

[math]\displaystyle{ \displaystyle B_{\rm C} = [ \begin{matrix} 1 & 0 & 0 & 0 \end{matrix} \rangle }[/math]

but it works as long as it is the first r elements of the subgroup basis.

We will denote the projection map by P. The goal is to work out the constrained projection map PC, which also satisfies

[math]\displaystyle{ \displaystyle AP_{\rm C} = A \\ P_{\rm C}B = O }[/math]

in addition to

[math]\displaystyle{ \displaystyle P_{\rm C} B_{\rm C} = B_{\rm C} }[/math]

Since P is characteristic of the temperament and is independent of the specific tuning, notice

[math]\displaystyle{ \displaystyle P = P_{\rm C}^+P_{\rm C} }[/math]

where + is the pseudoinverse. That makes the pseudoinverse of PC easier to work with than PC itself, as

[math]\displaystyle{ \displaystyle P_{\rm C}^+ B_{\rm C} = P_{\rm C}^+P_{\rm C} B_{\rm C} = P B_{\rm C} }[/math]

Both PC+BC and PBC are the same slice of the first r columns of P.

With the first r rows and columns removed, the remaining part in the mapping will be dubbed the minor, denoted AM. The minor of the projection map

[math]\displaystyle{ \displaystyle P_{\rm M} = A_{\rm M}^+ A_{\rm M} }[/math]

forms an orthogonal projection map filling the bottom-right section of PC+.

In general, if BC is the first r elements of the subgroup basis, then PC is of the form

[math]\displaystyle{ \displaystyle P_{\rm C} = \begin{bmatrix} A^+AB_{\rm C} & \begin{matrix} O \\ A_{\rm M}^+A_{\rm M} \end{matrix} \end{bmatrix}^+ }[/math]

Otherwise normed tuning

If there is a weight, such as CTE tuning, the weight should be applied to the map and the constraint first:

[math]\displaystyle{ \displaystyle \begin{align} V &= AW \\ M_{\rm C} &= W^{-1}B_{\rm C} \end{align} }[/math]

Working from here, we find the weighted projection map (PC)W:

[math]\displaystyle{ \displaystyle (P_{\rm C})_W = \begin{bmatrix} V^+VM_{\rm C} & \begin{matrix} O \\ V_{\rm M}^+V_{\rm M} \end{matrix} \end{bmatrix}^+ }[/math]

To reconstruct the original projection map, apply

[math]\displaystyle{ \displaystyle P_{\rm C} = W (P_{\rm C})_W W^{-1} }[/math]

Nontrivially constrained tuning

What if the constraint is something more complex, especially when it is not the first r elements of the subgroup basis? It turns out we can always transform the subgroup basis to encapsulate the constraint. Such a subgroup is formed by the constraint and its orthonormal complement.

For example, if the temperament is in the subgroup basis of 2.3.5.7, and the constraint is 2.5/3:

[math]\displaystyle{ \displaystyle B_{\rm C} = [[ \begin{matrix} 1 & 0 & 0 & 0 \end{matrix} \rangle, [ \begin{matrix} 0 & -1 & 1 & 0 \end{matrix} \rangle] }[/math]

Then the basis transformation matrix will be

[math]\displaystyle{ \displaystyle S = [\begin{matrix} B_{\rm C} & B_{\rm C}^\perp \end{matrix}] = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & -1 & 1/\sqrt{2} & 0 \\ 0 & 1 & 1/\sqrt{2} & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix} }[/math]

We should apply this S to the map and the constraint to convert them into the working basis:

[math]\displaystyle{ \displaystyle \begin{align} A_S &= AS \\ (B_{\rm C})_S &= S^{-1}B_{\rm C} \end{align} }[/math]

Proceed as before. The projection map found this way will be in the working basis. To reconstruct the original projection map, apply

[math]\displaystyle{ \displaystyle P_{\rm C} = S (P_{\rm C})_S S^{-1} }[/math]

Similarly, if there is a weight, it should be applied to the map and the constraint first:

[math]\displaystyle{ \displaystyle \begin{align} V &= AW \\ M_{\rm C} &= W^{-1}B_{\rm C} \end{align} }[/math]

and then the basis transformation matrix should be found out in this weighted space:

[math]\displaystyle{ \displaystyle S_W = [\begin{matrix} M_{\rm C} & M_{\rm C}^\perp \end{matrix}] }[/math]

We should apply this SW to the weighted map and the weighted constraint to convert them into the working basis:

[math]\displaystyle{ \displaystyle \begin{align} V_S &= VS_W \\ (M_{\rm C})_S &= S_W^{-1}M_{\rm C} \end{align} }[/math]

Proceed as before. The projection map found this way will be weighted and in the working basis. To reconstruct the original projection map, apply

[math]\displaystyle{ \displaystyle P_{\rm C} = WS (P_{\rm C})_{WS} S^{-1} W^{-1} }[/math]

Example

Let us try tuning septimal meantone to CFE.

Its mapping is

[math]\displaystyle{ \displaystyle A = \begin{bmatrix} 1 & 0 & -4 & -13 \\ 0 & 1 & 4 & 10 \end{bmatrix} }[/math]

The projection map is

[math]\displaystyle{ \displaystyle \begin{align} P &= A^+A \\ &= \frac{1}{446} \begin{bmatrix} 117 & 146 & 116 & -61 \\ 146 & 186 & 160 & -38 \\ 116 & 160 & 176 & 92 \\ -61 & -38 & 92 & 413 \end{bmatrix} \end{align} }[/math]

The minor of the mapping is

[math]\displaystyle{ \displaystyle A_{\rm M} = \begin{bmatrix} 1 & 4 & 10\end{bmatrix} }[/math]

and the minor projection map is

[math]\displaystyle{ \displaystyle \begin{align} P_{\rm M} &= A_{\rm M}^+A_{\rm M} \\ &= \frac{1}{117} \begin{bmatrix} 1 & 4 & 10 \\ 4 & 16 & 40 \\ 10 & 40 & 100 \end{bmatrix} \end{align} }[/math]

In fact,

[math]\displaystyle{ \displaystyle P_{\rm C}^+ = \begin{bmatrix} 117/446 & 0 & 0 & 0 \\ 146/446 & 1/117 & 4/117 & 10/117 \\ 116/446 & 4/117 & 16/117 & 40/117 \\ -61/446 & 10/117 & 40/117 & 100/117 \end{bmatrix} }[/math]

Hence,

[math]\displaystyle{ \displaystyle P_{\rm C} = \frac{1}{117} \begin{bmatrix} 117 & 146 & 116 & -61 \\ 0 & 1 & 4 & 10 \\ 0 & 4 & 16 & 40 \\ 0 & 10 & 40 & 100 \end{bmatrix} }[/math]