Module:Ups and downs notation: Difference between revisions

CompactStar (talk | contribs)
No edit summary
CompactStar (talk | contribs)
No edit summary
Line 85: 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))
if num_ups >= 3 then
table.insert(note_names[i], "^<sup>" .. num_ups .. "</sup>" .. last_major_names[j] .. string.rep("#", num_sharps))
else
table.insert(note_names[i], string.rep("^", num_ups) .. last_major_names[j] .. string.rep("#", num_sharps))
end
end
end
end
end
Line 105: Line 109:
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))
if num_downs >= 3 then
table.insert(note_names[i], "v<sup>" .. num_downs .. "</sup>" .. last_major_names[j] .. string.rep("b", num_flats))
else
table.insert(note_names[i], string.rep("v", num_downs) .. last_major_names[j] .. string.rep("b", num_flats))
end
end
end
end
end
end
end
-- -- Remove duplicate note names
-- for i = 0,et.size-1 do
-- temp = note_names[i]
-- note_names[i] = {}
-- hash = {}
-- for _,v in ipairs(temp) do
-- if (not hash[v]) then
-- table.insert(note_names[i], v)
-- hash[v] = true
-- end
-- end
-- end
return note_names
return note_names