Module:Lumatone mapping intro: Difference between revisions
ArrowHead294 (talk | contribs) mNo edit summary |
ArrowHead294 (talk | contribs) mNo edit summary |
||
| (5 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 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 | 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, | 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 .. " | 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 35: | Line 35: | ||
result = result .. " However, as both of its fifths are about as far away from just as possible, " | result = result .. " However, as both of its fifths are about as far away from just as possible, " | ||
.. "neither the sharp or the flat versions of the [[Standard Lumatone mapping for Pythagorean]] work particularly well." | .. "neither the sharp or the flat versions of the [[Standard Lumatone mapping for Pythagorean]] work particularly well." | ||
elseif octave ~= 12 then | |||
-- 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]]." | ||
end | end | ||
-- Debugger option | |||
if debugg == true then | |||
result = "<syntaxhighlight lang=\"wikitext\">" .. result .. "</syntaxhighlight>" | |||
end | |||
return frame:preprocess(result) | |||
end | end | ||
return p | return p | ||