Module:JI ratios: Difference between revisions

Ganaram inukshuk (talk | contribs)
No edit summary
Ganaram inukshuk (talk | contribs)
add todo to write filter-by-cent-range function
Line 6: Line 6:
local getArgs = require("Module:Arguments").getArgs
local getArgs = require("Module:Arguments").getArgs
p = {}
p = {}
-- TODO: write filter function for cent range


-- 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 38: Line 40:
-- - Removing ratios whose complement would exceed a max Tenney height or int limit
-- - Removing ratios whose complement would exceed a max Tenney height or int limit
function p.filter_ratios(ratios, equave, int_limit, tenney_height, complements_only)
function p.filter_ratios(ratios, equave, int_limit, tenney_height, complements_only)
--local tenney_height    = tenney_height or 1/0 -- Default Tenney height is +infinity
--local complements_only = complements_only or false -- Default is to allow ratios, regardless of whether their complement would be excluded
local filtered_ratios = {}
local filtered_ratios = {}
Line 67: Line 67:
return filtered_ratios
return filtered_ratios
end
-- Filters ratios from a table of ratios, returning an array of ratios within
-- the cent range and preserving the original table. Meant for searching for
-- multiple ranges. TODO: write
function p.filter_ratios_within_cent_range(ratios, min_cents, max_cents)
end
end