Module:Ups and downs sharpness: Difference between revisions

ArrowHead294 (talk | contribs)
mNo edit summary
Tristanbay (talk | contribs)
Added functionality to display semitones for edos 7\12 fifths
Line 58: Line 58:
tab = "{{sharpness-sharp1}}"
tab = "{{sharpness-sharp1}}"
else
else
if frame.args["edo"] % 12 == 0 then
if sharp * 12 ~= frame.args["edo"] 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 67: Line 67:
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"
.. "! Semitones\n"
.. "! Semitones\n"
.. "| '''0'''"
.. "| '''0'''"
for i = 1, sharp * 2 do
for i = 1, sharp * 2 do
tab = tab .. string.format((i % sharp == 0 and " || '''%s'''" or " || %s"), i)
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
end