Change clock starting point and add oncount method as alternative to onbeat

This commit is contained in:
2023-08-31 18:03:07 +03:00
parent 3c335a50a9
commit 86739faa77
6 changed files with 67 additions and 38 deletions

View File

@ -40,9 +40,9 @@ export class Clock {
tick: number;
constructor(public app: Editor, ctx: AudioContext) {
this.time_position = { bar: 0, beat: 0, pulse: 0 };
this.time_position = { bar: -1, beat: -1, pulse: -1 };
this.time_signature = [4, 4];
this.tick = 0;
this.tick = -1;
this._bpm = 120;
this._ppqn = 48;
this.transportNode = null;
@ -157,7 +157,7 @@ export class Clock {
/**
* Stops the TransportNode (stops the clock).
*/
this.app.clock.tick = 0;
this.app.clock.tick = -1;
this.transportNode?.stop();
}
}