Module:JI ratios: Difference between revisions
mNo edit summary |
Updated search-by-params to use new function; will momentarily break dependent modules |
||
| Line 269: | Line 269: | ||
-- Search for ratios based on params passed in. Each param is its own | -- Search for ratios based on params passed in. Each param is its own | ||
-- function call. Params must be parsed first. | -- function call. Params must be parsed first. | ||
function p.search_by_params(params, | function p.search_by_params(params, equave) | ||
local | local equave = equave or rat.new(2,1) | ||
-- First get ratios up to an int limit. If no int limit was passed in, it | -- First get ratios up to an int limit. If no int limit was passed in, it | ||
| Line 276: | Line 276: | ||
local ratios = {} | local ratios = {} | ||
if params["Int Limit"] ~= nil then | if params["Int Limit"] ~= nil then | ||
ratios = p. | ratios = p.search_by_int_limit_within_equave(params["Int Limit"], equave, params["Tenney Height"]) | ||
end | end | ||
return ratios | return ratios | ||
end | end | ||
| Line 296: | Line 291: | ||
if parsed["Tenney Height"] ~= nil then | if parsed["Tenney Height"] ~= nil then | ||
parsed["Tenney Height"] = tonumber(parsed["Tenney Height"]) | parsed["Tenney Height"] = tonumber(parsed["Tenney Height"]) | ||
end | end | ||
| Line 433: | Line 424: | ||
function p.tester() | function p.tester() | ||
local ratios = p. | local ratios = p.search_by_params(p.parse_search_params("Tenney Height: 10; Int Limit: 35"), rat.new(2,1)) | ||
return p.ratios_as_text(ratios) | return p.ratios_as_text(ratios) | ||