Tenney–Euclidean tuning: Difference between revisions
Motivation |
+ actually needed contents |
||
| (6 intermediate revisions by 2 users not shown) | |||
| Line 8: | Line 8: | ||
== Motivation == | == Motivation == | ||
TE tuning combines the ideas of Tenney weighting of prime limits and optimizing the root mean square (RMS) of weighted error/damage. Prime limits are a way of choosing musically useful intervals without being too specific about which intervals you think are useful. Tenney weighting is a way of giving equal treatment to intervals of equal complexity without choosing a finite set of intervals. RMS optimization (least squares) implies optimizing for the average sensory dissonance of an interval, and so allows for good consonances to balance weak dissonances and well tuned intervals to balance poorly tuned intervals. | |||
TE shares with TOP tuning the insight that adding octaves to the optimization simplifies the calculation. Allowing for scale stretch balances intervals of different sizes | TE shares with TOP tuning the insight that adding octaves to the optimization simplifies the calculation. Allowing for scale stretch balances intervals of different sizes. | ||
As an RMS measure, TE error is optimized by the least squares method, which is well known and simple and efficient to calculate. | As an RMS measure, TE error is optimized by the least squares method, which is well known and simple and efficient to calculate. | ||
TE tuning is uniquely optimized for a given prime limit. There are no free parameters determining the weighting of different intervals or the balance of wide and narrow intervals: all follow from the definition of Tenney weighting of primes. | TE tuning is uniquely optimized for a given prime limit. There are no free parameters determining the weighting of different intervals or the balance of wide and narrow intervals: all follow from the definition of Tenney weighting of primes. | ||
== Definition == | == Definition == | ||
| Line 34: | Line 34: | ||
There are a number of methods to solve least squares problems. One common way is to use the [[Moore–Penrose pseudoinverse]]. | There are a number of methods to solve least squares problems. One common way is to use the [[Moore–Penrose pseudoinverse]]. | ||
== Computation | == Computation == | ||
=== Using pseudoinverse === | |||
The Moore–Penrose pseudoinverse, denoted ''A''{{+}}, is a generalization of the inverse matrix with which it shares a lot of properties. In this method, the (not necessarily independent) TE generator map ''G'', which correspond to the rows of ''V'' are given by | The Moore–Penrose pseudoinverse, denoted ''A''{{+}}, is a generalization of the inverse matrix with which it shares a lot of properties. In this method, the (not necessarily independent) TE generator map ''G'', which correspond to the rows of ''V'' are given by | ||
| Line 46: | Line 47: | ||
We may find the same projection matrix starting from a list of weighted monzos rather than vals. If ''M''<sub>''W''</sub> is a rank-''n'' matrix whose columns are weighted monzos, and ''I'' is the ''n''×''n'' identity matrix, then {{nowrap| ''P''<sub>''W''</sub> {{=}} ''I'' − ''M''<sub>''W''</sub>{{subsup|''M''|''W''|+}} }} is the same projection matrix as {{subsup|''V''|''W''|+}}''V''<sub>''W''</sub> so long as the temperament defined by the vals is the same as the temperament defined by the monzos. Again, it is irrelevant if the monzos are independent or how many of them there are. | We may find the same projection matrix starting from a list of weighted monzos rather than vals. If ''M''<sub>''W''</sub> is a rank-''n'' matrix whose columns are weighted monzos, and ''I'' is the ''n''×''n'' identity matrix, then {{nowrap| ''P''<sub>''W''</sub> {{=}} ''I'' − ''M''<sub>''W''</sub>{{subsup|''M''|''W''|+}} }} is the same projection matrix as {{subsup|''V''|''W''|+}}''V''<sub>''W''</sub> so long as the temperament defined by the vals is the same as the temperament defined by the monzos. Again, it is irrelevant if the monzos are independent or how many of them there are. | ||
=== Computer program === | |||
Here is a minimalistic [https://www.python.org/ Python] script that takes a mapping and gives TE generators and tuning maps, using [https://scipy.org/ Scipy]. | |||
<syntaxhighlight lang="python"> | |||
import numpy as np | |||
from scipy import linalg | |||
def te (mapping, subgroup_basis): | |||
just_tuning_map = 1200*np.log2 (subgroup_basis) | |||
te_weight = np.diag (1/np.log2 (subgroup_basis)) | |||
mapping_w = mapping @ te_weight | |||
just_tuning_map_w = just_tuning_map @ te_weight | |||
te_generators = linalg.lstsq (np.transpose (mapping_w), just_tuning_map_w)[0] | |||
te_tuning_map = te_generators @ mapping | |||
return te_generators, te_tuning_map | |||
</syntaxhighlight> | |||
<syntaxhighlight lang="python"> | |||
# taking septimal magic as an example ... | |||
mapping = np.array ([[1, 0, 2, -1], [0, 5, 1, 12]]) | |||
subgroup_basis = np.array ([2, 3, 5, 7]) | |||
# to find the TE tuning you enter | |||
te (mapping, subgroup_basis) | |||
</syntaxhighlight> | |||
Output: | |||
<pre> | |||
[1201.08240941 380.695113 ] | |||
[1201.08240941, 1903.47556502, 2782.85993183, 3367.25894662] | |||
</pre> | |||
== Enforcement == | == Enforcement == | ||
| Line 51: | Line 86: | ||
{{Main| POTE tuning }} | {{Main| POTE tuning }} | ||
We may call the pure-octave Tenney−Euclidean tuning the ''POTE tuning''. If {{nowrap|''T'' {{=}} ''J''<sub>''W''</sub>{{subsup|''V''|''W''|+}}''V'' {{=}} ''GV''}} is the TE tuning map, then a corresponding pure-octaves map can be found by {{w|scalar multiplication}}, ''T''/''t''<sub>1</sub>, where ''t''<sub>1</sub>, the first entry, is the tuning of 2. | We may call the pure-octave Tenney−Euclidean tuning the ''POTE tuning''. If {{nowrap|''T'' {{=}} ''J''<sub>''W''</sub>{{subsup|''V''|''W''|+}}''V'' {{=}} ''GV''}} is the TE tuning map, then a corresponding pure-octaves map can be found by {{w|scalar multiplication}}, ''T''/''t''<sub>1</sub>, where ''t''<sub>1</sub>, the first entry, is the tuning of 2. While POTE is a very simple way to enforce a pure octave, it tends to overtemper the generators for divisive ratios and leads to less than ideal results. | ||
=== Constrained TE tuning === | === Constrained TE tuning === | ||
{{Main| Constrained tuning }} | {{Main| Constrained tuning }} | ||
Another way to enforce pure octaves is by adding the constraint before the optimization process. This is the ''CTE tuning''. The result, under the constraint of pure octaves, remains TE optimal. | Another way to enforce pure octaves is by adding the constraint before the optimization process. This is the ''CTE tuning''. The result, under the constraint of pure octaves, remains TE optimal. Contrary to POTE, CTE tends to under-optimize for divisive ratios; variations to fix this are considered under [[Constrained tuning]]. | ||
== Otherwise normed tunings == | == Otherwise normed tunings == | ||
Tenney weighting gives equal treatment to intervals of equal complexity without choosing a finite set of intervals. While this makes a lot of sense, more specific demands on the field sometimes require it to be altered one way or another. | |||
One common complaint is that it gives an undue weight to very high primes, as evidenced by the fact that you have to choose a limit to get sensible results. It does not converge as you keep adding primes. That it appears to be a limit to infinity of RMS of intervals approaching infinite complexity is psychoacoustically meaningless since the human ear cannot perceive even moderately complex intervals. To fix this, a free parameter ''s'' may be introduced such that each prime ''q'' is weighted by 1/(log<sub>2</sub>(''q''))<sup>s</sup> instead of 1/log<sub>2</sub>(''q''), and we can obtain a steeper weight curve with any {{nowrap| ''s'' > 1 }}: | |||
$$ W = \operatorname {diag} (1/(\log_2 (Q))^s) $$ | |||
Another fix is to adopt the Wilson weight in place of Tenney weight, discussed in [[#Benedetti/Wilson–Euclidean tuning]]. | |||
The other complaint, contrary to above, is that Tenney weighting gives insufficient weight to higher primes than a weight specifically considering the relevant intervals within the limit. For this, we can use the parameter ''s'' again, as any {{nowrap| ''s'' < 1 }} will give us a flatter weight curve. In particular, we can set ''s'' to 0, which removes the weight entirely and results in equal weight of all primes. This is called Frobenius tuning, discussed right below. | |||
=== Frobenius tuning and Frobenius projection matrix === | === Frobenius tuning and Frobenius projection matrix === | ||
The '''Frobenius tuning''' may be considered as the same RMS tuning but starting from nonweighted vals. This is perfectly functional but has less theoretical justification than TE tuning. However, if greater weight needs to be attached to the larger primes than TE tuning attaches, Frobenius tuning may be preferred; people who feel that larger primes require more tuning care than smaller ones may well prefer it. | |||
The weighting matrix ''W'' is given by | The weighting matrix ''W'' is given by | ||
| Line 85: | Line 130: | ||
=== Benedetti/Wilson–Euclidean tuning === | === Benedetti/Wilson–Euclidean tuning === | ||
'''Benedetti/Wilson–Euclidean tuning''' ('''BE tuning''') adopts the Benedetti or Wilson weight in place of Tenney weight, based on the dual norm of [[Wilson height]]. For {{nowrap|''Q'' {{=}} {{val| 2 3 5 … }}}}, the weighting matrix has the form | '''Benedetti/Wilson–Euclidean tuning''' ('''BE tuning''') adopts the Benedetti or Wilson weight in place of Tenney weight, based on the dual norm of [[Wilson norm]]<ref group="note">Technically, the [[Benedetti height]] is not a norm, and tunings that minimize the maximum Benedetti-weighted damage can be different from those based on the Wilson norm for certain subgroups. However, it is almost always more convenient to simply use the Wilson norm in these cases.</ref>. For {{nowrap|''Q'' {{=}} {{val| 2 3 5 … }}}}, the weighting matrix has the form | ||
$$ W = \operatorname{diag} (1/Q) $$ | $$ W = \operatorname{diag} (1/Q) $$ | ||
| Line 165: | Line 210: | ||
This sends monzos for 50/49, 64/63 etc. to the unison monzo, and vals for 10et, 12et, and 22et to themselves. | This sends monzos for 50/49, 64/63 etc. to the unison monzo, and vals for 10et, 12et, and 22et to themselves. | ||
== Notes == | |||
<references group="note"/> | |||
[[Category:Terms]] | [[Category:Terms]] | ||
[[Category:Math]] | [[Category:Math]] | ||
[[Category:Regular temperament tuning]] | [[Category:Regular temperament tuning]] | ||