Module:Ups and downs notation: Difference between revisions

ArrowHead294 (talk | contribs)
mNo edit summary
ArrowHead294 (talk | contribs)
mNo edit summary
 
Line 3: Line 3:
local ET = require("Module:ET")
local ET = require("Module:ET")
local utils = require("Module:Utils")
local utils = require("Module:Utils")
local yesno = require("Module:Yesno")


-- Returns a table of note names
-- Returns a table of note names
Line 179: Line 180:
function p.ups_and_downs_note_name(frame)
function p.ups_and_downs_note_name(frame)
local et = ET.parse(frame.args["tuning"]) or ET.parse("12edo")
local et = ET.parse(frame.args["tuning"]) or ET.parse("12edo")
local debugg = yesno(frame.args["debug"])
local fifth = tonumber(frame.args["fifth"])
local fifth = tonumber(frame.args["fifth"])
local step = tonumber(frame.args["step"])
local step = tonumber(frame.args["step"])
return table.concat(p.get_note_names_table(et, fifth)[step], ", "):sub(0, -1)
local result = table.concat(p.get_note_names_table(et, fifth)[step], ", "):sub(0, -1)
if debugg == true then
result = "<syntaxhighlight lang=\"wikitext\">" .. result .. "</syntaxhighlight>"
end
return frame:preprocess(result)
end
end


return p
return p