Module:MOS: Difference between revisions
Comments/todo; added several more helper functions (based on how many times these were needed in other modules): darkest_mode(), dark_gen(), period(), bright_gen_step_count(), dark_gen_step_count(), period_step_count() |
Added (the skeletons for) two more functions: interval() and interval_from_mossteps(); these serve the same role as bright_gen(), dark_gen(), and period(), but apply to all other mos intervals |
||
| Line 285: | Line 285: | ||
} | } | ||
return dark_gen | return dark_gen | ||
end | |||
-- Compute an arbitrary mos interval as a vector of L's and s's. | |||
-- The mossteps param is the number of mossteps in the interval. EG, a 2-mosstep | |||
-- should return a vector whose L and s values add up to 2. | |||
-- The size param is a value that denotes whether the interval is the large size | |||
-- (0) or the small size (-1). This can exceed the range of [-1, 0] to represent | |||
-- intervals raised/lowered by multiple chromas (augmented, diminished, etc). | |||
-- Note that for period intervals (eg, the root and equave), there is only one | |||
-- size (0 = perfect), so -1 is diminished and 1 is augmented. | |||
function p.interval(mos, mossteps, size) | |||
end | |||
-- Compute an arbitrary mos interval (as a string of steps) as a vector of L's | |||
-- and s's. | |||
-- This has the same output as the previous function, except arbitrary strings | |||
-- can be entered, such as with step sequences for certain modmosses. The step | |||
-- types are as follows: | |||
-- - L: large step. | |||
-- - s: small step. | |||
-- - c: a chroma; the difference between a large and small step. | |||
-- - A: an augmented step; a large step plus a chroma. | |||
-- - d: a diminished step, or diesis; a small step minus a chroma. | |||
function p.interval_from_mossteps(mos, step_sequence) | |||
end | end | ||