Module:Ups and downs notation: Difference between revisions
CompactStar (talk | contribs) No edit summary |
CompactStar (talk | contribs) No edit summary |
||
| Line 33: | Line 33: | ||
-- } | -- } | ||
function p.get_note_names_table(et, fifth | function p.get_note_names_table(et, fifth) | ||
local note_names = {} | local note_names = {} | ||
for i = 0,et.size do | for i = 0,et.size do | ||
| Line 47: | Line 47: | ||
chroma = et.size - chroma | chroma = et.size - chroma | ||
end | end | ||
| Line 86: | Line 85: | ||
local last_major_names = note_names[last_major_note] | local last_major_names = note_names[last_major_note] | ||
for j = 1,(#last_major_names) do | for j = 1,(#last_major_names) do | ||
table.insert(note_names[i], string.rep("^", num_ups) .. last_major_names[j] .. string.rep("#", num_sharps)) | |||
end | end | ||
end | end | ||
| Line 110: | Line 105: | ||
last_major_names = note_names[last_major_note] | last_major_names = note_names[last_major_note] | ||
for j = 1,(#last_major_names) do | for j = 1,(#last_major_names) do | ||
table.insert(note_names[i], string.rep("v", num_downs) .. last_major_names[j] .. string.rep("b", num_flats)) | |||
end | end | ||
end | end | ||
| Line 126: | Line 117: | ||
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], ",") | |||
return table.concat(p.get_note_names_table(et, fifth | |||
end | end | ||
return p | return p | ||