File tree Expand file tree Collapse file tree
source/funkin/backend/system Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -117,6 +117,7 @@ class Flags {
117117 public static var ICONS_AUTOPOSITION : Bool = true ;
118118
119119 @:lazy public static var DEFAULT_SOUND_TIME_SCALED_PITCH : Null <Bool > = null ;
120+ @:lazy public static var USE_SOUND_VOLUME_CURVE : Null <Bool > = null ;
120121 @:lazy public static var USE_FLXTRAIL_FRAMES : Null <Bool > = null ;
121122
122123 public static var SUPPORTED_CHART_RUNTIME_FORMATS : Array <String > = [" Legacy" , " Psych Engine" ];
@@ -341,6 +342,7 @@ class Flags {
341342 }
342343 }
343344 if (DEFAULT_SOUND_TIME_SCALED_PITCH == null ) DEFAULT_SOUND_TIME_SCALED_PITCH = MOD_API_VERSION >= 2 ;
345+ if (USE_SOUND_VOLUME_CURVE == null ) USE_SOUND_VOLUME_CURVE = MOD_API_VERSION >= 2 ;
344346 if (USE_FLXTRAIL_FRAMES == null ) USE_FLXTRAIL_FRAMES = MOD_API_VERSION < 2 ;
345347
346348 flixel.sound. FlxSound .defaultTimeScaledPitch = cast DEFAULT_SOUND_TIME_SCALED_PITCH ;
Original file line number Diff line number Diff line change @@ -138,6 +138,8 @@ class Main extends Sprite
138138 game .focusLostFramerate = 30 ;
139139 FlxG .fixedTimestep = false ;
140140 FlxG .scaleMode = scaleMode = new FunkinRatioScaleMode ();
141+ FlxG .sound .applySoundCurve = applySoundCurve ;
142+ FlxG .sound .reverseSoundCurve = reverseSoundCurve ;
141143
142144 Conductor .init ();
143145 EventManager .init ();
@@ -162,6 +164,14 @@ class Main extends Sprite
162164 initTransition ();
163165 }
164166
167+ public static function applySoundCurve (volume : Float ) {
168+ return Flags .USE_SOUND_VOLUME_CURVE ? Math .pow (volume , 1.75 ) : volume ;
169+ }
170+
171+ public static function reverseSoundCurve (curvedVolume : Float ) {
172+ return Flags .USE_SOUND_VOLUME_CURVE ? Math .pow (curvedVolume , 0.5714285714285714 ) : curvedVolume ;
173+ }
174+
165175 static var persistShaderKeys : Map <String , Bool >;
166176
167177 public static function refreshAssets () @:privateAccess {
You can’t perform that action at this time.
0 commit comments