Template:Harmonics in equal/doc

From Xenharmonic Wiki
Jump to navigation Jump to search

This template generates a table for prime approximations in equal tunings.

Usage

Simple

For divisions of the octave (EDOs), 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 = <anything>
}}
steps
Number of steps. This parameter can also be given without the parameter name. Default is 12.
num
Numerator of the interval that is divided equally. Can be used without parameter name. Default is 2.
denom
Denominator of the interval that is divided equally. Can be used without parameter name. Default is 1.
columns
Number of intervals to include. Default is 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 and integer 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
Anything here to collapse the table.

Examples

Basic

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

{{Harmonics in equal|31}}

Approximation of prime harmonics in 31edo
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:</nowiki>

{{Harmonics in equal|13|3}}

Approximation of harmonics in 13edt
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}}

Approximation of harmonics in 15ed7/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}}

Primes in 13edt
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}}
Approximation of prime harmonics in 313edo
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)
Same with prec=5
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)

See also