Module:MOS: Difference between revisions
No edit summary |
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( | function p.brightest_mode(mos) | ||
local nL = | local nL = mos.nL | ||
local ns = | 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( | function p.bright_gen(mos) -- Compute the abstract, equave-agnostic bright generator as a "vector" of L and s steps. | ||
local nL = | local nL = mos.nL | ||
local ns = | 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 | ||