Module:MOS gamut: Difference between revisions

Ganaram inukshuk (talk | contribs)
mNo edit summary
Ganaram inukshuk (talk | contribs)
Updated to use middle mode, since that's the common convention; as a tiebreaker for an even quantity of modes, use the brighter of the two
Line 151: Line 151:
local scale_sig = mos.as_string(input_mos)
local scale_sig = mos.as_string(input_mos)
-- The default UDP corresponds to the brightest mode
-- The default UDP corresponds to the middle mode. For mosses with an even
-- If it's 5L 2s, default to the second-brightest mode
-- number of modes, there are two middle modes, so use the brighter of the
local udp_default = { mossteps_per_equave - periods_per_equave, 0 }
-- two instead.
-- If it's 5L 2s, default to the second-brightest mode.
local udp_default = { periods_per_equave * math.ceil(mossteps_per_period / 2), periods_per_equave * math.floor(mossteps_per_period / 2) }
if scale_sig == "5L 2s" then
if scale_sig == "5L 2s" then
udp_default = { 5, 1 }
udp_default = { 5, 1 }
Line 305: Line 307:
local scale_sig = mos.as_string(input_mos)
local scale_sig = mos.as_string(input_mos)
-- The default UDP corresponds to the brightest mode
-- The default UDP corresponds to the middle mode. For mosses with an even
-- If it's 5L 2s, default to the second-brightest mode
-- number of modes, there are two middle modes, so use the brighter of the
local udp = { mossteps_per_equave - periods_per_equave, 0 }
-- two instead.
-- If it's 5L 2s, default to the second-brightest mode.
local udp = { periods_per_equave * math.ceil(mossteps_per_period / 2), periods_per_equave * math.floor(mossteps_per_period / 2) }
if scale_sig == "5L 2s" then
if scale_sig == "5L 2s" then
udp = { 5, 1 }
udp = { 5, 1 }