「モジュール:Infobox chord」の版間の差分

Furcht968 (トーク | 投稿記録)
ページの作成:「local p = {} local consistency = require("Module:Chord consistency") local infobox = require("Module:Infobox") local rat = require("Module:Rational") local utils = require("Module:Utils") local yesno = require("Module:Yesno") function p.infobox_chord(frame) local debug_mode = yesno(frame.args["debug"]) local page_name = frame:preprocess("{{PAGENAME}}") local debug_data = "" local infobox_data = {} local cats = "" local color_names = {} if utils.value_pro…」
 
Furcht968 (トーク | 投稿記録)
編集の要約なし
 
(同じ利用者による、間の3版が非表示)
178行目: 178行目:
end
end
end
end
local consistent_edos = consistency.consistent_edos(harmonics, distance, 'edo', 4)
local consistent_edos = consistency.consistent_edos(harmonics, distance, '平均律', 4)
-- compute tag to add for category sort order: as many "#" as the number of digits in the first harmonic
-- compute tag to add for category sort order: as many "#" as the number of digits in the first harmonic
193行目: 193行目:
end
end


table.insert(infobox_data, {"Harmonics", table.concat(harmonics, ":")})
table.insert(infobox_data, {"倍音", table.concat(harmonics, ":")})
if (not utils.value_provided(frame.args["Root"])) and (utonal_odd_limit <= otonal_odd_limit or utonal_odd_limit < 1000) then
if (not utils.value_provided(frame.args["Root"])) and (utonal_odd_limit <= otonal_odd_limit or utonal_odd_limit < 1000) then
table.insert(infobox_data, {"Subharmonics", "1/(" .. table.concat(subharmonics, ":") .. ")"})
table.insert(infobox_data, {"下方倍音", "1/(" .. table.concat(subharmonics, ":") .. ")"})
end
end
table.insert(infobox_data, {"Intervals from root", table.concat(root_interval_links,  
table.insert(infobox_data, {"根音からの音程", table.concat(root_interval_links,  
"<span style=\"padding-left: 0.1em; padding-right: 0.1em;\">&ndash;</span>")})
"<span style=\"padding-left: 0.1em; padding-right: 0.1em;\">&ndash;</span>")})
table.insert(infobox_data, {"Cents from root", table.concat(root_cents_steps,  
table.insert(infobox_data, {"根音からのセント", table.concat(root_cents_steps,  
"<span style=\"padding-left: 0.1em; padding-right: 0.1em;\">&ndash;</span>")})
"<span style=\"padding-left: 0.1em; padding-right: 0.1em;\">&ndash;</span>")})
table.insert(infobox_data, {"Step intervals", table.concat(step_interval_links, ", ")})
table.insert(infobox_data, {"ステップ音程", table.concat(step_interval_links, ", ")})
table.insert(infobox_data, {"Step cents", table.concat(step_cents, ", ")})
table.insert(infobox_data, {"ステップセント", table.concat(step_cents, ", ")})


-- TODO: category goes here.
-- TODO: category goes here.


if table.getn(color_names) > 0 then
if table.getn(color_names) > 0 then
local label = "Color name"
local label = "カラーネーム"
if table.getn(color_names) > 1 then
if table.getn(color_names) > 1 then
label = "Color names"
label = "カラーネーム"
end
end
table.insert(infobox_data, {"[[Color notation|" .. label .. "]]", table.concat(color_names, "<br />")})
table.insert(infobox_data, {"[[Color notation|" .. label .. "]]", table.concat(color_names, "<br />")})
215行目: 215行目:


if prime_limit < 96 then
if prime_limit < 96 then
table.insert(infobox_data, {"[[Prime limit]]", "[[" .. prime_limit .. "-limit|" .. prime_limit .. "]]"})
table.insert(infobox_data, {"[[素数リミット]]", "[[" .. prime_limit .. "-limit|" .. prime_limit .. "]]"})
cats = cats .. "[[Category:" .. prime_limit .. "-limit chords" .. sort_tag .. "]]"
cats = cats .. "[[Category:" .. prime_limit .. "-limit chords" .. sort_tag .. "]]"
else
else
table.insert(infobox_data, {"[[Prime limit]]", prime_limit})
table.insert(infobox_data, {"[[素数リミット]]", prime_limit})
cats = cats .. "[[Category:Just intonation chords" .. sort_tag .. "]]"
cats = cats .. "[[Category:Just intonation chords" .. sort_tag .. "]]"
end
end
228行目: 228行目:
genus_data = genus_data .. " (" .. genus_product .. ")"
genus_data = genus_data .. " (" .. genus_product .. ")"
end
end
table.insert(infobox_data, {"[[Euler-Fokker genus|Genus]]", genus_data})
table.insert(infobox_data, {"[[Euler-Fokker genus]]", genus_data})


if odd_limit < 32 then
if odd_limit < 32 then
table.insert(infobox_data, {"[[Intervallic odd limit]]", "[[" .. odd_limit .. "-odd-limit|" .. odd_limit .. "]]"})
table.insert(infobox_data, {"[[音程奇数リミット]]", "[[" .. odd_limit .. "-odd-limit|" .. odd_limit .. "]]"})
cats = cats .. "[[Category:" .. odd_limit .. "-odd-limit chords" .. sort_tag .. "]]"
cats = cats .. "[[Category:" .. odd_limit .. "-odd-limit chords" .. sort_tag .. "]]"
else  
else  
table.insert(infobox_data, {"[[Intervallic odd limit]]", odd_limit})
table.insert(infobox_data, {"[[音程奇数リミット]]", odd_limit})
end
end
table.insert(infobox_data, {"[[Otonal odd limit]]", otonal_odd_limit})
table.insert(infobox_data, {"[[上方奇数リミット]]", otonal_odd_limit})
table.insert(infobox_data, {"[[Utonal odd limit]]", utonal_odd_limit})
table.insert(infobox_data, {"[[下方奇数リミット]]", utonal_odd_limit})


if consistent_edos ~= "" then
if consistent_edos ~= "" then
table.insert(infobox_data, {"[[Consistency|Consistent edos]] (''d'' &ge; " .. distance .. ")", "<span style=\"font-size: 75%;\">" .. consistent_edos .. "</span>"})
table.insert(infobox_data, {"[[一貫性|一貫する平均律]] (''d'' &ge; " .. distance .. ")", "<span style=\"font-size: 75%;\">" .. consistent_edos .. "</span>"})
table.insert(infobox_data, {"<div style=\"font-size: 75%; text-align: right; white-space: nowrap;\">[[Module:Chord consistency/doc|* 2 &le; ''d'' &lt; 4; ** 4 &le; ''d'' &lt; 8; *** 8 &le; ''d'' &lt; 16; &hellip;]]</div>"})
table.insert(infobox_data, {"<div style=\"font-size: 75%; text-align: right; white-space: nowrap;\">[[Module:Chord consistency/doc|* 2 &le; ''d'' &lt; 4; ** 4 &le; ''d'' &lt; 8; *** 8 &le; ''d'' &lt; 16; &hellip;]]</div>"})
else
else
table.insert(infobox_data, {"[[Consistency|Consistent edos]] (''d'' &ge; " .. distance .. ")", "<small>not exist in the range up to 72</small>"})
table.insert(infobox_data, {"[[一貫性|一貫する平均律]] (''d'' &ge; " .. distance .. ")", "<small>not exist in the range up to 72</small>"})
end
end
end
end
254行目: 254行目:
end
end


local result = infobox.build("<u>Chord information</u>", infobox_data)
local result = infobox.build("<u>和音情報</u>", infobox_data)
if not debug_mode then
if not debug_mode then