POTE tuning: Difference between revisions

m Style & request for citation
Line 21: Line 21:


== Computation ==
== Computation ==
The TE and POTE tuning for a [[mapping]] such as {{nowrap|'''A''' {{=}} [{{val| 1 0 2 -1 }}, {{val| 0 5 1 12 }}]}} (the mapping for 7-limit [[magic]], which consists of a linearly independent list of [[val]]s defining magic) can be found as follows:
The TE and POTE tuning for a [[mapping]] such as {{nowrap| ''V'' {{=}} {{mapping| 1 0 2 -1 | 0 5 1 12 }} }} (the mapping for 7-limit [[magic]], which consists of a linearly independent list of [[val]]s defining magic) can be found as follows:


# Form a matrix '''V''' from '''A''' by multiplying by the diagonal matrix which is zero off the diagonal and 1/log<sub>2</sub>''p'' on the diagonal; in other words the diagonal is {{nowrap|[1 1/log<sub>2</sub>3 1/log<sub>2</sub>5 1/log<sub>2</sub>7]}}. Another way to say this is that each val is "weighted" by dividing through by the logarithms, so that {{nowrap|'''V''' {{=}} [{{val| 1 0 2/log<sub>2</sub>5 -1/log<sub>2</sub>7 }}, {{val| 5/log<sub>2</sub>3 1/log<sub>2</sub>5 12/log<sub>2</sub>7 }}]}}
# Form a matrix ''V''<sub>''W''</sub> from ''V'' by multiplying by the diagonal matrix which is zero off the diagonal and 1/log<sub>2</sub>''p'' on the diagonal; in other words the diagonal is {{nowrap|[1 1/log<sub>2</sub>3 1/log<sub>2</sub>5 1/log<sub>2</sub>7]}}. Another way to say this is that each val is weighted by dividing through by the logarithms, so that {{nowrap| ''V''<sub>''W''</sub> {{=}} {{mapping| 1 0 2/log<sub>2</sub>5 -1/log<sub>2</sub>7 | 5/log<sub>2</sub>3 1/log<sub>2</sub>5 12/log<sub>2</sub>7 }} }}
# Find the pseudoinverse of the matrix {{nowrap|'''V'''{{+}} {{=}} '''V'''{{t}}('''VV'''{{t}}){{inv}}}}.  
# Find the pseudoinverse of the matrix {{nowrap| {{subsup|''V''|''W''|{{+}}}} {{=}} {{subsup|''V''|''W''|T}}(''V''<sub>''W''</sub>{{subsup|''V''|''W''|T}}){{inv}} }}.  
# Find the TE generators {{nowrap|'''G''' {{=}} {{val| 1 1 1 1 }}'''V'''{{+}}}}.  
# Find the TE [[generator tuning map|generator map]] {{nowrap| ''G'' {{=}} ''J''<sub>''W''</sub>{{subsup|''V''|''W''|{{+}}}} }}, where {{nowrap| ''J''<sub>''W''</sub> {{=}} {{val| 1 1 1 1 }} }}.  
# Find the TE [[tuning map]]: {{nowrap|'''T''' {{=}} '''GV'''}}.  
# Find the TE [[tuning map]] {{nowrap| ''T'' {{=}} ''GV''<sub>''W''</sub> }}.  
# Find the POTE generators {{nowrap|'''G'''{{'}} {{=}} '''G'''/'''T'''<sub>1</sub>}}; in other words '''G''' divided by the first entry of '''T'''.  
# Find the POTE generator map {{nowrap|''G''{{'}} {{=}} ''G''/''t''<sub>1</sub>}}; in other words ''G'' divided by the first entry of ''T''.  


If you carry out these operations, you should find
If you carry out these operations, you should find


* V ~ [{{val| 1 0 0.861 -0.356 }}, {{val| 0 3.155 0.431 4.274 }}]
* ''V''<sub>''W''</sub> ~ {{mapping| 1.000 0 0.861 -0.356 | 0.000 3.155 0.431 4.274 }}
* G ~ {{val| 1.000902 0.317246 }}
* ''G'' ~ {{val| 1.000902 0.317246 }}
* G{{'}} ~ {{val| 1.000000 0.316960 }}
* ''G''{{'}} ~ {{val| 1.000000 0.316960 }}


The tuning of the POTE [[generator]] corresponding to the mapping '''A''' is therefore 0.31696 octaves, or 380.352{{cent}}. Naturally, this only gives the single POTE generator in the rank two case, but the POTE tuning can still be found in this way for mappings defining higher-rank temperaments. The method can be generalized to subgroup temperaments by [[Lp tuning|POL2 tuning]], treating the formal prime represented by the first column as the [[equave]].  
The tuning of the POTE [[generator]] corresponding to the mapping ''V'' is therefore 0.31696 octaves, or 380.352 cents. Naturally, this only gives the single POTE generator in the rank-2 case, but the POTE tuning can still be found in this way for mappings defining higher-rank temperaments. The method can be generalized to subgroup temperaments, treating the formal prime represented by the first column as the [[equave]].  


=== Computer Program for TE and POTE ===
=== Computer program for TE and POTE ===
Below is a [https://www.python.org/ Python] program that takes a mapping and gives TE and POTE generators.
Below is a [https://www.python.org/ Python] script that takes a mapping and gives TE and POTE generators, using [https://scipy.org/ Scipy].  
 
Note: this program depends on [https://scipy.org/ Scipy].  


<syntaxhighlight lang="python">
<syntaxhighlight lang="python">
Line 46: Line 44:
from scipy import linalg
from scipy import linalg


def find_te (map, subgroup):
def find_te (mapping, subgroup):
     jip = np.log2 (subgroup)
     just_tuning_map = np.log2 (subgroup)
     weighter = np.diag (1/np.log2 (subgroup))
     te_weight = np.diag (1/np.log2 (subgroup))
     map = map @ weighter
     mapping = mapping @ te_weight
     jip = jip @ weighter
     just_tuning_map = just_tuning_map @ te_weight


     te_gen = linalg.lstsq (np.transpose (map), jip)[0]
     te_generators = linalg.lstsq (np.transpose (mapping), just_tuning_map)[0]
     te_map = te_gen @ map
     te_tuning_map = te_generators @ mapping
     print (1200*te_gen)
     print (1200*te_generators)
     pote_gen = te_gen/te_map[0]
     pote_generators = te_generators/te_tuning_map[0]
     print (1200*pote_gen)
     print (1200*pote_generators)


# taking 7-limit magic as an example ...
# taking 7-limit magic as an example ...
seven_limit = [2, 3, 5, 7]
seven_limit = [2, 3, 5, 7]
map_magic = [[1, 0, 2, -1], [0, 5, 1, 12]]
mapping_magic = [[1, 0, 2, -1], [0, 5, 1, 12]]


# to find TE and POTE you input
# to find TE and POTE you enter
find_te (map_magic, seven_limit)
find_te (mapping_magic, seven_limit)
</syntaxhighlight>
</syntaxhighlight>