Constrained tuning: Difference between revisions

Mike Battaglia (talk | contribs)
Mike Battaglia (talk | contribs)
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 result is only a few lines of numpy code:
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=1):
  def modified_TE(limit, M, H=1000000):
     """
     """
     Computes the modified TE/CTE tuning of a *full-limit* temperament given
     Computes the interpolated TE/CTE tuning of a *full-limit* temperament given
     a limit and mapping matrix H. To compute the TE/CTE tuning of a subgroup
     a limit and mapping matrix M. For H = 0 we have TE, and as H -> inf we have
    temperament, first get the tuning of the full-limit temperament with the
    CTE. To compute CTE to arbitrary precision, make H sufficiently large.
    same kernel, and then restrict to the subgroup in question.
   
    For subgroup temperaments, first compute the tuning of the full-limit
    This function interpolates between the regular TE and the CTE: for H = 0 we
    temperament with same kernel, then multiply by the subgroup basis matrix.
    have the TE, and as H -> infinity we have the CTE.
    To compute the CTE to any precision, set H to some sufficiently large value.
     """
     """
     # 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 Sensi temperament
  # %% Compute the CTE of septimal meantone temperament
  H = 1_000_000
  H = 1000000
  limit = np.array([2, 3, 5, 7])
  limit = np.array([2, 3, 5, 7])
  M = np.array( # mapping matrix for Sensi
  M = np.array( # mapping matrix for meantone
     [[1, -1, -1, -2],
     [[1, 0, -4, -13],
       [0,  79, 13]]
       [0, 1410]]
  )
  )
   
   
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 ==