Module:ET: Difference between revisions

ArrowHead294 (talk | contribs)
No edit summary
ArrowHead294 (talk | contribs)
Revert for now, since things seems to be breaking
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("^(%d+|π|ϕ|n)([Ee][Dd](.+))$")
local size, suffix, equave = unparsed:match("^(%d+)([Ee][Dd](.+))$")
if equave == nil then
if equave == nil then
return nil
return nil
end
end
suffix = suffix:lower()
suffix = suffix:lower()
if size == "π" then
size = tonumber(size)
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 151: Line 143:
local markers = {}
local markers = {}
if zeta_peak then
if zeta_peak then
table.insert(markers, "[[The Riemann zeta function and tuning #Peak EDOs|Zeta peak]]")
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|Zeta peak?]]")
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|Zeta peak integer]]")
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|Zeta peak integer?]]")
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|Zeta integral]]")
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|Zeta integral?]]")
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|Zeta gap]]")
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|Zeta gap?]]")
table.insert(markers, "[[The Riemann zeta function and tuning #Zeta Gap EDOs|zeta gap?]]")
end
end