Module:JI ratios: Difference between revisions

Ganaram inukshuk (talk | contribs)
mNo edit summary
Ganaram inukshuk (talk | contribs)
m Rename functions
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, equave, tenney_height)
function p.search_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 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(equave, params["Int Limit"], params["Tenney Height"])
ratios = p.search_within_equave(equave, params["Int Limit"], params["Tenney Height"])
end
end
return ratios
return ratios