Module:Ups and downs sharpness: Difference between revisions

Tristanbay (talk | contribs)
Added Stein-Zimmerman accidental functionality
Dave Keenan (talk | contribs)
Increase width of sesquiflat now that it is Zimmermann's, not Couper's.
 
(10 intermediate revisions by 2 users not shown)
Line 39: Line 39:
local dflat_t = "  [[File:Heji4.svg|27px]]"
local dflat_t = "  [[File:Heji4.svg|27px]]"
local hsharp_t = "  [[File:HeQu1.svg|16px]]"
local hsharp_t = "  [[File:HeQu1.svg|14px]]"
local hflat_t = "  [[File:HeQd1.svg|16px]]"
local hflat_t = "  [[File:HeQd1.svg|16px]]"
local ssharp_t = "  [[File:HeQu3.svg|16px]]"
local ssharp_t = "  [[File:HeQu3.svg|22px]]"
local sflat_t = "  [[File:HeQd3.svg|16px]]"
local sflat_t = "  [[File:HeQd3.svg|30px]]"
if frame.args["sz"] == "true" and sharp % 2 == 0 then -- use SZ accidentals?
if frame.args["sz"] == "true" and sharp % 2 == 0 then -- use SZ accidentals?
use_sz = true
use_sz = true
sharp = sharp * 2
sharp = math.floor(sharp / 2)
else
else
use_sz = false
use_sz = false
Line 57: Line 57:
tab = "{{sharpness-flat1}}"
tab = "{{sharpness-flat1}}"
elseif sharp == 0 then
elseif sharp == 0 then
tab = "<div style=\"overflow-x:auto\">\n{| class=\"wikitable center-all\"\n"
tab = "<div style=\"overflow-x: auto;\">\n{| class=\"wikitable center-all\"\n"
.. "|-\n"
.. "|-\n"
.. "! Step offset\n"
.. "! Step offset\n"
Line 75: Line 75:
else
else
if edo % 12 == 0 and edo <= 300 then -- does it temper out 531441/524288?
if edo % 12 == 0 and edo <= 300 then -- does it temper out 531441/524288?
tab = "<div style=\"overflow-x:auto\">\n{| class=\"wikitable center-all\"\n"
tab = "<div style=\"overflow-x: auto;\">\n{| class=\"wikitable center-all\"\n"
.. "|-\n"
.. "|-\n"
.. "! Semitones\n"
.. "! Semitones\n"
.. "| '''0'''"
.. "| '''0'''"
for i = 1, use_sz and (use_sz and sharp * 4 or sharp * 2) + 1 do
if use_sz then
tab = tab .. (i % sharp == 0 and string.format(" || '''%s'''", math.floor(i / sharp)) or string.format(" || {{Simplified fraction|%s|%s|true}}", i, sharp))
for i = 1, sharp * 4 + 1 do
tab = tab .. (i % (sharp * 2) == 0 and string.format(" || '''%s'''", math.floor(i / sharp / 2)) or string.format(" || {{Simplified fraction|%s|%s|true}}", i, sharp * 2))
end
else
for i = 1, sharp * 2 + 1 do
tab = tab .. (i % sharp == 0 and string.format(" || '''%s'''", math.floor(i / sharp)) or string.format(" || {{Simplified fraction|%s|%s|true}}", i, sharp))
end
end
end
else
else
tab = "<div style=\"overflow-x:auto\">\n{| class=\"wikitable center-all\"\n"
tab = "<div style=\"overflow-x: auto;\">\n{| class=\"wikitable center-all\"\n"
.. "|-\n"
.. "|-\n"
.. "! Step offset\n"
.. "! Step offset\n"
.. "| '''0'''"
.. "| '''0'''"
for i = 1, use_sz and (use_sz and sharp * 4 or sharp * 2) + 1 do
if use_sz then
tab = tab .. string.format((i % sharp == 0 and " || '''%s'''" or " || %s"), i)
for i = 1, sharp * 4 + 1 do
tab = tab .. string.format((i % (sharp * 2) == 0 and " || '''%s'''" or " || %s"), i)
end
else
for i = 1, sharp * 2 + 1 do
tab = tab .. string.format((i % sharp == 0 and " || '''%s'''" or " || %s"), i)
end
end
end
end
end