「モジュール:MOS intro」の版間の差分

Furcht968 (トーク | 投稿記録)
ページの作成:「local p = {} local et = require("Module:ET") local mos = require("Module:MOS") local rat = require("Module:Rational") local tamnams = require("Module:TAMNAMS") local tip = require("Module:Template input parse") local utils = require("Module:Utils") local yesno = require("Module:Yesno") -- TODO: -- - Possible cleanup/rewording -- - Possible official deprecation of other names; focus should be on what a mos -- is, not what it's called. -- Helper function -- Lists…」
 
Furcht968 (トーク | 投稿記録)
編集の要約なし
タグ: モバイル編集 モバイルウェブ編集
 
(同じ利用者による、間の10版が非表示)
55行目: 55行目:
-- Construct the sentence
-- Construct the sentence
local sentence = string.format("'''%s'''", scale_sig)
local sentence = string.format("'''%s'''は、", scale_sig)
-- Add names
-- Add names
if tamnams_names_list ~= "" and other_names_list ~= "" then
if tamnams_names_list ~= "" and other_names_list ~= "" then
-- There are both tamnams names and alternate names
-- There are both tamnams names and alternate names
sentence = sentence .. string.format(", named %s in [[TAMNAMS]] (also known as %s),", tamnams_names_list, other_names_list)
sentence = sentence .. string.format("{{En仮リンク|TAMNAMS}}においては%sと呼ばれ、他に%sといった呼称が存在する。この音階は", tamnams_names_list, other_names_list)
elseif tamnams_names_list ~= "" and other_names_list == "" then
elseif tamnams_names_list ~= "" and other_names_list == "" then
-- There are only tamnams names
-- There are only tamnams names
sentence = sentence .. string.format(", named %s in [[TAMNAMS]],", tamnams_names_list)
sentence = sentence .. string.format("{{En仮リンク|TAMNAMS}}において%sと呼ばれる。この音階は", tamnams_names_list)
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 called %s,", other_names_list)
sentence = sentence .. string.format("%sと呼ばれる。この音階は", other_names_list)
end
end
177行目: 177行目:
local descendant_text = ""
local descendant_text = ""
if generations == 1 then
if generations == 1 then
descendant_text = string.format("%s is a child scale of [[%s]]", mos.as_string(input_mos), mos.as_string(ancestor_mos))
descendant_text = string.format("%sは、[[%s]]の親MOSであり", mos.as_string(input_mos), mos.as_string(ancestor_mos))
elseif generations == 2 then
elseif generations == 2 then
descendant_text = string.format("%s is a grandchild scale of [[%s]]", mos.as_string(input_mos), mos.as_string(ancestor_mos))
descendant_text = string.format("%sは、[[%s]]の祖MOSであり", mos.as_string(input_mos), mos.as_string(ancestor_mos))
elseif generations == 3 then
elseif generations == 3 then
descendant_text = string.format("%s is a great-grandchild scale of [[%s]]", mos.as_string(input_mos), mos.as_string(ancestor_mos))
descendant_text = string.format("%sは、[[%s]]の曽祖MOSであり", mos.as_string(input_mos), mos.as_string(ancestor_mos))
else
else
descendant_text = string.format("%s is related to [[%s]]", mos.as_string(input_mos), mos.as_string(ancestor_mos))
descendant_text = string.format("%sは、[[%s]]と近親であり", mos.as_string(input_mos), mos.as_string(ancestor_mos))
end
end
194行目: 194行目:
--end
--end
descendant_text = descendant_text .. string.format(", expanding it by %d tones.", input_mos.nL + input_mos.ns - ancestor_mos.nL - ancestor_mos.ns)
descendant_text = descendant_text .. string.format("%d音分増える。", input_mos.nL + input_mos.ns - ancestor_mos.nL - ancestor_mos.ns)
return descendant_text
return descendant_text
230行目: 230行目:
-- This is done through the aid of a helper function
-- This is done through the aid of a helper function
local intro = p.mos_intro_names(scale_sig, tamnams_pasred, other_parsed)
local intro = p.mos_intro_names(scale_sig, tamnams_pasred, other_parsed)
 
