// Subtracts a time value from all timeline values in the Beats e.g. to compensate
// for a known latency or to adjust the beats so that the first beat falls on 0.
Subtracts a time value from all timeline values in the Beats e.g. to compensate
for a known latency or to adjust the beats so that the first beat falls on 0.
// Subtracts a time value from all timeline values in the Beats e . g . to compensate // for a known latency or to adjust the beats so that the first beat falls on 0 .
func (beats *Beats) Sub(dt time.Duration) {
	if beats != nil {
		beats.Offset -= dt
		for i, b := range beats.Beats {
			beats.Beats[i].At = b.At - dt
			if len(b.Taps) > 0 {
				beats.Beats[i].Mean = b.Mean - dt
				for j, t := range b.Taps {
					beats.Beats[i].Taps[j] = t - dt
				}
			}
		}
	}
}
func ( beats * Beats ) Sub ( dt time . Duration ) { if beats != nil { beats . Offset -= dt for i , b := range beats . Beats { beats . Beats [ i ] . At = b . At - dt if len ( b . Taps ) > 0 { beats . Beats [ i ] . Mean = b . Mean - dt for j , t := range b . Taps { beats . Beats [ i ] . Taps [ j ] = t - dt } } } } }
Subtracts a time value from all timeline values in the Beats e.g.
Subtracts a time value from all timeline values in the Beats e . g .