Module:JI ratios: Difference between revisions

Ganaram inukshuk (talk | contribs)
No edit summary
Ganaram inukshuk (talk | contribs)
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 with non-coprime numerator and
-- ratios from 1/1 to the equave.
-- denominator, or exceed the tenney height, are omitted.
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)
else
break
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