public BeatSequence SkipToBeat(Beat beat) { var nextBeatTime = beat.GetFixedBeat(prevBeat: NextBeatTime, barLength: BeatPositioner.BarLength); if (nextBeatTime <= NextBeatTime) { throw new ArgumentException( "Next beat '" + beat + "' is before or at the same time as the currently planned next beat " + "(at audio time '" + NextBeatTime + "', " + "with the last beat at audio time '" + LastBeatTime + "')" ); } return(new BeatSequence( this.Beats, this.BeatPositioner, nextBeatOffset: nextBeatTime - LastBeatTime //Note: Make sure not to negate the current offset (I did that, oops) )); }
public double NextBeatToTime(double currentTime, Beat nextBeat) { return(BeatToTime(beat: nextBeat.GetFixedBeat(TimeToBeat(currentTime), this.BarLength))); }