Module:MOS mode degrees: Difference between revisions
m adding col for mode names |
mNo edit summary |
||
| Line 134: | Line 134: | ||
-- If it's for a modmos, add the step pattern | -- If it's for a modmos, add the step pattern | ||
local title = string.format("Scale degree qualities of %s", scale_sig) .. (is_true_mos and " " or string.format(" (%s) ", step_pattern)) | local title = string.format("Scale degree qualities of %s", scale_sig) .. (is_true_mos and " " or string.format(" (%s) ", step_pattern)) | ||
local num_cols = 3 + #step_matrices[1] -- 3 for udp, rotational order, and step pattern; plus possibly 1 for mode names, then 1 for each scale degree in a mode | |||
-- Calculate how many cols the table will be | |||
local mode_names_given = mode_names ~= nil and #mode_names == #step_patterns | |||
local num_cols = 3 + (mode_names_given and 1 or 0) + #step_matrices[1] -- 3 for udp, rotational order, and step pattern; plus possibly 1 for mode names, then 1 for each scale degree in a mode | |||
result = result .. string.format("! colspan=\"%s\" | %s\n", num_cols, title) | result = result .. string.format("! colspan=\"%s\" | %s\n", num_cols, title) | ||
.. "|-\n" | .. "|-\n" | ||
| Line 148: | Line 148: | ||
-- Add mode names if present | -- Add mode names if present | ||
if mode_names_given then | if mode_names_given then | ||
result = result .. " !! rowspan=\"2\" class=\"unsortable\" | Mode<br>Names" | result = result .. " !! rowspan=\"2\" class=\"unsortable\" | Mode<br>Names" | ||