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

ArrowHead294 (talk | contribs)
No edit summary
ArrowHead294 (talk | contribs)
No edit summary
Line 1: Line 1:
bit32 = require("bit32")
bit32 = require("bit32")
utils = require("Module:Utils")
utils = require("Module:Utils")
limits = require("Module:Limits")


local p = {}
local p = {}
Line 172: Line 173:
function p.q_odd_limit_intervals(frame)
function p.q_odd_limit_intervals(frame)
local steps = tonumber(frame.args["steps"])
local steps = tonumber(frame.args["steps"])
local limit = math.max(tonumber (frame.args["limit"]), 2)
local limit = math.max(tonumber(frame.args["limit"]), 2)
local constcy = limits.consistency_limit(steps, false, 43)
-- local prec = tonumber (frame.args['prec']) or prec_by_equal (steps)
-- local prec = tonumber (frame.args['prec']) or prec_by_equal (steps)
local note = frame.args["note"]
local note = frame.args["note"]
Line 184: Line 186:
if frame.args["header"] ~= "none" then
if frame.args["header"] ~= "none" then
out_str = out_str .. "The following table shows how [[" .. frame.args["limit"] .. "-odd-limit intervals]] are represented in " .. steps .. "edo. " ..
out_str = out_str .. "The following table shows how [[" .. frame.args["limit"] .. "-odd-limit intervals]] are represented in " .. steps .. "edo. " ..
"Octave-reduced prime harmonics are in '''bold'''; inconsistent intervals are in ''italic''.\n\n"
"Octave-reduced prime harmonics are in '''bold'''"
end
end
if constcy >= limit then
out_str = out_str .. "."
else
out_str = out_str .. "; inconsistent intervals are in ''italic''."
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"