1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-13 08:32:57 +08:00

Add high-pass filter to gameplay fail sequence

This commit is contained in:
Jamie Taylor 2021-10-15 17:00:47 +09:00
parent 05150b34e5
commit 8d6d7fcdbe
No known key found for this signature in database
GPG Key ID: 2ACFA8B6370B8C8C

View File

@ -6,6 +6,7 @@ using osu.Framework.Bindables;
using osu.Game.Rulesets.UI;
using System;
using System.Collections.Generic;
using ManagedBass.Fx;
using osu.Framework.Allocation;
using osu.Framework.Audio.Sample;
using osu.Framework.Audio.Track;
@ -35,6 +36,7 @@ namespace osu.Game.Screens.Play
private Track track;
private AudioFilter failLowPassFilter;
private AudioFilter failHighPassFilter;
private const float duration = 2500;
@ -52,6 +54,7 @@ namespace osu.Game.Screens.Play
failSample = audio.Samples.Get(@"Gameplay/failsound");
AddInternal(failLowPassFilter = new AudioFilter(audio.TrackMixer));
AddInternal(failHighPassFilter = new AudioFilter(audio.TrackMixer, BQFType.HighPass));
}
private bool started;
@ -66,14 +69,14 @@ namespace osu.Game.Screens.Play
started = true;
failSample.Play();
this.TransformBindableTo(trackFreq, 0, duration).OnComplete(_ =>
{
OnComplete?.Invoke();
});
failHighPassFilter.CutoffTo(300);
failLowPassFilter.CutoffTo(300, duration, Easing.OutCubic);
failSample.Play();
track.AddAdjustment(AdjustableProperty.Frequency, trackFreq);