POTE tuning: Difference between revisions

From Xenharmonic Wiki
Jump to navigation Jump to search
Add Python code for TE and POTE computation
General cleanup
Line 1: Line 1:
'''POTE tuning''' is the short form of '''Pure-Octaves [[Tenney-Euclidean_Tuning#Pure octaves TE tuning|Tenney-Euclidean tuning]]''', a good choice for a standard tuning enforcing a just 2/1 octave.
'''POTE tuning''' is the short form of '''Pure-Octaves [[Tenney-Euclidean_Tuning#Pure octaves TE tuning|Tenney-Euclidean tuning]]''', a good choice for a standard tuning enforcing a just 2/1 octave.


The POTE tuning for a [[mappings|map matrix]] such as M = [{{val|1 0 2 -1}}, {{val|0 5 1 12}}] (the [[map]] for 7-limit [[Magic_family|magic]], which consists of a linearly independent list of [[val|vals]] defining magic) can be found as follows:
== Computing TE and POTE ==


# Form a matrix V from M by multiplying by the diagonal matrix which is zero off the diagonal and 1/log2(p) on the diagonal; in other words the diagonal is [1 1/log2(3) 1/log2(5) 1/log2(7)]. Another way to say this is that each val is "weighted" by dividing through by the logarithms, so that V = [{{val|1 0 2/log2(5) -1/log2(7)}}, {{val|5/log2(3) 1/log2(5) 12/log2(7)}}]
The TE and POTE tuning for a [[mappings|map matrix]] such as M = [{{val|1 0 2 -1}}, {{val|0 5 1 12}}] (the [[map]] for 7-limit [[Magic_family|magic]], which consists of a linearly independent list of [[val|vals]] defining magic) can be found as follows:
# Find the matrix P = V<sup>T</sup>(VV<sup>T</sup>)<sup>-1</sup>.  
 
# Find the TE = {{val|1 1 1 1}}P.
# Form a matrix V from M 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 [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 V = [{{val|1 0 2/log2(5) -1/log2(7)}}, {{val|5/log2(3) 1/log2(5) 12/log2(7)}}]
# Find the TE octave: O<sub>TE</sub> = (TE*V)<sub>1</sub>, that is, the first entry of TE*V.  
# Find the pseudoinverse of the matrix V<sup>+</sup> = V<sup>T</sup>(VV<sup>T</sup>)<sup>-1</sup>.  
# Find the POTE = TE/O<sub>TE</sub>; in other words TE scalar divided by O<sub>TE</sub>.
# Find the TE generators '''g''' = {{val|1 1 1 1}}V<sup>+</sup>.
# Find the TE tuning map: T = '''g'''V.  
# Find the POTE generators '''g'''<nowiki/>' = '''g'''/T<sub>1</sub>; in other words '''g''' scalar 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
Line 13: Line 15:
* V ~ [{{val|1 0 0.861 -0.356}}, {{val|0 3.155 0.431 4.274}}]
* V ~ [{{val|1 0 0.861 -0.356}}, {{val|0 3.155 0.431 4.274}}]


* TE ~ {{val|1.000902 0.317246}}
* '''g''' ~ {{val|1.000902 0.317246}}


* POTE ~ {{val|1 0.3169600}}
* '''g'''<nowiki/>' ~ {{val|1.000000 0.316960}}


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 ==
=== Computer Program for TE and POTE ===


Below is a [https://www.python.org/ Python] program that takes a map and gives TE and POTE.  
Below is a [https://www.python.org/ Python] program that takes a map and gives TE and POTE generators.  


Note: this program depends on [https://scipy.org/ Scipy].  
Note: this program depends on [https://scipy.org/ Scipy].  
Line 28: Line 30:
import numpy as np
import numpy as np
from scipy import linalg
from scipy import linalg
def ratio2cent (ratio_list):
    return 1200*np.log2 (ratio_list)


def find_te (map, subgroup):
def find_te (map, subgroup):
     dimension = len (subgroup)
     dimension = len (subgroup)
     subgroup_cents = ratio2cent (subgroup)
     subgroup_octaves = np.log2 (subgroup)


     weight = np.eye (dimension)
     weight = np.eye (dimension)
Line 40: Line 39:
         weight[i][i] = 1/np.log2 (subgroup[i])
         weight[i][i] = 1/np.log2 (subgroup[i])
     map = map @ weight
     map = map @ weight
     subgroup_cents = subgroup_cents @ weight
     subgroup_octaves = subgroup_octaves @ weight


     te_gen = linalg.lstsq (np.transpose (map), subgroup_cents)[0]
     te_gen = linalg.lstsq (np.transpose (map), subgroup_octaves)[0]
     print (te_gen)
     te_map = te_gen @ map
     te_octave = (te_gen @ map)[0]
     print (1200*te_gen)
     pote_gen = te_gen*1200/te_octave
     pote_gen = te_gen/te_map[0]
     print (pote_gen)
     print (1200*pote_gen)
</pre>
</pre>


Line 63: Line 62:


[[Category:glossary]]
[[Category:glossary]]
[[Category:todo:clarify]]
[[Category:practical help]]
[[Category:tuning]]
[[Category:tuning technique]]

Revision as of 05:21, 25 June 2020

POTE tuning is the short form of Pure-Octaves Tenney-Euclidean tuning, a good choice for a standard tuning enforcing a just 2/1 octave.

Computing TE and POTE

The TE and POTE tuning for a map matrix such as M = [1 0 2 -1], 0 5 1 12]] (the map for 7-limit magic, which consists of a linearly independent list of vals defining magic) can be found as follows:

  1. Form a matrix V from M by multiplying by the diagonal matrix which is zero off the diagonal and 1/log2p on the diagonal; in other words the diagonal is [1 1/log23 1/log25 1/log27]. Another way to say this is that each val is "weighted" by dividing through by the logarithms, so that V = [1 0 2/log2(5) -1/log2(7)], 5/log2(3) 1/log2(5) 12/log2(7)]]
  2. Find the pseudoinverse of the matrix V+ = VT(VVT)-1.
  3. Find the TE generators g = 1 1 1 1]V+.
  4. Find the TE tuning map: T = gV.
  5. Find the POTE generators g' = g/T1; in other words g scalar divided by the first entry of T.

If you carry out these operations, you should find

  • V ~ [1 0 0.861 -0.356], 0 3.155 0.431 4.274]]
  • g ~ 1.000902 0.317246]
  • g' ~ 1.000000 0.316960]

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 POL2 tuning.

Computer Program for TE and POTE

Below is a Python program that takes a map and gives TE and POTE generators.

Note: this program depends on Scipy.

import numpy as np
from scipy import linalg

def find_te (map, subgroup):
    dimension = len (subgroup)
    subgroup_octaves = np.log2 (subgroup)

    weight = np.eye (dimension)
    for i in range (0, dimension):
        weight[i][i] = 1/np.log2 (subgroup[i])
    map = map @ weight
    subgroup_octaves = subgroup_octaves @ weight

    te_gen = linalg.lstsq (np.transpose (map), subgroup_octaves)[0]
    te_map = te_gen @ map
    print (1200*te_gen)
    pote_gen = te_gen/te_map[0]
    print (1200*pote_gen)

Take 7-limit magic as an example, to find TE and POTE you input:

seven_limit = [2, 3, 5, 7]
map_magic = [[1, 0, 2, -1], [0, 5, 1, 12]]
find_te (map_magic, seven_limit)

Output:

[1201.08240941  380.695113  ]
[1200.          380.35203249]