fix def skew
This commit is contained in:
parent
ccf2a6de52
commit
b2f90ecb3b
3 changed files with 9 additions and 4 deletions
|
|
@ -346,10 +346,10 @@ function getDelay(orbit, delaytime, delayfeedback, t, channels) {
|
||||||
export function getLfo(audioContext, begin, end, properties = {}) {
|
export function getLfo(audioContext, begin, end, properties = {}) {
|
||||||
const { shape = 0, ...props } = properties;
|
const { shape = 0, ...props } = properties;
|
||||||
const { dcoffset = -0.5, depth = 1 } = properties;
|
const { dcoffset = -0.5, depth = 1 } = properties;
|
||||||
return getWorklet(audioContext, 'lfo-processor', {
|
const lfoprops = {
|
||||||
frequency: 1,
|
frequency: 1,
|
||||||
depth,
|
depth,
|
||||||
skew: 0,
|
skew: .5,
|
||||||
phaseoffset: 0,
|
phaseoffset: 0,
|
||||||
time: begin,
|
time: begin,
|
||||||
begin,
|
begin,
|
||||||
|
|
@ -360,7 +360,10 @@ export function getLfo(audioContext, begin, end, properties = {}) {
|
||||||
max: dcoffset + depth * 0.5,
|
max: dcoffset + depth * 0.5,
|
||||||
curve: 1,
|
curve: 1,
|
||||||
...props,
|
...props,
|
||||||
});
|
}
|
||||||
|
|
||||||
|
console.info(lfoprops)
|
||||||
|
return getWorklet(audioContext, 'lfo-processor', lfoprops);
|
||||||
}
|
}
|
||||||
|
|
||||||
// export function getLfo(audioContext, time, end, properties = {}) {
|
// export function getLfo(audioContext, time, end, properties = {}) {
|
||||||
|
|
|
||||||
|
|
@ -279,7 +279,7 @@ export function registerSynthSounds() {
|
||||||
getParamADSR(envGain.gain, attack, decay, sustain, release, 0, 1, begin, holdend, 'linear');
|
getParamADSR(envGain.gain, attack, decay, sustain, release, 0, 1, begin, holdend, 'linear');
|
||||||
let lfo;
|
let lfo;
|
||||||
if (pwsweep != 0) {
|
if (pwsweep != 0) {
|
||||||
lfo = getLfo(ac, begin, end, { frequency: pwrate, depth: pwsweep });
|
lfo = getLfo(ac, begin, end, { frequency: pwrate, depth: pwsweep, skew: .5, dcoffset: 0 });
|
||||||
lfo.connect(o.parameters.get('pulsewidth'));
|
lfo.connect(o.parameters.get('pulsewidth'));
|
||||||
}
|
}
|
||||||
let timeoutNode = webAudioTimeout(
|
let timeoutNode = webAudioTimeout(
|
||||||
|
|
|
||||||
|
|
@ -185,6 +185,8 @@ class LFOProcessor extends AudioWorkletProcessor {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const output = outputs[0];
|
const output = outputs[0];
|
||||||
const frequency = parameters['frequency'][0];
|
const frequency = parameters['frequency'][0];
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue