Module:MOS intro: Difference between revisions

Ganaram inukshuk (talk | contribs)
Fixed rounding by converting values to strings
Ganaram inukshuk (talk | contribs)
Simplified function names; removed possibly unnecessary links or phrases that may require links; changed wording
Line 45: Line 45:
-- Introduces the mos by its scale sig and names
-- Introduces the mos by its scale sig and names
-- Names must be entered as an array
-- Names must be entered as an array
function p.mos_intro_scalesig_and_tamnams_names(input_mos, tamnams_name, other_names)
function p.mos_intro_names(input_mos, tamnams_name, other_names)
local input_mos = input_mos or mos.new(5, 2)
local input_mos = input_mos or mos.new(5, 2)
local tamnams_name = tamnams_name or { "diatonic" }
local tamnams_name = tamnams_name or { "diatonic" }
Line 69: Line 69:
elseif tamnams_names_list == "" and other_names_list ~= "" then
elseif tamnams_names_list == "" and other_names_list ~= "" then
-- There are no tamnams names but there are alternate names
-- There are no tamnams names but there are alternate names
sentence = sentence .. string.format(", also known as %s,", other_names_list)
sentence = sentence .. string.format(", also called %s,", other_names_list)
end
end
Line 156: Line 156:
local brightest_mode = mos.brightest_mode(input_mos)
local brightest_mode = mos.brightest_mode(input_mos)
local sentence = string.format("Scales of the true MOS form take on a [[step pattern]] of '''%s''' or some [[rotation]] thereof.", brightest_mode)
local sentence = string.format("[[mode|Modes]] of this scale are rotations of the step pattern '''%s'''.", brightest_mode)


return sentence
return sentence
Line 198: Line 198:
local dark_gen_max_r = tostring(utils._round_dec(dark_gen_max, round))
local dark_gen_max_r = tostring(utils._round_dec(dark_gen_max, round))
local sentence = string.format("[[generator|Generating intervals]] that produce this scale range from %s¢ to %s¢, or from %s¢ to %s¢.", bright_gen_min_r, bright_gen_max_r, dark_gen_min_r, dark_gen_max_r)
local sentence = string.format("[[generator|Generators]] that produce this scale range from %s¢ to %s¢, or from %s¢ to %s¢.", bright_gen_min_r, bright_gen_max_r, dark_gen_min_r, dark_gen_max_r)
return sentence
return sentence
Line 220: Line 220:
-- Construct the sentence
-- Construct the sentence
local scalesig_and_names = p.mos_intro_scalesig_and_tamnams_names(input_mos, tamnams_parsed, other_parsed)
local scalesig_and_names = p.mos_intro_names(input_mos, tamnams_parsed, other_parsed)
local steps_and_periods = p.mos_intro_steps_and_periods(input_mos)
local steps_and_periods = p.mos_intro_steps_and_periods(input_mos)
local step_pattern = p.mos_intro_step_pattern(input_mos)
local step_pattern = p.mos_intro_step_pattern(input_mos)