Module:MOS degrees: Difference between revisions

Ganaram inukshuk (talk | contribs)
Trying something with default params
Ganaram inukshuk (talk | contribs)
No edit summary
Line 37: Line 37:
local generators_up = udp[1]
local generators_up = udp[1]
local generators_down = udp[2]
local generators_down = udp[2]
-- Get note symbols
-- Get note symbols
Line 44: Line 43:
-- This order of operations allows for overriding standard notation for 5L 2s
-- This order of operations allows for overriding standard notation for 5L 2s
local note_symbols_main = "JKLMNOPQRSTUVWXYZ"
local note_symbols_main = "JKLMNOPQRSTUVWXYZ"
local note_symbols_default = string.sub(note_symbols_main, 1, mossteps_per_equave)
local note_symbols = string.sub(note_symbols_main, 1, mossteps_per_equave)
if scale_sig == "5L 2s" then
if scale_sig == "5L 2s" then
note_symbols_default = "CDEFGAB"
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
end
local note_symbols = frame.args['Note Symbols'] or note_symbols_default
-- Get accidental symbols
-- Get accidental symbols
Line 54: Line 56:
-- unless the mos is 5L 2s, then it's sharp and flat # and b
-- 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
-- This order of operations allows for overriding standard notation for 5L 2s
local sharp_default = "&"
local chroma_plus_symbol = "&"
local flat_default = "@"
local chroma_minus_symbol = "@"
if scale_sig == "5L 2s" then
if scale_sig == "5L 2s" then
sharp_default = "#"
chroma_plus_symbol = "#"
flat_default = "b"
chroma_minus_symbol = "b"
end
-- If value(s) were entered, override the default values
if string.len(frame.args['Sharp Symbol']) > 0 then
chroma_plus_symbol = frame.args['Sharp Symbol']
end
if string.len(frame.args['Flat Symbol']) > 0 then
chroma_minus_symbol = frame.args['Flat Symbol']
end
end
local chroma_plus_symbol = frame.args['Sharp Symbol'] or sharp_default
local chroma_minus_symbol = frame.args['Flat Symbol'] or flat_default
-- Override values for testing
-- Override values for testing