Module:JI ratios in ED: Difference between revisions

Ganaram inukshuk (talk | contribs)
m Bugfixed tolerance, which should be +/- 1/4th of an edstep
Ganaram inukshuk (talk | contribs)
m Bugfixing edo-vs-arbitrary-ed logic
Line 63: Line 63:


function p.parse_equave(unparsed)
function p.parse_equave(unparsed)
local unparsed = unparsed or "12ed11/8"
local unparsed = unparsed or "7ed2/1"
local equave_unparsed = ""
local equave_unparsed = ""
Line 81: Line 81:
function p.ji_ratios_in_ed_frame(frame)
function p.ji_ratios_in_ed_frame(frame)
local ed = tonumber(p.parse_ed(frame.args["EDO"])) or p.parse_ed(frame.args["ED"]) or 12
local ed = tonumber(p.parse_ed(frame.args["EDO"])) or 12
local equave = p.parse_equave(frame.args["EDO"]) or p.parse_ed(frame.args["ED"]) or rat.new(2,1)
if string.len(frame.args["ED"]) > 0 then
ed = p.parse_ed(frame.args["ED"])
end
 
local equave = p.parse_ed(frame.args["ED"])
if string.len(frame.args["ED"]) > 0 then
rat.new(2,1)
end
local primes = { 3, 5, 7, 11, 13 }
local primes = { 3, 5, 7, 11, 13 }