Optimization: Difference between revisions

m Another pass on style: matrices are italic following Wikipedia practice. Eigenmonzo -> unit eigenmonzo. Misc. cleanup
Improve the formulation
 
(5 intermediate revisions by 2 users not shown)
Line 18: Line 18:
The weight, represented by a diagonal transformation matrix, determines the importance of each formal prime. Since the tuning space and the interval space are {{w|dual (mathematics)|dual}} to each other, rating of importance in the tuning space is equivalent to rating of complexity in the interval space. The Tenney weight is the most common weight:  
The weight, represented by a diagonal transformation matrix, determines the importance of each formal prime. Since the tuning space and the interval space are {{w|dual (mathematics)|dual}} to each other, rating of importance in the tuning space is equivalent to rating of complexity in the interval space. The Tenney weight is the most common weight:  


<math>\displaystyle W = \operatorname {diag} (1/\log_2 (Q)) </math>
$$ W = \operatorname {diag} (1/\log_2 (Q)) $$


which indicates that the prime harmonic ''q'' in ''Q'' = {{val| 2 3 5 … }} has the importance of 1/log<sub>2</sub>(''q''). Its dual states that ''q'' has the complexity of log<sub>2</sub>(''q'').  
which indicates that the prime harmonic ''q'' in ''Q'' = {{val| 2 3 5 … }} has the importance of 1/log<sub>2</sub>(''q''). Its dual states that ''q'' has the complexity of log<sub>2</sub>(''q'').  
Line 25: Line 25:
An orthogonal space treats divisive ratios as equally important as multiplicative ratios, yet divisive ratios are sometimes thought to be more important. For example, 5/3 is sometimes found to be more important than 15. The skew is introduced to address that.  
An orthogonal space treats divisive ratios as equally important as multiplicative ratios, yet divisive ratios are sometimes thought to be more important. For example, 5/3 is sometimes found to be more important than 15. The skew is introduced to address that.  


Notably, adopting the standard [[Weil height]] will skew the space to 60 degrees.  
Notably, the [[Weil norm]] is equivalent to Tenney-weighting the intervals and skewing the space such that each basis element is 60 degrees from each other.  


Both the weight and the skew are represented by matrices that can be applied to the mapping. In a more general sense, the distinction may not matter, and they may be collectively called weight–skew transformation.  
Both the weight and the skew are represented by matrices that can be applied to the mapping. In a more general sense, the distinction may not matter, and they may be collectively called weight–skew transformation.  
Line 31: Line 31:
=== Order ===
=== Order ===
The order of the norm determines what is a unit step in the interval space.  
The order of the norm determines what is a unit step in the interval space.  
* The Euclidean norm a.k.a. ''L''<sup>2</sup> norm resembles real-world distances.
* The Manhattan norm, taxicab norm, a.k.a. ''L''<sup>1</sup> norm resembles movement of taxicabs in Manhattan – it can only traverse horizontally or vertically, so diagonal movement counts as two steps.
* The Chebyshevian norm a.k.a. ''L''<sup>inf</sup> norm is the opposite of the Manhattan norm – it is the maximum number of steps along any axis, so a diagonal movement is the same as a horizontal or vertical one.


The Euclidean norm aka ''L''<sup>2</sup> norm resembles real-world distances.  
Note that the dual norm of ''L''<sup>1</sup> is ''L''<sup>inf</sup>, and vice versa. Thus, the ''L''<sup>1</sup> norm on the interval space corresponds to the ''L''<sup>inf</sup> tuning space, and the ''L''<sup>inf</sup> norm corresponds to the ''L''<sup>1</sup> tuning space. The dual of ''L''<sup>2</sup> norm is itself, so the Euclidean norm corresponds to Euclidean tuning as one may expect.  


The Manhattan norm or taxicab norm a.k.a. ''L''<sup>1</sup> norm resembles movement of taxicabs in Manhattan – it can only traverse horizontally or vertically. A diagonal movement counts as two steps.
Technically, harmony works like taxicabs, as is modeled by [[James Tenney]]'s harmonic distance, or [[Tenney norm]], so it is often believed that optimization with the Manhattan norm should result in the best tuning and that Euclidean norms are only used because of ease of computation ([[D&D's guide]] has notably taken this stance). However, Euclidean and especially Chebyshevian norms may correspond to more efficient use of optimizational resource, as they take account of how many generator steps each formal prime is mapped to in the temperament.  
 
The Chebyshevian norm a.k.a. ''L''<sup>inf</sup> norm is the opposite of the Manhattan norm – it is the maximum number of steps along any axis, so a diagonal movement is the same as a horizontal or vertical one.
 
Note that the dual norm of ''L''<sup>1</sup> is ''L''<sup>inf</sup>, and vice versa. Thus, the Manhattan norm corresponds to the ''L''<sup>inf</sup> tuning space, and the Chebyshevian norm corresponds to the ''L''<sup>1</sup> tuning space. The dual of ''L''<sup>2</sup> norm is itself, so the Euclidean norm corresponds to Euclidean tuning as one may expect.


