Revert "Faster PPQN and bigger latency"

This reverts commit ca4f7acfe2.
This commit is contained in:
2023-11-10 14:12:54 +01:00
parent 2dae678b37
commit ccdbd6a7f7
3 changed files with 4 additions and 2 deletions

View File

@ -54,7 +54,7 @@ export class Clock {
this.logicalTime = 0;
this.tick = 0;
this._bpm = 120;
this._ppqn = 48 * 2;
this._ppqn = 48;
this.transportNode = null;
this.ctx = ctx;
this.running = true;
@ -175,6 +175,7 @@ export class Clock {
if (ppqn > 0 && this._ppqn !== ppqn) {
this._ppqn = ppqn;
this.transportNode?.setPPQN(ppqn);
this.logicalTime = this.realTime;
}
}

View File

@ -24,6 +24,7 @@ class TransportProcessor extends AudioWorkletProcessor {
this.currentPulsePosition = currentTime;
} else if (message.data.type === "ppqn") {
this.ppqn = message.data.value;
this.currentPulsePosition = currentTime;
} else if (message.data.type === "nudge") {
this.nudge = message.data.value;
}

View File

@ -83,7 +83,7 @@ export class Editor {
// Audio stuff
audioContext: AudioContext;
clock: Clock;
dough_nudge: number = 40;
dough_nudge: number = 20;
manualPlay: boolean = false;
isPlaying: boolean = false;