「モジュール:Infobox interval」の版間の差分
編集の要約なし |
編集の要約なし |
||
| (同じ利用者による、間の3版が非表示) | |||
| 91行目: | 91行目: | ||
prime_limit = rat.max_prime(ratio) | prime_limit = rat.max_prime(ratio) | ||
end | end | ||
cats = cats .. "[[Category: | cats = cats .. "[[Category:有理数音程]]" .. "[[Category:" .. prime_limit .. "-limit音程]]" | ||
else | else | ||
cats = cats .. "[[Category: | cats = cats .. "[[Category:無理数音程]]" | ||
end | end | ||
end | end | ||
| 101行目: | 101行目: | ||
if small and rat.is_superparticular(ratio) then | if small and rat.is_superparticular(ratio) then | ||
if rat.is_square_superparticular(ratio) then | if rat.is_square_superparticular(ratio) then | ||
table.insert(special_properties, " | table.insert(special_properties, "{{en仮リンク|平方スーパーパーティキュラー|square superparticular}}") | ||
else | else | ||
table.insert(special_properties, "[[ | table.insert(special_properties, "[[スーパーパーティキュラー]]") | ||
end | end | ||
cats = cats .. "[[Category: | cats = cats .. "[[Category:スーパーパーティキュラー]]" | ||
end | end | ||
if rat.is_reduced(ratio, 2, not small) then | if rat.is_reduced(ratio, 2, not small) then | ||
table.insert(special_properties, "[[ | table.insert(special_properties, "[[オクターブ縮約]]") | ||
end | end | ||
if rat.is_harmonic(ratio) then | if rat.is_harmonic(ratio) then | ||
num, den = rat.as_pair (ratio) | num, den = rat.as_pair (ratio) | ||
table.insert(special_properties, "[[ | table.insert(special_properties, "[[倍音]]") | ||
cats = cats .. "[[Category: | cats = cats .. "[[Category:倍音|" .. string.rep("#", string.len(num)) .. "]]" | ||
if rat.is_prime(ratio) then | if rat.is_prime(ratio) then | ||
table.insert(special_properties, "[[ | table.insert(special_properties, "[[素数倍音]]") | ||
cats = cats .. "[[Category: | cats = cats .. "[[Category:素数倍音|" .. string.rep("#", string.len(num)) .. "]]" | ||
end | end | ||
if rat.is_highly_composite(ratio) then | if rat.is_highly_composite(ratio) then | ||
table.insert(special_properties, "[[ | table.insert(special_properties, "[[高度合成数倍音]]") | ||
cats = cats .. "[[Category: | cats = cats .. "[[Category:倍音|" .. string.rep("#", string.len(num)) .. "]]" | ||
end | end | ||
elseif rat.is_harmonic(ratio, true, not small) then | elseif rat.is_harmonic(ratio, true, not small) then | ||
table.insert(special_properties, "[[Harmonic| | table.insert(special_properties, "[[Harmonic|縮約倍音]]") | ||
cats = cats .. "[[Category: | cats = cats .. "[[Category:オクターブ縮約倍音]]" | ||
elseif rat.is_subharmonic(ratio, true, not small) then | elseif rat.is_subharmonic(ratio, true, not small) then | ||
table.insert(special_properties, "[[Subharmonic| | table.insert(special_properties, "[[Subharmonic|縮約下方倍音]]") | ||
cats = cats .. "[[Category: | cats = cats .. "[[Category:オクターブ縮約下方倍音]]" | ||
end | end | ||
elseif regular then | elseif regular then | ||
if cents >= 0 and cents < 1200 then | if cents >= 0 and cents < 1200 then | ||
table.insert(special_properties, "[[ | table.insert(special_properties, "[[オクターブ縮約]]") | ||
end | end | ||
end | end | ||
| 143行目: | 143行目: | ||
else | else | ||
table.insert(infobox_data, { | table.insert(infobox_data, { | ||
" | "式", | ||
"<math>" .. ratio_string .. "</math>", | "<math>" .. ratio_string .. "</math>", | ||
}) | }) | ||
| 209行目: | 209行目: | ||
cats = cats .. "[[Category:Todo:add interval name]]" | cats = cats .. "[[Category:Todo:add interval name]]" | ||
table.insert(infobox_data, { | table.insert(infobox_data, { | ||
" | "名前", | ||
"<abbr title=\"missing value for parameter 'Name'\">''missing''</abbr><sup>[[Template:Infobox Interval| ? ]]</sup>", | "<abbr title=\"missing value for parameter 'Name'\">''missing''</abbr><sup>[[Template:Infobox Interval| ? ]]</sup>", | ||
}) | }) | ||
| 264行目: | 264行目: | ||
if rational and regular then | if rational and regular then | ||
table.insert(infobox_data, { | table.insert(infobox_data, { | ||
"[[テニーノルム]] (log<sub>2</sub> ''nd'')", | "[[テニーノルム]] <br />(log<sub>2</sub> ''nd'')", | ||
utils._round(rat.tenney_height(ratio), 6), | utils._round(rat.tenney_height(ratio), 6), | ||
}) | }) | ||
table.insert(infobox_data, { | table.insert(infobox_data, { | ||
"[[ワイルノルム]] (log<sub>2</sub> max(''n'', ''d''))", | "[[ワイルノルム]] <br />(log<sub>2</sub> max(''n'', ''d''))", | ||
utils._round(rat.weil_height(ratio), 6), | utils._round(rat.weil_height(ratio), 6), | ||
}) | }) | ||
table.insert(infobox_data, { | table.insert(infobox_data, { | ||
"[[ウィルソンノルム]] (sopfr(''nd''))", | "[[ウィルソンノルム]] <br />(sopfr(''nd''))", | ||
utils._round(rat.wilson_height(ratio), 6), | utils._round(rat.wilson_height(ratio), 6), | ||
}) | }) | ||
| 282行目: | 282行目: | ||
if harmonic_entropy_switch then | if harmonic_entropy_switch then | ||
table.insert(infobox_data, { | table.insert(infobox_data, { | ||
"[[ | "[[ハーモニックエントロピー]]<br>(Shannon, <math>\\sqrt{nd}</math>)", | ||
"~" .. utils._round(he.harmonic_entropy(cents), 6) .. " bits", | "~" .. utils._round(he.harmonic_entropy(cents), 6) .. " bits", | ||
}) | }) | ||
| 317行目: | 317行目: | ||
local S_expressions = rat.find_S_expression(ratio) | local S_expressions = rat.find_S_expression(ratio) | ||
if #S_expressions > 0 then | if #S_expressions > 0 then | ||
local caption = "[[ | local caption = "[[S式]]" | ||
if #S_expressions > 1 then | if #S_expressions > 1 then | ||
caption = caption .. "s" | caption = caption .. "s" | ||
| 369行目: | 369行目: | ||
query = mw.uri.encode(query) | query = mw.uri.encode(query) | ||
table.insert(infobox_data, { | table.insert(infobox_data, { | ||
"<span style=\"font-size: 75%;\">[https://www.yacavone.net/xen-calc/?q=" .. query .. " | "<span style=\"font-size: 75%;\">[https://www.yacavone.net/xen-calc/?q=" .. query .. "''xen-calc''で聴く]</span>", | ||
}) | }) | ||
end | end | ||