Module:JI ratios: Difference between revisions

Ganaram inukshuk (talk | contribs)
mNo edit summary
Ganaram inukshuk (talk | contribs)
Bugfix to reflect changes to mediants module
Line 50: Line 50:
-- Int limit filter determines whether a ratio is within an int limit. Does not
-- Int limit filter determines whether a ratio is within an int limit. Does not
-- use depth.
-- use depth.
function p.int_limit_filter(mediant, depth, int_limit)
function p.int_limit_filter(mediant_data, int_limit)
local mediant = mediant_data["mediant"]
return math.max(mediant[1], mediant[2]) <= int_limit
return math.max(mediant[1], mediant[2]) <= int_limit
end
end
Line 57: Line 58:
-- height. Does not use depth.
-- height. Does not use depth.
function p.tenney_height_filter(mediant, depth, tenney_height)
function p.tenney_height_filter(mediant, depth, tenney_height)
local mediant = mediant_data["mediant"]
return math.log(mediant[1] * mediant[2]) / math.log(2) <= tenney_height
return math.log(mediant[1] * mediant[2]) / math.log(2) <= tenney_height
end
end