Module:MOS degrees: Difference between revisions

Ganaram inukshuk (talk | contribs)
Added helper function into main function
Ganaram inukshuk (talk | contribs)
No edit summary
Line 218: Line 218:
-- 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 chroma_plus_symbol = "&"
local sharp_symbol = "&"
local chroma_minus_symbol = "@"
local flat_symbol = "@"
if scale_sig == "5L 2s" then
if scale_sig == "5L 2s" then
chroma_plus_symbol = "#"
sharp_symbol = "#"
chroma_minus_symbol = "b"
flat_symbol = "b"
end
end
-- If value(s) were entered, override the default values
-- If value(s) were entered, override the default values
if string.len(frame.args['Sharp Symbol']) > 0 then
if string.len(frame.args['Sharp Symbol']) > 0 then
chroma_plus_symbol = frame.args['Sharp Symbol']
sharp_symbol = frame.args['Sharp Symbol']
end
end
if string.len(frame.args['Flat Symbol']) > 0 then
if string.len(frame.args['Flat Symbol']) > 0 then
chroma_minus_symbol = frame.args['Flat Symbol']
flat_symbol = frame.args['Flat Symbol']
end
end
Line 238: Line 238:
local udp = { 5, 1 }
local udp = { 5, 1 }
local note_symbols = "CDEFGAB"
local note_symbols = "CDEFGAB"
local chroma_plus_symbol = "#"
local sharp_symbol = "#"
local chroma_minus_symbol = "b"
local flat_symbol = "b"
local mossteps_per_equave = input_mos.nL + input_mos.ns
local mossteps_per_equave = input_mos.nL + input_mos.ns
local periods_per_equave = rat.gcd(input_mos.nL, input_mos.ns)
local periods_per_equave = rat.gcd(input_mos.nL, input_mos.ns)