Skip to content

Commit

Permalink
Remove 70% stem volume scaler (YARC-Official#198)
Browse files Browse the repository at this point in the history
  • Loading branch information
sonicfind authored Jul 29, 2024
1 parent 48675e1 commit f34023f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 14 deletions.
1 change: 0 additions & 1 deletion YARG.Core/Audio/AudioHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ namespace YARG.Core.Audio
{
public static class AudioHelpers
{
public const double SONG_VOLUME_MULTIPLIER = 0.7;
public static readonly Dictionary<string, SongStem> SupportedStems = new()
{
{ "song", SongStem.Song },
Expand Down
18 changes: 9 additions & 9 deletions YARG.Core/Audio/GlobalAudioHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ public static class GlobalAudioHandler

static GlobalAudioHandler()
{
var vocals = new StemSettings(AudioHelpers.SONG_VOLUME_MULTIPLIER);
var drums = new StemSettings(AudioHelpers.SONG_VOLUME_MULTIPLIER);
var vocals = new StemSettings();
var drums = new StemSettings();

StemSettings = new()
{
{ SongStem.Song, new StemSettings(AudioHelpers.SONG_VOLUME_MULTIPLIER) },
{ SongStem.Guitar, new StemSettings(AudioHelpers.SONG_VOLUME_MULTIPLIER) },
{ SongStem.Bass, new StemSettings(AudioHelpers.SONG_VOLUME_MULTIPLIER) },
{ SongStem.Rhythm, new StemSettings(AudioHelpers.SONG_VOLUME_MULTIPLIER) },
{ SongStem.Keys, new StemSettings(AudioHelpers.SONG_VOLUME_MULTIPLIER) },
{ SongStem.Song, new StemSettings() },
{ SongStem.Guitar, new StemSettings() },
{ SongStem.Bass, new StemSettings() },
{ SongStem.Rhythm, new StemSettings() },
{ SongStem.Keys, new StemSettings() },
{ SongStem.Vocals, vocals },
{ SongStem.Vocals1, vocals },
{ SongStem.Vocals2, vocals },
Expand All @@ -44,8 +44,8 @@ static GlobalAudioHandler()
{ SongStem.Drums2, drums },
{ SongStem.Drums3, drums },
{ SongStem.Drums4, drums },
{ SongStem.Crowd, new StemSettings(AudioHelpers.SONG_VOLUME_MULTIPLIER) },
{ SongStem.Sfx, new StemSettings(1) },
{ SongStem.Crowd, new StemSettings() },
{ SongStem.Sfx, new StemSettings() },
};
}

Expand Down
6 changes: 2 additions & 4 deletions YARG.Core/Audio/StemSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,14 @@ namespace YARG.Core.Audio
public class StemSettings
{
public static bool ApplySettings = true;
private readonly double _volumeScaling;

private Action<double>? _onVolumeChange;
private Action<bool>? _onReverbChange;
private double _volume;
private bool _reverb;

public StemSettings(double scaling)
public StemSettings()
{
_volumeScaling = scaling;
_volume = 1;
}

Expand All @@ -40,7 +38,7 @@ public double VolumeSetting
}
}

public double TrueVolume => (ApplySettings ? _volume : 1) * _volumeScaling;
public double TrueVolume => (ApplySettings ? _volume : 1);

public bool Reverb
{
Expand Down

0 comments on commit f34023f

Please sign in to comment.