Remove internal LFO
This commit is contained in:
parent
02cd79a6d9
commit
d1869c18ba
2 changed files with 3 additions and 7 deletions
|
|
@ -232,7 +232,7 @@ async function onTriggerSynth(t, value, onended, bank, frameLen) {
|
||||||
|
|
||||||
const out = ac.createGain(); // we need a separate gain for the cutgroups because firefox...
|
const out = ac.createGain(); // we need a separate gain for the cutgroups because firefox...
|
||||||
node.connect(out);
|
node.connect(out);
|
||||||
let handle = { node: out, bufferSource: source };
|
let handle = { node: out, bufferSource: source, oscillator: worklet };
|
||||||
let timeoutNode = webAudioTimeout(
|
let timeoutNode = webAudioTimeout(
|
||||||
ac,
|
ac,
|
||||||
() => {
|
() => {
|
||||||
|
|
|
||||||
|
|
@ -1008,7 +1008,6 @@ class WavetableOscillatorProcessor extends AudioWorkletProcessor {
|
||||||
this.numFrames = this.tables[0].length;
|
this.numFrames = this.tables[0].length;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
this.lfoPhase = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_chooseMip(dphi) {
|
_chooseMip(dphi) {
|
||||||
|
|
@ -1183,12 +1182,11 @@ class WavetableOscillatorProcessor extends AudioWorkletProcessor {
|
||||||
for (let i = 0; i < outL.length; i++) {
|
for (let i = 0; i < outL.length; i++) {
|
||||||
const detune = pv(parameters.detune, i);
|
const detune = pv(parameters.detune, i);
|
||||||
const spread = pv(parameters.spread, i) * 0.5 + 0.5;
|
const spread = pv(parameters.spread, i) * 0.5 + 0.5;
|
||||||
const tablePos = pv(parameters.position, i); //Math.sin(2 * Math.PI * this.lfoPhase);
|
const tablePos = pv(parameters.position, i);
|
||||||
// morph across frames
|
|
||||||
const idx = tablePos * (this.numFrames - 1);
|
const idx = tablePos * (this.numFrames - 1);
|
||||||
const fIdx = idx | 0;
|
const fIdx = idx | 0;
|
||||||
const frac = idx - fIdx;
|
const frac = idx - fIdx;
|
||||||
const warpAmount = 0.5 * Math.sin(2 * Math.PI * this.lfoPhase) + 0.5; // pv(parameters.warp, i);
|
const warpAmount = pv(parameters.warp, i);
|
||||||
const warpMode = pv(parameters.warpMode, i);
|
const warpMode = pv(parameters.warpMode, i);
|
||||||
const voices = pv(parameters.voices, i);
|
const voices = pv(parameters.voices, i);
|
||||||
const gain1 = Math.sqrt(1 - spread);
|
const gain1 = Math.sqrt(1 - spread);
|
||||||
|
|
@ -1222,8 +1220,6 @@ class WavetableOscillatorProcessor extends AudioWorkletProcessor {
|
||||||
outR[i] += (s * gainR) / Math.sqrt(voices);
|
outR[i] += (s * gainR) / Math.sqrt(voices);
|
||||||
this.phase[n] = wrapPhase(this.phase[n] + dPhase);
|
this.phase[n] = wrapPhase(this.phase[n] + dPhase);
|
||||||
}
|
}
|
||||||
this.lfoPhase += 1 / sampleRate;
|
|
||||||
if (this.lfoPhase >= 1) this.lfoPhase -= 1;
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue