Template:Harmonics in equal/doc: Difference between revisions

m Default number of columns is 10 now
No edit summary
 
(13 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<includeonly><hr><small>Documentation transcluded from [[/doc]]</small></includeonly>
{{Dochead}}{{lua}}
This template generates a table for prime approximations in [[Equal-step tuning|equal-step tunings]].
This template generates a table with the approximations of harmonics for a given [[equal tuning]].


=== Usage ===
=== Usage ===
==== Simple ====
==== Simple ====
For divisions of the octave ([[edo]]s), you can use one unnamed argument:


For divisions of the octave ([[edo]]), you can use one unnamed argument:
<code><nowiki>{{Harmonics in equal|<edo number>}}</nowiki></code>
 
<syntaxhighlight lang="text">
{{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><nowiki>{{Harmonics in equal|<steps>|<numerator>|<denominator>}}</nowiki></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.


==== Advanced ====
==== Advanced ====
The template takes up to 9 arguments:


The template takes up to 8 arguments:
<pre>
 
{{Harmonics in equal
<syntaxhighlight lang="text">
{{harmonics in equal
| steps = <number of steps>
| steps = <number of steps>
| num = <numerator>
| num = <numerator>
Line 34: Line 27:
| title = <your title>
| title = <your title>
| intervals = <interval list name>
| intervals = <interval list name>
| collapsed = <anything>
}}
}}
</syntaxhighlight>
</pre>
 
; <code>steps</code>
: Number of steps. This parameter can also be given without the parameter name. Default is 12.
 
; <code>num</code>
: Numerator of the interval that is divided equally. Can be used without parameter name. Default is 2.
 
; <code>denom</code>
: Denominator of the interval that is divided equally. Can be used without parameter name. Default is 1.
 
; </code>columns</code>
: Number of intervals to include. Default is 11.


; steps
; <code>start</code>
: Number of steps. This parameter can also be given without the parameter name. Default: 12.
; num
: Numerator of the interval that is divided equally. Can be used without parameter name. Default: 2.
; denom
: Denominator of the interval that is divided equally. Can be used without parameter name. Default: 1.
; columns
: number of intervals to include. Default: 10.
; start
: 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.
; prec
 
; <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.
; title
 
; <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.
; intervals
 
; <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>
: Anything here to collapse the table.


=== Examples ===
=== Examples ===
==== Basic ====
==== Basic ====
For edos it is sufficient to only input the number of steps:


For edos it is sufficient to only input the number of steps:
<code><nowiki>{{Harmonics in equal|31}}</nowiki></code>
{{{{ROOTPAGENAME}}|31}}


<syntaxhighlight lang="text">
For tritave or other integer divisions, two arguments is enough:</nowiki>
{{harmonics in equal|31}}
</syntaxhighlight>
{{harmonics in equal|31}}


For tritave or other integer divisions, two arguments is enough:
<code><nowiki>{{Harmonics in equal|13|3}}</nowiki></code>
<syntaxhighlight lang="text">
{{{{ROOTPAGENAME}}|13|3}}
{{harmonics in equal|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.


<syntaxhighlight lang="text">
<code><nowiki>{{Harmonics in equal|15|7|3}}</nowiki></code>
{{harmonics in equal|15|7|3}}
{{{{ROOTPAGENAME}}|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><nowiki>{{Harmonics in equal|13|3|columns=11|start=2|title=Primes in [[13edt]]|intervals=prime}}</nowiki></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}}
{{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}}
</syntaxhighlight>
</pre>
{{harmonics in equal|313|columns=9|start=2}}
{{{{ROOTPAGENAME}}|313|columns=9|start=2}}
{{harmonics in equal|313|columns=9|start=2|prec=5|title=Same with prec=5}}
{{{{ROOTPAGENAME}}|313|columns=9|start=2|prec=5|title=Same with prec=5}}
 
=== See also ===
* [[Template: Harmonics in cet]]