Module:Infobox chord: Difference between revisions
No edit summary |
No edit summary |
||
Line 39: | Line 39: | ||
if utils.value_provided(frame.args["Harmonics"]) then | if utils.value_provided(frame.args["Harmonics"]) then | ||
local harmonics = {} | local harmonics = {} | ||
for hs in string.gmatch(frame.args["Harmonics"], "[^:]+") do | for hs in string.gmatch(frame.args["Harmonics"], "[^:]+") do | ||
debug_data = debug_data .. "hs:" .. hs .. "<br/>" | debug_data = debug_data .. "hs:" .. hs .. "<br/>" | ||
Line 46: | Line 45: | ||
errors = errors .. "<p>error: invalid harmonic " .. hs .. "</p>" | errors = errors .. "<p>error: invalid harmonic " .. hs .. "</p>" | ||
else | else | ||
harmonics | table.insert(harmonics, h) | ||
end | end | ||
end | end | ||
local root = harmonics[ | local root = harmonics[1] | ||
if root == nil and errors == "" then | if root == nil and errors == "" then | ||
errors = errors .. "<p>error: no harmonics found</p>" | errors = errors .. "<p>error: no harmonics found</p>" |