POTE tuning: Difference between revisions
Improvement (see talk) |
Add Python code for TE and POTE computation |
||
Line 17: | Line 17: | ||
* POTE ~ {{val|1 0.3169600}} | * POTE ~ {{val|1 0.3169600}} | ||
The tuning of the POTE [[generator]] corresponding to the mapping M is therefore 0.31696 octaves, or 380.352 cents. Naturally, this only gives the single POTE generator in the rank two case, and only when the map M is in period-generator form, 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 so long as the group contains 2 by [[Lp_tuning|POL2 tuning]]. | The tuning of the POTE [[generator]] corresponding to the mapping M is therefore 0.31696 octaves, or 380.352 cents. Naturally, this only gives the single POTE generator in the rank two case, and only when the map M is in period-generator form, 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 so long as the group contains 2 by [[Lp_tuning|POL2 tuning]]. | ||
== Program for TE and POTE == | |||
Below is a [https://www.python.org/ Python] program that takes a map and gives TE and POTE. | |||
Note: this program depends on [https://scipy.org/ Scipy]. | |||
<pre> | |||
import numpy as np | |||
from scipy import linalg | |||
def ratio2cent (ratio_list): | |||
return 1200*np.log2 (ratio_list) | |||
def find_te (map, subgroup): | |||
dimension = len (subgroup) | |||
subgroup_cents = ratio2cent (subgroup) | |||
weight = np.eye (dimension) | |||
for i in range (0, dimension): | |||
weight[i][i] = 1/np.log2 (subgroup[i]) | |||
map = map @ weight | |||
subgroup_cents = subgroup_cents @ weight | |||
te_gen = linalg.lstsq (np.transpose (map), subgroup_cents)[0] | |||
print (te_gen) | |||
te_octave = (te_gen @ map)[0] | |||
pote_gen = te_gen*1200/te_octave | |||
print (pote_gen) | |||
</pre> | |||
Take 7-limit magic as an example, to find TE and POTE you input: | |||
<pre> | |||
seven_limit = [2, 3, 5, 7] | |||
map_magic = [[1, 0, 2, -1], [0, 5, 1, 12]] | |||
find_te (map_magic, seven_limit) | |||
</pre> | |||
Output: | |||
<pre> | |||
[1201.08240941 380.695113 ] | |||
[1200. 380.35203249] | |||
</pre> | |||
[[Category:glossary]] | [[Category:glossary]] | ||
[[Category:todo:clarify]] | [[Category:todo:clarify]] |