Module:MOS intro: Difference between revisions
m capitalization |
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( | 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]] (%. | 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]] (%. | 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 | ||