Module:Sharpness documentation: Difference between revisions
added a less jargon-y and more musical description for 2187/2048 |
ArrowHead294 (talk | contribs) mNo edit summary |
||
| Line 3: | Line 3: | ||
function p.main(frame) | function p.main(frame) | ||
local page_name = string.lower(frame:preprocess("{{PAGENAME}}")) | local page_name = string.lower(frame:preprocess("{{PAGENAME}}")) | ||
local d, b = page_name:match("%-(%a*)(%d+)") | local d, b, c = page_name:match("%-(%a*)(%d+)(%a*)") | ||
local s = tonumber(b) | local s = tonumber(b) | ||
local sc = s * 12 | local sc = s * 12 | ||
local note = frame.args["note"] or "" | local note = frame.args["note"] or "" | ||
local notation = frame.args["notation"] | local notation = frame.args["notation"] | ||
local out_str = "This template is used " | local out_str = "This template is \"" .. c .. "\"used " | ||
if (d == "flat") then | if c == nil then | ||
c = "" | |||
end | |||
if (d == "flat" or d == "flat") then | |||
s = -s | s = -s | ||
end | end | ||
| Line 30: | Line 34: | ||
out_str = out_str .. "." | out_str = out_str .. "." | ||
if notation == "" then | if notation == "" and c == "" then | ||
if s >= 3 then | if s >= 3 then | ||
out_str = out_str .. " The symbol set is based on [[ups and downs notation]] and comprises " | out_str = out_str .. " The symbol set is based on [[ups and downs notation]] and comprises " | ||