Module:MOS modes: Difference between revisions
ArrowHead294 (talk | contribs) mNo edit summary |
Undo revision 148879 by ArrowHead294 (talk) Undo recent changes as they broke default names and udp Tag: Undo |
||
| Line 79: | Line 79: | ||
local gens_down = (i - 1) * periods | local gens_down = (i - 1) * periods | ||
local gens_up = (#mos_modes - i) * periods | local gens_up = (#mos_modes - i) * periods | ||
local udp_as_text = | local udp_as_text = "" | ||
if periods == 1 then | if periods == 1 then | ||
udp_as_text = udp_as_text .. "(" .. periods .. ")" | udp_as_text = gens_up .. "|" .. gens_down | ||
else | |||
udp_as_text = gens_up .. "|" .. gens_down .. "(" .. periods .. ")" | |||
end | end | ||
result = result .. "| " .. udp_as_text | result = result .. "| " .. udp_as_text | ||
| Line 116: | Line 118: | ||
function p.modes_table(frame) | function p.modes_table(frame) | ||
-- Mos is entered as a scale signature "xL ys" or "xL ys<p/q>" since the mos module can parse that format | -- Mos is entered as a scale signature "xL ys" or "xL ys<p/q>" since the mos module can parse that format | ||
local | local scale_sig = frame.args["Scale Signature"] or "5L 2s" | ||
local input_mos = mos.parse(scale_sig) | |||
-- Get the mos's mode names, if given | -- Get the mos's mode names, if given | ||
-- Mode names are entered as a semicolon-delimited list | -- Mode names are entered as a semicolon-delimited list | ||
-- 5L 2s gets default names | -- 5L 2s gets default names | ||
local mode_names = | local mode_names = nil | ||
if scale_sig == "5L 2s" then | |||
mode_names_unparsed = "Lydian; Ionian (major); Mixolydian; Dorian; Aeolian (minor); Phrygian; Locrian" | |||
mode_names = tip.parse_entries(mode_names_unparsed) | |||
else | |||
mode_names_unparsed = frame.args["Mode Names"] | |||
mode_names = tip.parse_entries(mode_names_unparsed) | |||
end | |||
-- 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 | ||
-- For n headers, the number of entries must match the number of modes times the number of headers | -- For n headers, the number of entries must match the number of modes times the number of headers | ||
-- or else column data won't be added | -- or else column data won't be added | ||
local | local headers_unparsed = frame.args["Table Headers"] | ||
local | local headers = tip.parse_entries(headers_unparsed) | ||
local entries_unparsed = frame.args["Table Entries"] | |||
local entries = tip.parse_entries(entries_unparsed) | |||
local is_collapsed = yesno(frame.args["Collapsed"], false) | local is_collapsed = yesno(frame.args["Collapsed"], false) | ||