-- Add step counts
if nL >= 10 then
intro = intro .. string.format("%d個の広い音程と", nL)
else
intro = intro .. string.format("%dつの広い音程と", nL)
end
if ns >= 10 then
intro = intro .. string.format("%d個の狭い音程を有し、", ns)
else
intro = intro .. string.format("%dつの狭い音程を有し、", ns)
end
 
-- Add equave equivalence
-- Add equave equivalence
if rat.eq(input_mos.equave, rat.new(2)) then
if rat.eq(input_mos.equave, rat.new(2)) then
intro = intro .. " is a 2/1-equivalent ([[octave equivalence|octave-equivalent]]) [[moment of symmetry]] scale"
intro = intro .. "[[オクターブ]]を周期とする[[MOSスケール]]である。"
elseif rat.eq(input_mos.equave, rat.new(3)) then
elseif rat.eq(input_mos.equave, rat.new(3)) then
intro = intro .. " is a 3/1-equivalent ([[tritave]]-equivalent) [[moment of symmetry]] scale"
intro = intro .. "[[トリターブ]]を周期とする[MOSスケール]]である。"
elseif rat.eq(input_mos.equave, rat.new(3,2)) then
elseif rat.eq(input_mos.equave, rat.new(3,2)) then
intro = intro .. " is a 3/2-equivalent (fifth-equivalent) [[moment of symmetry]] scale"
intro = intro .. "[[3/2]]を周期とする[[MOSスケール]]である。"
else
else
intro = intro .. string.format(" is a %s-equivalent ([[nonoctave|non-octave]]) [[moment of symmetry]] scale", equave_as_ratio)
intro = intro .. string.format("%sを周期とする[[MOSスケール]]である。", equave_as_ratio)
end
end
-- Add step counts
intro = intro .. string.format(" containing %d large %s", nL, (nL == 1 and "step" or "steps"))
intro = intro .. string.format(" and %d small %s", ns, (ns == 1 and "step" or "steps"))
-- 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]] (%.1f{{cent}}).", equave_as_ratio, equave_in_cents, round))
intro = intro .. (equave_in_cents == 1200 and "[[オクターブ]]" or string.format("[[%s]] (%.1f{{cent}})の音程", 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("この音階は、%d個の広い音程と%d個の狭い音程からなる繰り返しが", nL/n, ns/n)
intro = intro .. string.format(" and %d small %s", ns/n, (ns/n == 1 and "step" or "steps"))
intro = intro .. string.format("%.1f{{cent}}ごとに、つまり", period_in_cents)
intro = intro .. string.format(" that repeats every %.1f{{cent}}", period_in_cents)
intro = intro .. (equave_in_cents == 1200 and "[[オクターブ]]" or string.format("[[%s]] (%.1f{{cent}})の音程", equave_as_ratio, equave_in_cents, round)) .. string.format("につき%d回繰り返される。", n)
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(" interval of [[%s]] (%.1f{{cent}}).", equave_as_ratio, equave_in_cents, round))
 
end
end
283行目: 292行目:
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))
intro = intro .. string.format(" [[Generator]]s that produce this scale range from %s{{cent}} to %s{{cent}}, or from %s{{cent}} to %s{{cent}}.", bright_gen_min_r, bright_gen_max_r, dark_gen_min_r, dark_gen_max_r)
intro = intro .. string.format("%s{{cent}}から%s{{cent}}、あるいは%s{{cent}}から%s{{cent}}までの[[ジェネレーター]]を用いて作られる。", bright_gen_min_r, bright_gen_max_r, dark_gen_min_r, dark_gen_max_r)
-- Rothenberg propriety (rothenprop) info
-- Rothenberg propriety (rothenprop) info
if ns == 1 then
if ns == 1 then
intro = intro .. " Scales of this form are always [[proper]] because there is only one small step."
intro = intro .. "この形式の音階は、狭い音程が1つしかないため、常に{{En仮リンク|厳密に適正|Rothenberg propriety}}となる。"
elseif ns / n == 1 then
elseif ns / n == 1 then
intro = intro .. " Scales of the true MOS form, where every period is the same, are [[proper]] because there is only one small step per period."
intro = intro .. "全ての周期が等しく、真にMOSである場合は、1周期につき狭い音程が1つしかないため、{{En仮リンク|厳密に適正|Rothenberg propriety}}である。"
end
end