Module:MOS intro: Difference between revisions

Ganaram inukshuk (talk | contribs)
m capitalization
Ganaram inukshuk (talk | contribs)
Fixed code for rounding again
Line 193: Line 193:
-- Main function (updated)
-- Main function (updated)
function p._mos_intro(input_mos, other_names)
function p._mos_intro(input_mos, other_names)
local input_mos = input_mos or mos.new(6, 6, 2)
local input_mos = input_mos or mos.new(5, 5, 3)
local other_names = other_names or ""
local other_names = other_names or ""
Line 240: Line 240:
-- Add repetition
-- Add repetition
if n == 1 then
if n == 1 then
intro = intro .. ", repeating every " .. (equave_in_cents == 1200 and "[[octave]]." or string.format(" interval of [[%s]] (%.).", equave_as_ratio, utils._round_dec(equave_in_cents, round)))
intro = intro .. ", repeating every " .. (equave_in_cents == 1200 and "[[octave]]." or string.format(" interval of [[%s]] (%.1f¢).", equave_as_ratio, equave_in_cents, round))
else
else
intro = intro .. string.format(", with a [[period]] of %d large %s", nL/n, (nL/n == 1 and "step" or "steps"))
intro = intro .. string.format(", with a [[period]] of %d large %s", nL/n, (nL/n == 1 and "step" or "steps"))
intro = intro .. string.format(" and %d small %s", ns/n, (ns/n == 1 and "step" or "steps"))
intro = intro .. string.format(" and %d small %s", ns/n, (ns/n == 1 and "step" or "steps"))
intro = intro .. string.format(" that repeats every %.1f¢", period_in_cents)
intro = intro .. string.format(" that repeats every %.1f¢", period_in_cents)
intro = intro .. (n == 2 and " or twice every" or string.format(" or %d times every", n)) .. (equave_in_cents == 1200 and " octave." or string.format(" every interval of [[%s]] (%.).", equave_as_ratio, utils._round(equave_in_cents, round)))
intro = intro .. (n == 2 and " or twice every" or string.format(" or %d times every", n)) .. (equave_in_cents == 1200 and " octave." or string.format(" every interval of [[%s]] (%.1f¢).", equave_as_ratio, equave_in_cents, round))
end
end