Template:Infobox interval: Difference between revisions

From Xenharmonic Wiki
Jump to navigation Jump to search
Xenwolf (talk | contribs)
First version. Import from de:Vorlage:Infobox Intervall is now complete :)
Fredg999 (talk | contribs)
Add parameter for harmonic entropy (opt-in switch)
 
(46 intermediate revisions by 8 users not shown)
Line 1: Line 1:
<div style="
<includeonly>{{#invoke: Infobox_interval | infobox_interval
border: 1px solid #999;
| Ratio={{{1|{{{Ratio|{{PAGENAME}}}}}}}}
margin: 0;
| Ket={{{Ket|{{{Monzo|}}}}}}
margin-left: 1em;
| Cents={{{Cents|}}}
margin-bottom: 0.5em;
| Comma={{{Comma|}}}
padding: 0.25em 0.5em;
| Name={{{Name|}}}
background-color: #fafafa;
| Color name={{{Color name|}}}
<!-- width: 15em; -->
| FJS name={{{FJS name|}}}
float: right;
| Sound={{{Sound|}}}
">
| Calc={{{Calc|}}}
{|
| debug={{lc:{{{debug|}}}}}
|+ '''Interval info'''
| Harmonic entropy={{lc:{{{Harmonic entropy|}}}}}
{{#if: {{{Icon|}}} |
}}</includeonly><noinclude>
  {{!}} colspan="2" style="text-align:center" {{!}} {{{Icon}}}
{{documentation}}
}}
|-
| style="text-align:right" | Ratio&nbsp; || '''{{{Ratio|[[Template:Infobox Interval|Ratio?]]}}}'''
|-
| style="text-align:right" | [[Monzos|Monzo]]&nbsp; || '''{{Monzo|{{{Monzo|[[Template:Infobox Interval|Monzo?]]}}} }}'''
|-
| style="text-align:right" | Size in [[Cent|Cents (&cent;)]]&nbsp; || '''{{{Cents|[[Template:Infobox Interval|Cents?]]}}}'''
|-
| style="text-align:right" | Name(s)&nbsp; || '''{{{Name|{{{Names|[[Template:Infobox Interval|Names?]]}}}}}}'''
|-
{{#if: {{{Sound|}}} |
  {{!}} colspan="2" style="text-align: center;" {{!}} [[File:{{{Sound}}}]]<br/><small>[[:File:{{{Sound}}}|[sound info]]]</small>
}}
|}
</div><noinclude>


The template '''Infobox Interval''' was built to help presenting basic informations about [[Interval]]s in a unified form, to make them obvious by glance. Also the formatting of the wiki text itself is easier to read and improve when it is obviously structured by this template.
[[Category:Infoboxes]]
 
The templates supports the following parameters (mandatory parameters in '''bold'''):
 
{| class="wikitable"
! Parameter
! Meaning
! Usage hints, Remarks
|-
| Icon
| Image or symbol, if one exists
| complete with prefix "File:" and brackets
|-
| '''Ratio'''
| Frequency ratio of the interval
|
|-
| '''Cents'''
| Size in [[Cent]]
|
|-
| '''Monzo'''
| Parameters of the [[Monzos|Monzo notation]]
|
|-
| '''Names''' <br/> or '''Name'''
| Name(s) od the interval
| '''''Maybe better optional?'''''
|-
| Sound
| Soundfile is one exists
| only name of the file (no prefix "File:" and of course without Brackets)
|}
 
Usage example for the oktave ([[2/1]]).
<nowiki>{{Infobox Interval
| Ratio = 2/1
| Cents = 1200
| Monzo = 1
| Name = Octave
}}</nowiki>
 
[[Category:Templates]]
 
[[de:Vorlage:Infobox Intervall]]
</noinclude>
</noinclude>

Latest revision as of 19:00, 4 August 2025

Template documentation[view] [edit] [history] [purge]

The Infobox Interval template was built to help presenting basic information about intervals in a unified form, to make them obvious by glance. Also the formatting of the wiki text itself is easier to read and improve when it is obviously structured by this template.

Usage

The template should be placed at the beginning of an interval page. There are three different ways to use this template:

  • Small ratios: {{Infobox Interval}} (the ratio is inferred from page name), {{Infobox Interval|7/4}}, {{Infobox Interval|Ratio=7/4}}.
    • When use this form? In most cases, whenever both numerator and denominator of the ratio are small enough to fit within Lua numbers as integers. You should not encounter any problems with integers up to 232 − 1, and you might happen to not encounter any problems when those are 253. With larger numbers, you are almost guaranteed to get inaccurate results.
  • Large ratios: {{Infobox Interval|Ket=-2 0 0 1}}, {{Infobox Interval|Monzo=-2 0 0 1}}.
    • In this form, Ratio (unless you specify it explicitly, in which case it will be printed as is) and most norms are omitted.
    • When use this form? Whenever numerator or denominator are too large.
  • Irrational intervals: {{Infobox Interval|Ratio=\pi|Cents=1981.795}}.
    • In this form, Factorization, Subgroup, Monzo (unless you specify it explicitly), FJS name, norms are omitted.
    • When use this form? Whenever the interval is irrational.

