Godtone (talk | contribs)
My Python 3 code: IMPORTANT BUGFIX (correct et_badness's default badness parameter to *actually* use the square of the error measured in octaves, so that the default error for an `optimal_edo_sequence` is *actually* in terms of the square of the absolute error)
Godtone (talk | contribs)
m add note for readers of the code of a subtle breaking change/bugfix
Line 1,382: Line 1,382:
#  in term of absolute error (cent/octave) error, (redundantly) divided by the sum of the weightings of the intervals
#  in term of absolute error (cent/octave) error, (redundantly) divided by the sum of the weightings of the intervals
# * for edos in the 2 to 311 range (inclusive)
# * for edos in the 2 to 311 range (inclusive)
# IMPORTANT: on Jan 9 i corrected rel_err**2 * et2 to rel_err**2 * et2**2 in et_badness which optimal_edo_sequence depends on;
#            strict_optimal_edo_sequence is unaffected however.
def optimal_edo_sequence(ivs_or_edo_badness,edo_set=range(2,311+1),weighting=lambda x: iv_complexity(x),combine='avg'):
def optimal_edo_sequence(ivs_or_edo_badness,edo_set=range(2,311+1),weighting=lambda x: iv_complexity(x),combine='avg'):
et_badness_judger = ivs_or_edo_badness
et_badness_judger = ivs_or_edo_badness