Tenney–Euclidean temperament measures: Difference between revisions
Move TE error above simple badness (for obvious reasons) |
Undo revision 203571 by VectorGraphics (talk). Readers aren't obligated to see your poor-tasted operation name Tag: Undo |
||
(19 intermediate revisions by 2 users not shown) | |||
Line 4: | Line 4: | ||
$$ \text{TE simple badness} = \text{TE complexity} \times \text{TE error} $$ | $$ \text{TE simple badness} = \text{TE complexity} \times \text{TE error} $$ | ||
There have been several minor variations in the definition of TE temperament measures, which differ from each other only in their choice of multiplicative scaling factor. | == Preliminaries == | ||
There have been several minor variations in the definition of TE temperament measures, which differ from each other only in their choice of multiplicative scaling factor. The reason these differences come up is because we are adopting different averaging methods for the entries of a multivector. | |||
To start with, we may define a norm by means of the usual {{w|norm (mathematics) #Euclidean norm|Euclidean norm}}, a.k.a. ''L''<sup>2</sup> norm or ℓ<sub>2</sub> norm. The result of this is a kind of a sum of all the entries. We can rescale this in several ways, for example by taking a {{w|root mean square}} (RMS) average of the entries. | |||
Here are the different standards for scaling that are commonly in use: | |||
# Taking the simple ''L''<sup>2</sup> norm | # Taking the simple ''L''<sup>2</sup> norm | ||
# Taking an RMS | # Taking an RMS | ||
Line 17: | Line 15: | ||
# Any of the above and also dividing by the norm of the just intonation points ([[JIP]]). | # Any of the above and also dividing by the norm of the just intonation points ([[JIP]]). | ||
Graham Breed's original definitions from his ''primerr.pdf'' paper tend to use the third definition, as do parts of his [ | As these metrics are mainly used to rank temperaments within the same [[rank]] and [[just intonation subgroup]], it does not matter much which scheme is used, because they are equivalent up to a scaling factor, so they will rank temperaments identically. As a result, it is somewhat common to equivocate between the various choices of scaling factor, and treat the entire thing as "the" Tenney–Euclidean norm, so that we are really only concerned with the results of these metrics up to that equivalence. | ||
Graham Breed's original definitions from his ''primerr.pdf'' paper tend to use the third definition, as do parts of his [https://x31eq.com/temper/ temperament finder], although other scaling and normalization methods are sometimes used as well. | |||
It is also possible to normalize the metrics to allow us to meaningfully compare temperaments across subgroups and even ranks. [[Sintel]]'s scheme in 2023 is the first attempt at this goal<ref name="sintel">Sintel. [https://github.com/Sin-tel/temper/blob/c0d5c36e3c189f64860f4aea288ff3ff3bc34982/lib_temper/temper.py "Collection of functions for dealing with regular temperaments"], Temperament Calculator.</ref>. | |||
== TE complexity == | == TE complexity == | ||
{{Todo|rework|inline=1|text=Explain without wedgies}} | |||
Given a [[wedgie]] ''M'', that is a canonically reduced ''r''-val correspondng to a temperament of rank ''r'', the norm ‖''M''‖ is a measure of the complexity of ''M''; that is, how many notes in some sort of weighted average it takes to get to intervals. For 1-vals, for instance, it is approximately equal to the number of scale steps it takes to reach an octave. | |||
Let us define the val weighting matrix ''W'' to be the {{w|diagonal matrix}} with values 1, 1/log<sub>2</sub>3, 1/log<sub>2</sub>5 … 1/log<sub>2</sub>''p'' along the diagonal. For the prime basis {{nowrap|''Q'' {{=}} {{val| 2 3 5 … ''p'' }} }}, | Let us define the val weighting matrix ''W'' to be the {{w|diagonal matrix}} with values 1, 1/log<sub>2</sub>3, 1/log<sub>2</sub>5 … 1/log<sub>2</sub>''p'' along the diagonal. For the prime basis {{nowrap|''Q'' {{=}} {{val| 2 3 5 … ''p'' }} }}, | ||
Line 30: | Line 30: | ||
$$ W = \operatorname {diag} (1/\log_2 (Q)) $$ | $$ W = \operatorname {diag} (1/\log_2 (Q)) $$ | ||
If ''V'' is the mapping matrix of a temperament, then ''V<sub>W</sub>'' {{=}} ''VW'' is the mapping matrix in the weighted space, its rows being the weighted vals ( | If ''V'' is the mapping matrix of a temperament, then ''V<sub>W</sub>'' {{=}} ''VW'' is the mapping matrix in the weighted space, its rows being the weighted vals (''v''<sub>''w''</sub>)<sub>''i''</sub>. | ||
Our first complexity measure of a temperament is given by the ''L''<sup>2</sup> norm of the Tenney-weighted wedgie ''M''<sub>''W''</sub>, which can in turn be obtained from the Tenney-weighted mapping matrix ''V''<sub>''W''</sub>. This complexity can be easily computed either from the wedgie or from the mapping matrix, using the {{w|Gramian matrix|Gramian}}: | |||
$$ \norm{ | $$ \norm{M_W}_2 = \sqrt {\det(V_W V_W^\mathsf{T})} $$ | ||
where | where det(·) denotes the determinant, and {{t}} denotes the transpose. | ||
Graham Breed and [[Gene Ward Smith]] have proposed different RMS norms. Let us denote the RMS norm of ''M'' as ‖''M''‖<sub>RMS</sub>. In Graham's paper<ref name="primerr">Graham Breed. [http://x31eq.com/temper/primerr.pdf ''Prime Based Error and Complexity Measures''], often referred to as ''primerr.pdf''.</ref>, an RMS norm is proposed as | |||
$$ \norm{ | $$ \norm{M_W}_\text{RMS} = \sqrt {\det \left( \frac {V_W V_W^\mathsf{T}}{n} \right)} = \frac {\norm{M_W}_2}{\sqrt {n^r}} $$ | ||
where ''n'' is the number of primes up to the prime limit ''p'', and ''r'' is the rank of the temperament, which equals the number of | where ''n'' is the number of primes up to the prime limit ''p'', and ''r'' is the rank of the temperament. Thus ''n''<sup>''r''</sup> is the number of permutations of ''n'' things taken ''r'' at a time with repetition, which equals the number of entries of the wedgie in its full tensor form. | ||
: '''Note''': that is the definition used by Graham Breed's temperament finder. | : '''Note''': that is the definition used by Graham Breed's temperament finder. | ||
Gene Ward Smith's RMS norm is given as | |||
$$ \norm{M_W}_\text{RMS'} = \sqrt {\frac{\det(V_W V_W^\mathsf{T})}{C(n, r)}} = \frac {\norm{M_W}_2}{\sqrt {C(n, r)}} $$ | |||
where {{nowrap|C(''n'', ''r'')}} is the number of combinations of ''n'' things taken ''r'' at a time without repetition, which equals the number of entries of the wedgie in the usual, compressed form. | |||
We may also note {{nowrap| det(''V''<sub>''W''</sub>''V''<sub>''W''</sub>{{t}}) {{=}} det(''VW''<sup>2</sup>''V''{{t}}) }}. This may be related to the [[Tenney–Euclidean metrics|TE tuning projection matrix]] ''P''<sub>''W''</sub>, which is ''V''<sub>''W''</sub>{{t}}(''V''<sub>''W''</sub>''V''<sub>''W''</sub>{{t}}){{inv}}''V''<sub>''W''</sub>, and the corresponding matrix for unweighted monzos {{nowrap|''P'' {{=}} ''V''{{t}}(''VW''<sup>2</sup>''V''{{t}}){{inv}}''V''}}. | |||
Sintel has defined a complexity measure that serves as an intermediate step for his badness metric<ref name="sintel"/>, which we will get to later. To obtain this complexity, we normalize the Tenney-weighting matrix ''W'' to ''U'' such that {{nowrap| det(''U'') {{=}} 1 }}, and then take the ''L''<sup>2</sup> norm of ''M''<sub>''U''</sub>. It can be shown that | |||
$$ U = W / \det(W)^{1/n} $$ | |||
and so the complexity is | |||
$$ \norm{M_U}_2 = \norm{M_W}_2 / \det(W)^{r/n} $$ | |||
== TE error == | == TE error == | ||
We can consider | We can consider TE error to be a weighted average of the error of each [[prime harmonic]]s in [[TE tuning]], that is, a weighted average of the [[error map]] in the tuning where it is minimized. In this regard, TE error may be expressed in any logarithmic [[interval size unit]]s such as [[cent]]s or [[octave]]s. | ||
As with complexity, we may simply define the TE error as the ''L''<sup>2</sup> norm of the weighted TE error map. If {{nowrap| ''T''<sub>''W''</sub> {{=}} ''TW'' }} is the weighted TE tuning map and {{nowrap| ''J''<sub>''W''</sub> {{=}} ''JW'' {{=}} {{val| 1 1 … 1 }} }} is the weighted just tuning map, then the TE error ''E'' is given by | |||
< | $$ | ||
\begin{align} | |||
E &= \norm{T_W - J_W}_2 \\ | |||
&= \norm{J_W(V_W^+ V_W - I) }_2 \\ | |||
&= \sqrt{J_W(V_W^+ V_W - I)(V_W^+ V_W - I)^\mathsf{T} J_W^\mathsf{T}} | |||
\end{align} | |||
$$ | |||
where <sup>+</sup> denotes the [[pseudoinverse]]. | |||
Often, it is desirable to know the average of errors instead of the sum, which corresponds to Graham Breed's definition<ref name="primerr"/>. This error figure, ''G'', can be found by | |||
$$ | |||
\begin{align} | \begin{align} | ||
G &= \norm{T_W - J_W}_\text{RMS} \\ | G &= \norm{T_W - J_W}_\text{RMS} \\ | ||
&= | &= E / \sqrt{n} | ||
\end{align} | \end{align} | ||
$$ | |||
: '''Note''': that is the definition used by Graham Breed's temperament finder. | : '''Note''': that is the definition used by Graham Breed's temperament finder. | ||
Gene Ward Smith defines the TE error as the ratio ‖''M''<sub>''W''</sub> ∧ ''J''<sub>''W''</sub>‖/‖''M''<sub>''W''</sub>‖, derived from the relationship of TE simple badness and TE complexity. See the next section. We denote this definition of TE error ''Ψ''. From {{nowrap|‖''M''<sub>''W''</sub> ∧ ''J''<sub>''W''</sub>‖/‖''M''<sub>''W''</sub>‖}} we can extract a coefficient {{nowrap| sqrt(''C''(''n'', ''r'' + 1)/''C''(''n'', ''r'')) {{=}} sqrt((''n'' − ''r'')/(''r'' + 1)) }}, which relates ''Ψ'' with ''E'' as follows: | |||
$$ \Psi = \sqrt{\frac{r + 1}{n - r}} E $$ | |||
Also, if we set the rank ''r'' to 1, we get {{nowrap| (''n'' − 1)/2 }}. It follows that dividing TE error by this value gives a constant of proportionality such that | |||
$$ \psi = \sqrt{\frac{2}{n - 1}} E $$ | |||
'' | gives another error, called the ''adjusted error'', which makes the error of a rank-''r'' temperament correspond to the errors of the edo vals which support it; so that requiring the edo val error to be less than {{nowrap|(1 + ''ε'')''ψ''}} for any positive ''ε'' results in an infinite set of vals supporting the temperament. | ||
''G'' and ''ψ'' error both have the advantage that higher-rank temperament error corresponds directly to rank-1 error, but the RMS normalization has the further advantage that in the rank-1 case, {{nowrap| ''G'' {{=}} sin ''θ'' }} octaves, where ''θ'' is the angle between ''J''<sub>''W''</sub> and the val in question. | |||
''G'' and ''ψ'' error both have the advantage that higher-rank temperament error corresponds directly to rank-1 error, but the RMS normalization has the further advantage that in the rank-1 case, {{nowrap|''G'' {{=}} sin ''θ''}}, where ''θ'' is the angle between ''J''<sub>''W''</sub> and the val in question | |||
== TE simple badness == | == TE simple badness == | ||
The '''TE simple badness''' of a temperament, which we may also call the '''relative error''' of a temperament, may be considered error relativized to the complexity of the temperament. It is error proportional to the complexity, or size, of the multival; in particular for a 1-val, it is (weighted) error compared to the size of a step. | The '''TE simple badness''' of a temperament, which we may also call the '''relative error''' of a temperament, may be considered error relativized to the complexity of the temperament. It is error proportional to the complexity, or size, of the multival; in particular for a 1-val, it is (weighted) error compared to the size of a step. | ||
In general, if ''C'' is the complexity and ''E'' is the error of a temperament, then TE simple badness ''B'' is found by | |||
$$ | $$ B = C \cdot E $$ | ||
A perhaps simpler way to view this is to start with a mapping matrix ''V''<sub>''W''</sub> and add an extra row ''J''<sub>''W''</sub> corresponding to the | Gene Ward Smith defines the simple badness of ''M'' as {{nowrap|‖''M''<sub>''W''</sub> ∧ ''J''<sub>''W''</sub>‖<sub>RMS</sub>}}. A perhaps simpler way to view this is to start with a mapping matrix ''V''<sub>''W''</sub> and add an extra row ''J''<sub>''W''</sub> corresponding to the just tuning map; we will label this matrix ''Ṽ''<sub>''W''</sub>. Then the simple badness is: | ||
$$ \norm{ | $$ \norm{ M_W \wedge J_W }_\text {RMS'} = \sqrt{\frac{\det(\tilde V_W \tilde V_W^\mathsf{T})}{C(n, r + 1)}} $$ | ||
So that we can basically view the simple badness as the TE complexity of the "pseudo-temperament" formed by adding the JIP to the mapping matrix as if it were another val. | So that we can basically view the simple badness as the TE complexity of the "pseudo-temperament" formed by adding the JIP to the mapping matrix as if it were another val. | ||
Graham Breed defines the simple badness slightly differently, again equivalent to a choice of scaling | Graham Breed defines the simple badness slightly differently, again equivalent to a choice of scaling, skipped here because it is derived from the general formula. | ||
Sintel has likewise given a simple badness as | |||
$$ \norm{ M_U \wedge J_U }_2 = \sqrt{\det(\tilde V_U \tilde V_U^\mathsf{T})} $$ | |||
where {{nowrap| ''J''<sub>''U''</sub> {{=}} ''J''<sub>''W''</sub>/det(''W'')<sup>1/''n''</sup> }} is the ''U''-weighted just tuning map. | |||
=== Reduction to the span of a comma === | === Reduction to the span of a comma === | ||
Line 107: | Line 126: | ||
This relationship also holds if TOP is used rather than TE, as the TOP damage associated with tempering out some comma ''n''/''d'' is log(''n''/''d'')/(''nd''), and if we multiply by the complexity ''nd'', we simply get log(''n''/''d'') as our result. | This relationship also holds if TOP is used rather than TE, as the TOP damage associated with tempering out some comma ''n''/''d'' is log(''n''/''d'')/(''nd''), and if we multiply by the complexity ''nd'', we simply get log(''n''/''d'') as our result. | ||
== TE logflat badness == | |||
Some consider the simple badness to be a sort of badness which | Some consider the simple badness to be a sort of badness which favors complex temperaments. The '''logflat badness''' (called ''Dirichlet coefficients'' in Sintel's scheme), is developed to address that. If we define ''B'' to be the simple badness (relative error) of a temperament, and ''C'' to be the complexity, then the logflat badness ''L'' is defined by the formula | ||
$$ L = B \cdot C^{r/(n - r)} $$ | |||
The exponent is chosen such that if we set a cutoff margin for logflat badness, there are still infinite numbers of new temperaments appearing as complexity goes up, at a lower rate which is approximately logarithmic in terms of complexity. | |||
In Graham's and Gene's derivations, | |||
$$ L = \norm{ M_W \wedge J_W } \norm{M_W}^{r/(n - r)} $$ | |||
In Sintel's derivation, | |||
$$ L = \norm{ M_U \wedge J_U } \norm{M_U}^{r/(n - r)} / \norm{J_U} $$ | |||
= \norm{ | |||
Notice the extra factor 1/‖''J''<sub>''U''</sub>‖, which is to say we divide it by the norm of the just tuning map. For comparison, Gene's derivation does not have this factor, whereas with Tenney weights, whether this factor is omitted or not has no effects on Graham's derivation since ‖''J''<sub>''W''</sub>‖<sub>RMS</sub> is unity. | |||
== Examples == | == Examples == | ||
While the different definitions yield different results, they are related to each other by a factor derived only from the rank and subgroup. A meaningful comparison of temperaments in the same rank and subgroup is provided by picking any one of them. Here, we consider septimal [[magic]] and [[meantone]], as follows. | |||
{| class="wikitable center-all left-1" | |||
|+ style="font-size: 105%;" | ''L''<sup>2</sup> norm | |||
{| class="wikitable center-all" | |- | ||
|+ style="font-size: 105%;" | | ! Temperament | ||
! Complexity | |||
! Error (¢) | |||
! Simple badness | |||
|- | |||
| Septimal meantone | |||
| 5.400 | |||
| 2.763 | |||
| 12.435×10<sup>−3</sup> | |||
|- | |||
| Septimal magic | |||
| 7.195 | |||
| 2.149 | |||
| 12.882×10<sup>−3</sup> | |||
|} | |||
{| class="wikitable center-all left-1" | |||
|+ style="font-size: 105%;" | Breed's RMS norm | |||
|- | |||
! Temperament | |||
! Complexity | |||
! Error (¢) | |||
! Simple badness | |||
|- | |- | ||
| Septimal meantone | |||
| 1.350 | |||
| 1.382 | |||
| 1.554×10<sup>−3</sup> | |||
|- | |- | ||
| Septimal magic | |||
| | | 1.799 | ||
| | | 1.074 | ||
| | | 1.610×10<sup>−3</sup> | ||
|} | |||
{| class="wikitable center-all left-1" | |||
|+ style="font-size: 105%;" | Smith's RMS norm | |||
|- | |- | ||
! | ! Temperament | ||
! Complexity | |||
! Error (¢) | |||
! Simple badness | |||
|- | |- | ||
| Septimal meantone | |||
| | | 2.204 | ||
| | | 3.384 | ||
| 6. | | 6.218×10<sup>−3</sup> | ||
|- | |||
| Septimal magic | |||
| 2.937 | |||
| 2.631 | |||
| 6.441×10<sup>−3</sup> | |||
|} | |} | ||
<references /> | |||
== See also == | |||
* [[Cangwu badness]] – a derived badness measure with a free parameter that enables one to specify a tradeoff between complexity and error | |||
== Notes == | |||
<references/> | |||
[[Category:Regular temperament theory]] | [[Category:Regular temperament theory]] |