Module:MOS intro: Difference between revisions

Ganaram inukshuk (talk | contribs)
mNo edit summary
Ganaram inukshuk (talk | contribs)
Added punctuation, added back use of rounding function from utils module to resolve instances of negative 0
Line 115: Line 115:
sentence = sentence .. string.format(" containing %d large step%s and %d small step%s", nL, s_nl, ns, s_ns)
sentence = sentence .. string.format(" containing %d large step%s and %d small step%s", nL, s_nl, ns, s_ns)
-- How does it repeat?
-- How large is the period in cents? Round to 3 decimal places
local round = 3
local equave_rounded = utils._round_dec(equave_in_cents, round)
local period_rounded = utils._round_dec(equave_in_cents / n, round)
-- Should step be singular or plural?
local s_x = ""
local s_x = ""
local s_y = ""
local s_y = ""
Line 131: Line 135:
end
end
if n == 1 and equave_in_cents == 1200 then
if n == 1 and equave_in_cents == 1200 then
sentence = sentence .. string.format(" and repeating every [[octave]].")
sentence = sentence .. string.format(", repeating every [[octave]].")
elseif n == 1 and equave_in_cents ~= 1200 then
elseif n == 1 and equave_in_cents ~= 1200 then
sentence = sentence .. string.format(" and repeating every interval of [[%s]] (%.3f¢).", equave_as_ratio, equave_in_cents)
sentence = sentence .. string.format(", repeating every interval of [[%s]] (%).", equave_as_ratio, equave_rounded)
elseif n ~= 1 and equave_in_cents == 1200 then
elseif n ~= 1 and equave_in_cents == 1200 then
sentence = sentence .. string.format(", with a [[period]] of %d large step%s and %d small step%s", x, s_x, y, s_y)
sentence = sentence .. string.format(", with a [[period]] of %d large step%s and %d small step%s", x, s_x, y, s_y)
sentence = sentence .. string.format(" that repeats every %.3f¢, or %s every [[octave]].", equave_in_cents / n, repetition)
sentence = sentence .. string.format(" that repeats every %, or %s every [[octave]].", period_rounded, repetition)
elseif n ~= 1 and equave_in_cents ~= 1200 then
elseif n ~= 1 and equave_in_cents ~= 1200 then
sentence = sentence .. string.format(", with a [[period]] of %d large step%s and %d small step%s", x, s_x, y, s_y)
sentence = sentence .. string.format(", with a [[period]] of %d large step%s and %d small step%s", x, s_x, y, s_y)
sentence = sentence .. string.format(" that repeats every %.3f¢, or %s every interval of %s (%.3f¢).", equave_in_cents / n, repetition, equave_as_ratio, equave_in_cents)
sentence = sentence .. string.format(" that repeats every %, or %s every interval of %s (%).", period_rounded, repetition, equave_as_ratio, equave_rounded)
end
end