Working details of tuning program
Adaptive tuning program - working details
A list member has asked that I describe the meaning of the input
parameters to my leisure tuning program. This list member shall remain
nameless, but Monz, you know who you are.
When I retune a General Midi piece, I insert some text records into the
top of the file that list the input used values. For example:
E0 4C 3F (For pitch 0, we have target bend -1.2917)
E1 52 40 (For pitch 1, we have target bend 2.0139)
E2 06 41 (For pitch 2, we have target bend 3.2750)
E3 0B 3E (For pitch 3, we have target bend -5.9821)
E4 06 40 (For pitch 4, we have target bend 0.1546)
E5 6D 3D (For pitch 5, we have target bend -6.7344)
E6 24 40 (For pitch 6, we have target bend 0.8917)
E7 0B 42 (For pitch 7, we have target bend 6.5429)
E8 41 41 (For pitch 8, we have target bend 4.7193)
EA 15 3F (For pitch 9, we have target bend -2.6272)
EB 67 3F (For pitch 10, we have target bend -0.6167)
EC 02 40 (For pitch 11, we have target bend 0.0573)
jSez: DThalf = 1000.0000
jSez: DriftHalf = 1000.0000
jSez: Kslide = 0.00100000
jSez: Kgood = 0.00010000
jSez: Kdrift = 0.00000100
jSez: KcontPainFact = 10.0000
jSez: KextraCredit = 1.1000
jSez: DTmaxPSE = 64.0000
jSez: Rslide = 0.40000000
jSez: Rgood = 0.00250000
jSez: Rdrift = 0.00100000
jSez: SRFfact = 0.50000000
jSez: HighNote = 1.00000000
jSez: VolFlatn = 0.50000000
jSez: KeyedTunable = 1.00000000
jSez: Rmelody = 1.00000000
jSez: Stretch = 2.00000000
jSez: minSeven = 0
jSez: maxSeven = 0
jSez: jdebug = 0000
The first set of values is the target grounding bend for each pitch
class (0 == C, 1 == C#/Db, etc.) in cents relative to 12-tET. This is
closely aligned to the COFT tuning, but has been allowed to move as
needed to suit the adaptive case. Each note of each pitch class is
connected by a "grounding spring" to the target tuning of that pitch
class. These springs counteract the tendency of the piece's tuning to
drift as a result of comma pumps and other drift-inducing forces.
Next we come to input coefficients, which are quickly described as:
1. msec for volume memory to cut in half (default 1000).
2. msec for drift to fall to half (default 1000).
3. pain coefficient for sliding a pitch's tuning (default 0.0010000)
4. goodness coefficient for well-tuned intervals (default 0.0001000)
5. pain coefficient for drift of center tuning (default 0.0000010)
6. pain factor for sliding continuously sounding notes (default 10.0000)
7. extra credit multiplier for adjacent tunings the same (default 1.1000)
8. maximum time (msec) for pseudo-simultaneous events (default 64)
9. pain coefficient for sliding a pitch's tuning, sprng. (default 0.4000000)
10. goodness coefficient for well-tuned intervals, sprng. (default 0.0100000)
11. pain coefficient for drift of center tuning, sprng. (default 0.0010000)
12. SRF reduction exponent (1.0 full SRF; 0.0 none) (default 0.5000000)
13. High note extra credit (0.0 none; 1.0 double) (default 1.0000000)
14. Volume flattening exp (1.0 no flattening; 0.0 flat) (default 0.5000000)
15. Keyed instrument tunability (1.0 fully; 0.0 COFT) (default 1.0000000)
16. Melodic spring coefficient (default 1.0000000)
17. Stretch extent (default 0.0000000)
DThalf reflects the idea that we gradually forget the intonation of a
particular pitch class if it has been silent a long time. Thus it
allows a pitch class's tuning to change with less calculated pain when
that is the case. This value represents the "half-life" of tuning
DriftHalf was used in the pre-spring version of the program to work away
drift that had accumulated. It is no longer used (unless the program is
instructed to skip the spring step, something I no longer ask it to do).
Kslide is a coefficient of pain for retuning a continuously sounding
note; i.e., horizontal unison pain.
Kgood is a coefficient of pain for deviation from ideal in vertical
tuning (notes sounding simultaneously).
Kdrift is a coefficient of pain for drift (overall tuning changes over
The above three refer to calculations done pre-spring. During this
phase, a tuning for each moment in time is picked, but then adjacent
tunings are compared and possibly merged, when merging reduces
horizontal and drift pain more than it increases vertical pain.
KcontPainFact causes greater horizontal unison pain to be calculated
when a note is continuously sounding vs. when the pitch class is
interrupted and then restarted.
KextraCredit gives slight extra incentive for two adjacent tuning
specifications to merge, if they're almost tied in desirability.
DTmaxPSE, defaulting to 64 milliseconds, is the maximum duration of a
"Pseudo Simultaneous Event" (PSE). During a PSE, one or more notes may
end and one or more notes may begin, but they are treated by the program
as if all had happened together.
Rslide is a spring coefficient of pain for retuning a continuously
sounding note; i.e., horizontal unison pain.
Rgood is a spring coefficient of pain for deviation from ideal in
vertical tuning (notes sounding simultaneously).
Rdrift is a spring coefficient of pain for drift (overall tuning changes
over time), i.e. for grounding springs.
SRFfact. The Stress Reduction Factor (SRF) is a means by which
horizontal unison pain calculation is reduced when many notes are
sounding. The raw SRF is raised to the power SRFfact, tending to
reduce its effect.
HighNote is a means by which the highest note sounding is given
greater effective volume than it otherwise would have, since the ear
may tend to be more greatly attuned to the highest voice.
VolFlatn is a means by which the raw absolute volume of a voice is
"flattened" somewhat against other voices, reflecting the tendency of
the ear to hear volume in a somewhat logarithmic fashion.
KeyedTunable is the extent to which keyed voices (piano, etc.) are
to be treated as tunable. If 0.0, these voices will not be retuned.
Rmelody is a coefficient for future horizontal non-unison "melody"
springs. This will be a way to make melody steps somewhat more uniform.
Stretch is for tapping into a "stretched piano" tuning curve.
minSeven and maxSeven are for attempting to reconstruct an extended
meantone set of notes, at present not well functioning.
jdebug is a flag by which a number of other on/off switches can be
0x0001: debug writes
0x0002: absurdly many debug writes
0x0008: use stdout, not a file.
0x0010: use old tch rather than new tsp for final tuning.
0x0020: special TChoiceBase::calcSeam() writes
0x0040: write absolute time into the output file
0x0080: iNoRelax of tsprings
0x0100: suppress shift of ideal ground using doCOFT()
0x0200: suppress re-spring of 12-tET intervals
0x0400: suppress adaptive re-grounding AFTER doCOFT()
0x0800: suppress capture of input pitch bends for gliss
0x1000: [not used]
(higher): [not used as of 10-31-00]
Return to home page