George Shagov - 2020-08-09

Hello Team!

I would like to change the default Solfeggio, based A=440 Hz to another value, like 432 Hz or 528 Hz, keeping the Musical proportion of cause. Just for experimental purposes.
Looking at the code I see quite a few numbers of line with 440 hardcoded,

~/Downloads/TiMidity++-2.15.0$ find ./ -type f -name "*" -exec grep -H 440 {} \; 
./libunimod/mlutil.c:  446836, 446433, 446030, 445628, 445226, 444824, 444423, 444022,
./libunimod/mlutil.c:  443622, 443221, 442821, 442422, 442023, 441624, 441226, 440828,
./libunimod/mlutil.c:  440430, 440033, 439636, 439239, 438843, 438447, 438051, 437656,
./libunimod/mlutil.c:  362420, 362093, 361766, 361440, 361114, 360788, 360463, 360137,
./libunimod/mlutil.c:  LOGFAC * 440, LOGFAC * 437, LOGFAC * 434, LOGFAC * 431
./libunimod/load_m15.c:  1712, 1616, 1524, 1440, 1356, 1280, 1208, 1140, 1076, 1016, 960, 906,
./libunimod/load_mod.c:  1712, 1616, 1524, 1440, 1356, 1280, 1208, 1140, 1076, 1016, 960, 906,
./timidity/playmidi.c:          *note = log(f / 440000.0) / log(2) * 12 + 69.5;
./timidity/playmidi.c:      f = 440 * pow(2.0, (st - 69) / 12.0);
./timidity/playmidi.c:              f = 440 * pow(2.0, (i - 9) / 12.0 + j - 5);
./timidity/mac_soundspec.c:#define MAX_ZOOM 440.0
./timidity/audio_cnv.c:(short)0xf540,   (short)0xf5c0,  (short)0xf440,  (short)0xf4c0,  (short)0xf740,  (short)0xf7c0,  (short)0xf640,  (short)0xf6c0,
./timidity/mod2midi.c:      1712, 1616, 1524, 1440, 1356, 1280, 1208, 1140, 1076, 1016,  960,  906,
./timidity/freq.c:    369.994423, 391.995436, 415.304698, 440.000000, 466.163762, 493.883301,
./timidity/tables.c:        freq_table[i] = 440 * pow(2.0, (i - 69) / 12.0) * 1000 + 0.5;
./timidity/tables.c:        f = 440 * pow(2.0, (i - 69) / 12.0);
./timidity/tables.c:            f = 440 * pow(2.0, (i - 9) / 12.0 + j - 5);
./timidity/tables.c:            f = 440 * pow(2.0, (i - 9) / 12.0 + j - 5);
./timidity/tables.c:            f = 440 * pow(2.0, (i - 9) / 12.0 + j - 5);
./timidity/tables.c:                f = 440 * pow(2.0, (i - 9) / 12.0 + j - 5);
./timidity/tables.c: 0.26671275747489837, 0.27262135544994898, 0.27851968938505306, 0.28440753721127188,
./timidity/tables.c: 0.63439328416364549, 0.63912444486377573, 0.64383154288979139, 0.64851440102211244,
./timidity/tables.c: 0.94154406518302081, 0.94359345816196039, 0.94560732538052128, 0.94758559101774109,
./timidity/tables.c: 0.97570213003852857, 0.97702814265775439, 0.97831737071962765, 0.97956976568544052,
./timidity/tables.c:    200, 220, 240, 260, 280, 300, 320, 340, 360, 380, 400, 420, 440, 460, 480,
./timidity/tables.c:    1.889764, 1.968504, 2.047244, 2.125984, 2.204724, 2.283465, 2.362205, 2.440945, 
./timidity/tables.c:    4.409449, 4.488189, 4.566929, 4.645669, 4.724409, 4.803150, 4.881890, 4.960630, 
./timidity/tables.c:    6.929134, 7.007874, 7.086614, 7.165354, 7.244094, 7.322835, 7.401575, 7.480315, 
./timidity/tables.c:    12.598425, 13.236220, 13.889764, 14.559055, 15.244094, 15.944882, 16.661417, 17.393701, 
./timidity/tables.c:    50.393701, 51.661417, 52.944882, 54.244094, 55.559055, 56.889764, 58.236220, 59.598425, 
./timidity/tables.c:    29.630534, 26.944060, 24.493331, 22.258137, 20.219967, 18.361866, 16.668311, 15.125088, 
./timidity/tables.c:    0.535887, 0.533570, 0.531264, 0.528967, 0.526681, 0.524404, 0.522137, 0.519880, 
./timidity/tables.c:    0.450625, 0.448677, 0.446738, 0.444807, 0.442884, 0.440969, 0.439063, 0.437165, 
./timidity/tables.c:    0.241484, 0.240440, 0.239401, 0.238366, 0.237336, 0.236310, 0.235288, 0.234271, 
./timidity/tables.c:    0.054409, 0.054174, 0.053940, 0.053707, 0.053475, 0.053244, 0.053013, 0.052784, 
./timidity/tables.c:    0.044194, 0.044003, 0.043813, 0.043624, 0.043435, 0.043247, 0.043060, 0.042874, 
./timidity/tables.c:    0.410349, 0.440872, 0.468882, 0.494640, 0.518394, 0.540373, 0.560793, 0.579854, 
./timidity/tables.c:    0.440961, 0.443820, 0.446612, 0.449337, 0.451995, 0.454584, 0.457105, 0.459557, 
./timidity/tables.c:    8.663240, 9.374459, 10.144065, 10.976853, 11.878010, 12.853149, 13.908342, 15.050163, 
./timidity/tables.c:    4900.0, 4400.0, 4000.0, 3700.0, 3400.0, 3200.0, 2900.0, 2800.0,
./timidity/sfitem.c:    {L_INHRT, T_VOLSUST, 0, 1440, 0}, /* sustainEnv2 */
./timidity/sfitem.c:    {L_INHRT, T_ATTEN, 0, 1440, 0}, /* initialAttenuation */
./timidity/sbkconv.c:       return 14400;
./timidity/reverb.c:    case 0: level = 0.744025605;    break;  /* Room 1 */
./interface/soundspec.c:#define MAX_ZOOM 440.0
./interface/w32g_i.c:#define MPANEL_XMAX 440
./autoconf/config.guess:    3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0)

I would say that 440Hz Solfeggio is hardcoded and quite severely.
I am ready to make all the changes myself, redifining 440 to some pre-defined value, but I need some help here, from development team.
If I do a fork, will you help me with reviewing the changes?

thx in advance
Yours truly, George