Module:MOS gamut: Difference between revisions

Ganaram inukshuk (talk | contribs)
No edit summary
Ganaram inukshuk (talk | contribs)
Updated to use parse_notation function from mos notation module
Line 32: Line 32:
local generators_up = udp[1]
local generators_up = udp[1]
local generators_down = udp[2]
local generators_down = udp[2]
-- The natural note symbols are those that correspond to diamond-mos
-- (JKLMN...) unless the mos is 5L 2s, then it's CDEFGAB
-- If it's diamond-mos, gamut is limited to 17 note names
local note_symbols_main = "JKLMNOPQRSTUVWXYZ"
local note_symbols_default = string.sub(note_symbols_main, 1, mossteps_per_equave)
if scale_sig == "5L 2s" then
note_symbols_default = "CDEFGAB"
end
local note_symbols = note_symbols or note_symbols_default
-- The default accidentals are the amp and at (& and @)
-- Get notation: naturals (or nominals), sharp symbol, and flat symbol
-- unless the mos is 5L 2s, then it's sharp and flat (# and b)
local notation_default = { ['Naturals'] = string.sub("JKLMNOPQRSTUVWXYZ", 1, mossteps_per_equave), ['Sharp'] = "&", ['Flat'] = "@" }
local chroma_plus_default = "&"
local chroma_minus_default = "@"
if scale_sig == "5L 2s" then
if scale_sig == "5L 2s" then
chroma_plus_default = "#"
notation_default['Naturals'] = "CDEFGAB"
chroma_minus_default = "b"
notation_default['Sharp'] = "#"
notation_default['Flat'] = "b"
end
end
local chroma_plus_symbol = chroma_plus_symbol or chroma_plus_default
local notation = mosnot.parse_notation(frame.args['Notation']) or notation_default
local chroma_minus_symbol = chroma_minus_symbol or chroma_minus_default
local note_symbols = notation['Naturals']
local chroma_plus_symbol = notation['Sharp']
local chroma_minus_symbol = notation['Flat']
-- How long is the inital genchain for notes without accidentals?
-- How long is the inital genchain for notes without accidentals?