Module:MOS degrees: Difference between revisions

Ganaram inukshuk (talk | contribs)
No edit summary
Ganaram inukshuk (talk | contribs)
Notation is now passed in as one parameter, as a semicolon-delimited string (EG, "CDEFGAB; #; b")
Line 271: Line 271:
end
end
local udp = mosnot.parse_udp(frame.args['UDP']) or udp_default
local udp = mosnot.parse_udp(frame.args['UDP']) or udp_default
-- Get note symbols
-- If this param was blank, default to diamond-mos; limited to 17 note names
-- But if it's blank and the scalesig is 5L 2s, default to standard notation
-- This order of operations allows for overriding standard notation for 5L 2s
local note_symbols_main = "JKLMNOPQRSTUVWXYZ"
local note_symbols = string.sub(note_symbols_main, 1, mossteps_per_equave)
if scale_sig == "5L 2s" then
note_symbols = "CDEFGAB"
end
-- If a value was entered, override the default value
if string.len(frame.args['Note Symbols']) > 0 then
note_symbols = frame.args['Note Symbols']
end
-- Get genchain extend value
-- Get genchain extend value
Line 295: Line 281:
local genchain_extend_dn = genchain_extend[2] or genchain_extend_default
local genchain_extend_dn = genchain_extend[2] or genchain_extend_default
-- Get accidental symbols
-- Get notation: naturals (or nominals), sharp symbol, and flat symbol
-- If this param was blank, default to diamond-mos symbols & 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
-- This order of operations allows for overriding standard notation for 5L 2s
local sharp_symbol = "&"
local flat_symbol = "@"
if scale_sig == "5L 2s" then
if scale_sig == "5L 2s" then
sharp_symbol = "#"
notation_default['Naturals'] = "CDEFGAB"
flat_symbol = "b"
notation_default['Sharp'] = "#"
end
notation_default['Flat'] = "b"
-- If value(s) were entered, override the default values
if string.len(frame.args['Sharp Symbol']) > 0 then
sharp_symbol = frame.args['Sharp Symbol']
end
if string.len(frame.args['Flat Symbol']) > 0 then
flat_symbol = frame.args['Flat Symbol']
end
end
local notation = notation_default or mosnot.parse_notation(frame.args['Notation'])
local note_symbols = notation['Naturals']
local sharp_symbol = notation['Sharp']
local flat_symbol = notation['Flat']
-- Get notational options
-- Get notational options