Module:MOS intervals: Difference between revisions

Ganaram inukshuk (talk | contribs)
m Typing in either "ordinal" or "ordinals" uses ordinal names now
Ganaram inukshuk (talk | contribs)
Dropped support for mos-ordinals
Line 64: Line 64:
local scale_sig = mos.as_string(input_mos)
local scale_sig = mos.as_string(input_mos)
-- Is there a mos prefix? Should ordinals be used?
-- Is there a mos prefix?
-- For 5L 2s, that would be no to prefixes and yes to ordinals, by default.
-- For any other mos, that would be yes to prefixes and no to ordinals, by
-- default. The default prefix is "mos".
local mos_prefix = "mos"
local mos_prefix = "mos"
local use_ordinals = false
if scale_sig == "5L 2s" then
use_ordinals = true
mos_prefix = ""
end
if string.len(frame.args['Interval Notation']) > 0 then
use_ordinals = frame.args['Interval Notation'] == "ordinals" or frame.args['Interval Notation'] == "ordinal"
end
if frame.args['MOS Prefix'] == "NONE" then
if frame.args['MOS Prefix'] == "NONE" then
mos_prefix = ""
mos_prefix = ""
Line 98: Line 87:
-- First row is the unison
-- First row is the unison
result = result .. "|-\n"
result = result .. "|-\n"
if use_ordinals and mos_prefix == "" then
result = result .. "|'''0-" .. mos_prefix .. "step (unison)'''\n"
result = result .. "|'''1st (unison)'''\n"
elseif use_ordinals and mos_prefix ~= "" then
result = result .. "|'''" .. mos_prefix .. "-1st (unison)'''\n"
else
result = result .. "|'''0-" .. mos_prefix .. "step (unison)'''\n"
end
result = result .. "|0\n"
result = result .. "|0\n"
result = result .. "|Perfect\n"
result = result .. "|Perfect\n"
Line 126: Line 109:
result = result .. "|-\n"
result = result .. "|-\n"
if i % steps_per_period == steps_per_bright_gen and not is_nL_ns then
if i % steps_per_period == steps_per_bright_gen and not is_nL_ns then
if use_ordinals and mos_prefix == "" then
result = result .. "|'''" .. i .. "-" .. mos_prefix .. "step'''\n"
result = result .. "|'''" .. ord._ordinal(i + 1) .. "'''\n"
elseif use_ordinals and mos_prefix ~= "" then
result = result .. "|'''" .. mos_prefix .. "-" .. ord._ordinal(i + 1) .. "'''\n"
else
result = result .. "|'''" .. i .. "-" .. mos_prefix .. "step'''\n"
end
result = result .. "|" .. p.mos_interval_to_step_count_string(brightest_mode, i) .. "\n"
result = result .. "|" .. p.mos_interval_to_step_count_string(brightest_mode, i) .. "\n"
result = result .. "|Perfect\n"
result = result .. "|Perfect\n"
Line 139: Line 116:
elseif i % steps_per_period == steps_per_dark_gen and not is_nL_ns then
elseif i % steps_per_period == steps_per_dark_gen and not is_nL_ns then
if use_ordinals and mos_prefix == "" then
result = result .. "|'''" .. i .. "-" .. mos_prefix .. "step'''\n"
result = result .. "|'''" .. ord._ordinal(i + 1) .. "'''\n"
elseif use_ordinals and mos_prefix ~= "" then
result = result .. "|'''" .. mos_prefix .. "-" .. ord._ordinal(i + 1) .. "'''\n"
else
result = result .. "|'''" .. i .. "-" .. mos_prefix .. "step'''\n"
end
result = result .. "|" .. p.mos_interval_to_step_count_string(brightest_mode, i) .. "\n"
result = result .. "|" .. p.mos_interval_to_step_count_string(brightest_mode, i) .. "\n"
result = result .. "|Augmented\n"
result = result .. "|Augmented\n"
Line 152: Line 123:
elseif i % steps_per_period == 0 and i ~= mossteps_per_equave then
elseif i % steps_per_period == 0 and i ~= mossteps_per_equave then
if use_ordinals and mos_prefix == "" then
result = result .. "|'''" .. i .. "-" .. mos_prefix .. "step (period)'''\n"
result = result .. "|'''" .. ord._ordinal(i + 1) .. "'''\n"
elseif use_ordinals and mos_prefix ~= "" then
result = result .. "|'''" .. mos_prefix .. "-" .. ord._ordinal(i + 1) .. "'''\n"
else
result = result .. "|'''" .. i .. "-" .. mos_prefix .. "step (period)'''\n"
end
result = result .. "|" .. p.mos_interval_to_step_count_string(brightest_mode, i) .. "\n"
result = result .. "|" .. p.mos_interval_to_step_count_string(brightest_mode, i) .. "\n"
result = result .. "|Perfect\n"
result = result .. "|Perfect\n"
Line 165: Line 130:
else
else
if use_ordinals and mos_prefix == "" then
result = result .. "|" .. i .. "-" .. mos_prefix .. "step\n"
result = result .. "|" .. ord._ordinal(i + 1) .. "\n"
elseif use_ordinals and mos_prefix ~= "" then
result = result .. "|" .. mos_prefix .. "-" .. ord._ordinal(i + 1) .. "\n"
else
result = result .. "|" .. i .. "-" .. mos_prefix .. "step\n"
end
result = result .. "|" .. p.mos_interval_to_step_count_string(brightest_mode, i) .. "\n"
result = result .. "|" .. p.mos_interval_to_step_count_string(brightest_mode, i) .. "\n"
result = result .. "|Major\n"
result = result .. "|Major\n"
Line 181: Line 140:
-- Manually add the last row of the table (this is for the equave)
-- Manually add the last row of the table (this is for the equave)
result = result .. "|-\n"
result = result .. "|-\n"
if use_ordinals and mos_prefix == "" then
result = result .. "|'''" .. steps_per_equave .. "-" .. mos_prefix .. "step"
result = result .. "|'''" .. ord._ordinal(steps_per_equave + 1)
elseif use_ordinals and mos_prefix ~= "" then
result = result .. "|'''" .. mos_prefix .. "-" .. ord._ordinal(steps_per_equave + 1)
else
result = result .. "|'''" .. steps_per_equave .. "-" .. mos_prefix .. "step"
end
-- Is the equave 2/1?
-- Is the equave 2/1?