== Enforcement ==
== Enforcement ==
Line 44: Line 43:


=== Destretch ===
=== Destretch ===
Destretch is a postprocess to enforce a pure interval. The result is no longer optimal measured by the original norm, but it often works as a quick approximation to more sophisticated tunings. The most common destretched tuning is [[POTE tuning]], which approximates [[CTWE tuning]].  
Destretch is a postprocess to enforce a pure interval. The result is no longer optimal measured by the original norm, but it often works as a quick approximation to more sophisticated tunings. The most common destretched tuning is [[POTE tuning]], which approximates [[CWE tuning]].  


=== Constraint ===
=== Constraint ===
Line 50: Line 49:


== General formulation ==
== General formulation ==
In general, the temperament optimization problem (except for the destretch) can be defined as follows. Given a temperament mapping ''V'' and the [[just tuning map]] ''J'', we specify a weight–skew transformation, represented by transformation matrix ''X'', and a ''q''-norm. An optional unit eigenmonzo list ''M''<sub>''I''</sub> can be added. The goal is to find the generator list ''G'' by
In general, the temperament optimization problem (except for the destretch) can be defined as follows. Given a temperament mapping matrix ''V'' and the [[just tuning map]] ''J'', we specify a weight–skew transformation matrix ''X'', a ''q''-norm, and optionally a unit eigenmonzo list ''M''. Let ''G'' denote the generator tuning map, we want to


Minimize
$$
 
\begin{align}
<math>\displaystyle \lVert GV_X - J_X \rVert_q </math>
& \text{find} && G \\
 
& \text{that minimizes} && \lVert GV_X - J_X \rVert_q \\
subject to
& \text{subject to} && (GV - J)M = O
 
\end{align}
<math>\displaystyle (GV - J)M_I = O </math>
$$


where (·)<sub>''X''</sub> denotes the variable in the weight–skew transformed space, found by
where (·)<sub>''X''</sub> denotes the variable in the weight–skew transformed space, found by


<math>\displaystyle
$$
\begin{align}
\begin{align}
V_X &= VX \\
V_X &= VX \\
J_X &= JX
J_X &= JX
\end{align}
\end{align}
</math>
$$


== Common tunings ==
== Common tunings ==
Line 75: Line 74:
|+Table of common tunings
|+Table of common tunings
|-
|-
! Weight–Skew\Order !! Chebyshevian<br>(''L''<sup>1</sup> tuning) !! Euclidean<br>(''L''<sup>2</sup> tuning) !! Manhattan<br>(''L''<sup>inf</sup> tuning)
! Weight–skew\order !! Chebyshevian<br>(''L''<sup>1</sup> tuning) !! Euclidean<br>(''L''<sup>2</sup> tuning) !! Manhattan<br>(''L''<sup>inf</sup> tuning)
|-
|-
| Tenney<br>Tenney-Weil || TC tuning<br><br> || [[TE tuning]]<br>[[TWE tuning]] || [[TOP tuning]]<br><br>
| Tenney<br>Weil || TC tuning<br><br> || [[TE tuning]]<br>[[WE tuning]] || [[TOP tuning]]<br><br>
|-
|-
| Equilateral<br>Equilateral-Weil || EC tuning<br><br> || [[Frobenius tuning]]<br>EWE tuning || EOP tuning<br><br>
| Equilateral<br>Skewed-equilateral || EC tuning<br><br> || [[Frobenius tuning]]<br><abbr title="Skewed-equilateral-Euclidean">SEE</abbr> tuning || EOP tuning<br><br>
|-
|-
| Benedetti/Wilson<br>Benedetti/Wilson-Weil || BC tuning<br><br> || [[BE tuning]]<br>BWE tuning || [[BOP tuning]]<br><br>
| Benedetti/Wilson<br>Skewed-Benedetti/Wilson || BC tuning<br><br> || [[BE tuning]]<br><abbr title="Skewed-Benedetti-Euclidean">SBE</abbr> tuning || [[BOP tuning]]<br><br>
|}
|}


Each has a constrained and/or destretched variant. E.g. for TE tuning there is [[CTE tuning]], and for TWE tuning there is [[CTWE tuning]].
Each has a constrained and/or destretched variant. E.g. for TE tuning there is [[CTE tuning]], and for WE tuning there is [[CWE tuning]].
 
: '''Note''': in [https://sintel.pythonanywhere.com/ Sintel's temperament calculator], Frobenius tuning is known as ''E tuning'', and CEE tuning is known as ''CE tuning''.


== See also ==
== See also ==
* [[Generator embedding optimization]] – more information on RTT optimization techniques that follow the above concepts but give exact solutions in the form of non-JI prime-count vectors with non-integer entries (e.g. including roots)
* [[:File:MiddlePath2015.pdf|''A Middle Path between Just Intonation and the Equal Temperaments – Part 1'']] ("middle path") by [[Paul Erlich]]
* [[:File:MiddlePath2015.pdf|''A Middle Path between Just Intonation and the Equal Temperaments – Part 1'']] ("middle path") by [[Paul Erlich]]