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

ArrowHead294 (talk | contribs)
mNo edit summary
ArrowHead294 (talk | contribs)
mNo edit summary
Line 215: Line 215:
local title = frame.args["title"]
local title = frame.args["title"]
local header = string.lower(frame.args["header"]:gsub("%s+", ""))
local header = string.lower(frame.args["header"]:gsub("%s+", ""))
local apx = string.lower(frame.args["apx"]:gsub("%s+", ""))
local tag
local tag
local apx = string.lower(frame.args["apx"]:gsub("%s+", ""))
if not utils.value_provided (title) then
if not utils.value_provided(apx) then
apx = "direct"
end
if not utils.value_provided(title) then
title = string.format("%d-odd-limit intervals in " .. steps .. "edo", limit)
title = string.format("%d-odd-limit intervals in " .. steps .. "edo", limit)
end
end
Line 229: Line 233:
apx = "val"
apx = "val"
end
end
out_str = "The following " .. string.gsub("table show", "()", {[((apx == "direct" or apx == "val") and {11} or {6})[1]] = "s"}) .. " how [[" .. limit .. "-odd-limit]] intervals are represented in " .. steps .. "edo. Prime harmonics are in '''bold'''"
out_str = "The following "
.. string.gsub("table show", "()", {[((apx == "direct" or apx == "val") and {11} or {6})[1]] = "s"})
.. " how [[" .. limit .. "-odd-limit]] intervals are represented in "
.. steps .. "edo. Prime harmonics are in '''bold'''"
.. ((constcy >= limit) and {".\n\nAs " .. steps .. "edo is consistent in the " .. limit .. "-odd-limit, the mappings by direct approximation and through the patent val are identical."} or {"; inconsistent intervals are in ''italics''."})[1]
.. "\n\n"
if constcy >= limit then
if constcy >= limit then
out_str = out_str .. ".\n\nAs " .. steps .. "edo is consistent in the " .. limit .. "-odd-limit, the mappings by direct approximation and through the patent val are identical."
tag = "none"
tag = "none"
else
out_str = out_str .. "; inconsistent intervals are in ''italics''."
end
end
out_str = out_str .. "\n\n"
if note ~= "" then
if note ~= "" then
out_str = out_str .. note .. "\n\n"
out_str = out_str .. 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"
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"
end
end
else
else
Line 248: Line 253:
end
end
if utils.value_provided (apx) then
out_str = out_str .. (utils.value_provided(apx) or {approx(steps, subgroup, monzo_list, title, tag, apx)} or {approx(steps, subgroup, monzo_list, title, tag, "direct") .. "\n\n" .. approx(steps, subgroup, monzo_list, title, tag, "val")})[1]
out_str = out_str .. approx(steps, subgroup, monzo_list, title, tag, apx)
else
out_str = out_str .. approx(steps, subgroup, monzo_list, title, tag, "direct") .. "\n\n" .. approx(steps, subgroup, monzo_list, title, tag, "val")
end
return out_str
return out_str
end
end


return p;
return p