Template:Chord edo approximation: Difference between revisions
WIP experiments to add chord / edo approximation tables |
No edit summary |
||
| Line 2: | Line 2: | ||
| chord = {{{chord|{{PAGENAME}}}}} | | chord = {{{chord|{{PAGENAME}}}}} | ||
| chord_name = {{{chord_name|{{PAGENAME}}}}} | | chord_name = {{{chord_name|{{PAGENAME}}}}} | ||
| max_total_error = {{{max_total_error| | | max_total_error = {{{max_total_error|}}} | ||
| min_edo = {{{min_edo|2}}} | | min_edo = {{{min_edo|2}}} | ||
| max_edo = {{{max_edo|80}}} | | max_edo = {{{max_edo|80}}} | ||
Revision as of 02:20, 26 May 2026
- This template is implemented by the Lua module Module:Chord edo approximation.
- This template invokes the following functions: main from Chord edo approximation.
Usage
This template generates edo approximation tables for just intonation chords. For each edo within range, it finds the nearest steps to every chord tone and scores the fit by the RMS of the per-note errors around the optimal (least-squares) reference, expressed as a percentage of the edo step so smaller edos aren't penalized for their coarser resolution.
Basic syntax
{{Chord edo approximation|chord = 4:5:6 | chord_name = Major triad}}
if the name of the page is the chord you are trying to create a table of, it will by default use the pagename as the chord.
{{Chord edo approximation|{{PAGENAME}}}}
With custom parameters
{{Chord edo approximation|chord=4:5:6:7|max_rms=10|min_edo=12|max_edo=72 | chord_name = Harmonic seventh chord}}
Parameters
chord- the just intonation chord (required). Format: colon-separated positive integers "a:b:c" (e.g., "4:5:6", "4:5:6:7", "6:7:9"). At least two notes are required; the first note is treated as the root.
max_rms- maximum RMS error in percent of the edo step (optional, default: 15). Rows above this threshold are excluded.
min_edo- minimum edo to check (optional, default: 5)
max_edo- maximum edo to check (optional, default: 60)
chord_name- the name you would like to label the chord with (optional). If omitted, the raw chord string is used. The chord string is always shown alongside a custom name.
Notes
Each row includes inline ▶ play buttons: one in the caption to hear the chord in just intonation, and one per row to hear that edo's approximation. The "Steps", "Cents", and "Absolute errors" columns list one value per chord tone (root first), monospaced and aligned. Results are sortable by edo or by RMS error.
Examples
- Major triad (4
- 5:6)
| Edo | Steps | Cents (¢) | Absolute errors (¢) | RMS (¢) | RMS (%) | |
|---|---|---|---|---|---|---|
| ▶ | 3 | 0 1 2 |
0.00 400.00 800.00 |
0.00 +13.69 +98.04 |
43.35 | 10.84 |
| ▶ | 4 | 0 1 2 |
0.00 300.00 600.00 |
0.00 -86.31 -101.96 |
44.83 | 14.94 |
| ▶ | 7 | 0 2 4 |
0.00 342.86 685.71 |
0.00 -43.46 -16.24 |
17.93 | 10.46 |
| ▶ | 12 | 0 4 7 |
0.00 400.00 700.00 |
0.00 +13.69 -1.96 |
6.96 | 6.96 |
| ▶ | 15 | 0 5 9 |
0.00 400.00 720.00 |
0.00 +13.69 +18.04 |
7.69 | 9.61 |
| ▶ | 16 | 0 5 9 |
0.00 375.00 675.00 |
0.00 -11.31 -26.96 |
11.05 | 14.74 |
| ▶ | 19 | 0 6 11 |
0.00 378.95 694.74 |
0.00 -7.37 -7.22 |
3.44 | 5.44 |
| ▶ | 22 | 0 7 13 |
0.00 381.82 709.09 |
0.00 -4.50 +7.14 |
4.79 | 8.78 |
| ▶ | 24 | 0 8 14 |
0.00 400.00 700.00 |
0.00 +13.69 -1.96 |
6.96 | 13.92 |
| ▶ | 27 | 0 9 16 |
0.00 400.00 711.11 |
0.00 +13.69 +9.16 |
5.69 | 12.81 |
| ▶ | 31 | 0 10 18 |
0.00 387.10 696.77 |
0.00 +0.78 -5.18 |
2.65 | 6.84 |
| ▶ | 34 | 0 11 20 |
0.00 388.24 705.88 |
0.00 +1.92 +3.93 |
1.60 | 4.54 |
| ▶ | 38 | 0 12 22 |
0.00 378.95 694.74 |
0.00 -7.37 -7.22 |
3.44 | 10.89 |
| ▶ | 41 | 0 13 24 |
0.00 380.49 702.44 |
0.00 -5.83 +0.48 |
2.87 | 9.80 |
| ▶ | 43 | 0 14 25 |
0.00 390.70 697.67 |
0.00 +4.38 -4.28 |
3.54 | 12.68 |
| ▶ | 46 | 0 15 27 |
0.00 391.30 704.35 |
0.00 +4.99 +2.39 |
2.04 | 7.81 |
| ▶ | 49 | 0 16 29 |
0.00 391.84 710.20 |
0.00 +5.52 +8.25 |
3.43 | 14.01 |
| ▶ | 50 | 0 16 29 |
0.00 384.00 696.00 |
0.00 -2.31 -5.96 |
2.45 | 10.21 |
| ▶ | 53 | 0 17 31 |
0.00 384.91 701.89 |
0.00 -1.41 -0.07 |
0.65 | 2.86 |
| ▶ | 56 | 0 18 33 |
0.00 385.71 707.14 |
0.00 -0.60 +5.19 |
2.60 | 12.13 |
| ▶ | 58 | 0 19 34 |
0.00 393.10 703.45 |
0.00 +6.79 +1.49 |
2.91 | 14.08 |
| ▶ | 60 | 0 19 35 |
0.00 380.00 700.00 |
0.00 -6.31 -1.96 |
2.64 | 13.20 |
| ▶ | 62 | 0 20 36 |
0.00 387.10 696.77 |
0.00 +0.78 -5.18 |
2.65 | 13.67 |
| ▶ | 65 | 0 21 38 |
0.00 387.69 701.54 |
0.00 +1.38 -0.42 |
0.77 | 4.16 |
| ▶ | 68 | 0 22 40 |
0.00 388.24 705.88 |
0.00 +1.92 +3.93 |
1.60 | 9.09 |
| ▶ | 69 | 0 22 40 |
0.00 382.61 695.65 |
0.00 -3.71 -6.30 |
2.59 | 14.87 |
| ▶ | 72 | 0 23 42 |
0.00 383.33 700.00 |
0.00 -2.98 -1.96 |
1.24 | 7.42 |
| ▶ | 75 | 0 24 44 |
0.00 384.00 704.00 |
0.00 -2.31 +2.04 |
1.78 | 11.13 |
| ▶ | 77 | 0 25 45 |
0.00 389.61 701.30 |
0.00 +3.30 -0.66 |
1.73 | 11.10 |
| ▶ | 80 | 0 26 47 |
0.00 390.00 705.00 |
0.00 +3.69 +3.04 |
1.61 | 10.72 |
- Harmonic seventh chord (4
- 5:6:7) with tighter tolerance (8%)
| Edo | Steps | Cents (¢) | Absolute errors (¢) | RMS (¢) | RMS (%) | |
|---|---|---|---|---|---|---|
| ▶ | 4 | 0 1 2 3 |
0.00 300.00 600.00 900.00 |
0.00 -86.31 -101.96 -68.83 |
38.91 | 12.97 |
| ▶ | 10 | 0 3 6 8 |
0.00 360.00 720.00 960.00 |
0.00 -26.31 +18.04 -8.83 |
15.99 | 13.33 |
| ▶ | 12 | 0 4 7 10 |
0.00 400.00 700.00 1000.00 |
0.00 +13.69 -1.96 +31.17 |
13.25 | 13.25 |
| ▶ | 15 | 0 5 9 12 |
0.00 400.00 720.00 960.00 |
0.00 +13.69 +18.04 -8.83 |
10.72 | 13.40 |
| ▶ | 19 | 0 6 11 15 |
0.00 378.95 694.74 947.37 |
0.00 -7.37 -7.22 -21.46 |
7.78 | 12.32 |
| ▶ | 22 | 0 7 13 18 |
0.00 381.82 709.09 981.82 |
0.00 -4.50 +7.14 +12.99 |
6.69 | 12.26 |
| ▶ | 27 | 0 9 16 22 |
0.00 400.00 711.11 977.78 |
0.00 +13.69 +9.16 +8.95 |
4.96 | 11.17 |
| ▶ | 31 | 0 10 18 25 |
0.00 387.10 696.77 967.74 |
0.00 +0.78 -5.18 -1.08 |
2.30 | 5.94 |
| ▶ | 37 | 0 12 22 30 |
0.00 389.19 713.51 972.97 |
0.00 +2.88 +11.56 +4.15 |
4.26 | 13.15 |
| ▶ | 41 | 0 13 24 33 |
0.00 380.49 702.44 965.85 |
0.00 -5.83 +0.48 -2.97 |
2.54 | 8.67 |
| ▶ | 46 | 0 15 27 37 |
0.00 391.30 704.35 965.22 |
0.00 +4.99 +2.39 -3.61 |
3.17 | 12.14 |
| ▶ | 50 | 0 16 29 40 |
0.00 384.00 696.00 960.00 |
0.00 -2.31 -5.96 -8.83 |
3.38 | 14.08 |
| ▶ | 53 | 0 17 31 43 |
0.00 384.91 701.89 973.58 |
0.00 -1.41 -0.07 +4.76 |
2.34 | 10.34 |
| ▶ | 58 | 0 19 34 47 |
0.00 393.10 703.45 972.41 |
0.00 +6.79 +1.49 +3.59 |
2.55 | 12.32 |
| ▶ | 62 | 0 20 36 50 |
0.00 387.10 696.77 967.74 |
0.00 +0.78 -5.18 -1.08 |
2.30 | 11.87 |
| ▶ | 68 | 0 22 40 55 |
0.00 388.24 705.88 970.59 |
0.00 +1.92 +3.93 +1.76 |
1.39 | 7.88 |
| ▶ | 72 | 0 23 42 58 |
0.00 383.33 700.00 966.67 |
0.00 -2.98 -1.96 -2.16 |
1.09 | 6.56 |
| ▶ | 77 | 0 25 45 62 |
0.00 389.61 701.30 966.23 |
0.00 +3.30 -0.66 -2.59 |
2.12 | 13.62 |
| ▶ | 80 | 0 26 47 65 |
0.00 390.00 705.00 975.00 |
0.00 +3.69 +3.04 +6.17 |
2.20 | 14.66 |
- Subminor triad (6
- 7:9) with extended range (up to 150edo)
| Edo | Steps | Cents (¢) | Absolute errors (¢) | RMS (¢) | RMS (%) | |
|---|---|---|---|---|---|---|
| ▶ | 5 | 0 1 3 |
0.00 240.00 720.00 |
0.00 -26.87 +18.04 |
18.45 | 7.69 |
| ▶ | 8 | 0 2 5 |
0.00 300.00 750.00 |
0.00 +33.13 +48.04 |
20.08 | 13.39 |
| ▶ | 9 | 0 2 5 |
0.00 266.67 666.67 |
0.00 -0.20 -35.29 |
16.59 | 12.44 |
| ▶ | 14 | 0 3 8 |
0.00 257.14 685.71 |
0.00 -9.73 -16.24 |
6.67 | 7.79 |
| ▶ | 17 | 0 4 10 |
0.00 282.35 705.88 |
0.00 +15.48 +3.93 |
6.57 | 9.31 |
| ▶ | 19 | 0 4 11 |
0.00 252.63 694.74 |
0.00 -14.24 -7.22 |
5.81 | 9.20 |
| ▶ | 22 | 0 5 13 |
0.00 272.73 709.09 |
0.00 +5.86 +7.14 |
3.11 | 5.70 |
| ▶ | 27 | 0 6 16 |
0.00 266.67 711.11 |
0.00 -0.20 +9.16 |
4.37 | 9.82 |
| ▶ | 31 | 0 7 18 |
0.00 270.97 696.77 |
0.00 +4.10 -5.18 |
3.80 | 9.81 |
| ▶ | 36 | 0 8 21 |
0.00 266.67 700.00 |
0.00 -0.20 -1.96 |
0.88 | 2.63 |
| ▶ | 39 | 0 9 23 |
0.00 276.92 707.69 |
0.00 +10.05 +5.74 |
4.12 | 13.38 |
| ▶ | 41 | 0 9 24 |
0.00 263.41 702.44 |
0.00 -3.46 +0.48 |
1.75 | 5.99 |
| ▶ | 44 | 0 10 26 |
0.00 272.73 709.09 |
0.00 +5.86 +7.14 |
3.11 | 11.39 |
| ▶ | 46 | 0 10 27 |
0.00 260.87 704.35 |
0.00 -6.00 +2.39 |
3.53 | 13.54 |
| ▶ | 49 | 0 11 29 |
0.00 269.39 710.20 |
0.00 +2.52 +8.25 |
3.45 | 14.10 |
| ▶ | 50 | 0 11 29 |
0.00 264.00 696.00 |
0.00 -2.87 -5.96 |
2.43 | 10.13 |
| ▶ | 53 | 0 12 31 |
0.00 271.70 701.89 |
0.00 +4.83 -0.07 |
2.29 | 10.12 |
| ▶ | 55 | 0 12 32 |
0.00 261.82 698.18 |
0.00 -5.05 -3.77 |
2.14 | 9.83 |
| ▶ | 58 | 0 13 34 |
0.00 268.97 703.45 |
0.00 +2.09 +1.49 |
0.88 | 4.26 |
| ▶ | 60 | 0 13 35 |
0.00 260.00 700.00 |
0.00 -6.87 -1.96 |
2.89 | 14.45 |
| ▶ | 63 | 0 14 37 |
0.00 266.67 704.76 |
0.00 -0.20 +2.81 |
1.37 | 7.21 |
| ▶ | 67 | 0 15 39 |
0.00 268.66 698.51 |
0.00 +1.79 -3.45 |
2.17 | 12.13 |
| ▶ | 68 | 0 15 40 |
0.00 264.71 705.88 |
0.00 -2.17 +3.93 |
2.52 | 14.29 |
| ▶ | 72 | 0 16 42 |
0.00 266.67 700.00 |
0.00 -0.20 -1.96 |
0.88 | 5.26 |
| ▶ | 75 | 0 17 44 |
0.00 272.00 704.00 |
0.00 +5.13 +2.04 |
2.11 | 13.18 |
| ▶ | 77 | 0 17 45 |
0.00 264.94 701.30 |
0.00 -1.94 -0.66 |
0.80 | 5.16 |
| ▶ | 80 | 0 18 47 |
0.00 270.00 705.00 |
0.00 +3.13 +3.04 |
1.46 | 9.70 |
| ▶ | 82 | 0 18 48 |
0.00 263.41 702.44 |
0.00 -3.46 +0.48 |
1.75 | 11.99 |
| ▶ | 85 | 0 19 50 |
0.00 268.24 705.88 |
0.00 +1.36 +3.93 |
1.63 | 11.53 |
| ▶ | 86 | 0 19 50 |
0.00 265.12 697.67 |
0.00 -1.75 -4.28 |
1.76 | 12.59 |
| ▶ | 89 | 0 20 52 |
0.00 269.66 701.12 |
0.00 +2.79 -0.83 |
1.55 | 11.49 |
| ▶ | 91 | 0 20 53 |
0.00 263.74 698.90 |
0.00 -3.13 -3.05 |
1.46 | 11.06 |
| ▶ | 94 | 0 21 55 |
0.00 268.09 702.13 |
0.00 +1.21 +0.17 |
0.54 | 4.20 |
| ▶ | 96 | 0 21 56 |
0.00 262.50 700.00 |
0.00 -4.37 -1.96 |
1.79 | 14.30 |
| ▶ | 99 | 0 22 58 |
0.00 266.67 703.03 |
0.00 -0.20 +1.08 |
0.56 | 4.63 |
| ▶ | 103 | 0 23 60 |
0.00 267.96 699.03 |
0.00 +1.09 -2.93 |
1.70 | 14.55 |
| ▶ | 104 | 0 23 61 |
0.00 265.38 703.85 |
0.00 -1.49 +1.89 |
1.38 | 11.98 |
| ▶ | 108 | 0 24 63 |
0.00 266.67 700.00 |
0.00 -0.20 -1.96 |
0.88 | 7.90 |
| ▶ | 111 | 0 25 65 |
0.00 270.27 702.70 |
0.00 +3.40 +0.75 |
1.46 | 13.49 |
| ▶ | 113 | 0 25 66 |
0.00 265.49 700.88 |
0.00 -1.38 -1.07 |
0.59 | 5.58 |
| ▶ | 116 | 0 26 68 |
0.00 268.97 703.45 |
0.00 +2.09 +1.49 |
0.88 | 8.51 |
| ▶ | 118 | 0 26 69 |
0.00 264.41 701.69 |
0.00 -2.46 -0.26 |
1.11 | 10.87 |
| ▶ | 121 | 0 27 71 |
0.00 267.77 704.13 |
0.00 +0.90 +2.18 |
0.89 | 9.01 |
| ▶ | 125 | 0 28 73 |
0.00 268.80 700.80 |
0.00 +1.93 -1.16 |
1.27 | 13.25 |
| ▶ | 126 | 0 28 74 |
0.00 266.67 704.76 |
0.00 -0.20 +2.81 |
1.37 | 14.43 |
| ▶ | 127 | 0 28 74 |
0.00 264.57 699.21 |
0.00 -2.30 -2.74 |
1.20 | 12.73 |
| ▶ | 130 | 0 29 76 |
0.00 267.69 701.54 |
0.00 +0.82 -0.42 |
0.51 | 5.57 |
| ▶ | 132 | 0 29 77 |
0.00 263.64 700.00 |
0.00 -3.23 -1.96 |
1.33 | 14.63 |
| ▶ | 135 | 0 30 79 |
0.00 266.67 702.22 |
0.00 -0.20 +0.27 |
0.19 | 2.17 |
| ▶ | 138 | 0 31 81 |
0.00 269.57 704.35 |
0.00 +2.69 +2.39 |
1.21 | 13.86 |
| ▶ | 140 | 0 31 82 |
0.00 265.71 702.86 |
0.00 -1.16 +0.90 |
0.84 | 9.83 |
| ▶ | 143 | 0 32 84 |
0.00 268.53 704.90 |
0.00 +1.66 +2.94 |
1.20 | 14.34 |
| ▶ | 144 | 0 32 84 |
0.00 266.67 700.00 |
0.00 -0.20 -1.96 |
0.88 | 10.53 |
| ▶ | 147 | 0 33 86 |
0.00 269.39 702.04 |
0.00 +2.52 +0.09 |
1.17 | 14.29 |
| ▶ | 149 | 0 33 87 |
0.00 265.77 700.67 |
0.00 -1.10 -1.28 |
0.57 | 7.04 |