adding elapsed time, missing pause/resume mechanism

This commit is contained in:
2023-10-27 09:48:24 +02:00
parent b276516a0e
commit fd54c0fd82
3 changed files with 11 additions and 3 deletions

View File

@ -23,6 +23,7 @@ export class Clock {
*
* @param app - The main application instance
* @param ctx - The current AudioContext used by app
* @param elapsed - Time elapsed since play been pressed
* @param transportNode - The TransportNode helper
* @param bpm - The current beats per minute value
* @param time_signature - The time signature
@ -32,6 +33,7 @@ export class Clock {
*/
ctx: AudioContext;
elapsed: number
transportNode: TransportNode | null;
private _bpm: number;
time_signature: number[];
@ -42,6 +44,7 @@ export class Clock {
constructor(public app: Editor, ctx: AudioContext) {
this.time_position = { bar: -1, beat: -1, pulse: -1 };
this.time_signature = [4, 4];
this.elapsed = 0;
this.tick = -1;
this._bpm = 120;
this._ppqn = 48;