From 7adf2159f66513d61460819a29976910d3ee3909 Mon Sep 17 00:00:00 2001 From: James R Date: Thu, 6 Aug 2020 21:24:41 -0700 Subject: [PATCH 1/9] Reduce songs and sounds to 1/4 volume, add a musicdef option for volume --- src/doomdef.h | 4 ++++ src/s_sound.c | 18 ++++++++++++++++++ src/s_sound.h | 2 ++ src/sdl/mixer_sound.c | 7 +++++-- 4 files changed, 29 insertions(+), 2 deletions(-) diff --git a/src/doomdef.h b/src/doomdef.h index 3a49cccd4..26072b705 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -676,4 +676,8 @@ extern const char *compdate, *comptime, *comprevision, *compbranch; /// Hardware renderer: OpenGL #define GL_SHADERS +/// Default volume for songs that don't have "volume" set via musicdef +/// TODO: Remove this once all songs are ported +#define DEFAULT_MUSICDEF_VOLUME 25 + #endif // __DOOMDEF__ diff --git a/src/s_sound.c b/src/s_sound.c index 9b49784ec..0bff2e028 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -1578,6 +1578,7 @@ static UINT32 queue_fadeinms; musicdef_t *musicdefstart = NULL; // First music definition struct cursongcredit cursongcredit; // Currently displayed song credit info +int musicdef_volume; // // search for music definition in wad @@ -1686,6 +1687,8 @@ void S_LoadMusicDefs(UINT16 wadnum) } } + def->volume = DEFAULT_MUSICDEF_VOLUME; + skip_lump: stoken = strtok(NULL, "\r\n "); line++; @@ -1720,6 +1723,8 @@ skip_lump: for (value = def->source; *value; value++) if (*value == '_') *value = ' '; // turn _ into spaces. //CONS_Printf("S_LoadMusicDefs: Set source to '%s'\n", def->source); + } else if (!stricmp(stoken, "volume")) { + def->volume = atoi(value); } else { CONS_Alert(CONS_WARNING, "MUSICDEF: Invalid field '%s'. (file %s, line %d)\n", stoken, wadfiles[wadnum]->filename, line); } @@ -2047,6 +2052,19 @@ void S_ChangeMusicEx(const char *mmusic, UINT16 mflags, boolean looping, UINT32 music_flags = mflags; music_looping = looping; + musicdef_volume = DEFAULT_MUSICDEF_VOLUME; + + { + musicdef_t *def; + for (def = musicdefstart; def; def = def->next) + { + if (strcasecmp(def->name, music_name) == 0) + { + musicdef_volume = def->volume; + } + } + } + if (!S_PlayMusic(looping, fadeinms)) { CONS_Alert(CONS_ERROR, "Music %.6s could not be played!\n", newmusic); diff --git a/src/s_sound.h b/src/s_sound.h index c433aa974..332f93324 100644 --- a/src/s_sound.h +++ b/src/s_sound.h @@ -139,6 +139,7 @@ typedef struct musicdef_s char name[7]; //char usage[256]; char source[256]; + int volume; struct musicdef_s *next; } musicdef_t; @@ -151,6 +152,7 @@ extern struct cursongcredit } cursongcredit; extern musicdef_t *musicdefstart; +extern int musicdef_volume; void S_LoadMusicDefs(UINT16 wadnum); void S_InitMusicDefs(void); diff --git a/src/sdl/mixer_sound.c b/src/sdl/mixer_sound.c index 77fcc0914..0821a22c9 100644 --- a/src/sdl/mixer_sound.c +++ b/src/sdl/mixer_sound.c @@ -493,7 +493,8 @@ void I_FreeSfx(sfxinfo_t *sfx) INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority, INT32 channel) { - UINT8 volume = (((UINT16)vol + 1) * (UINT16)sfx_volume) / 62; // (256 * 31) / 62 == 127 + //UINT8 volume = (((UINT16)vol + 1) * (UINT16)sfx_volume) / 62; // (256 * 31) / 62 == 127 + int volume = ( vol + 1 ) / 8;/* reduce to 1/4, 256 / 8 = 128 / 4 = 32 */ INT32 handle = Mix_PlayChannel(channel, S_sfx[id].data, 0); Mix_Volume(handle, volume); Mix_SetPanning(handle, min((UINT16)(0xff-sep)<<1, 0xff), min((UINT16)(sep)<<1, 0xff)); @@ -531,6 +532,7 @@ void I_SetSfxVolume(UINT8 volume) static UINT32 get_real_volume(UINT8 volume) { + (void)volume; #ifdef _WIN32 if (I_SongType() == MU_MID) // HACK: Until we stop using native MIDI, @@ -540,7 +542,8 @@ static UINT32 get_real_volume(UINT8 volume) #endif // convert volume to mixer's 128 scale // then apply internal_volume as a percentage - return ((UINT32)volume*128/31) * (UINT32)internal_volume / 100; + //return ((UINT32)volume*128/31) * (UINT32)internal_volume / 100; + return MIX_MAX_VOLUME * musicdef_volume / 100 * internal_volume / 100; } static UINT32 get_adjusted_position(UINT32 position) From 374d032a6b63347f4a81e0f029412a336511cc43 Mon Sep 17 00:00:00 2001 From: James R Date: Fri, 7 Aug 2020 12:28:15 -0700 Subject: [PATCH 2/9] Clean up stuff, make volume work again --- src/doomdef.h | 5 ++--- src/i_sound.h | 4 ++-- src/s_sound.h | 6 ++++++ src/sdl/mixer_sound.c | 22 +++++++++++++++------- 4 files changed, 25 insertions(+), 12 deletions(-) diff --git a/src/doomdef.h b/src/doomdef.h index 26072b705..fbea62c7e 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -676,8 +676,7 @@ extern const char *compdate, *comptime, *comprevision, *compbranch; /// Hardware renderer: OpenGL #define GL_SHADERS -/// Default volume for songs that don't have "volume" set via musicdef -/// TODO: Remove this once all songs are ported -#define DEFAULT_MUSICDEF_VOLUME 25 +/// Divide volume of music and sounds by this much (loudest sounds on earth) +#define VOLUME_DIVIDER 4 #endif // __DOOMDEF__ diff --git a/src/i_sound.h b/src/i_sound.h index 93e3f6dd0..f418b598f 100644 --- a/src/i_sound.h +++ b/src/i_sound.h @@ -118,7 +118,7 @@ void I_UpdateSoundParams(INT32 handle, UINT8 vol, UINT8 sep, UINT8 pitch); \return void */ -void I_SetSfxVolume(UINT8 volume); +void I_SetSfxVolume(int volume); /// ------------------------ // MUSIC SYSTEM @@ -227,7 +227,7 @@ void I_ResumeSong(void); \return void */ -void I_SetMusicVolume(UINT8 volume); +void I_SetMusicVolume(int volume); boolean I_SetSongTrack(INT32 track); diff --git a/src/s_sound.h b/src/s_sound.h index 332f93324..1fccd97fc 100644 --- a/src/s_sound.h +++ b/src/s_sound.h @@ -23,6 +23,12 @@ // mask used to indicate sound origin is player item pickup #define PICKUP_SOUND 0x8000 +// +#define SOUND_VOLUME_RANGE 256 +#define MAX_SOUND_VOLUME 255 + +#define DEFAULT_MUSICDEF_VOLUME ( 100 / VOLUME_DIVIDER ) + extern consvar_t stereoreverse; extern consvar_t cv_soundvolume, cv_digmusicvolume;//, cv_midimusicvolume; extern consvar_t cv_numChannels; diff --git a/src/sdl/mixer_sound.c b/src/sdl/mixer_sound.c index 0821a22c9..54e63f8fe 100644 --- a/src/sdl/mixer_sound.c +++ b/src/sdl/mixer_sound.c @@ -84,7 +84,9 @@ static UINT32 stutter_threshold_user; static UINT32 stutter_threshold; static Mix_Music *music; -static UINT8 music_volume, sfx_volume, internal_volume; +static int music_volume; +static int sfx_volume; +static int internal_volume; static float loop_point; static float song_length; // length in seconds static boolean songpaused; @@ -494,7 +496,9 @@ void I_FreeSfx(sfxinfo_t *sfx) INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority, INT32 channel) { //UINT8 volume = (((UINT16)vol + 1) * (UINT16)sfx_volume) / 62; // (256 * 31) / 62 == 127 - int volume = ( vol + 1 ) / 8;/* reduce to 1/4, 256 / 8 = 128 / 4 = 32 */ + const int scale = SOUND_VOLUME_RANGE / MIX_MAX_VOLUME; + const int divider = VOLUME_DIVIDER * scale; + const int volume = ( vol + 1 ) / divider * sfx_volume / 100; INT32 handle = Mix_PlayChannel(channel, S_sfx[id].data, 0); Mix_Volume(handle, volume); Mix_SetPanning(handle, min((UINT16)(0xff-sep)<<1, 0xff), min((UINT16)(sep)<<1, 0xff)); @@ -521,7 +525,7 @@ void I_UpdateSoundParams(INT32 handle, UINT8 vol, UINT8 sep, UINT8 pitch) (void)pitch; } -void I_SetSfxVolume(UINT8 volume) +void I_SetSfxVolume(int volume) { sfx_volume = volume; } @@ -530,9 +534,8 @@ void I_SetSfxVolume(UINT8 volume) /// Music Utilities /// ------------------------ -static UINT32 get_real_volume(UINT8 volume) +static UINT32 get_real_volume(int volume) { - (void)volume; #ifdef _WIN32 if (I_SongType() == MU_MID) // HACK: Until we stop using native MIDI, @@ -540,10 +543,15 @@ static UINT32 get_real_volume(UINT8 volume) return ((UINT32)31*128/31); // volume = 31 else #endif + { // convert volume to mixer's 128 scale // then apply internal_volume as a percentage //return ((UINT32)volume*128/31) * (UINT32)internal_volume / 100; - return MIX_MAX_VOLUME * musicdef_volume / 100 * internal_volume / 100; + return MIX_MAX_VOLUME + * musicdef_volume / 100 + * internal_volume / 100 + * volume / 100; + } } static UINT32 get_adjusted_position(UINT32 position) @@ -1237,7 +1245,7 @@ void I_ResumeSong(void) songpaused = false; } -void I_SetMusicVolume(UINT8 volume) +void I_SetMusicVolume(int volume) { if (!I_SongPlaying()) return; From 9077a4ff03e196d79522d52b422432c9f67a1cdd Mon Sep 17 00:00:00 2001 From: James R Date: Fri, 7 Aug 2020 12:38:55 -0700 Subject: [PATCH 3/9] Kill MIDI --- src/d_main.c | 25 +--------- src/d_netcmd.c | 3 -- src/doomdef.h | 3 -- src/doomstat.h | 5 -- src/s_sound.c | 119 ++------------------------------------------ src/s_sound.h | 10 ++-- src/sdl/sdl_sound.c | 3 -- 7 files changed, 8 insertions(+), 160 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index fe7e312ee..0b37e3aac 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -126,15 +126,9 @@ INT32 postimgparam[MAXSPLITSCREENPLAYERS]; // whether the respective sound system is disabled // or they're init'ed, but the player just toggled them #ifdef _XBOX -#ifndef NO_MIDI -boolean midi_disabled = true; -#endif boolean sound_disabled = true; boolean digital_disabled = true; #else -#ifndef NO_MIDI -boolean midi_disabled = false; -#endif boolean sound_disabled = false; boolean digital_disabled = false; #endif @@ -1350,17 +1344,11 @@ void D_SRB2Main(void) { sound_disabled = true; digital_disabled = true; -#ifndef NO_MIDI - midi_disabled = true; -#endif } if (M_CheckParm("-noaudio")) // combines -nosound and -nomusic { sound_disabled = true; digital_disabled = true; -#ifndef NO_MIDI - midi_disabled = true; -#endif } else { @@ -1369,25 +1357,14 @@ void D_SRB2Main(void) if (M_CheckParm("-nomusic")) // combines -nomidimusic and -nodigmusic { digital_disabled = true; -#ifndef NO_MIDI - midi_disabled = true; -#endif } else { -#ifndef NO_MIDI - if (M_CheckParm("-nomidimusic")) - midi_disabled = true; // WARNING: DOS version initmusic in I_StartupSound -#endif if (M_CheckParm("-nodigmusic")) digital_disabled = true; // WARNING: DOS version initmusic in I_StartupSound } } - if (!( sound_disabled && digital_disabled -#ifndef NO_MIDI - && midi_disabled -#endif - )) + if (!( sound_disabled && digital_disabled )) { CONS_Printf("S_InitSfxChannels(): Setting up sound channels.\n"); I_StartupSound(); diff --git a/src/d_netcmd.c b/src/d_netcmd.c index a106530cf..52a3247a4 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -1098,9 +1098,6 @@ void D_RegisterClientCommands(void) // s_sound.c CV_RegisterVar(&cv_soundvolume); CV_RegisterVar(&cv_digmusicvolume); -#ifndef NO_MIDI - CV_RegisterVar(&cv_midimusicvolume); -#endif CV_RegisterVar(&cv_numChannels); // i_cdmus.c diff --git a/src/doomdef.h b/src/doomdef.h index fbea62c7e..ec887b075 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -663,9 +663,6 @@ extern const char *compdate, *comptime, *comprevision, *compbranch; /// SRB2Kart: Camera always has noclip. #define NOCLIPCAM -/// SRB2Kart: MIDI support is shitty and busted and we don't want it, lets throw it behind a define -#define NO_MIDI - /// FINALLY some real clipping that doesn't make walls dissappear AND speeds the game up /// (that was the original comment from SRB2CB, sadly it is a lie and actually slows game down) /// on the bright side it fixes some weird issues with translucent walls diff --git a/src/doomstat.h b/src/doomstat.h index e678886a8..bf4f64497 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -110,11 +110,6 @@ extern boolean forceresetplayers, deferencoremode; // Internal parameters for sound rendering. // ======================================== -#ifdef NO_MIDI -#define midi_disabled true -#else -extern boolean midi_disabled; -#endif extern boolean sound_disabled; extern boolean digital_disabled; diff --git a/src/s_sound.c b/src/s_sound.c index 0bff2e028..790468284 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -55,9 +55,6 @@ static void Command_Tunes_f(void); static void Command_RestartAudio_f(void); // Sound system toggles -#ifndef NO_MIDI -static void GameMIDIMusic_OnChange(void); -#endif static void GameSounds_OnChange(void); static void GameDigiMusic_OnChange(void); @@ -97,9 +94,6 @@ static consvar_t precachesound = {"precachesound", "Off", CV_SAVE, CV_OnOff, NUL // actual general (maximum) sound & music volume, saved into the config consvar_t cv_soundvolume = {"soundvolume", "18", CV_SAVE, soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_digmusicvolume = {"digmusicvolume", "18", CV_SAVE, soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -#ifndef NO_MIDI -consvar_t cv_midimusicvolume = {"midimusicvolume", "18", CV_SAVE, soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -#endif // number of channels available #if defined (_WIN32_WCE) || defined (DC) || defined (PSP) || defined(GP2X) consvar_t cv_numChannels = {"snd_channels", "8", CV_SAVE|CV_CALL, CV_Unsigned, SetChannelsNum, 0, NULL, NULL, 0, 0, NULL}; @@ -112,9 +106,6 @@ consvar_t surround = {"surround", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, // Sound system toggles, saved into the config consvar_t cv_gamedigimusic = {"digimusic", "On", CV_SAVE|CV_CALL|CV_NOINIT, CV_OnOff, GameDigiMusic_OnChange, 0, NULL, NULL, 0, 0, NULL}; -#ifndef NO_MIDI -consvar_t cv_gamemidimusic = {"midimusic", "On", CV_SAVE|CV_CALL|CV_NOINIT, CV_OnOff, GameMIDIMusic_OnChange, 0, NULL, NULL, 0, 0, NULL}; -#endif consvar_t cv_gamesounds = {"sounds", "On", CV_SAVE|CV_CALL|CV_NOINIT, CV_OnOff, GameSounds_OnChange, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_playmusicifunfocused = {"playmusicifunfocused", "No", CV_SAVE|CV_CALL|CV_NOINIT, CV_YesNo, PlayMusicIfUnfocused_OnChange, 0, NULL, NULL, 0, 0, NULL}; @@ -286,9 +277,6 @@ void S_RegisterSoundStuff(void) //CV_RegisterVar(&cv_resetmusic); CV_RegisterVar(&cv_gamesounds); CV_RegisterVar(&cv_gamedigimusic); -#ifndef NO_MIDI - CV_RegisterVar(&cv_gamemidimusic); -#endif CV_RegisterVar(&cv_playmusicifunfocused); CV_RegisterVar(&cv_playsoundifunfocused); @@ -902,9 +890,6 @@ void S_StopSound(void *origin) // static INT32 actualsfxvolume; // check for change through console static INT32 actualdigmusicvolume; -#ifndef NO_MIDI -static INT32 actualmidimusicvolume; -#endif void S_UpdateSounds(void) { @@ -931,10 +916,6 @@ void S_UpdateSounds(void) S_SetSfxVolume (cv_soundvolume.value); if (actualdigmusicvolume != cv_digmusicvolume.value) S_SetDigMusicVolume (cv_digmusicvolume.value); -#ifndef NO_MIDI - if (actualmidimusicvolume != cv_midimusicvolume.value) - S_SetMIDIMusicVolume (cv_midimusicvolume.value); -#endif // We're done now, if we're not in a level. if (gamestate != GS_LEVEL) @@ -1790,11 +1771,6 @@ boolean S_DigMusicDisabled(void) return digital_disabled; } -boolean S_MIDIMusicDisabled(void) -{ - return midi_disabled; // SRB2Kart: defined as "true" w/ NO_MIDI -} - boolean S_MusicDisabled(void) { return (midi_disabled && digital_disabled); @@ -1900,15 +1876,6 @@ static boolean S_LoadMusic(const char *mname) CONS_Alert(CONS_NOTICE, "Digital music is disabled!\n"); return false; } - else if (S_MIDIMusicDisabled() && S_MIDIExists(mname)) - { -#ifdef NO_MIDI - CONS_Alert(CONS_ERROR, "A MIDI music lump %.6s was found,\nbut SRB2Kart does not support MIDI output.\nWe apologise for the inconvenience.\n", mname); -#else - CONS_Alert(CONS_NOTICE, "MIDI music is disabled!\n"); -#endif - return false; - } else { CONS_Alert(CONS_ERROR, M_GetText("Music lump %.6s not found!\n"), mname); @@ -2158,50 +2125,19 @@ void S_EnableSound(void) } } -void S_SetMusicVolume(INT32 digvolume, INT32 seqvolume) +void S_SetMusicVolume(INT32 digvolume) { if (digvolume < 0) digvolume = cv_digmusicvolume.value; -#ifdef NO_MIDI - (void)seqvolume; -#else - if (seqvolume < 0) - seqvolume = cv_midimusicvolume.value; -#endif - - if (digvolume < 0 || digvolume > 31) - CONS_Alert(CONS_WARNING, "digmusicvolume should be between 0-31\n"); - CV_SetValue(&cv_digmusicvolume, digvolume&31); + CV_SetValue(&cv_digmusicvolume, digvolume); actualdigmusicvolume = cv_digmusicvolume.value; //check for change of var -#ifndef NO_MIDI - if (seqvolume < 0 || seqvolume > 31) - CONS_Alert(CONS_WARNING, "midimusicvolume should be between 0-31\n"); - CV_SetValue(&cv_midimusicvolume, seqvolume&31); - actualmidimusicvolume = cv_midimusicvolume.value; //check for change of var -#endif - #ifdef DJGPPDOS digvolume = 31; -#ifndef NO_MIDI - seqvolume = 31; -#endif #endif - switch(I_SongType()) - { -#ifndef NO_MIDI - case MU_MID: - //case MU_MOD: - //case MU_GME: - I_SetMusicVolume(seqvolume&31); - break; -#endif - default: - I_SetMusicVolume(digvolume&31); - break; - } + I_SetMusicVolume(digvolume); } void @@ -2378,11 +2314,7 @@ static void Command_RestartAudio_f(void) // These must be called or no sound and music until manually set. I_SetSfxVolume(cv_soundvolume.value); -#ifdef NO_MIDI - S_SetMusicVolume(cv_digmusicvolume.value, -1); -#else - S_SetMusicVolume(cv_digmusicvolume.value, cv_midimusicvolume.value); -#endif + S_SetMusicVolume(cv_digmusicvolume.value); S_StartSound(NULL, sfx_strpst); @@ -2448,49 +2380,6 @@ void GameDigiMusic_OnChange(void) } } -#ifndef NO_MIDI -void GameMIDIMusic_OnChange(void) -{ - if (M_CheckParm("-nomusic") || M_CheckParm("-noaudio")) - return; - else if (M_CheckParm("-nomidimusic")) - return; - - if (midi_disabled) - { - midi_disabled = false; - I_InitMusic(); - if (Playing()) - P_RestoreMusic(&players[consoleplayer]); - else - S_ChangeMusicInternal("titles", looptitle); - } - else - { - midi_disabled = true; - if (S_MusicType() == MU_MID) - { - if (digital_disabled) - S_StopMusic(); - else - { - char mmusic[7]; - UINT16 mflags; - boolean looping; - - if (S_MusicInfo(mmusic, &mflags, &looping) && S_DigExists(mmusic)) - { - S_StopMusic(); - S_ChangeMusic(mmusic, mflags, looping); - } - else - S_StopMusic(); - } - } - } -} -#endif - static void PlayMusicIfUnfocused_OnChange(void) { if (window_notinfocus) diff --git a/src/s_sound.h b/src/s_sound.h index 1fccd97fc..c4b4deef7 100644 --- a/src/s_sound.h +++ b/src/s_sound.h @@ -35,9 +35,6 @@ extern consvar_t cv_numChannels; extern consvar_t surround; //extern consvar_t cv_resetmusic; extern consvar_t cv_gamedigimusic; -#ifndef NO_MIDI -extern consvar_t cv_gamemidimusic; -#endif extern consvar_t cv_gamesounds; extern consvar_t cv_playmusicifunfocused; extern consvar_t cv_playsoundifunfocused; @@ -240,10 +237,9 @@ void S_UpdateSounds(void); FUNCMATH fixed_t S_CalculateSoundDistance(fixed_t px1, fixed_t py1, fixed_t pz1, fixed_t px2, fixed_t py2, fixed_t pz2); void S_SetSfxVolume(INT32 volume); -void S_SetMusicVolume(INT32 digvolume, INT32 seqvolume); -#define S_SetDigMusicVolume(a) S_SetMusicVolume(a,-1) -#define S_SetMIDIMusicVolume(a) S_SetMusicVolume(-1,a) -#define S_InitMusicVolume() S_SetMusicVolume(-1,-1) +void S_SetMusicVolume(INT32 digvolume); +#define S_SetDigMusicVolume S_SetMusicVolume +#define S_InitMusicVolume() S_SetMusicVolume(-1) INT32 S_OriginPlaying(void *origin); INT32 S_IdPlaying(sfxenum_t id); diff --git a/src/sdl/sdl_sound.c b/src/sdl/sdl_sound.c index 4bb1b5676..ad3486219 100644 --- a/src/sdl/sdl_sound.c +++ b/src/sdl/sdl_sound.c @@ -1173,9 +1173,6 @@ void I_StartupSound(void) const char *sdrv_name = NULL; #endif #ifndef HAVE_MIXER -#ifndef NO_MIDI - midi_disabled = -#endif digital_disabled = true; #endif From 72e225f8c9afae5e4bba09b25a3d96b7e4c9918b Mon Sep 17 00:00:00 2001 From: James R Date: Fri, 7 Aug 2020 12:43:59 -0700 Subject: [PATCH 4/9] Rename digmusicvolume to musicvolume, default soundvolume and musicvolume to 100% --- src/doomdef.h | 1 + src/s_sound.c | 8 +++----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/doomdef.h b/src/doomdef.h index ec887b075..d84aaa4e9 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -675,5 +675,6 @@ extern const char *compdate, *comptime, *comprevision, *compbranch; /// Divide volume of music and sounds by this much (loudest sounds on earth) #define VOLUME_DIVIDER 4 +#define MAX_VOLUME ( 100 * VOLUME_DIVIDER ) #endif // __DOOMDEF__ diff --git a/src/s_sound.c b/src/s_sound.c index 790468284..ec1f53e1f 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -49,7 +49,7 @@ extern INT32 msg_id; static INT32 S_AdjustSoundParams(const mobj_t *listener, const mobj_t *source, INT32 *vol, INT32 *sep, INT32 *pitch, sfxinfo_t *sfxinfo); #endif -CV_PossibleValue_t soundvolume_cons_t[] = {{0, "MIN"}, {31, "MAX"}, {0, NULL}}; +CV_PossibleValue_t soundvolume_cons_t[] = {{0, "MIN"}, {MAX_VOLUME, "MAX"}, {0, NULL}}; static void SetChannelsNum(void); static void Command_Tunes_f(void); static void Command_RestartAudio_f(void); @@ -92,8 +92,8 @@ consvar_t stereoreverse = {"stereoreverse", "Off", CV_SAVE, CV_OnOff, NULL, 0, N static consvar_t precachesound = {"precachesound", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; // actual general (maximum) sound & music volume, saved into the config -consvar_t cv_soundvolume = {"soundvolume", "18", CV_SAVE, soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_digmusicvolume = {"digmusicvolume", "18", CV_SAVE, soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_soundvolume = {"soundvolume", "100", CV_SAVE, soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_digmusicvolume = {"musicvolume", "100", CV_SAVE, soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; // number of channels available #if defined (_WIN32_WCE) || defined (DC) || defined (PSP) || defined(GP2X) consvar_t cv_numChannels = {"snd_channels", "8", CV_SAVE|CV_CALL, CV_Unsigned, SetChannelsNum, 0, NULL, NULL, 0, 0, NULL}; @@ -121,8 +121,6 @@ consvar_t cv_music_resync_threshold = {"music_resync_threshold", "100", CV_SAVE| consvar_t cv_music_resync_powerups_only = {"music_resync_powerups_only", "No", CV_SAVE|CV_CALL, CV_YesNo, I_UpdateSongLagConditions, 0, NULL, NULL, 0, 0, NULL}; -#define S_MAX_VOLUME 127 - // when to clip out sounds // Does not fit the large outdoor areas. // added 2-2-98 in 8 bit volume control (before (1200*0x10000)) From aedc5ae7af5689572184673ad3dee9531cfb0d78 Mon Sep 17 00:00:00 2001 From: James R Date: Fri, 7 Aug 2020 12:50:59 -0700 Subject: [PATCH 5/9] Kill MIDI more >:) --- src/i_sound.h | 1 - src/lua_baselib.c | 4 +--- src/s_sound.c | 31 ++++----------------------- src/s_sound.h | 6 ++---- src/sdl/mixer_sound.c | 50 +++++++++++++------------------------------ src/sdl/sdl_sound.c | 6 +++--- src/w_wad.c | 1 - 7 files changed, 25 insertions(+), 74 deletions(-) diff --git a/src/i_sound.h b/src/i_sound.h index f418b598f..28cab0c54 100644 --- a/src/i_sound.h +++ b/src/i_sound.h @@ -24,7 +24,6 @@ typedef enum { MU_CMD, MU_WAV, MU_MOD, - MU_MID, MU_OGG, MU_MP3, MU_MP3_MAD_UNUSED, // use MU_MP3 instead diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 9916ceab8..3914b4c1e 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -1959,8 +1959,6 @@ static int lib_sMusicInfo(lua_State *L) static int lib_sMusicExists(lua_State *L) { - boolean checkMIDI = lua_opttrueboolean(L, 2); - boolean checkDigi = lua_opttrueboolean(L, 3); #ifdef MUSICSLOT_COMPATIBILITY const char *music_name; UINT32 music_num; @@ -1989,7 +1987,7 @@ static int lib_sMusicExists(lua_State *L) const char *music_name = luaL_checkstring(L, 1); #endif NOHUD - lua_pushboolean(L, S_MusicExists(music_name, checkMIDI, checkDigi)); + lua_pushboolean(L, S_MusicExists(music_name)); return 1; } diff --git a/src/s_sound.c b/src/s_sound.c index ec1f53e1f..e9bd96cc4 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -1771,7 +1771,7 @@ boolean S_DigMusicDisabled(void) boolean S_MusicDisabled(void) { - return (midi_disabled && digital_disabled); + return digital_disabled; } boolean S_MusicPlaying(void) @@ -1807,12 +1807,9 @@ boolean S_MusicInfo(char *mname, UINT16 *mflags, boolean *looping) return (boolean)mname[0]; } -boolean S_MusicExists(const char *mname, boolean checkMIDI, boolean checkDigi) +boolean S_MusicExists(const char *mname) { - return ( - (checkDigi ? W_CheckNumForName(va("O_%s", mname)) != LUMPERROR : false) - || (checkMIDI ? W_CheckNumForName(va("D_%s", mname)) != LUMPERROR : false) - ); + return W_CheckNumForName(va("O_%s", mname)) != LUMPERROR; } /// ------------------------ @@ -1867,8 +1864,6 @@ static boolean S_LoadMusic(const char *mname) if (!S_DigMusicDisabled() && S_DigExists(mname)) mlumpnum = W_GetNumForName(va("o_%s", mname)); - else if (!S_MIDIMusicDisabled() && S_MIDIExists(mname)) - mlumpnum = W_GetNumForName(va("d_%s", mname)); else if (S_DigMusicDisabled() && S_DigExists(mname)) { CONS_Alert(CONS_NOTICE, "Digital music is disabled!\n"); @@ -2356,25 +2351,7 @@ void GameDigiMusic_OnChange(void) else { digital_disabled = true; - if (S_MusicType() != MU_MID) - { - if (midi_disabled) - S_StopMusic(); - else - { - char mmusic[7]; - UINT16 mflags; - boolean looping; - - if (S_MusicInfo(mmusic, &mflags, &looping) && S_MIDIExists(mmusic)) - { - S_StopMusic(); - S_ChangeMusic(mmusic, mflags, looping); - } - else - S_StopMusic(); - } - } + S_StopMusic(); } } diff --git a/src/s_sound.h b/src/s_sound.h index c4b4deef7..d2ea6b4d4 100644 --- a/src/s_sound.h +++ b/src/s_sound.h @@ -118,16 +118,14 @@ void S_StopSound(void *origin); // boolean S_DigMusicDisabled(void); -boolean S_MIDIMusicDisabled(void); boolean S_MusicDisabled(void); boolean S_MusicPlaying(void); boolean S_MusicPaused(void); musictype_t S_MusicType(void); const char *S_MusicName(void); boolean S_MusicInfo(char *mname, UINT16 *mflags, boolean *looping); -boolean S_MusicExists(const char *mname, boolean checkMIDI, boolean checkDigi); -#define S_DigExists(a) S_MusicExists(a, false, true) -#define S_MIDIExists(a) S_MusicExists(a, true, false) +boolean S_MusicExists(const char *mname); +#define S_DigExists S_MusicExists // // Music Effects diff --git a/src/sdl/mixer_sound.c b/src/sdl/mixer_sound.c index 54e63f8fe..dc088185c 100644 --- a/src/sdl/mixer_sound.c +++ b/src/sdl/mixer_sound.c @@ -536,13 +536,6 @@ void I_SetSfxVolume(int volume) static UINT32 get_real_volume(int volume) { -#ifdef _WIN32 - if (I_SongType() == MU_MID) - // HACK: Until we stop using native MIDI, - // disable volume changes - return ((UINT32)31*128/31); // volume = 31 - else -#endif { // convert volume to mixer's 128 scale // then apply internal_volume as a percentage @@ -611,7 +604,7 @@ static void count_music_bytes(int chan, void *stream, int len, void *udata) (void)stream; (void)udata; - if (!music || I_SongType() == MU_GME || I_SongType() == MU_MOD || I_SongType() == MU_MID) + if (!music || I_SongType() == MU_GME || I_SongType() == MU_MOD) return; music_bytes += len; @@ -714,8 +707,6 @@ musictype_t I_SongType(void) #endif if (!music) return MU_NONE; - else if (Mix_GetMusicType(music) == MUS_MID) - return MU_MID; else if (Mix_GetMusicType(music) == MUS_MOD || Mix_GetMusicType(music) == MUS_MODPLUG) return MU_MOD; else if (Mix_GetMusicType(music) == MUS_MP3 || Mix_GetMusicType(music) == MUS_MP3_MAD) @@ -798,7 +789,7 @@ UINT32 I_GetSongLength(void) } else #endif - if (!music || I_SongType() == MU_MOD || I_SongType() == MU_MID) + if (!music || I_SongType() == MU_MOD) return 0; else { @@ -813,7 +804,7 @@ UINT32 I_GetSongLength(void) boolean I_SetSongLoopPoint(UINT32 looppoint) { - if (!music || I_SongType() == MU_GME || I_SongType() == MU_MOD || I_SongType() == MU_MID || !is_looping) + if (!music || I_SongType() == MU_GME || I_SongType() == MU_MOD || !is_looping) return false; else { @@ -849,7 +840,7 @@ UINT32 I_GetSongLoopPoint(void) } else #endif - if (!music || I_SongType() == MU_MOD || I_SongType() == MU_MID) + if (!music || I_SongType() == MU_MOD) return 0; else return (UINT32)(loop_point * 1000); @@ -883,7 +874,7 @@ boolean I_SetSongPosition(UINT32 position) } else #endif - if (!music || I_SongType() == MU_MID) + if (!music) return false; else if (I_SongType() == MU_MOD) return Mix_SetMusicPosition(position); // Goes by channels @@ -942,7 +933,7 @@ UINT32 I_GetSongPosition(void) } else #endif - if (!music || I_SongType() == MU_MID) + if (!music) return 0; else return music_bytes/44100.0L*1000.0L/4; //assume 44.1khz @@ -1170,12 +1161,12 @@ boolean I_PlaySong(boolean looping) if (fpclassify(song_length) == FP_ZERO && (I_SongType() == MU_OGG || I_SongType() == MU_MP3 || I_SongType() == MU_FLAC)) CONS_Debug(DBG_DETAILED, "This song is missing a LENGTHMS= tag! Required to make seeking work properly.\n"); - if (I_SongType() != MU_MOD && I_SongType() != MU_MID && Mix_PlayMusic(music, 0) == -1) + if (I_SongType() != MU_MOD && Mix_PlayMusic(music, 0) == -1) { CONS_Alert(CONS_ERROR, "Mix_PlayMusic: %s\n", Mix_GetError()); return false; } - else if ((I_SongType() == MU_MOD || I_SongType() == MU_MID) && Mix_PlayMusic(music, looping ? -1 : 0) == -1) // if MOD, loop forever + else if (I_SongType() == MU_MOD && Mix_PlayMusic(music, looping ? -1 : 0) == -1) // if MOD, loop forever { CONS_Alert(CONS_ERROR, "Mix_PlayMusic: %s\n", Mix_GetError()); return false; @@ -1185,10 +1176,10 @@ boolean I_PlaySong(boolean looping) I_SetMusicVolume(music_volume); - if (I_SongType() != MU_MOD && I_SongType() != MU_MID) + if (I_SongType() != MU_MOD) Mix_HookMusicFinished(music_loop); // don't bother counting if MOD - if(I_SongType() != MU_MOD && I_SongType() != MU_MID && !Mix_RegisterEffect(MIX_CHANNEL_POST, count_music_bytes, NULL, NULL)) + if(I_SongType() != MU_MOD && !Mix_RegisterEffect(MIX_CHANNEL_POST, count_music_bytes, NULL, NULL)) CONS_Alert(CONS_WARNING, "Error registering SDL music position counter: %s\n", Mix_GetError()); return true; @@ -1217,10 +1208,9 @@ void I_StopSong(void) void I_PauseSong(void) { - if(I_SongType() == MU_MID) // really, SDL Mixer? why can't you pause MIDI??? - return; + // really, SRB2? why do you support MIDI??? - if(I_SongType() != MU_GME && I_SongType() != MU_MOD && I_SongType() != MU_MID) + if(I_SongType() != MU_GME && I_SongType() != MU_MOD) Mix_UnregisterEffect(MIX_CHANNEL_POST, count_music_bytes); Mix_PauseMusic(); @@ -1229,15 +1219,12 @@ void I_PauseSong(void) void I_ResumeSong(void) { - if (I_SongType() == MU_MID) - return; - - if (I_SongType() != MU_GME && I_SongType() != MU_MOD && I_SongType() != MU_MID) + if (I_SongType() != MU_GME && I_SongType() != MU_MOD) { while(Mix_UnregisterEffect(MIX_CHANNEL_POST, count_music_bytes) != 0) { } // HACK: fixes issue of multiple effect callbacks being registered - if(music && I_SongType() != MU_MOD && I_SongType() != MU_MID && !Mix_RegisterEffect(MIX_CHANNEL_POST, count_music_bytes, NULL, NULL)) + if(music && I_SongType() != MU_MOD && !Mix_RegisterEffect(MIX_CHANNEL_POST, count_music_bytes, NULL, NULL)) CONS_Alert(CONS_WARNING, "Error registering SDL music position counter: %s\n", Mix_GetError()); } @@ -1250,14 +1237,7 @@ void I_SetMusicVolume(int volume) if (!I_SongPlaying()) return; -#ifdef _WIN32 - if (I_SongType() == MU_MID) - // HACK: Until we stop using native MIDI, - // disable volume changes - music_volume = 31; - else -#endif - music_volume = volume; + music_volume = volume; Mix_VolumeMusic(get_real_volume(music_volume)); } diff --git a/src/sdl/sdl_sound.c b/src/sdl/sdl_sound.c index ad3486219..6cee7161b 100644 --- a/src/sdl/sdl_sound.c +++ b/src/sdl/sdl_sound.c @@ -195,7 +195,7 @@ static void Snd_LockAudio(void) //Alam: Lock audio data and uninstall audio call { if (Snd_Mutex) SDL_LockMutex(Snd_Mutex); else if (sound_disabled) return; - else if (midi_disabled && digital_disabled + else if (digital_disabled #ifdef HW3SOUND && hws_mode == HWS_DEFAULT_MODE #endif @@ -209,7 +209,7 @@ static void Snd_UnlockAudio(void) //Alam: Unlock audio data and reinstall audio { if (Snd_Mutex) SDL_UnlockMutex(Snd_Mutex); else if (sound_disabled) return; - else if (midi_disabled && digital_disabled + else if (digital_disabled #ifdef HW3SOUND && hws_mode == HWS_DEFAULT_MODE #endif @@ -1153,7 +1153,7 @@ void I_ShutdownSound(void) } #endif - if (midi_disabled && digital_disabled) + if (digital_disabled) SDL_CloseAudio(); CONS_Printf("%s", M_GetText("shut down\n")); sound_started = false; diff --git a/src/w_wad.c b/src/w_wad.c index 54ae7fb26..89802d23a 100644 --- a/src/w_wad.c +++ b/src/w_wad.c @@ -1707,7 +1707,6 @@ int W_VerifyNMUSlumps(const char *filename) { lumpchecklist_t NMUSlist[] = { - {"D_", 2}, // MIDI music {"O_", 2}, // Digital music {"DS", 2}, // Sound effects From 0e0015cb444f339a8461501e311bb410231f7f91 Mon Sep 17 00:00:00 2001 From: James R Date: Fri, 7 Aug 2020 13:02:35 -0700 Subject: [PATCH 6/9] And remove the limit on S_SetSfxVolume :V --- src/s_sound.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/s_sound.c b/src/s_sound.c index e9bd96cc4..6b810dc7a 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -1148,17 +1148,14 @@ void S_UpdateSounds(void) void S_SetSfxVolume(INT32 volume) { - if (volume < 0 || volume > 31) - CONS_Alert(CONS_WARNING, "sfxvolume should be between 0-31\n"); - - CV_SetValue(&cv_soundvolume, volume&0x1F); + CV_SetValue(&cv_soundvolume, volume); actualsfxvolume = cv_soundvolume.value; // check for change of var #ifdef HW3SOUND hws_mode == HWS_DEFAULT_MODE ? I_SetSfxVolume(volume&0x1F) : HW3S_SetSfxVolume(volume&0x1F); #else // now hardware volume - I_SetSfxVolume(volume&0x1F); + I_SetSfxVolume(volume); #endif } From 559029511bf2242544a591ed489a0a6ac52f696d Mon Sep 17 00:00:00 2001 From: James R Date: Fri, 7 Aug 2020 13:10:13 -0700 Subject: [PATCH 7/9] Update sounds with correct volume --- src/sdl/mixer_sound.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/sdl/mixer_sound.c b/src/sdl/mixer_sound.c index dc088185c..7c997e2e0 100644 --- a/src/sdl/mixer_sound.c +++ b/src/sdl/mixer_sound.c @@ -200,6 +200,15 @@ void I_UpdateSound(void) /// SFX /// ------------------------ +static int +get_real_sfx_volume (int vol) +{ + const int scale = SOUND_VOLUME_RANGE / MIX_MAX_VOLUME; + const int divider = VOLUME_DIVIDER * scale; + const int volume = ( vol + 1 ) / divider * sfx_volume / 100; + return volume; +} + // this is as fast as I can possibly make it. // sorry. more asm needed. static Mix_Chunk *ds2chunk(void *stream) @@ -496,9 +505,7 @@ void I_FreeSfx(sfxinfo_t *sfx) INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority, INT32 channel) { //UINT8 volume = (((UINT16)vol + 1) * (UINT16)sfx_volume) / 62; // (256 * 31) / 62 == 127 - const int scale = SOUND_VOLUME_RANGE / MIX_MAX_VOLUME; - const int divider = VOLUME_DIVIDER * scale; - const int volume = ( vol + 1 ) / divider * sfx_volume / 100; + UINT8 volume = get_real_sfx_volume(vol); INT32 handle = Mix_PlayChannel(channel, S_sfx[id].data, 0); Mix_Volume(handle, volume); Mix_SetPanning(handle, min((UINT16)(0xff-sep)<<1, 0xff), min((UINT16)(sep)<<1, 0xff)); @@ -519,7 +526,8 @@ boolean I_SoundIsPlaying(INT32 handle) void I_UpdateSoundParams(INT32 handle, UINT8 vol, UINT8 sep, UINT8 pitch) { - UINT8 volume = (((UINT16)vol + 1) * (UINT16)sfx_volume) / 62; // (256 * 31) / 62 == 127 + //UINT8 volume = (((UINT16)vol + 1) * (UINT16)sfx_volume) / 62; // (256 * 31) / 62 == 127 + UINT8 volume = get_real_sfx_volume(vol); Mix_Volume(handle, volume); Mix_SetPanning(handle, min((UINT16)(0xff-sep)<<1, 0xff), min((UINT16)(sep)<<1, 0xff)); (void)pitch; From 922f6aa9f8bb16ba6ce679bd511326fb8cef039f Mon Sep 17 00:00:00 2001 From: James R Date: Fri, 25 Sep 2020 02:23:44 -0700 Subject: [PATCH 8/9] Scale volume cvars by half, 200% max and 50% default --- src/doomdef.h | 3 ++- src/s_sound.c | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/doomdef.h b/src/doomdef.h index 3a6875a57..a3f7cacd2 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -648,7 +648,8 @@ extern const char *compdate, *comptime, *comprevision, *compbranch; /// Divide volume of music and sounds by this much (loudest sounds on earth) #define VOLUME_DIVIDER 4 -#define MAX_VOLUME ( 100 * VOLUME_DIVIDER ) +#define USER_VOLUME_SCALE 2 +#define MAX_VOLUME ( 100 * VOLUME_DIVIDER / USER_VOLUME_SCALE ) #if defined (HAVE_CURL) && ! defined (NONET) #define MASTERSERVER diff --git a/src/s_sound.c b/src/s_sound.c index ac58d7c4e..1bb554dfe 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -92,8 +92,8 @@ consvar_t stereoreverse = {"stereoreverse", "Off", CV_SAVE, CV_OnOff, NULL, 0, N static consvar_t precachesound = {"precachesound", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; // actual general (maximum) sound & music volume, saved into the config -consvar_t cv_soundvolume = {"soundvolume", "100", CV_SAVE, soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_digmusicvolume = {"musicvolume", "100", CV_SAVE, soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_soundvolume = {"soundvolume", "50", CV_SAVE, soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_digmusicvolume = {"musicvolume", "50", CV_SAVE, soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; // number of channels available #if defined (_WIN32_WCE) || defined (DC) || defined (PSP) || defined(GP2X) consvar_t cv_numChannels = {"snd_channels", "8", CV_SAVE|CV_CALL, CV_Unsigned, SetChannelsNum, 0, NULL, NULL, 0, 0, NULL}; @@ -1154,7 +1154,7 @@ void S_UpdateSounds(void) void S_SetSfxVolume(INT32 volume) { CV_SetValue(&cv_soundvolume, volume); - actualsfxvolume = cv_soundvolume.value; // check for change of var + actualsfxvolume = cv_soundvolume.value * USER_VOLUME_SCALE; #ifdef HW3SOUND hws_mode == HWS_DEFAULT_MODE ? I_SetSfxVolume(volume&0x1F) : HW3S_SetSfxVolume(volume&0x1F); @@ -2123,7 +2123,7 @@ void S_SetMusicVolume(INT32 digvolume) digvolume = cv_digmusicvolume.value; CV_SetValue(&cv_digmusicvolume, digvolume); - actualdigmusicvolume = cv_digmusicvolume.value; //check for change of var + actualdigmusicvolume = cv_digmusicvolume.value * USER_VOLUME_SCALE; #ifdef DJGPPDOS digvolume = 31; From ce4dc9fbc92a9435bcf76910c1cf19ab0e0d2603 Mon Sep 17 00:00:00 2001 From: James R Date: Fri, 25 Sep 2020 02:29:07 -0700 Subject: [PATCH 9/9] Adjust volumes by 5% in menu --- src/m_menu.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/m_menu.c b/src/m_menu.c index dcadc6d21..785200d83 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -2379,6 +2379,11 @@ static void M_ChangeCvar(INT32 choice) ||((currentMenu->menuitems[itemOn].status & IT_CVARTYPE) == IT_CV_INVISSLIDER) ||((currentMenu->menuitems[itemOn].status & IT_CVARTYPE) == IT_CV_NOMOD)) { + if (cv == &cv_digmusicvolume || cv == &cv_soundvolume) + { + choice *= 5; + } + CV_SetValue(cv,cv->value+choice); } else if (cv->flags & CV_FLOAT)