mirror of
https://github.com/Tonejs/Tone.js
synced 2024-12-27 03:53:07 +00:00
compute the start of the next tick using the tickDuration instead of getTimeOfTick
fixes #706
This commit is contained in:
parent
9c1b303bcf
commit
530a997a07
1 changed files with 2 additions and 1 deletions
|
@ -569,7 +569,8 @@ export class Transport extends ToneWithContext<TransportOptions> implements Emit
|
|||
if (this.state === "started") {
|
||||
const ticks = this._clock.getTicksAtTime(now);
|
||||
// schedule to start on the next tick, #573
|
||||
const time = this._clock.getTimeOfTick(Math.ceil(ticks));
|
||||
const remainingTick = this._clock.frequency.getDurationOfTicks(Math.ceil(ticks) - ticks, now);
|
||||
const time = now + remainingTick;
|
||||
this.emit("stop", time);
|
||||
this._clock.setTicksAtTime(t, time);
|
||||
// restart it with the new time
|
||||
|
|
Loading…
Reference in a new issue