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:
parent
05150b34e5
commit
8d6d7fcdbe
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user