Module:JI ratios: Difference between revisions
No edit summary |
No edit summary |
||
| Line 7: | Line 7: | ||
-- TODO: | -- TODO: | ||
-- Template for handling multiple entry of JI ratios into a template, and for | -- Template for handling multiple entry of JI ratios into a template, and for | ||
| Line 231: | Line 229: | ||
for j = i, #products do | for j = i, #products do | ||
local numerator = products[j] | local numerator = products[j] | ||
local gcd = utils._gcd(numerator, denominator) | local gcd = utils._gcd(numerator, denominator) | ||
local ratio = { numerator / gcd, denominator / gcd } | local ratio = { numerator / gcd, denominator / gcd } | ||
local | local ratio_added_alraedy = false | ||
for k = 1, #ratios do | for k = 1, #ratios do | ||
ratio_added_alraedy = ratios[k][1] == ratio[1] and ratios[k][2] == ratio[2] | |||
if | if ratio_added_alraedy then | ||
break | break | ||
end | end | ||
end | end | ||
if not | if not ratio_added_alraedy and p.ratio_within_search(ratio, equave, fine_search_args) then | ||
table.insert(ratios, ratio) | |||
end | end | ||
end | end | ||
| Line 458: | Line 450: | ||
local equave = rat.new(2,1) | local equave = rat.new(2,1) | ||
local fine_search_args = p.parse_search_args("Subgroup: 2.5.9.21; Int Limit: 30; Complements Only: 1; Tenney Height: 100000000") | |||
return p.ratios_as_string(p.search_by_args_within_equave(equave, fine_search_args)) | |||
--return p.ratio_within_search({16,13}, equave, fine_search_args) and p.ratio_within_search({8,13}, equave, fine_search_args) | --return p.ratio_within_search({16,13}, equave, fine_search_args) and p.ratio_within_search({8,13}, equave, fine_search_args) | ||
end | end | ||
return p | return p | ||