Module:JI ratios in ED: Difference between revisions
Separated parse function into two functions (one for the ed, one for the equave) |
m Troubleshooting |
||
| Line 55: | Line 55: | ||
function p.parse_ed(unparsed) | function p.parse_ed(unparsed) | ||
local unparsed = unparsed or " | local unparsed = unparsed or "12" | ||
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 " | local unparsed = unparsed or "12ed11/8" | ||
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[" | local ed = tonumber(p.parse_ed(frame.args["EDO"])) or p.parse_ed(frame.args["ED"]) | ||
local equave = p.parse_equave(frame.args["EDO"]) or p.parse_ed(frame.args[" | local equave = p.parse_equave(frame.args["EDO"]) or p.parse_ed(frame.args["ED"]) | ||
local primes = tip.parse_entries(frame.args["Primes"], | local primes = tip.parse_entries(frame.args["Primes"], ',') or { 3, 5, 7, 11, 13, 17, 19 } | ||
local result = p.find_ratios_in_ed_by_primes(ed, primes, 99, equave) | local result = p.find_ratios_in_ed_by_primes(ed, primes, 99, equave) | ||