From 0e205b6b6c6d211c77c7755d264462e31db2ca9b Mon Sep 17 00:00:00 2001 From: Raphael Forment Date: Fri, 27 Oct 2023 09:56:28 +0200 Subject: [PATCH] adding logicalTime and realTime getters --- src/Clock.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Clock.ts b/src/Clock.ts index 9a6081f..fab3172 100644 --- a/src/Clock.ts +++ b/src/Clock.ts @@ -144,6 +144,14 @@ export class Clock { return this._ppqn; } + get logicalTime(): number { + return this.tick * this.pulse_duration; + } + + get realTime(): number { + return this.elapsed; + } + set ppqn(ppqn: number) { if (ppqn > 0 && this._ppqn !== ppqn) { this._ppqn = ppqn;