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, sharp_lowers)
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
-- local sharp_flat_swap = is_mavila and (sharp_lowers == nil or sharp_lowers == "")


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
if sharp_lowers then
table.insert(note_names[i], string.rep("^", num_ups) .. last_major_names[j] .. string.rep("#", num_sharps))
table.insert(note_names[i], string.rep("^", num_ups) .. last_major_names[j] .. string.rep("b", 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 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
if sharp_lowers then
table.insert(note_names[i], string.rep("v", num_downs) .. last_major_names[j] .. string.rep("b", num_flats))
table.insert(note_names[i], string.rep("v", num_downs) .. last_major_names[j] .. string.rep("#", 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
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"])
local sharp_lowers = tonumber(frame.args["sharp_lowers"])
return table.concat(p.get_note_names_table(et, fifth)[step], ",")
return table.concat(p.get_note_names_table(et, fifth, sharp_lowers)[step], ",")
end
end


return p
return p