Synced ziffers to onbeat

This commit is contained in:
2023-08-24 11:46:29 +03:00
parent 10c1d467ca
commit 24901163cb

View File

@ -27,8 +27,15 @@ export class Player extends Event {
return this.current;
}
pulseToSecond = (pulse: number): number => {
return this.app.clock.convertPulseToSecond(pulse);
}
areWeThereYet = (): boolean => {
const howAboutNow = (this.ziffers.notStarted() || this.app.api.epulse() > this.callTime+(this.current.duration*this.app.api.ppqn()));
const howAboutNow = (this.ziffers.notStarted() ||
this.pulseToSecond(this.app.api.epulse()) >
this.pulseToSecond(this.callTime) +
this.current.duration * this.pulseToSecond(this.app.api.ppqn() * 4))
if(howAboutNow) {
this.tick = 0;
} else {