Module:MOS: Difference between revisions

Ganaram inukshuk (talk | contribs)
added is_root_mos, under the reasoning that this came up enough times to justify adding it
ArrowHead294 (talk | contribs)
m This goes on the documentation page
Line 1: Line 1:
-- Module for working with mosses in lua code; this serves as a "library" for
-- mos-related modules and thus does not have a corresponding template.
-- Following style guide: https://en.xen.wiki/w/User:Ganaram_inukshuk/Provisional_style_guide_for_Lua#Lua_style
 
-- Functionality includes:
-- - Creating/parsing mosses from string representations (scalesigs, xL ys)
-- - Creating scalesigs (string representations) of mosses
-- - Finding relatives of mosses or applying certain operations on them
-- - Finding certain modes of a mos
-- - Finding generators for a mos
-- - Producing vectors for simple mos intervals
-- - Interval arithmetic, in the form of adding vectors of L's and s's, and
--  period/equave-reducing intervals
-- - Finding equal tunings for mosses
-- - Producing intervals of mosses as steps of an equal tuning, as a quantity of
--  steps (EG, for 7\12, this is 7) or as a string (EG, 7\12 as a string).
local rat = require("Module:Rational")
local rat = require("Module:Rational")
local utils = require("Module:Utils")
local utils = require("Module:Utils")
Line 22: Line 4:
local p = {}
local p = {}


-- Naming scheme for function names:
-- - Functions related to mosses don't have any special names.
-- - Functions related to a mos's modes generally end with "mode".
-- - Functions related to a mos's generators, equave, or period contain the
--  corresponding interval as part of its name.
-- - Functions related to intervals generally begin with "interval".
-- - Interval complement/reduce functions end with "complement" and "reduce".
-- - Functions that produce strings generally have the phrase "as string".
-- - Functions that "count" something generally end with "count".
-- - If a function requires an interval and mos as input, the interval(s) come
--  after the mos.
-- - Functions that have to do with equal tunings will have "et" in its name.


--------------------------------------------------------------------------------
--------------------------------------------------------------------------------