Module:MOS: Difference between revisions
m Comments |
m Minor rewrites to comments |
||
| Line 153: | Line 153: | ||
end | end | ||
-- parse a MOS structure | -- parse a MOS structure from its scalesig | ||
function p.parse(unparsed) | function p.parse(unparsed) | ||
local nL, ns, equave = unparsed:match('^(%d+)[Ll]%s*(%d+)[Ss]%s*(.*)$') | local nL, ns, equave = unparsed:match('^(%d+)[Ll]%s*(%d+)[Ss]%s*(.*)$') | ||
| Line 166: | Line 166: | ||
end | end | ||
-- | -- Construct a string representation (scalesig) for a MOS structure | ||
-- Scalesig is "xL ys", or "xL ys<p/q>" for nonoctave scales | |||
function p.as_string(mos) | function p.as_string(mos) | ||
local suffix = '' | local suffix = '' | ||
| Line 175: | Line 176: | ||
end | end | ||
-- | -- Construct a longer string representation for a MOS structure | ||
-- Scalesig is "xL ys", or "xL ys (p/q-equivalent)" for nonoctave scales | |||
function p.as_long_string(mos) | function p.as_long_string(mos) | ||
local suffix = '' | local suffix = '' | ||
| Line 208: | Line 210: | ||
end | end | ||
-- Compute the abstract, equave-agnostic bright generator as a "vector" of L and s steps. | |||
function p.bright_gen(mos) | |||
local nL = mos.nL | local nL = mos.nL | ||
local ns = mos.ns | local ns = mos.ns | ||