Module:JI ratios in ED: Difference between revisions

Ganaram inukshuk (talk | contribs)
m Bugfixing edo-vs-arbitrary-ed logic
Ganaram inukshuk (talk | contribs)
m Simplified entry of ED
Line 55: Line 55:


function p.parse_ed(unparsed)
function p.parse_ed(unparsed)
local unparsed = unparsed or "12"
local unparsed = unparsed or "12edo"
local ed = tonumber(unparsed) or unparsed:match('(%d+)ed')
local ed = tonumber(unparsed) or unparsed:match('(%d+)ed')
Line 63: Line 63:


function p.parse_equave(unparsed)
function p.parse_equave(unparsed)
local unparsed = unparsed or "7ed2/1"
local unparsed = unparsed or "7"
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 12
local ed = p.parse_ed(frame.args["ED"])
if string.len(frame.args["ED"]) > 0 then
local equave = p.parse_equave(frame.args["ED"])
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 }
if string.len(frame.args["Primes"]) > 0 then
if string.len(frame.args["Primes"]) > 0 then