Template:Harmonics in equal/doc: Difference between revisions
m Default number of columns is 10 now |
Update |
||
Line 3: | Line 3: | ||
=== Usage === | === Usage === | ||
==== Simple ==== | ==== Simple ==== | ||
Line 9: | Line 8: | ||
<syntaxhighlight lang="text"> | <syntaxhighlight lang="text"> | ||
{{ | {{Harmonics in equal|<EDO number>}} | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 15: | Line 14: | ||
<syntaxhighlight lang="text"> | <syntaxhighlight lang="text"> | ||
{{ | {{Harmonics in equal|<steps>|<numerator>|<denominator>}} | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 22: | Line 21: | ||
==== Advanced ==== | ==== Advanced ==== | ||
The template takes up to | The template takes up to 9 arguments: | ||
<syntaxhighlight lang="text"> | <syntaxhighlight lang="text"> | ||
{{ | {{Harmonics in equal | ||
| steps = <number of steps> | | steps = <number of steps> | ||
| num = <numerator> | | num = <numerator> | ||
Line 34: | Line 33: | ||
| title = <your title> | | title = <your title> | ||
| intervals = <interval list name> | | intervals = <interval list name> | ||
| collapsed = <true/false> | |||
}} | }} | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 53: | Line 53: | ||
; intervals | ; intervals | ||
: 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. | ||
; collapsed | |||
: <code>true</code> or <code>false</code> to collapse the table. Default: false. | |||
=== Examples === | === Examples === | ||
Line 61: | Line 63: | ||
<syntaxhighlight lang="text"> | <syntaxhighlight lang="text"> | ||
{{ | {{Harmonics in equal|31}} | ||
</syntaxhighlight> | </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"> | <syntaxhighlight lang="text"> | ||
{{ | {{Harmonics in equal|13|3}} | ||
</syntaxhighlight> | </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"> | <syntaxhighlight lang="text"> | ||
{{ | {{Harmonics in equal|15|7|3}} | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{ | {{Harmonics in equal|15|7|3}} | ||
==== Advanced ==== | ==== Advanced ==== | ||
Line 83: | Line 85: | ||
<syntaxhighlight lang="text"> | <syntaxhighlight lang="text"> | ||
{{ | {{Harmonics in equal|13|3|columns=11|start=2|title=Primes in [[13edt]]|intervals=prime}} | ||
</syntaxhighlight> | </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"> | <syntaxhighlight lang="text"> | ||
{{ | {{Harmonics in equal|313|columns=9|start=2}} | ||
{{ | {{Harmonics in equal|313|columns=9|start=2|prec=5|title=Same with prec=5}} | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{ | {{Harmonics in equal|313|columns=9|start=2}} | ||
{{ | {{Harmonics in equal|313|columns=9|start=2|prec=5|title=Same with prec=5}} |
Revision as of 11:03, 7 April 2023
This template generates a table for prime approximations in equal-step tunings.
Usage
Simple
For divisions of the octave (edo), you can use one unnamed argument:
{{Harmonics in equal|<EDO number>}}
For other divisions, you can use two or three unnamed arguments:
{{Harmonics in equal|<steps>|<numerator>|<denominator>}}
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
The template takes up to 9 arguments:
{{Harmonics in equal
| steps = <number of steps>
| num = <numerator>
| denom = <denominator>
| columns = <column count>
| start = <start column>
| prec = <decimals of abs error>
| title = <your title>
| intervals = <interval list name>
| collapsed = <true/false>
}}
- steps
- 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.
- prec
- Precision of absolute error (digits after the decimal point), default is estimated according to the step size.
- title
- 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
- Can be
prime
for primes,odd
for odd harmonics andinteger
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. - collapsed
true
orfalse
to collapse the table. Default: false.
Examples
Basic
For edos it is sufficient to only input the number of steps:
{{Harmonics in equal|31}}
Harmonic | 2 | 3 | 5 | 7 | 11 | 13 | 17 | 19 | 23 | 29 | 31 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|
Error | Absolute (¢) | +0.0 | -5.2 | +0.8 | -1.1 | -9.4 | +11.1 | +11.2 | +12.2 | -8.9 | +15.6 | +16.3 |
Relative (%) | +0.0 | -13.4 | +2.0 | -2.8 | -24.2 | +28.6 | +28.9 | +31.4 | -23.0 | +40.3 | +42.0 | |
Steps (reduced) |
31 (0) |
49 (18) |
72 (10) |
87 (25) |
107 (14) |
115 (22) |
127 (3) |
132 (8) |
140 (16) |
151 (27) |
154 (30) |
For tritave or other integer divisions, two arguments is enough:
{{Harmonics in equal|13|3}}
Harmonic | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|
Error | Absolute (¢) | -29.6 | +0.0 | -59.1 | -6.5 | -29.6 | -3.8 | +57.6 | +0.0 | -36.1 | -54.8 | -59.1 |
Relative (%) | -20.2 | +0.0 | -40.4 | -4.5 | -20.2 | -2.6 | +39.4 | +0.0 | -24.7 | -37.5 | -40.4 | |
Steps (reduced) |
8 (8) |
13 (0) |
16 (3) |
19 (6) |
21 (8) |
23 (10) |
25 (12) |
26 (0) |
27 (1) |
28 (2) |
29 (3) |
In the most general case, we can input the number of steps, numerator and denominator.
{{Harmonics in equal|15|7|3}}
Harmonic | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|
Error | Absolute (¢) | -26.5 | -43.9 | +44.8 | -48.2 | +27.4 | -43.9 | +18.3 | +10.0 | +23.1 | -44.1 | +0.9 |
Relative (%) | -27.1 | -44.9 | +45.8 | -49.2 | +28.0 | -44.9 | +18.7 | +10.2 | +23.7 | -45.1 | +0.9 | |
Steps (reduced) |
12 (12) |
19 (4) |
25 (10) |
28 (13) |
32 (2) |
34 (4) |
37 (7) |
39 (9) |
41 (11) |
42 (12) |
44 (14) |
Advanced
Sometimes you want to see more or skip some lower columns and have to adjust the title:
{{Harmonics in equal|13|3|columns=11|start=2|title=Primes in [[13edt]]|intervals=prime}}
Harmonic | 3 | 5 | 7 | 11 | 13 | 17 | 19 | 23 | 29 | 31 | 37 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|
Error | Absolute (¢) | +0.0 | -6.5 | -3.8 | -54.8 | -51.4 | +69.4 | +23.1 | -15.0 | +22.6 | +53.4 | +39.7 |
Relative (%) | +0.0 | -4.5 | -2.6 | -37.5 | -35.1 | +47.4 | +15.8 | -10.3 | +15.4 | +36.5 | +27.2 | |
Steps (reduced) |
13 (0) |
19 (6) |
23 (10) |
28 (2) |
30 (4) |
34 (8) |
35 (9) |
37 (11) |
40 (1) |
41 (2) |
43 (4) |
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 prec
to a higher value. This is not recommended generally.
{{Harmonics in equal|313|columns=9|start=2}}
{{Harmonics in equal|313|columns=9|start=2|prec=5|title=Same with prec=5}}
Harmonic | 3 | 5 | 7 | 11 | 13 | 17 | 19 | 23 | 29 | |
---|---|---|---|---|---|---|---|---|---|---|
Error | Absolute (¢) | -0.36 | +0.91 | +1.14 | +0.76 | -0.91 | -1.44 | +1.53 | +0.48 | +1.73 |
Relative (%) | -9.3 | +23.7 | +29.8 | +19.8 | -23.8 | -37.6 | +39.9 | +12.5 | +45.2 | |
Steps (reduced) |
496 (183) |
727 (101) |
879 (253) |
1083 (144) |
1158 (219) |
1279 (27) |
1330 (78) |
1416 (164) |
1521 (269) |
Harmonic | 3 | 5 | 7 | 11 | 13 | 17 | 19 | 23 | 29 | |
---|---|---|---|---|---|---|---|---|---|---|
Error | Absolute (¢) | -0.35756 | +0.90673 | +1.14214 | +0.75873 | -0.91105 | -1.44103 | +1.52852 | +0.47965 | +1.73271 |
Relative (%) | -9.3 | +23.7 | +29.8 | +19.8 | -23.8 | -37.6 | +39.9 | +12.5 | +45.2 | |
Steps (reduced) |
496 (183) |
727 (101) |
879 (253) |
1083 (144) |
1158 (219) |
1279 (27) |
1330 (78) |
1416 (164) |
1521 (269) |