revert the semitones thing
This commit is contained in:
parent
4e53310512
commit
a25de4a1a6
|
|
@ -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"]);
|
||||
}
|
||||
),
|
||||
|
|
|
|||
|
|
@ -458,7 +458,7 @@ namespace HeavenStudio.Util
|
|||
/// <summary>
|
||||
/// Gets a pitch multiplier from semitones.
|
||||
/// </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);
|
||||
if (pitchToMusic) newSemitones *= Conductor.instance.musicSource.pitch;
|
||||
|
|
|
|||
Loading…
Reference in a new issue