From a25de4a1a6a4ed4628fca506652a98ddef73660a Mon Sep 17 00:00:00 2001 From: AstrlJelly Date: Mon, 26 Feb 2024 09:44:16 -0500 Subject: [PATCH] revert the semitones thing --- Assets/Scripts/Minigames.cs | 3 ++- Assets/Scripts/Util/SoundByte.cs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Assets/Scripts/Minigames.cs b/Assets/Scripts/Minigames.cs index 66a4d6009..137c9164b 100644 --- a/Assets/Scripts/Minigames.cs +++ b/Assets/Scripts/Minigames.cs @@ -1256,7 +1256,8 @@ namespace HeavenStudio }, preFunction : delegate { var e = eventCaller.currentEntity; - float pitch = e["useSemitones"] ? SoundByte.GetPitchFromSemiTones(e["semitones"] + e["semitonesFine"], false) : e["pitch"]; + float pitch = e["pitch"]; + if (e["useSemitones"]) pitch = SoundByte.GetPitchFromSemiTones(e["semitones"], false) + SoundByte.GetPitchFromCents(e["semitonesFine"], false); GameManager.PlaySFXArbitrary(e.beat, e.length, e["game"].CurrentValue, e["sfxName"].CurrentValue, pitch, e["volume"], e["loop"], e["offset"]); } ), diff --git a/Assets/Scripts/Util/SoundByte.cs b/Assets/Scripts/Util/SoundByte.cs index c5a03cf53..51b7981ee 100644 --- a/Assets/Scripts/Util/SoundByte.cs +++ b/Assets/Scripts/Util/SoundByte.cs @@ -458,7 +458,7 @@ namespace HeavenStudio.Util /// /// Gets a pitch multiplier from semitones. /// - public static float GetPitchFromSemiTones(float semiTones, bool pitchToMusic) + public static float GetPitchFromSemiTones(int semiTones, bool pitchToMusic) { var newSemitones = Mathf.Pow(2f, (1f / 12f) * semiTones); if (pitchToMusic) newSemitones *= Conductor.instance.musicSource.pitch;