Module:MOS gamut: Difference between revisions

Ganaram inukshuk (talk | contribs)
Updated to use parse_notation function from mos notation module
Ganaram inukshuk (talk | contribs)
Undo revision 118031 by Ganaram inukshuk (talk; parse function was put in the wrong place)
Tag: Undo
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
-- Get notation: naturals (or nominals), sharp symbol, and flat symbol
-- The default accidentals are the amp and at (& and @)
local notation_default = { ['Naturals'] = string.sub("JKLMNOPQRSTUVWXYZ", 1, mossteps_per_equave), ['Sharp'] = "&", ['Flat'] = "@" }
-- unless the mos is 5L 2s, then it's sharp and flat (# and b)
local chroma_plus_default = "&"
local chroma_minus_default = "@"
if scale_sig == "5L 2s" then
if scale_sig == "5L 2s" then
notation_default['Naturals'] = "CDEFGAB"
chroma_plus_default = "#"
notation_default['Sharp'] = "#"
chroma_minus_default = "b"
notation_default['Flat'] = "b"
end
end
local notation = mosnot.parse_notation(frame.args['Notation']) or notation_default
local chroma_plus_symbol = chroma_plus_symbol or chroma_plus_default
local note_symbols = notation['Naturals']
local chroma_minus_symbol = chroma_minus_symbol or chroma_minus_default
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?