Module:MOS modes: Difference between revisions
m Added todo |
Adopt functions provided by other templates; also a bugfix to "round" being missing |
||
| Line 2: | Line 2: | ||
local rat = require('Module:Rational') | local rat = require('Module:Rational') | ||
local utils = require('Module:Utils') | local utils = require('Module:Utils') | ||
local tip = require('Module:Template input parse') | |||
local p = {} | local p = {} | ||
-- TODO: collapse table if the number of modes is, say, more than 12 | -- TODO: collapse table if the number of modes is, say, more than 12 | ||
-- "Main" function | -- "Main" function | ||
| Line 71: | Line 18: | ||
-- Get the mos's modes and the mode count | -- Get the mos's modes and the mode count | ||
local mos_modes = | local mos_modes = mos.modes_by_brightness(input_mos) | ||
local periods = | local periods = mos.period_count(input_mos) | ||
local mossteps_per_period = (input_mos | local mossteps_per_period = mos.period_step_count(input_mos) | ||
-- This is for entering multiple columns of info, if a single column of mode names isn't enough | -- This is for entering multiple columns of info, if a single column of mode names isn't enough | ||
| Line 92: | Line 39: | ||
-- Used for calculating rotational order | -- Used for calculating rotational order | ||
local bright_gen = mos.bright_gen(input_mos) | local bright_gen = mos.bright_gen(input_mos) | ||
local mossteps_per_bright_gen = | local mossteps_per_bright_gen = mos.bright_gen_step_count(input_mos) | ||
-- Make a table with a column for the mode (as a string of L's and s's) and UDP | -- Make a table with a column for the mode (as a string of L's and s's) and UDP | ||
| Line 118: | Line 65: | ||
-- As of coding, mos mode listings are fairly inconsistent or nonexistent, but consist of | -- As of coding, mos mode listings are fairly inconsistent or nonexistent, but consist of | ||
-- the UDP, step pattern, and any mode names(s) in some order | -- the UDP, step pattern, and any mode names(s) in some order | ||
-- This table orders them as UDP, step pattern, and | -- This table orders them as UDP, step pattern, and mode names, as that's more common | ||
for i = 1, #mos_modes do | for i = 1, #mos_modes do | ||
result = result .. "|-\n" | result = result .. "|-\n" | ||
| Line 178: | Line 125: | ||
else | else | ||
mode_names_unparsed = frame.args['Mode Names'] | mode_names_unparsed = frame.args['Mode Names'] | ||
mode_names = | mode_names = tip.parse_entries(mode_names_unparsed) | ||
end | end | ||