Template:Harmonics in equal/doc: Difference between revisions

ArrowHead294 (talk | contribs)
No edit summary
ArrowHead294 (talk | contribs)
mNo edit summary
Line 4: Line 4:
=== Usage ===
=== Usage ===
==== Simple ====
==== Simple ====
For divisions of the octave ([[edo]]), you can use one unnamed argument:
For divisions of the octave ([[EDO]]s), you can use one unnamed argument:


<syntaxhighlight lang="text">
<code>{{((}}Harmonics in equal{{!}}{{^(}}EDO number{{)^}}{{))}}</code>
{{Harmonics in equal|<EDO number>}}
</syntaxhighlight>


For other divisions, you can use two or three unnamed arguments:
For other divisions, you can use two or three unnamed arguments:


<syntaxhighlight lang="text">
<code>{{((}}Harmonics in equal{{!}}{{^(}}steps{{)^}}{{!}}{{^(}}numerator{{)^}}{{!}}{{^(}}denominator{{)^}}{{))}}</code>
{{Harmonics in equal|<steps>|<numerator>|<denominator>}}
</syntaxhighlight>


By default, the titles for divisions of 2/1, 3/1 and 3/2 will be displayed as 'edo', 'edt' and 'edf' respectively. When the denominator is 1, it will not be displayed. Edos get primes if they are consistent for the odd harmonics up to 21, otherwise they get odds. Everything that is not an edo gets integers.
By default, the titles for divisions of 2/1, 3/1 and 3/2 will be displayed as 'edo', 'edt' and 'edf' respectively. When the denominator is 1, it will not be displayed. Edos get primes if they are consistent for the odd harmonics up to 21, otherwise they get odds. Everything that is not an edo gets integers.
Line 21: Line 17:
The template takes up to 9 arguments:
The template takes up to 9 arguments:


<syntaxhighlight lang="text">
<pre>
{{Harmonics in equal
{{Harmonics in equal
| steps = <number of steps>
| steps = <number of steps>
Line 33: Line 29:
| collapsed = <anything>
| collapsed = <anything>
}}
}}
</syntaxhighlight>
</pre>


; <code>steps</code>
; <code>steps</code>
: Number of steps. This parameter can also be given without the parameter name. Default: 12.
: Number of steps. This parameter can also be given without the parameter name. Default is 12.
 
; <code>num</code>
; <code>num</code>
: Numerator of the interval that is divided equally. Can be used without parameter name. Default: 2.
: Numerator of the interval that is divided equally. Can be used without parameter name. Default is 2.
 
; <code>denom</code>
; <code>denom</code>
: Denominator of the interval that is divided equally. Can be used without parameter name. Default: 1.
: Denominator of the interval that is divided equally. Can be used without parameter name. Default is 1.
 
; </code>columns</code>
; </code>columns</code>
: Number of intervals to include. Default: 10.  
: Number of intervals to include. Default is 10.  
 
; <code>start</code>
; <code>start</code>
: Default is 1 (which means the prime 2), set to 2 to skip the octave.
: Default is 1 (which means the prime 2), set to 2 to skip the octave.
; <code>prec</code>
; <code>prec</code>
: Precision of absolute error (digits after the decimal point), default is estimated according to the step size.
: Precision of absolute error (digits after the decimal point), default is estimated according to the step size.
; <code>title</code>
; <code>title</code>
: Default is: "Approximations of harmonics in ''name''". By default, the names for divisions of 2/1, 3/1 and 3/2 will be displayed as 'edo', 'edt' and 'edf' respectively. When the denominator is 1, it will not be displayed.
: Default is: "Approximations of harmonics in ''name''". By default, the names for divisions of 2/1, 3/1 and 3/2 will be displayed as 'edo', 'edt' and 'edf' respectively. When the denominator is 1, it will not be displayed.
; <code>intervals</code>
; <code>intervals</code>
: Can be <code>prime</code> for primes, <code>odd</code> for odd harmonics and <code>integer</code> for integer harmonics. By default, edos get primes if they are consistent for the odd harmonics up to 21, otherwise they get odds. Everything that is not an edo gets integers.
: Can be <code>prime</code> for primes, <code>odd</code> for odd harmonics and <code>integer</code> for integer harmonics. By default, edos get primes if they are consistent for the odd harmonics up to 21, otherwise they get odds. Everything that is not an edo gets integers.
; <code>collapsed</code>
; <code>collapsed</code>
: Anything here to collapse the table.
: Anything here to collapse the table.
Line 58: Line 62:
For edos it is sufficient to only input the number of steps:
For edos it is sufficient to only input the number of steps:


