Constrained tuning: Difference between revisions
→Simple Fast Algorithm: subgroup CTE |
→Simple Fast Algorithm: sensi -> meantone |
||
| Line 185: | Line 185: | ||
== Simple Fast Algorithm == | == Simple Fast Algorithm == | ||
A much simpler way to compute the CTE tuning is just to note that it's what we get if we modify the TE tuning so that the weighting of the 2's coefficient is very large. As the weighting goes to infinity, we get the CTE tuning. Thus, we can set it to some sufficiently large number, so that we get whatever numerical precision we want, and compute the result in closed-form using the pseudoinverse. The | A much simpler way to compute the CTE tuning is just to note that it's what we get if we modify the TE tuning so that the weighting of the 2's coefficient is very large. As the weighting goes to infinity, we get the CTE tuning. Thus, we can set it to some sufficiently large number, so that we get whatever numerical precision we want, and compute the result in closed-form using the pseudoinverse. The calculation is only about five lines of python code: | ||
import numpy as np | import numpy as np | ||
def modified_TE(limit, M, H= | def modified_TE(limit, M, H=1000000): | ||
""" | """ | ||
Computes the | Computes the interpolated TE/CTE tuning of a *full-limit* temperament given | ||
a limit and mapping matrix | a limit and mapping matrix M. For H = 0 we have TE, and as H -> inf we have | ||
CTE. To compute CTE to arbitrary precision, make H sufficiently large. | |||
For subgroup temperaments, first compute the tuning of the full-limit | |||
temperament with same kernel, then multiply by the subgroup basis matrix. | |||
""" | """ | ||
# Compute adjusted TE weighting matrix and JIP | # Compute adjusted TE weighting matrix and JIP | ||
| Line 212: | Line 209: | ||
return G, T | return G, T | ||
# %% Compute the CTE of | # %% Compute the CTE of septimal meantone temperament | ||
H = | H = 1000000 | ||
limit = np.array([2, 3, 5, 7]) | limit = np.array([2, 3, 5, 7]) | ||
M = np.array( # mapping matrix for | M = np.array( # mapping matrix for meantone | ||
[[1, | [[1, 0, -4, -13], | ||
[0, | [0, 1, 4, 10]] | ||
) | ) | ||
| Line 224: | Line 221: | ||
print("Generator map: " + str(G)) | print("Generator map: " + str(G)) | ||
print("Tuning map: " + str(T)) | print("Tuning map: " + str(T)) | ||
The output to the above is: | |||
Generator map: [ 1200.0000 1896.9521] | |||
Tuning map: [ 1200.0000 1896.9521 2787.8086 3369.5214] | |||
== CTE tuning vs POTE tuning CWE tuning vs CTWE tuning == | == CTE tuning vs POTE tuning CWE tuning vs CTWE tuning == | ||