1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-07 13:47:33 +08:00

Merge pull request #21661 from nekodex/clamp-sfx-panning

Limit SFX panning on results screen
This commit is contained in:
Dean Herbert 2022-12-16 18:05:40 +09:00 committed by GitHub
commit 965be5123d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 2 deletions

View File

@ -234,7 +234,7 @@ namespace osu.Game.Graphics.Cursor
SampleChannel channel = tapSample.GetChannel();
// Scale to [-0.75, 0.75] so that the sample isn't fully panned left or right (sounds weird)
channel.Balance.Value = ((activeCursor.X / DrawWidth) * 2 - 1) * 0.75;
channel.Balance.Value = ((activeCursor.X / DrawWidth) * 2 - 1) * OsuGameBase.SFX_STEREO_STRENGTH;
channel.Frequency.Value = baseFrequency - (random_range / 2f) + RNG.NextDouble(random_range);
channel.Volume.Value = baseFrequency;

View File

@ -83,6 +83,8 @@ namespace osu.Game
public const int SAMPLE_CONCURRENCY = 6;
public const double SFX_STEREO_STRENGTH = 0.75;
/// <summary>
/// Length of debounce (in milliseconds) for commonly occuring sample playbacks that could stack.
/// </summary>

View File

@ -225,7 +225,7 @@ namespace osu.Game.Screens.Ranking
protected override void Update()
{
base.Update();
audioContent.Balance.Value = (ScreenSpaceDrawQuad.Centre.X / game.ScreenSpaceDrawQuad.Width) * 2 - 1;
audioContent.Balance.Value = ((ScreenSpaceDrawQuad.Centre.X / game.ScreenSpaceDrawQuad.Width) * 2 - 1) * OsuGameBase.SFX_STEREO_STRENGTH;
}
private void playAppearSample()