CBFalconer wrote:
We can store 7 of them in a 32 bit record, by using the technique of multiplying 7 values in the range 1..23. We can't allow a 0 char representation for this, but this allows expanding the char. set by 1 item. This is 4.57 bits per char.
By using a special technique called bit-tuning, we can in fact store 7 of them in the range 1..24, which gives us an important extra Klingon character. 24^7=4586471424 > 4294967296= 2^32, so how is this done ? Well, (24^7)=(12^7) * 128. The numbers 7, 12 and 128 are important ... if you take a closer look at the seven octaves of a piano.
In music, an octave consists of 12 halftones on the diatonic tone scale (on which all western music is based), where the frequency proportion of an octave is 1:2. The seven octaves of a piano have a total frequency proportion of 1:2^7 = 1:128.
Now, of course, we don't only play octaves, which would be boring, but also fifths notes (7 halftones, frequency proportion 2:3), quarter notes (5 halftones, 3:4), major thirds (4 halftones, 4:5) and minor thirds (3 halftones, 5:6) etcetera.
We see that a fifth note plus a quarter note sum to an octave, with a frequency proportion of (2:3) * (3:4) = 2:4 = 1:2. Likewise, a major third plus a minor third sum to a quint, with a frequency proportion of (4:5) * (5"6) = 4:6 = 2:3.
Now, the quint is the crucial thing in bit-tuning techniques. Twelve of them form the circle of fifths, which fits exactly in the seven octaves of a piano. Those 12 quints sum to a frequency proportion of (3:2)^12 = 129,746... > 128 = 2^7, the frequency proportion of the 7 octaves. How is this done ? Well, a good piano tuner can tell you, some of the best indeed stretch the octaves somewhat in the descant (the high notes) although this is officially not allowed.
There is also a second technique, called bit resonance, used by the masters of the 16th and 17th century, but the technique has since been long forgotten, which I regret.
Not all platforms do support bit tuning (not to mention bit resonance) but --target=steinway-piano-grand does. This is a new platform, so it would be a good thing to start with a finger exercise, for example by writing a Turing machine for it. It has to use musical notation, of course, to make bit-tuning work ...
Regards,
Adriaan van Os