Most regular musical temperaments divide the octave exactly into equal steps. The octave is the simplest and most important of all intervals, but it is not infinitely more important than any other. Here I look for scales that minimize the worst of the errors in any rational interval, inversely weighted by the interval's complexity; in other words, the error in each interval is bounded by an amount proportional to its complexity. By sacrificing the purity of the octave, we can improve other tempered intervals.
Leonhard Euler defined a ranking of rational numbers, which he named gradus suavitatis (degrees of sweetness), by adding up p-1 for each of the prime factors of the least common multiple of numerator and denominator. (His numbers are higher by one than mine, and his formula more complex; he considered this a ranking, beginning with 1, but it is more convenient for my purpose to consider it a measurement from zero.)
The image above illustrates my scheme: the horizontal axis is the size of the temperament's basic step, and the colored peaks represent the error in the best representation of some prime number (gray for 2, red for 3, blue for 5 ...) as a multiple of that step, inversely weighted by the complexity of that prime. (Only the primes need be considered here, because the gradus add up like logarithms.)
I will not be at all surprised if someone who knows more about ears proposes a subtler rule.
The table below lists those minima that give either a smallest weighted worst error or a greater depth than the previous entry. “Depth” is the ratio between half the step size (the line of the gray peaks) and the maximum weighted error. An interval whose complexity exceeds depth is trivially fitted, because its allowed error range is wider than the step. Each entry in the table links to a list of intervals (within the range of a pianoforte) with nontrivial fits.
Here n//r is my compact notation for the rth root of n, by loose analogy with the exponentiation operator ** in various programming languages.
| step size (in cents) | step ratio (exact) | weighted error (in cents) | depth | comments |
| 1433.99 | 12//3 | 233.985 | 3.06427 | One must begin somewhere! |
| 1075.49 | 12//4 | 124.511 | 4.31884 | |
| 632.193 | 80//12 | 64.3856 | 4.90943 | |
| 599.111 | 45//11 | 52.3106 | 5.72648 | |
| 391.087 | 12//11 | 26.7395 | 7.31289 | |
| 244.082 | 45//27 | 25.3519 | 4.81388 | |
| 237.072 | 80//32 | 14.6385 | 8.09757 | |
| 173.259 | 448//61 | 12.8161 | 6.75945 | |
| 171.552 | 6125//88 | 10.3697 | 8.27183 | |
| 134.436 | 12//32 | 9.92484 | 6.77271 | |
| 119.822 | 45//55 | 7.60049 | 7.88253 | |
| 99.8052 | 637//112 | 4.09167 | 12.1961 | closest to 2//12 |
| 99.6997 | 9477//159 | 3.83003 | 13.0155 | |
| 63.2788 | 22370117//463 | 2.50827 | 12.6140 | close to Carlos beta |
| 54.4647 | 45//121 | 2.15403 | 12.6425 | |
| 38.7564 | 12//111 | 1.44689 | 13.3930 | compare 2//31 |
| 29.2894 | 1625//437 | 0.955124 | 15.3328 | |
| 26.0736 | 6125//579 | 0.889381 | 14.6583 | |
| 22.6415 | 22370117//1294 | 0.792594 | 14.2832 | compare 2//53 |
| 16.6742 | 12//258 | 0.545582 | 15.2812 | |
| 12.7716 | 80//594 | 0.527759 | 12.0998 | |
| 12.1169 | (11^6 13^5)//3888 | 0.478218 | 12.6688 | |
| 10.8066 | 448//978 | 0.470679 | 11.4798 | |
| 10.1731 | 53248//1852 | 0.422389 | 12.0423 | |
| 10.1712 | 637//1099 | 0.358245 | 14.1959 | |
| 9.23001 | 45//714 | 0.286964 | 16.0821 | |
| 7.89297 | 53248//2387 | 0.268033 | 14.7239 | |
| 7.01648 | 2673//1947 | 0.244016 | 14.3771 | |
| 6.55686 | 189//1384 | 0.233149 | 14.0615 | |
| 5.66143 | 80//1340 | 0.222767 | 12.7071 | |
| 5.52989 | 6125//2730 | 0.187400 | 14.7542 | |
| 5.35720 | 6125//2818 | 0.142274 | 18.8271 | |
| 4.44417 | (17^11 23^8)//21912 | 0.0881783 | 25.1999 | |
| 2.72091 | 11264//5936 | 0.0789736 | 17.2267 | |
| 2.42914 | 6517//6259 | 0.0653406 | 18.5883 | |
| 2.42903 | 4980736//10991 | 0.0571895 | 21.2367 | |
| 1.96073 | (7^8 17^3)//21250 | 0.0491535 | 19.9449 | |
| 1.92301 | 189//4719 | 0.0483513 | 19.8858 | |
| 1.68770 | 12//2549 | 0.0431520 | 19.5553 | |
| 1.57063 | 4980736//16998 | 0.0411846 | 19.0681 | |
| 1.36053 | 2673//10041 | 0.0337504 | 20.1558 | |
| 1.25789 | 448//8402 | 0.0309349 | 20.3313 | |
| 1.10704 | 12//3886 | 0.0306796 | 18.0419 | |
| 1.08498 | 1625//11797 | 0.0234593 | 23.1247 |
You may well ask, what the heck are the numbers in the second column? Where the (weighted) error in p represented by m steps equals that in q represented by n steps, the step is (pq-1qp-1)//(m(q-1) + n(p-1)). In most of these cases a common factor can be divided out of the exponents and the .. what do you call the number after the // ?
Raw list of all local optima down to one cent.