<syntaxhighlight lang="text">
<code>{{((}}Harmonics in equal{{!}}31{{))}}</code>
{{Harmonics in equal|31}}
{{{{ROOTPAGENAME}}|31}}
</syntaxhighlight>
{{Harmonics in equal|31}}


For tritave or other integer divisions, two arguments is enough:
For tritave or other integer divisions, two arguments is enough:
<syntaxhighlight lang="text">
<code>{{((}}Harmonics in equal{{!}}13{{!}}3{{))}}</code>
{{Harmonics in equal|13|3}}
{{{{ROOTPAGENAME}}|13|3}}
</syntaxhighlight>
{{Harmonics  in equal|13|3}}


In the most general case, we can input the number of steps, numerator and denominator.
In the most general case, we can input the number of steps, numerator and denominator.
 
<code>{{((}}Harmonics in equal{{!}}15{{!}}7{{!}}3{{))}}</code>
<syntaxhighlight lang="text">
{{{{ROOTPAGENAME}}|15|7|3}}
{{Harmonics in equal|15|7|3}}
</syntaxhighlight>
{{Harmonics in equal|15|7|3}}


==== Advanced ====
==== Advanced ====
Sometimes you want to see more or skip some lower columns and have to adjust the title:
Sometimes you want to see more or skip some lower columns and have to adjust the title:


<syntaxhighlight lang="text">
<code>{{((}}Harmonics in equal{{!}}13{{!}}3{{!}}columns{{=}}11{{!}}start{{=}}2{{!}}title{{=}}Primes in {{!((}}<nowiki />13edt{{))!}}{{!}}intervals{{=}}prime{{))}}</code>
{{Harmonics in equal|13|3|columns=11|start=2|title=Primes in [[13edt]]|intervals=prime}}
{{{{ROOTPAGENAME}}|13|3|columns=11|start=2|title=Primes in [[13edt]]|intervals=prime}}
</syntaxhighlight>
{{Harmonics in equal|13|3|columns=11|start=2|title=Primes in [[13edt]]|intervals=prime}}


For large divisions ([[313edo]] in this example) the absolute error gets very small. The default precision gets calculated automatically, but if we want to increase it even further, we can set <code>prec</code> to a higher value. This is not recommended generally.
For large divisions ([[313edo]] in this example) the absolute error gets very small. The default precision gets calculated automatically, but if we want to increase it even further, we can set <code>prec</code> to a higher value. This is not recommended generally.


<syntaxhighlight lang="text">
<pre>
{{Harmonics in equal|313|columns=9|start=2}}
{{Harmonics in equal|313|columns=9|start=2|prec=5|title=Same with prec=5}}
</syntaxhighlight>
{{Harmonics in equal|313|columns=9|start=2}}
{{Harmonics in equal|313|columns=9|start=2}}
{{Harmonics in equal|313|columns=9|start=2|prec=5|title=Same with prec=5}}
{{Harmonics in equal|313|columns=9|start=2|prec=5|title=Same with prec=5}}
</pre>
{{{{ROOTPAGENAME}}|313|columns=9|start=2}}
{{{{ROOTPAGENAME}}|313|columns=9|start=2|prec=5|title=Same with prec=5}}


=== See also ===
=== See also ===
* {{modlink}}
* {{modlink}}