Module:Ups and downs notation: Difference between revisions

CompactStar (talk | contribs)
No edit summary
CompactStar (talk | contribs)
No edit summary
Line 43: Line 43:
local fourth = et.size - fifth
local fourth = et.size - fifth
local chroma = (fifth * 7) % et.size
local chroma = (fifth * 7) % et.size
if fifth/et.size < 4/7 and sharp_lowers == nil then
local sharp_flat_swap = fifth/et.size < 4/7 and (sharp_lowers == nil or sharp_lowers == "")
chroma = -chroma
end
local major_note_idx = {
local major_note_idx = {
Line 83: Line 81:
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 sharp_flat_swap then
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 103: 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
name = string.rep("v", num_downs) .. last_major_names[j] .. string.rep("b", num_flats)
if sharp_flat_swap then
table.insert(note_names[i], name)
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