Module:MOS degrees: Difference between revisions
Trying to bring back color-coded rows that mimics a piano |
Fixing function calls to the gamut module |
||
| Line 38: | Line 38: | ||
-- How far these extend is dependent on UDP | -- How far these extend is dependent on UDP | ||
-- TODO: separate this into a helper module called "MOS notation" | -- TODO: separate this into a helper module called "MOS notation" | ||
function p.mos_degrees(input_mos, step_ratio, | function p.mos_degrees(input_mos, step_ratio, udp) | ||
local input_mos = input_mos or mos.new(5, 2, 2) | local input_mos = input_mos or mos.new(5, 2, 2) | ||
local step_ratio = step_ratio or { 2, 1 } | local step_ratio = step_ratio or { 2, 1 } | ||
| Line 47: | Line 47: | ||
local mossteps_per_period = mossteps_per_equave / periods_per_equave | local mossteps_per_period = mossteps_per_equave / periods_per_equave | ||
-- The default | -- The default UDP corresponds to the brightest mode | ||
-- | -- If it's 5L 2s, default to the second-brightest mode | ||
local | local udp_default = { mossteps_per_equave - periods_per_equave, 0 } | ||
if scale_sig == "5L 2s" then | if scale_sig == "5L 2s" then | ||
udp_default = { 5, 1 } | |||
end | end | ||
local | local udp_parsed = udp or udp_default | ||
local generators_up = udp_parsed[1] | |||
local generators_down = udp_parsed[2] | |||
local generators_down = | |||
-- How long is the inital genchain for notes without accidentals? | -- How long is the inital genchain for notes without accidentals? | ||
| Line 256: | Line 251: | ||
local scale_sig = mos.as_string(input_mos) | local scale_sig = mos.as_string(input_mos) | ||
-- The default | -- The default UDP corresponds to the brightest mode | ||
-- | -- If it's 5L 2s, default to the second-brightest mode | ||
local | local udp = { mossteps_per_equave - periods_per_equave, 0 } | ||
if scale_sig == "5L 2s" then | if scale_sig == "5L 2s" then | ||
udp = { 5, 1 } | |||
end | end | ||
if string.len(frame.args['UDP']) > 0 then | |||
if string.len(frame.args[' | udp = p.parse_udp(frame.args['UDP']) | ||
end | end | ||
| Line 300: | Line 294: | ||
-- Get the gamut | -- Get the gamut | ||
local gamut = mosg.mos_gamut(input_mos, | local gamut = mosg.mos_gamut(input_mos, udp, step_ratio, note_symbols, chroma_plus_symbol, chroma_minus_symbol) | ||
-- Get the scale degrees | -- Get the scale degrees | ||