adding new important method
This commit is contained in:
@ -47,7 +47,7 @@ export class Clock {
|
||||
this.time_position = { bar: 0, beat: 0, pulse: 0 }
|
||||
this.bpm = 120;
|
||||
this.time_signature = [4, 4];
|
||||
this.ppqn = 48*2;
|
||||
this.ppqn = 48;
|
||||
ctx.audioWorklet.addModule(TransportProcessor).then((e) => {
|
||||
this.transportNode = new TransportNode(ctx, {}, this.app);
|
||||
this.transportNode.connect(ctx.destination);
|
||||
@ -65,6 +65,10 @@ export class Clock {
|
||||
return this.time_signature[0];
|
||||
}
|
||||
|
||||
get beats_since_origin(): number {
|
||||
return (this.time_position.bar - 1) * this.beats_per_bar + this.time_position.beat;
|
||||
}
|
||||
|
||||
get pulse_duration(): number {
|
||||
/**
|
||||
* Returns the duration of a pulse in seconds.
|
||||
|
||||
Reference in New Issue
Block a user