foxygit / doom Log in
commit 3b9503da9b5f5788e4fc430a3972af0099a8448c
Author:     ceski <56656010+ceski-1@users.noreply.github.com>
AuthorDate: Tue Sep 27 12:34:29 2022 -0700
Commit:     GitHub <noreply@github.com>
CommitDate: Tue Sep 27 21:34:29 2022 +0200

    Adjust music volume to prevent clipping and match midiOutSetVolume curve (#1508)

    * Adjust music volume slider to match vanilla Doom

    * Prevent music volume clipping

    * Adjust native MIDI volume slider curve to match midiOutSetVolume
---
 src/i_winmusic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/i_winmusic.c b/src/i_winmusic.c
index 51e7dc40..3a3409f0 100644
--- a/src/i_winmusic.c
+++ b/src/i_winmusic.c
@@ -471,7 +471,7 @@ boolean I_WIN_InitMusic(void)

 void I_WIN_SetMusicVolume(int volume)
 {
-    volume_factor = (float)volume / 127;
+    volume_factor = sqrt((float)volume / 120);

     UpdateVolume();
 }