Module:Lumatone mapping intro: Difference between revisions

ArrowHead294 (talk | contribs)
mNo edit summary
ArrowHead294 (talk | contribs)
mNo edit summary
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
local p = {}
local p = {}
local ET = require("Module:ET")
local ET = require("Module:ET")
local rat = require("Module:Rational")
local gcd = require("Module:Utils")._gcd
local gcd = require("Module:Utils")._gcd
local rat = require("Module:Rational")
local yesno = require("Module:Yesno")
local yesno = require("Module:Yesno")


Line 8: Line 8:
local tuning = frame.args["edo"]
local tuning = frame.args["edo"]
local et = ET.parse(tuning) or ET.parse(tuning .. "edo") or ET.parse("12edo")
local et = ET.parse(tuning) or ET.parse(tuning .. "edo") or ET.parse("12edo")
local debug_mode = yesno(frame.args["debug"])
local debugg = yesno(frame.args["debug"])
local octave = ET.approximate(et, 2)
local octave = ET.approximate(et, 2)
Line 25: Line 25:
if rings > 1 then
if rings > 1 then
-- If the EDO has multiple rings of fifths
-- If the EDO has multiple rings of fifths
result = result .. string.format(" However, since it has %d mutually-exclusive rings of fifths, ", rings)
result = result .. string.format(" However, it has %d mutually-exclusive rings of fifths, ", rings)
.. "the [[Standard Lumatone mapping for Pythagorean]] is not one of them."
.. "so the [[Standard Lumatone mapping for Pythagorean]] is not one of them."
if ET.is_highly_composite(et) then
if ET.is_highly_composite(et) then
-- If the EDO has multiple rings of fifths and is highly composite (multiples of 12 especially)
-- If the EDO has multiple rings of fifths and is highly composite (multiples of 12 especially)
result = result .. " Additionally, since it is [[highly composite]], many other mappings will also fail to cover the whole gamut."
result = result .. " Since it is [[highly composite]], many other mappings will also fail to cover the whole gamut."
end
end
elseif is_far_fifth == true then
elseif is_far_fifth == true then
Line 38: Line 38:
-- If the EDO can be generated entirely by fifths
-- If the EDO can be generated entirely by fifths
result = result .. " Only one, however, agrees with the [[Standard Lumatone mapping for Pythagorean]]."
result = result .. " Only one, however, agrees with the [[Standard Lumatone mapping for Pythagorean]]."
else
result = nil
end
end
return frame:preprocess(debug_mode == true and "<pre>" .. result .. "</pre>" or result)
-- Debugger option
if debugg == true then
result = "<syntaxhighlight lang=\"wikitext\">" .. result .. "</syntaxhighlight>"
end
return frame:preprocess(result)
end
end


return p
return p