revert the semitones thing

This commit is contained in:
AstrlJelly 2024-02-26 09:44:16 -05:00
parent 4e53310512
commit a25de4a1a6
2 changed files with 3 additions and 2 deletions

View file

@ -1256,7 +1256,8 @@ namespace HeavenStudio
}, },
preFunction : delegate { preFunction : delegate {
var e = eventCaller.currentEntity; 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"]); GameManager.PlaySFXArbitrary(e.beat, e.length, e["game"].CurrentValue, e["sfxName"].CurrentValue, pitch, e["volume"], e["loop"], e["offset"]);
} }
), ),

View file

@ -458,7 +458,7 @@ namespace HeavenStudio.Util
/// <summary> /// <summary>
/// Gets a pitch multiplier from semitones. /// Gets a pitch multiplier from semitones.
/// </summary> /// </summary>
public static float GetPitchFromSemiTones(float semiTones, bool pitchToMusic) public static float GetPitchFromSemiTones(int semiTones, bool pitchToMusic)
{ {
var newSemitones = Mathf.Pow(2f, (1f / 12f) * semiTones); var newSemitones = Mathf.Pow(2f, (1f / 12f) * semiTones);
if (pitchToMusic) newSemitones *= Conductor.instance.musicSource.pitch; if (pitchToMusic) newSemitones *= Conductor.instance.musicSource.pitch;