Module:Ups and downs notation: Difference between revisions

CompactStar (talk | contribs)
No edit summary
CompactStar (talk | contribs)
No edit summary
Line 66: Line 66:
     table.insert(note_names[major_note_idx[8]], "C")
     table.insert(note_names[major_note_idx[8]], "C")
-- temporary
mw.logObject(note_names)
-- Add sharp/up notes
i = 0
i = 0
local last_major_note = 0
local last_major_note = 0
Line 87: Line 91:
i = i + 1
i = i + 1
end
end
 
-- temporary
-- Add flat/down notes
mw.logObject(note_names)
i = tuning.size - 1
local last_major_note = tuning.size - 1
while i >= 0 do
if table_contains(major_note_idx, i) then
last_major_note = i
else
local num_flats = math.floor((last_major_note - i) / chroma)
local num_downs = (last_major_note -i) % chroma
local name = interval_names[last_major_note]
local j = 0
while j < num_flats do
name = name + "b"
end
j = 0
while j < num_downs do
name = "v" + name
end
table.insert(note_names[i], name)
end
i = i - 1
end
return note_names
return note_names
end
end


return p
return p