Module:MOS: Difference between revisions

Inthar (talk | contribs)
No edit summary
Inthar (talk | contribs)
should pass mos as variable
Line 41: Line 41:
-- Find the brightest mode of a mos.
-- Find the brightest mode of a mos.
-- We go back to the root of the scale tree, then progressively construct descendants.
-- We go back to the root of the scale tree, then progressively construct descendants.
function p.brightest_mode(n_L, n_s)
function p.brightest_mode(mos)
local nL = n_L
local nL = mos.nL
local ns = n_s
local ns = mos.ns
local d = rat.gcd(nL, ns)
local d = rat.gcd(nL, ns)
if d > 1 then -- use single period mos, with period as new equave
if d > 1 then -- use single period mos, with period as new equave
Line 72: Line 72:
end
end


function p.bright_gen(n_L, n_s) -- Compute the abstract, equave-agnostic bright generator as a "vector" of L and s steps.
function p.bright_gen(mos) -- Compute the abstract, equave-agnostic bright generator as a "vector" of L and s steps.
local nL = n_L
local nL = mos.nL
local ns = n_s
local ns = mos.ns
local d = rat.gcd(nL, ns)
local d = rat.gcd(nL, ns)
if d > 1 then -- use single period mos, with period as new equave
if d > 1 then -- use single period mos, with period as new equave