Module:Q-odd-limit intervals: Difference between revisions

ArrowHead294 (talk | contribs)
mNo edit summary
ArrowHead294 (talk | contribs)
mNo edit summary
Line 241: Line 241:
local subgroup = table_filter(PRIME_LIST, limit)
local subgroup = table_filter(PRIME_LIST, limit)
local monzo_list = odd_limit_monzo_list_gen(limit)
local monzo_list = odd_limit_monzo_list_gen(limit)
local out_str
local result
if header ~= "none" then
if header ~= "none" then
if constcy >= limit then
if constcy >= limit then
apx = "val"
apx = "val"
end
end
out_str = string.format("The following %s how [[%d-odd-limit]] intervals are represented in %dedo. ",
result = string.format("The following %s how [[%d-odd-limit]] intervals are represented in %dedo. ",
string.gsub("table show", "()", {[((apx == "direct" or apx == "val") and 11 or 6)] = "s"}), limit, steps)
string.gsub("table show", "()", {[((apx == "direct" or apx == "val") and 11 or 6)] = "s"}), limit, steps)
.. "Prime harmonics are in '''bold'''"
.. "Prime harmonics are in '''bold'''"
Line 257: Line 257:
end
end
if note ~= "" then
if note ~= "" then
out_str = out_str .. note .. "\n\n"
result = result .. note .. "\n\n"
end
end
if steps == 12 then
if steps == 12 then
out_str = out_str .. "Note that, since the [[cent]] was defined in terms of 12edo, the absolute and relative errors for 12edo are identical.\n\n"
result = result .. "Note that, since the [[cent]] was defined in terms of 12edo, the absolute and relative errors for 12edo are identical.\n\n"
end
end
else
else
tag = string.lower(frame.args["tag"]:gsub("%s+", ""))
tag = string.lower(frame.args["tag"]:gsub("%s+", ""))
out_str = ""
result = ""
end
end
if utils.value_provided(apx) then
if utils.value_provided(apx) then
out_str = out_str .. approx(steps, subgroup, monzo_list, title, tag, apx)
result = result .. approx(steps, subgroup, monzo_list, title, tag, apx)
else
else
out_str = out_str .. approx(steps, subgroup, monzo_list, title, tag, "direct") .. "\n\n" .. approx(steps, subgroup, monzo_list, title, tag, "val")
result = result .. approx(steps, subgroup, monzo_list, title, tag, "direct") .. "\n\n" .. approx(steps, subgroup, monzo_list, title, tag, "val")
end
end
return frame:preprocess(debugg == true and "<pre>" .. out_str .. "</pre>" or out_str)
return frame:preprocess(debugg == true and "<pre>" .. result .. "</pre>" or result)
end
end


return p
return p