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 | local result | ||
if header ~= "none" then | if header ~= "none" then | ||
if constcy >= limit then | if constcy >= limit then | ||
apx = "val" | apx = "val" | ||
end | end | ||
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 | ||
result = result .. note .. "\n\n" | |||
end | end | ||
if steps == 12 then | if steps == 12 then | ||
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+", "")) | ||
result = "" | |||
end | end | ||
if utils.value_provided(apx) then | if utils.value_provided(apx) then | ||
result = result .. approx(steps, subgroup, monzo_list, title, tag, apx) | |||
else | else | ||
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>" .. | |||
return frame:preprocess(debugg == true and "<pre>" .. result .. "</pre>" or result) | |||
end | end | ||
return p | return p | ||