Add Two Clocks

Co-authored-by: Raphaël Forment <Bubobubobubobubo@users.noreply.github.com>
This commit is contained in:
Fr0stbyteR
2023-08-02 20:20:36 +08:00
parent 3b65cfd5c7
commit 0d2373c026
4 changed files with 80 additions and 18 deletions

View File

@ -38,6 +38,15 @@ export class Clock {
get beats_per_bar(): number { return this.time_signature[0]; }
get pulse_duration(): number {
return 60 / this.bpm / this.ppqn;
}
public convertPulseToSecond(n: number): number {
return n * this.pulse_duration
}
start(): void {
// Check if the clock is already running
if (this.transportNode?.state === 'running') {