diff --git a/Source/i_sound.c b/Source/i_sound.c index 5550b787..3fe73623 100644 --- a/Source/i_sound.c +++ b/Source/i_sound.c @@ -50,6 +50,8 @@ boolean precache_sounds; boolean lowpass_filter; // [FG] music backend midi_player_t midi_player; +// [FG] variable pitch bend range +int pitch_bend_range; // Music modules extern music_module_t music_win_module; @@ -462,6 +464,7 @@ void I_SetChannels(void) int i; int *steptablemid = steptable + 128; + const double base = pitch_bend_range / 100.0; // Okay, reset internal mixing channels to zero. for(i = 0; i < MAX_CHANNELS; ++i) @@ -472,7 +475,7 @@ void I_SetChannels(void) // This table provides step widths for pitch parameters. for(i=-128 ; i<128 ; i++) { - steptablemid[i] = (int)(pow(2.0, (double)i / 64.0) * 65536.0); // [FG] pimp (was 1.2) + steptablemid[i] = (int)(pow(base, (double)i / 64.0) * 65536.0); // [FG] variable pitch bend range } } diff --git a/Source/i_sound.h b/Source/i_sound.h index 2e9808fe..543bbf07 100644 --- a/Source/i_sound.h +++ b/Source/i_sound.h @@ -48,6 +48,8 @@ extern int snd_samplerate; extern boolean precache_sounds; // [FG] optional low-pass filter extern boolean lowpass_filter; +// [FG] variable pitch bend range +extern int pitch_bend_range; // Init at program start... void I_InitSound(void); diff --git a/Source/m_misc.c b/Source/m_misc.c index 7b4186ae..8a6552bb 100644 --- a/Source/m_misc.c +++ b/Source/m_misc.c @@ -195,6 +195,13 @@ default_t defaults[] = { "1 to enable variable pitch in sound effects (from id's original code)" }, + { + "pitch_bend_range", + (config_t *) &pitch_bend_range, NULL, + {200}, {100,300}, number, ss_none, wad_yes, + "variable pitch bend range (100 none, 120 original, 200 Woof default)" + }, + { // phares "translucency", (config_t *) &general_translucency, NULL,