Module:MOS modes: Difference between revisions
m Adopt yesno module |
ArrowHead294 (talk | contribs) mNo edit summary |
||
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 = gens_up .. "|" .. gens_down | ||
if periods == 1 then | if periods == 1 then | ||
udp_as_text = | udp_as_text = udp_as_text .. "(" .. periods .. ")" | ||
end | end | ||
result = result .. "| " .. udp_as_text | result = result .. "| " .. udp_as_text | ||
Line 118: | Line 116: | ||
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 input_mos = mos.parse(frame.args["Scale Signature"] or "5L 2s") | ||
-- 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 = tip.parse_entries(((scale_sig == "5L 2s") and {"Lydian; Ionian (major); Mixolydian; Dorian; Aeolian (minor); Phrygian; Locrian"} or {frame.args["Mode Names"]})[1]) | ||
-- 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 = tip.parse_entries(frame.args["Table Headers"]) | ||
local | local entries = tip.parse_entries(frame.args["Table Entries"]) | ||
local is_collapsed = yesno(frame.args["Collapsed"], false) | local is_collapsed = yesno(frame.args["Collapsed"], false) | ||