Module:ET: Difference between revisions
ArrowHead294 (talk | contribs) m Clear TODOs |
ArrowHead294 (talk | contribs) mNo edit summary |
||
Line 42: | Line 42: | ||
-- parse a ET structure | -- parse a ET structure | ||
function p.parse(unparsed) | function p.parse(unparsed) | ||
local size, suffix, equave = unparsed:match("^( | local size, suffix, equave = unparsed:match("^(\d+)[π|ϕ|n]?([Ee][Dd](.+))$") | ||
if equave == nil then | if equave == nil then | ||
return nil | return nil | ||
end | end | ||
suffix = suffix:lower() | suffix = suffix:lower() | ||
size = tonumber(size) | if size == "π" then | ||
size = math.pi | |||
elseif size == "ϕ" then | |||
size = (1 + math.sqrt(5)) / 2 | |||
elseif size == "n" then | |||
size = math.exp(1) | |||
else | |||
size = tonumber(size) | |||
end | |||
equave = common_ratio[equave] or rat.parse(equave) | equave = common_ratio[equave] or rat.parse(equave) | ||
if size == nil or equave == nil then | if size == nil or equave == nil then | ||
Line 143: | Line 151: | ||
local markers = {} | local markers = {} | ||
if zeta_peak then | if zeta_peak then | ||
table.insert(markers, "[[The Riemann zeta function and tuning #Peak EDOs| | table.insert(markers, "[[The Riemann zeta function and tuning #Peak EDOs|Zeta peak]]") | ||
elseif zeta_peak == nil then | elseif zeta_peak == nil then | ||
table.insert(markers, "[[The Riemann zeta function and tuning #Peak EDOs| | table.insert(markers, "[[The Riemann zeta function and tuning #Peak EDOs|Zeta peak?]]") | ||
end | end | ||
if zeta_peak_integer then | if zeta_peak_integer then | ||
table.insert(markers, "[[The Riemann zeta function and tuning #Peak EDOs| | table.insert(markers, "[[The Riemann zeta function and tuning #Peak EDOs|Zeta peak integer]]") | ||
elseif zeta_peak_integer == nil then | elseif zeta_peak_integer == nil then | ||
table.insert(markers, "[[The Riemann zeta function and tuning #Peak EDOs| | table.insert(markers, "[[The Riemann zeta function and tuning #Peak EDOs|Zeta peak integer?]]") | ||
end | end | ||
if zeta_integral then | if zeta_integral then | ||
table.insert(markers, "[[The Riemann zeta function and tuning #Integral of Zeta EDOs| | table.insert(markers, "[[The Riemann zeta function and tuning #Integral of Zeta EDOs|Zeta integral]]") | ||
elseif zeta_integral == nil then | elseif zeta_integral == nil then | ||
table.insert(markers, "[[The Riemann zeta function and tuning #Integral of Zeta EDOs| | table.insert(markers, "[[The Riemann zeta function and tuning #Integral of Zeta EDOs|Zeta integral?]]") | ||
end | end | ||
if zeta_gap then | if zeta_gap then | ||
table.insert(markers, "[[The Riemann zeta function and tuning #Zeta Gap EDOs| | table.insert(markers, "[[The Riemann zeta function and tuning #Zeta Gap EDOs|Zeta gap]]") | ||
elseif zeta_gap == nil then | elseif zeta_gap == nil then | ||
table.insert(markers, "[[The Riemann zeta function and tuning #Zeta Gap EDOs| | table.insert(markers, "[[The Riemann zeta function and tuning #Zeta Gap EDOs|Zeta gap?]]") | ||
end | end | ||