Module:JI ratios: Difference between revisions
Cleanup unused functions |
m Change order of params so equave is first |
||
| Line 44: | Line 44: | ||
-- Int limit is hardcoded to a max size to restrict the size of output, to avoid | -- Int limit is hardcoded to a max size to restrict the size of output, to avoid | ||
-- risk of out-of-memory operations or the like. | -- risk of out-of-memory operations or the like. | ||
function p.search_by_int_limit_within_equave(int_limit | function p.search_by_int_limit_within_equave(equave, int_limit, tenney_height) | ||
local int_limit = int_limit or DEFAULT_INT_LIMIT | local int_limit = int_limit or DEFAULT_INT_LIMIT | ||
local equave = equave or rat.new(2,1) -- Defualt equave is 2/1. | local equave = equave or rat.new(2,1) -- Defualt equave is 2/1. | ||
| Line 101: | Line 101: | ||
-- Note that members in a subgroup need not be prime, as long as the terms are, | -- Note that members in a subgroup need not be prime, as long as the terms are, | ||
-- for the most part, relatively prime. | -- for the most part, relatively prime. | ||
function p.search_by_subgroup_within_equave(subgroup, int_limit | function p.search_by_subgroup_within_equave(equave, subgroup, int_limit, tenney_height) | ||
local subgroup = subgroup or { 2, 3, 7 } | local subgroup = subgroup or { 2, 3, 7 } | ||
local int_limit = int_limit or 50 | local int_limit = int_limit or 50 | ||
| Line 188: | Line 188: | ||
-- Like subgroup search, prime limit search can also allow for very high int | -- Like subgroup search, prime limit search can also allow for very high int | ||
-- limits, as long as the prime is reasonably small. | -- limits, as long as the prime is reasonably small. | ||
function p.search_by_prime_limit_within_equave(prime_limit, int_limit | function p.search_by_prime_limit_within_equave(equave, prime_limit, int_limit, tenney_height) | ||
local prime_limit = 3 | local prime_limit = 3 | ||
local int_limit = int_limit or 1000 | local int_limit = int_limit or 1000 | ||
| Line 227: | Line 227: | ||
local ratios = {} | local ratios = {} | ||
if params["Int Limit"] ~= nil then | if params["Int Limit"] ~= nil then | ||
ratios = p.search_by_int_limit_within_equave(params["Int Limit"] | ratios = p.search_by_int_limit_within_equave(equave, params["Int Limit"], params["Tenney Height"]) | ||
end | end | ||
return ratios | return ratios | ||