Module:Ups and downs notation: Difference between revisions

CompactStar (talk | contribs)
No edit summary
CompactStar (talk | contribs)
No edit summary
Line 35: Line 35:
function p.get_note_names_table(et)
function p.get_note_names_table(et)
local note_names = {}
local note_names = {}
local i = 0
return note_names
while i < et.size do
-- local i = 0
note_names[i] = ""
-- while i < et.size do
end
-- note_names[i] = ""
-- end
local fifth = u.round(math.log(3/2)/math.log(2) * et.size)
-- local fifth = u.round(math.log(3/2)/math.log(2) * et.size)
local fourth = u.round(math.log(4/3)/math.log(2) * et.size)
-- local fourth = u.round(math.log(4/3)/math.log(2) * et.size)
local chroma = (fifth * 7) % et.size
-- local chroma = (fifth * 7) % et.size
local major_note_idx = {
-- local major_note_idx = {
0,  
-- 0,  
(fifth * 2) % et.size,
-- (fifth * 2) % et.size,
(fifth * 4) % et.size,
-- (fifth * 4) % et.size,
fourth,
-- fourth,
fifth,
-- fifth,
(fifth * 3) % et.size,
-- (fifth * 3) % et.size,
(fifth * 5) % et.size,
-- (fifth * 5) % et.size,
tuning.size
-- tuning.size
}
-- }
-- Add major scale notes
-- -- Add major scale notes
note_names[major_note_idx[1]] = "C"
-- note_names[major_note_idx[1]] = "C"
note_names[major_note_idx[2]] = "D"
-- note_names[major_note_idx[2]] = "D"
note_names[major_note_idx[3]] = "E"
-- note_names[major_note_idx[3]] = "E"
note_names[major_note_idx[4]] = "F"
-- note_names[major_note_idx[4]] = "F"
note_names[major_note_idx[5]] = "G"
-- note_names[major_note_idx[5]] = "G"
note_names[major_note_idx[6]] = "A"
-- note_names[major_note_idx[6]] = "A"
    note_names[major_note_idx[7]] = "B"
--  note_names[major_note_idx[7]] = "B"
    note_names[major_note_idx[8]] = "C"
--  note_names[major_note_idx[8]] = "C"


-- -- Add sharp/up notes
-- -- Add sharp/up notes
Line 111: Line 112:
-- end
-- end
return note_names
-- return note_names
end
end