Module:Chord edo approximation: Difference between revisions
No edit summary Tag: Manual revert |
No edit summary |
||
| Line 7: | Line 7: | ||
-- ===== CONFIGURATION VARIABLES ===== | -- ===== CONFIGURATION VARIABLES ===== | ||
local DEFAULT_ERROR_BASE = | local DEFAULT_ERROR_BASE = 10 -- Constant tolerance offset (%) | ||
local | local DEFAULT_ERROR_QUADRATIC = 2.5 -- Multiplier on n·(n+1), where n = number of intervals | ||
local DEFAULT_MIN_EDO = 5 | local DEFAULT_MIN_EDO = 5 | ||
local DEFAULT_MAX_EDO = 60 | local DEFAULT_MAX_EDO = 60 | ||
| Line 99: | Line 99: | ||
end | end | ||
if not max_total_error then | |||
local n = #notes - 1 | |||
max_total_error = DEFAULT_ERROR_QUADRATIC * n * (n + 1) + DEFAULT_ERROR_BASE | |||
end | |||
local root = notes[1] | local root = notes[1] | ||