Cangwu badness

From Xenharmonic Wiki
Jump to navigation Jump to search

Cangwu badness is a polynomial function badness measure; the name stems from Cangwu Green Park, Lianyungang, China, where Graham Breed thought it up.


In the following definitions, suppose that [math]C(T)[/math] is the TE Complexity, and [math]E_R(T)[/math] is the "relativized error" of temperament [math]T[/math]. The "relativized error" for EDOs gives the error as a proportion of the step size, and yields a similar result for higher-rank temperaments; we may also call it the "TE Simple Badness." The Cangwu badness, then, can be most simply thought of as a weighted RMS of the two. The main feature of Cangwu badness is that there is a free weighting parameter determining how much we are weighting the error vs complexity into the calculation.

There are several different conventions for the Cangwu badness, usually corresponding to a choice of "units" for the free parameter. The most common is Graham's [math]E_k[/math], which can be thought of as describing the "intended target error in cents" in temperament searches, and also has sometimes written in terms of a simplified [math]\epsilon[/math] parameter that makes the entire thing a weighted RMS. Gene has a separate derivation in terms of matrix determinants that is equivalent to the square of the preceeding definition. There are also some different conventions regarding scalar normalization of the rank, and whether the norm used is an [math]\ell_2[/math] norm ("root-sum-squared") or an RMS ("root-mean-squared").

However, these definitions are all equivalent, up to some monotonic transformation that preserves the relative ratings of each temperament, given any choice of weighting and temperament rank. We will begin with Graham's [math]\epsilon[/math] definition as it is simplest.

Simplified Version of Graham's Definition

Let [math]\epsilon[/math] be a free parameter in [math][0,1][/math]. The Cangwu badness is then simply defined via the weighted RMS

$$ \sqrt{(1-\epsilon^2)E_R(T)^2 + \epsilon^2 C(T)^2} $$

where the squaring is just due to convention and/or for numerical stability reasons.

This is equivalent to the definition used in Graham's regular temperament python library. It is also equivalent to the definitions in "Tenney-Euclidean Formulas", "Parametric Scalar Badness", and "Prime Based Error and Complexity Measures", except for a multiplication by a scalar "rank-normalization" term that is constant for any choice of [math]\epsilon[/math] or rank.

Simplified Version of Graham's Definition With "Intended Cents of Error" Parameter

Graham tends to use a change of variables so that the free parameter can be viewed as a number of cents representing the "intended target error" in temperament searches. To that extent, we define the change of variables

$$ \epsilon^2 = \frac{E_k^2}{1+E_k^2} \\ E_k^2 = \frac{\epsilon^2}{1-\epsilon^2} $$

So that [math]E_k[/math] can now be thought of as a real number in [math][0,\infty)[/math]. This leads to the formula

$$ \sqrt{\frac{E_R(T)^2 + E_k^2 C(T)^2}{1+E_k^2}} $$

This formula is also equivalent to the one used in Graham's python library in terms of the [math]E_k[/math] parameter, and is again equivalent to the version in his articles except for the aforementioned scalar multiplication.

Graham's Original Definition

Graham's original definition, in terms of [math]E_k[/math], can be written as

$$ \sqrt{\frac{E_R(T)^2 + E_k^2 C(T)^2}{1+E_k^2}} \cdot \left(\sqrt{1+E_k^2}\right)^{\text{rank(t)}} $$

This can be shown to be identical to the metric given in Graham's three articles linked above, although he originally defined it in terms of a large matrix formula. It is also equivalent to the metrics previously given, except for the presence of the added term

$$ \left(\sqrt{1+E_k^2}\right)^{\text{rank(t)}} $$

which, for any choice of [math]E_k[/math] or [math]\text{rank}(t)[/math], multiplies all temperaments only by a scalar.

Gene Smith's Matrix Determinant Definition

Gene Ward Smith wrote the below presentation of Cangwu badness in terms of the characteristic polynomial of a matrix. The definition is again equivalent to the above, except it is equivalent to the *square* of the above Cangwu badness, and again involving equivalence only up to a scalar multiplication.

Note that the notation below is not, in general, the same as the notation above; Gene's original notation has been left as written, where the free parameter is called [math]x[/math].

Gene's definition of the Cangwu badness is in terms

$$ C(x) = \det\left(\left[(1+x)\frac{v_i \cdot v_j}{n} - a_ia_j\right]\right) $$

where the vᵢ are r independent weighted vals of dimension n defining a rank r regular temperament, and the aᵢ are the average of the values of vᵢ; that is, the sum of the values of vᵢ divided by n.

From this definition, it follows that C(0) is proportional to the square of simple badness, aka relative error. The leading coefficient of the polynomial defining C(x) is proportional to the square of TE complexity. Hence as x grows larger, C(x) increasingly weights smaller complexity temperaments as better, and in the limit becomes a complexity measure, whereas at 0 C(0) is a badness measure which strongly favors more accurate temperaments, being in fact a measure of relative error.

Cangwu Dominance

If Ca(x) is the Cangwu badness for rank r temperament 'a', and Cb(x) for 'b', we can say a dominates b if Cb(x) - Ca(x) is a positive function for x ≥ 0, which says that the badness of 'a' is always less than the badness of 'b' for every choice of the parameter x. If a temperament is not dominated by any temperament of the same rank (and on the same subgroup, if we are considering subgroups) we may say it is indomitable. An alternative procedure is to divide the cangwu badness polynomial by the coefficient of the highest degree term, getting a monic polynomial with constant term proportional to the the square of TE absolute error. When one temperament dominates another using this polynomial, it is lower in both error and complexity.

Examples of Indomitable Temperaments

Examples of 5-limit indomitable temperaments are:

Father 16/15 |4 -1 -1>

Dicot 25/24 |-3 -1 2>

Meantone 81/80 |-4 4 -1>

Srutal/Diaschismic 2048/2025 |11 -4 -2>

Hanson/Kleismic 15625/15552 |-6 -5 6>

Helmholtz/Schismic 32805/32768 |-15 8 1>

Hemithirds |38 -2 -15>

Ennealimmal |1 -27 18>

Kwazy |-53 10 16>

Monzismic |54 -37 2>

Senior |-17 62 -35>

Pirate |-90 -15 49>

Atomic |161 -84 -12>

Some 7-limit examples are beep, meantone, miracle, pontiac and ennealimmal.

If two temperaments of the same rank are such that neither dominants the other, we may subtract one Cangwu badness polynomial from the other and find the positive root of the result. This gives a value of the parameter 'x' at which the two temperaments are rated equal in badness, which can be applied to rate other temperaments by badness. For example, if 5-limit father and helmholtz are made equally bad, then meantone, augmented, dicot, porcupine, srutal, diminished, magic, hanson and mavila, in that order, rate as better.