Conductor: property that returns secPerBeat scaled to song pitch

NEEDS TESTING
This commit is contained in:
minenice55
2022-03-22 14:29:15 -04:00
parent 7444165b08
commit f6df1644bc
5 changed files with 11 additions and 8 deletions

View File

@ -17,6 +17,9 @@ namespace HeavenStudio
// The number of seconds for each song beat
public float secPerBeat;
// The number of seconds for each song beat, inversely scaled to song pitch (higer pitch = shorter time)
public float pitchedSecPerBeat => (secPerBeat / musicSource.pitch);
// Current song position, in seconds
private float songPos; // for Conductor use only
public float songPosition;
@ -237,7 +240,7 @@ namespace HeavenStudio
// convert real seconds to beats
public float GetRestFromRealTime(float seconds)
{
return seconds/secPerBeat;
return seconds/pitchedSecPerBeat;
}
public void SetBpm(float bpm)