Module:MOS: Difference between revisions
ArrowHead294 (talk | contribs) m This goes on the documentation page |
Review code+comments as being its own documentation |
||
| Line 1: | Line 1: | ||
-- This module follows User:Ganaram inukshuk/Provisional style guide for Lua#Lua_style | |||
local rat = require("Module:Rational") | local rat = require("Module:Rational") | ||
local utils = require("Module:Utils") | local utils = require("Module:Utils") | ||
local et = require("Module:ET") | local et = require("Module:ET") | ||
local p = {} | local p = {} | ||
-------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | ||
| Line 22: | Line 23: | ||
-------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | ||
------------------------------ | ----------------------------- MOS-CREATING FUNCTIONS --------------------------- | ||
-------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | ||
| Line 49: | Line 50: | ||
-------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | ||
---------------------- | ---------------------- VALIDATION AND CHECKING FUNCTIONS ----------------------- | ||
-------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | ||
| Line 391: | Line 392: | ||
-------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | ||
--------------- | --------------- FUNCTIONS FOR GENERATOR AND PERIOD INTERVALS ------------------- | ||
-------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | ||
| Line 457: | Line 457: | ||
-------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | ||
------------------ | ------------------- FUNCTIONS FOR SINGLE-STEP INTERVALS ------------------------ | ||
-------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | ||
| Line 614: | Line 614: | ||
-------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | ||
--------------- INTERVAL ARITHMETIC AND MANIPULATION FUNCTIONS ----------------- | |||
-------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | ||
| Line 647: | Line 647: | ||
interval_1["s"] == interval_2["s"] | interval_1["s"] == interval_2["s"] | ||
end | end | ||
-- Given an interval vector and a mos, find its period complement. This is the | -- Given an interval vector and a mos, find its period complement. This is the | ||
| Line 704: | Line 701: | ||
---------------------------- EQUAL-TUNING FUNCTIONS ---------------------------- | ---------------------------- EQUAL-TUNING FUNCTIONS ---------------------------- | ||
-------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | ||
-- Given a mos and a step ratio, return an equal tuning (or equal division). | -- Given a mos and a step ratio, return an equal tuning (or equal division). | ||
-- The step ratio is entered as a 2-element array to allow non-simplified | -- The step ratio is entered as a 2-element array to allow non-simplified | ||