From 9a32e15ae59e4247937e7af121c6c28a65e81215 Mon Sep 17 00:00:00 2001 From: Henry Lin Date: Fri, 4 Feb 2022 14:37:43 +0800 Subject: [PATCH 01/10] Add IApplicableToTrackMixer --- osu.Game/Overlays/MusicController.cs | 6 ++++++ osu.Game/Rulesets/Mods/IApplicableToTrackMixer.cs | 15 +++++++++++++++ osu.Game/Screens/Play/Player.cs | 5 +++++ 3 files changed, 26 insertions(+) create mode 100644 osu.Game/Rulesets/Mods/IApplicableToTrackMixer.cs diff --git a/osu.Game/Overlays/MusicController.cs b/osu.Game/Overlays/MusicController.cs index 5fc0da889109..5d0a1f3ad165 100644 --- a/osu.Game/Overlays/MusicController.cs +++ b/osu.Game/Overlays/MusicController.cs @@ -52,6 +52,9 @@ public class MusicController : CompositeDrawable [NotNull] public DrawableTrack CurrentTrack { get; private set; } = new DrawableTrack(new TrackVirtual(1000)); + [Resolved] + private AudioManager audioManager { get; set; } + [Resolved] private RealmAccess realm { get; set; } @@ -389,11 +392,14 @@ public void ResetTrackAdjustments() CurrentTrack.RemoveAllAdjustments(AdjustableProperty.Frequency); CurrentTrack.RemoveAllAdjustments(AdjustableProperty.Tempo); CurrentTrack.RemoveAllAdjustments(AdjustableProperty.Volume); + audioManager.TrackMixer.Effects.Clear(); if (allowTrackAdjustments) { foreach (var mod in mods.Value.OfType()) mod.ApplyToTrack(CurrentTrack); + foreach (var mod in mods.Value.OfType()) + mod.ApplyToTrackMixer(audioManager.TrackMixer); } } } diff --git a/osu.Game/Rulesets/Mods/IApplicableToTrackMixer.cs b/osu.Game/Rulesets/Mods/IApplicableToTrackMixer.cs new file mode 100644 index 000000000000..77ceb657e7b2 --- /dev/null +++ b/osu.Game/Rulesets/Mods/IApplicableToTrackMixer.cs @@ -0,0 +1,15 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using osu.Framework.Audio.Mixing; + +namespace osu.Game.Rulesets.Mods +{ + /// + /// An interface for mods that add effects to an + /// + public interface IApplicableToTrackMixer : IApplicableMod + { + void ApplyToTrackMixer(AudioMixer sample); + } +} diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 240620b68696..4630c6a96051 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -100,6 +100,9 @@ public abstract class Player : ScreenWithBeatmapBackground, ISamplePlaybackDisab [Resolved] private MusicController musicController { get; set; } + [Resolved] + private AudioManager audioManager { get; set; } + [Resolved] private SpectatorClient spectatorClient { get; set; } @@ -960,6 +963,8 @@ public override void OnEntering(IScreen last) musicController.ResetTrackAdjustments(); foreach (var mod in GameplayState.Mods.OfType()) mod.ApplyToTrack(musicController.CurrentTrack); + foreach (var mod in GameplayState.Mods.OfType()) + mod.ApplyToTrackMixer(audioManager.TrackMixer); updateGameplayState(); From 890b58d290b044be897fe5ce90cb87adeedead36 Mon Sep 17 00:00:00 2001 From: Henry Lin Date: Fri, 4 Feb 2022 14:43:00 +0800 Subject: [PATCH 02/10] Fix naming for parameter --- osu.Game/Rulesets/Mods/IApplicableToTrackMixer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Rulesets/Mods/IApplicableToTrackMixer.cs b/osu.Game/Rulesets/Mods/IApplicableToTrackMixer.cs index 77ceb657e7b2..dadf341adab0 100644 --- a/osu.Game/Rulesets/Mods/IApplicableToTrackMixer.cs +++ b/osu.Game/Rulesets/Mods/IApplicableToTrackMixer.cs @@ -10,6 +10,6 @@ namespace osu.Game.Rulesets.Mods /// public interface IApplicableToTrackMixer : IApplicableMod { - void ApplyToTrackMixer(AudioMixer sample); + void ApplyToTrackMixer(AudioMixer mixer); } } From 20afd6ddd1d4203aacc54431d8290fb535173945 Mon Sep 17 00:00:00 2001 From: Henry Lin Date: Fri, 4 Feb 2022 15:08:10 +0800 Subject: [PATCH 03/10] Update comment --- osu.Game/Rulesets/Mods/IApplicableToTrackMixer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Rulesets/Mods/IApplicableToTrackMixer.cs b/osu.Game/Rulesets/Mods/IApplicableToTrackMixer.cs index dadf341adab0..614ad3cbce6f 100644 --- a/osu.Game/Rulesets/Mods/IApplicableToTrackMixer.cs +++ b/osu.Game/Rulesets/Mods/IApplicableToTrackMixer.cs @@ -6,7 +6,7 @@ namespace osu.Game.Rulesets.Mods { /// - /// An interface for mods that add effects to an + /// An interface for mods that add effects to the track mixer. /// public interface IApplicableToTrackMixer : IApplicableMod { From 016e0c320745dae61a9c273d4bbb46d382392baa Mon Sep 17 00:00:00 2001 From: Henry Lin Date: Fri, 4 Feb 2022 15:08:53 +0800 Subject: [PATCH 04/10] Add interface for sample mixer --- osu.Game/Overlays/MusicController.cs | 3 +++ osu.Game/Rulesets/Mods/IApplicableToMixers.cs | 9 +++++++++ .../Rulesets/Mods/IApplicableToSampleMixer.cs | 15 +++++++++++++++ osu.Game/Screens/Play/Player.cs | 2 ++ 4 files changed, 29 insertions(+) create mode 100644 osu.Game/Rulesets/Mods/IApplicableToMixers.cs create mode 100644 osu.Game/Rulesets/Mods/IApplicableToSampleMixer.cs diff --git a/osu.Game/Overlays/MusicController.cs b/osu.Game/Overlays/MusicController.cs index 5d0a1f3ad165..affd297ad651 100644 --- a/osu.Game/Overlays/MusicController.cs +++ b/osu.Game/Overlays/MusicController.cs @@ -393,6 +393,7 @@ public void ResetTrackAdjustments() CurrentTrack.RemoveAllAdjustments(AdjustableProperty.Tempo); CurrentTrack.RemoveAllAdjustments(AdjustableProperty.Volume); audioManager.TrackMixer.Effects.Clear(); + audioManager.SampleMixer.Effects.Clear(); if (allowTrackAdjustments) { @@ -400,6 +401,8 @@ public void ResetTrackAdjustments() mod.ApplyToTrack(CurrentTrack); foreach (var mod in mods.Value.OfType()) mod.ApplyToTrackMixer(audioManager.TrackMixer); + foreach (var mod in mods.Value.OfType()) + mod.ApplyToSampleMixer(audioManager.SampleMixer); } } } diff --git a/osu.Game/Rulesets/Mods/IApplicableToMixers.cs b/osu.Game/Rulesets/Mods/IApplicableToMixers.cs new file mode 100644 index 000000000000..e125a417e335 --- /dev/null +++ b/osu.Game/Rulesets/Mods/IApplicableToMixers.cs @@ -0,0 +1,9 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +namespace osu.Game.Rulesets.Mods +{ + public interface IApplicableToMixers : IApplicableToTrackMixer, IApplicableToSampleMixer + { + } +} diff --git a/osu.Game/Rulesets/Mods/IApplicableToSampleMixer.cs b/osu.Game/Rulesets/Mods/IApplicableToSampleMixer.cs new file mode 100644 index 000000000000..c1e78f8d7eff --- /dev/null +++ b/osu.Game/Rulesets/Mods/IApplicableToSampleMixer.cs @@ -0,0 +1,15 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using osu.Framework.Audio.Mixing; + +namespace osu.Game.Rulesets.Mods +{ + /// + /// An interface for mods that add effects to the sample mixer. + /// + public interface IApplicableToSampleMixer : IApplicableMod + { + void ApplyToSampleMixer(AudioMixer mixer); + } +} diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 4630c6a96051..55f6d788fbff 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -965,6 +965,8 @@ public override void OnEntering(IScreen last) mod.ApplyToTrack(musicController.CurrentTrack); foreach (var mod in GameplayState.Mods.OfType()) mod.ApplyToTrackMixer(audioManager.TrackMixer); + foreach (var mod in GameplayState.Mods.OfType()) + mod.ApplyToSampleMixer(audioManager.SampleMixer); updateGameplayState(); From 20b5b029500362ca25566e8b8dc3b4c1c7bfd951 Mon Sep 17 00:00:00 2001 From: Henry Lin Date: Sat, 5 Feb 2022 10:31:26 +0800 Subject: [PATCH 05/10] Revert "Add interface for sample mixer" This reverts commit 016e0c320745dae61a9c273d4bbb46d382392baa. --- osu.Game/Overlays/MusicController.cs | 3 --- osu.Game/Rulesets/Mods/IApplicableToMixers.cs | 9 --------- .../Rulesets/Mods/IApplicableToSampleMixer.cs | 15 --------------- osu.Game/Screens/Play/Player.cs | 2 -- 4 files changed, 29 deletions(-) delete mode 100644 osu.Game/Rulesets/Mods/IApplicableToMixers.cs delete mode 100644 osu.Game/Rulesets/Mods/IApplicableToSampleMixer.cs diff --git a/osu.Game/Overlays/MusicController.cs b/osu.Game/Overlays/MusicController.cs index affd297ad651..5d0a1f3ad165 100644 --- a/osu.Game/Overlays/MusicController.cs +++ b/osu.Game/Overlays/MusicController.cs @@ -393,7 +393,6 @@ public void ResetTrackAdjustments() CurrentTrack.RemoveAllAdjustments(AdjustableProperty.Tempo); CurrentTrack.RemoveAllAdjustments(AdjustableProperty.Volume); audioManager.TrackMixer.Effects.Clear(); - audioManager.SampleMixer.Effects.Clear(); if (allowTrackAdjustments) { @@ -401,8 +400,6 @@ public void ResetTrackAdjustments() mod.ApplyToTrack(CurrentTrack); foreach (var mod in mods.Value.OfType()) mod.ApplyToTrackMixer(audioManager.TrackMixer); - foreach (var mod in mods.Value.OfType()) - mod.ApplyToSampleMixer(audioManager.SampleMixer); } } } diff --git a/osu.Game/Rulesets/Mods/IApplicableToMixers.cs b/osu.Game/Rulesets/Mods/IApplicableToMixers.cs deleted file mode 100644 index e125a417e335..000000000000 --- a/osu.Game/Rulesets/Mods/IApplicableToMixers.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. -// See the LICENCE file in the repository root for full licence text. - -namespace osu.Game.Rulesets.Mods -{ - public interface IApplicableToMixers : IApplicableToTrackMixer, IApplicableToSampleMixer - { - } -} diff --git a/osu.Game/Rulesets/Mods/IApplicableToSampleMixer.cs b/osu.Game/Rulesets/Mods/IApplicableToSampleMixer.cs deleted file mode 100644 index c1e78f8d7eff..000000000000 --- a/osu.Game/Rulesets/Mods/IApplicableToSampleMixer.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. -// See the LICENCE file in the repository root for full licence text. - -using osu.Framework.Audio.Mixing; - -namespace osu.Game.Rulesets.Mods -{ - /// - /// An interface for mods that add effects to the sample mixer. - /// - public interface IApplicableToSampleMixer : IApplicableMod - { - void ApplyToSampleMixer(AudioMixer mixer); - } -} diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 55f6d788fbff..4630c6a96051 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -965,8 +965,6 @@ public override void OnEntering(IScreen last) mod.ApplyToTrack(musicController.CurrentTrack); foreach (var mod in GameplayState.Mods.OfType()) mod.ApplyToTrackMixer(audioManager.TrackMixer); - foreach (var mod in GameplayState.Mods.OfType()) - mod.ApplyToSampleMixer(audioManager.SampleMixer); updateGameplayState(); From 1f1629d77bd692af505996f85f14cc3c58aa83c5 Mon Sep 17 00:00:00 2001 From: Henry Lin Date: Sat, 5 Feb 2022 10:59:07 +0800 Subject: [PATCH 06/10] Do not assert that mixer contains the filter in `ensureDetached` All test failures originates from this assertion, which prevents mixers from clearing effects on their own. In practice, `AudioFilter` already gracefully handles such cases in `updateFilter`, so I don't think this assertion is necessary. --- osu.Game/Audio/Effects/AudioFilter.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/osu.Game/Audio/Effects/AudioFilter.cs b/osu.Game/Audio/Effects/AudioFilter.cs index 94469671730b..1baacd495aa4 100644 --- a/osu.Game/Audio/Effects/AudioFilter.cs +++ b/osu.Game/Audio/Effects/AudioFilter.cs @@ -131,7 +131,9 @@ private void ensureDetached() if (!isAttached) return; - Debug.Assert(mixer.Effects.Contains(filter)); + // Do not assert for the existence of the filter in mixer + // There are cases where effects are cleared from the mixer's side, + // causing the filter to still think it's attached when it isn't mixer.Effects.Remove(filter); isAttached = false; } From 602a586bf6d61501e467459338fe5eeaedb3fe25 Mon Sep 17 00:00:00 2001 From: Henry Lin Date: Sat, 5 Feb 2022 12:07:36 +0800 Subject: [PATCH 07/10] Expose `IAudioMixer` interface instead of `AudioMixer` abstract class --- osu.Game/Audio/Effects/AudioFilter.cs | 4 ++-- osu.Game/Rulesets/Mods/IApplicableToTrackMixer.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Audio/Effects/AudioFilter.cs b/osu.Game/Audio/Effects/AudioFilter.cs index 1baacd495aa4..d4f01d45c1bd 100644 --- a/osu.Game/Audio/Effects/AudioFilter.cs +++ b/osu.Game/Audio/Effects/AudioFilter.cs @@ -16,7 +16,7 @@ public class AudioFilter : Component, ITransformableFilter /// public const int MAX_LOWPASS_CUTOFF = 22049; // nyquist - 1hz - private readonly AudioMixer mixer; + private readonly IAudioMixer mixer; private readonly BQFParameters filter; private readonly BQFType type; @@ -45,7 +45,7 @@ public int Cutoff /// /// The mixer this effect should be applied to. /// The type of filter (e.g. LowPass, HighPass, etc) - public AudioFilter(AudioMixer mixer, BQFType type = BQFType.LowPass) + public AudioFilter(IAudioMixer mixer, BQFType type = BQFType.LowPass) { this.mixer = mixer; this.type = type; diff --git a/osu.Game/Rulesets/Mods/IApplicableToTrackMixer.cs b/osu.Game/Rulesets/Mods/IApplicableToTrackMixer.cs index 614ad3cbce6f..a6af18cd007e 100644 --- a/osu.Game/Rulesets/Mods/IApplicableToTrackMixer.cs +++ b/osu.Game/Rulesets/Mods/IApplicableToTrackMixer.cs @@ -10,6 +10,6 @@ namespace osu.Game.Rulesets.Mods /// public interface IApplicableToTrackMixer : IApplicableMod { - void ApplyToTrackMixer(AudioMixer mixer); + void ApplyToTrackMixer(IAudioMixer mixer); } } From e8bc3013ffe67293e8ed0993809fd6e1ed258f4e Mon Sep 17 00:00:00 2001 From: Henry Lin Date: Sat, 5 Feb 2022 12:11:06 +0800 Subject: [PATCH 08/10] Use local audio mixer in `MusicController` --- osu.Game/Overlays/MusicController.cs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/osu.Game/Overlays/MusicController.cs b/osu.Game/Overlays/MusicController.cs index 5d0a1f3ad165..5fdcead04156 100644 --- a/osu.Game/Overlays/MusicController.cs +++ b/osu.Game/Overlays/MusicController.cs @@ -58,6 +58,13 @@ public class MusicController : CompositeDrawable [Resolved] private RealmAccess realm { get; set; } + private readonly DrawableAudioMixer drawableAudioMixer; + + public MusicController() + { + AddInternal(drawableAudioMixer = new DrawableAudioMixer { Name = $"{nameof(MusicController)} {nameof(DrawableAudioMixer)}" }); + } + [BackgroundDependencyLoader] private void load() { @@ -331,7 +338,7 @@ private void changeTrack() if (queuedTrack == CurrentTrack) { - AddInternal(queuedTrack); + drawableAudioMixer.Add(queuedTrack); queuedTrack.VolumeTo(0).Then().VolumeTo(1, 300, Easing.Out); } else @@ -392,14 +399,14 @@ public void ResetTrackAdjustments() CurrentTrack.RemoveAllAdjustments(AdjustableProperty.Frequency); CurrentTrack.RemoveAllAdjustments(AdjustableProperty.Tempo); CurrentTrack.RemoveAllAdjustments(AdjustableProperty.Volume); - audioManager.TrackMixer.Effects.Clear(); + drawableAudioMixer.Effects.Clear(); if (allowTrackAdjustments) { foreach (var mod in mods.Value.OfType()) mod.ApplyToTrack(CurrentTrack); foreach (var mod in mods.Value.OfType()) - mod.ApplyToTrackMixer(audioManager.TrackMixer); + mod.ApplyToTrackMixer(drawableAudioMixer); } } } From 37ab7c4df1bd76f6478df10887857c8e1b93bbca Mon Sep 17 00:00:00 2001 From: Henry Lin Date: Sat, 5 Feb 2022 12:17:38 +0800 Subject: [PATCH 09/10] Use local mixer in `Player` --- osu.Game/Overlays/MusicController.cs | 6 +++--- osu.Game/Screens/Play/Player.cs | 5 +---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/osu.Game/Overlays/MusicController.cs b/osu.Game/Overlays/MusicController.cs index 5fdcead04156..aa70da0a0730 100644 --- a/osu.Game/Overlays/MusicController.cs +++ b/osu.Game/Overlays/MusicController.cs @@ -7,6 +7,7 @@ using JetBrains.Annotations; using osu.Framework.Allocation; using osu.Framework.Audio; +using osu.Framework.Audio.Mixing; using osu.Framework.Audio.Track; using osu.Framework.Bindables; using osu.Framework.Graphics; @@ -52,14 +53,13 @@ public class MusicController : CompositeDrawable [NotNull] public DrawableTrack CurrentTrack { get; private set; } = new DrawableTrack(new TrackVirtual(1000)); - [Resolved] - private AudioManager audioManager { get; set; } - [Resolved] private RealmAccess realm { get; set; } private readonly DrawableAudioMixer drawableAudioMixer; + public IAudioMixer AudioMixer => drawableAudioMixer; + public MusicController() { AddInternal(drawableAudioMixer = new DrawableAudioMixer { Name = $"{nameof(MusicController)} {nameof(DrawableAudioMixer)}" }); diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 4630c6a96051..a1fca256b4ed 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -100,9 +100,6 @@ public abstract class Player : ScreenWithBeatmapBackground, ISamplePlaybackDisab [Resolved] private MusicController musicController { get; set; } - [Resolved] - private AudioManager audioManager { get; set; } - [Resolved] private SpectatorClient spectatorClient { get; set; } @@ -964,7 +961,7 @@ public override void OnEntering(IScreen last) foreach (var mod in GameplayState.Mods.OfType()) mod.ApplyToTrack(musicController.CurrentTrack); foreach (var mod in GameplayState.Mods.OfType()) - mod.ApplyToTrackMixer(audioManager.TrackMixer); + mod.ApplyToTrackMixer(musicController.AudioMixer); updateGameplayState(); From 872a3ca16f739c09c03ad50fdb426c750ae6c33a Mon Sep 17 00:00:00 2001 From: Henry Lin Date: Sun, 6 Feb 2022 10:42:03 +0800 Subject: [PATCH 10/10] Rename `AudioMixer` to `TrackMixer` and add xmldoc --- osu.Game/Overlays/MusicController.cs | 16 ++++++++++------ osu.Game/Screens/Play/Player.cs | 2 +- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/osu.Game/Overlays/MusicController.cs b/osu.Game/Overlays/MusicController.cs index aa70da0a0730..5adf89fd5e52 100644 --- a/osu.Game/Overlays/MusicController.cs +++ b/osu.Game/Overlays/MusicController.cs @@ -56,13 +56,17 @@ public class MusicController : CompositeDrawable [Resolved] private RealmAccess realm { get; set; } - private readonly DrawableAudioMixer drawableAudioMixer; + private readonly DrawableAudioMixer trackMixer; - public IAudioMixer AudioMixer => drawableAudioMixer; + /// + /// Get the local audio mixer layered on top of . + /// This mixer allows components (like mods) to apply audio filters to the current track without interfering with the global track mixer. + /// + public IAudioMixer TrackMixer => trackMixer; public MusicController() { - AddInternal(drawableAudioMixer = new DrawableAudioMixer { Name = $"{nameof(MusicController)} {nameof(DrawableAudioMixer)}" }); + AddInternal(trackMixer = new DrawableAudioMixer { Name = $"{nameof(MusicController)} {nameof(TrackMixer)}" }); } [BackgroundDependencyLoader] @@ -338,7 +342,7 @@ private void changeTrack() if (queuedTrack == CurrentTrack) { - drawableAudioMixer.Add(queuedTrack); + trackMixer.Add(queuedTrack); queuedTrack.VolumeTo(0).Then().VolumeTo(1, 300, Easing.Out); } else @@ -399,14 +403,14 @@ public void ResetTrackAdjustments() CurrentTrack.RemoveAllAdjustments(AdjustableProperty.Frequency); CurrentTrack.RemoveAllAdjustments(AdjustableProperty.Tempo); CurrentTrack.RemoveAllAdjustments(AdjustableProperty.Volume); - drawableAudioMixer.Effects.Clear(); + trackMixer.Effects.Clear(); if (allowTrackAdjustments) { foreach (var mod in mods.Value.OfType()) mod.ApplyToTrack(CurrentTrack); foreach (var mod in mods.Value.OfType()) - mod.ApplyToTrackMixer(drawableAudioMixer); + mod.ApplyToTrackMixer(trackMixer); } } } diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index a1fca256b4ed..06bd092ab4e2 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -961,7 +961,7 @@ public override void OnEntering(IScreen last) foreach (var mod in GameplayState.Mods.OfType()) mod.ApplyToTrack(musicController.CurrentTrack); foreach (var mod in GameplayState.Mods.OfType()) - mod.ApplyToTrackMixer(musicController.AudioMixer); + mod.ApplyToTrackMixer(musicController.TrackMixer); updateGameplayState();