Module:JI ratios: Difference between revisions
No edit summary |
No edit summary |
||
| Line 224: | Line 224: | ||
-- Using the products produced earlier, combine them to make all possible | -- Using the products produced earlier, combine them to make all possible | ||
-- ratios from 1/1 to the equave | -- ratios from 1/1 to the equave. | ||
local ratios = {} | local ratios = {} | ||
local equave_as_float = rat.as_float(equave) | local equave_as_float = rat.as_float(equave) | ||
| Line 237: | Line 236: | ||
if p.ratio_within_search(ratio, equave, fine_search_args) then | if p.ratio_within_search(ratio, equave, fine_search_args) then | ||
table.insert(ratios, ratio) | table.insert(ratios, ratio) | ||
end | end | ||
else | |||
local factor_within_subgroup = false | |||
for i = 1, #subgroup do | |||
factor_within_subgroup = factor_within_subgroup or subgroup[i] == gcd | |||
end | |||
if not factor_within_subgroup and p.ratio_within_search(ratio, equave, fine_search_args) then | |||
table.insert(ratios, ratio) | |||
end | |||
end | |||
if numerator / denominator > rat.as_float(equave) then | |||
break | |||
end | end | ||
end | end | ||