The template will add the page to the categories when appropriate:

The template supports the following parameters:

Entry Parameter Meaning and usage notes
Ratio 1, Ratio Frequency ratio of the interval. Specified explicitly, derived from page name or omitted. For irrational intervals, a LaTeX expression describing the interval (without <math>).
Factorization Prime factorization of the ratio. Derived either from Ratio or Monzo or omitted for irrational intervals.
Monzo Ket, Monzo Coefficients of the monzo notation, separated by whitespaces. Derived from Ratio or specified or omitted for irrational intervals. If you specify one for an irrational interval, Template: Monzo with the provided argument will be printed.
Subgroup monzo Shown instead of Factorization and Monzo when there is a sequence of 4 or more zeros in ket notation. Derived either from Ratio or Monzo or omitted for irrational intervals.
Cents Cents Size in cents. Either derived from Ratio or Monzo or specified for irrational intervals.
Name Name Name(s) of the interval. Pages with missing values go into Category:Todo:add interval name. You should not put any <br> tags between names here; it will be done automatically.
Color name Color name Color name after Kite's color notation in the form: written form, spoken form. For color names see also Gallery of just intervals. Pages with missing values go into Category:Todo:add color name. Default: omitted.
FJS name FJS name Functional Just System name. Provided, derived from Ratio or Monzo or omitted for irrational intervals. Use LaTeX syntax to provide custom names: P5^{11}_{5}.
Special properties Currently implemented: superparticular and square superparticular for small ratios, harmonics and subharmonics, including reduced ones, whether a ratio is reduced.
Tenney height Derived from Ratio or Monzo or omitted.
Weil height Derived from Ratio or omitted.
Wilson height Derived from Ratio, or omitted.
Harmonic entropy Harmonic entropy Harmonic entropy approximation (Shannon, [math]\displaystyle{ \sqrt{nd} }[/math] weights, [math]\displaystyle{ 200\text{-integer limit} \cap \left\lbrace x \mid \left\Vert x \right\Vert \leq 100 \right\rbrace }[/math]). Derived from Ratio, Monzo, or Cents. Harmonic entropy is hidden by default, pass the value of yes to display it.
Comma size Comma Pass a non-empty string (for example, yes or 1) to enable this entry. For specific values of Cents, an interval is considered a comma. [math]\displaystyle{ (0; 3.5] \to }[/math] unnoticeable, [math]\displaystyle{ (3.5; 30] \to }[/math] small, [math]\displaystyle{ (30; 100] \to }[/math] medium, [math]\displaystyle{ (100; +∞) \to }[/math] large. If the interval is rational and is an integer power of another rational number, the entry is omitted.
S-expressions For a rational Comma, a search for S-expressions of specific forms is done.
Sound Sound Soundfile, if one exists. Only name of the file is required (no prefix "File:" and of course without brackets). Default: omitted.
Xen-calc Calc A link to xen-calc. Provided or derived from Ratio or Monzo or omitted. When provided (you should do that only for irrational intervals recognised by xen-calc, such as sqrt(25/24)), Calc is interpreted as the query, not the full link. It is urlencoded automatically.

Examples

Interval information
Ratio 7/4
Factorization 2-2 × 7
Monzo [-2 0 0 1
Size in cents 968.8259¢
Name harmonic seventh
Color name z7, zo 7th
FJS name [math]\displaystyle{ \text{m7}^{7} }[/math]
Special properties reduced,
reduced harmonic
Tenney height (log2 nd) 4.80735
Weil height (log2 max(n, d)) 5.61471
Wilson height (sopfr(nd)) 11

[sound info]
Open this interval in xen-calc

Usage example for a small ratio (7/4):

{{Infobox Interval
| Name = harmonic seventh
| Color name = z7, zo 7th
| Sound = jid_7_4_pluck_adu_dr220.mp3
}}

Usage example for a large ratio (septimal ruthenia), which is also considered to be a comma:

{{Infobox Interval
| Monzo = -263 88 0 44
| Name = septimal ruthenia, septiruthenia
| Comma = yes
}}

Usage example for an irrational interval (sqrt(25/24)):

{{Infobox Interval
| Ratio = \sqrt{25/24}
| Monzo = -3/2 -1/2 1
| Cents = 35.336213
| Name = square root of 25/24
| Calc = sqrt(25/24)
}}

Boilerplate

Empty template for copy & paste (to avoid copying wrong values from interval pages):

{{Infobox Interval
| Name = 
| Color name = 
| Sound = 
}}

See also