mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-25 04:28:30 +00:00
prettier again
This commit is contained in:
parent
3eface706c
commit
83c820a18c
@ -15,6 +15,7 @@ const setRelease = (param, phase, sustain, startTime, endTime, endValue, curve =
|
|||||||
const currValue = param.value;
|
const currValue = param.value;
|
||||||
param.cancelScheduledValues(0);
|
param.cancelScheduledValues(0);
|
||||||
param.setValueAtTime(currValue, 0);
|
param.setValueAtTime(currValue, 0);
|
||||||
|
|
||||||
//release
|
//release
|
||||||
param[ramp](endValue, endTime);
|
param[ramp](endValue, endTime);
|
||||||
}, (startTime - ctx.currentTime) * 1000);
|
}, (startTime - ctx.currentTime) * 1000);
|
||||||
@ -89,6 +90,7 @@ export const getParamADSR = (
|
|||||||
|
|
||||||
param.setValueAtTime(min, begin);
|
param.setValueAtTime(min, begin);
|
||||||
phase += attack;
|
phase += attack;
|
||||||
|
|
||||||
//attack
|
//attack
|
||||||
param[ramp](peak, phase);
|
param[ramp](peak, phase);
|
||||||
phase += decay;
|
phase += decay;
|
||||||
@ -139,13 +141,10 @@ export function createFilter(context, type, frequency, Q, att, dec, sus, rel, fe
|
|||||||
// Apply ADSR to filter frequency
|
// Apply ADSR to filter frequency
|
||||||
if (!isNaN(fenv) && fenv !== 0) {
|
if (!isNaN(fenv) && fenv !== 0) {
|
||||||
const offset = fenv * fanchor;
|
const offset = fenv * fanchor;
|
||||||
|
|
||||||
const max = clamp(2 ** (fenv - offset) * frequency, 0, 20000);
|
const max = clamp(2 ** (fenv - offset) * frequency, 0, 20000);
|
||||||
|
|
||||||
getParamADSR(filter.frequency, attack, decay, sustain, release, frequency, max, start, end, curve);
|
getParamADSR(filter.frequency, attack, decay, sustain, release, frequency, max, start, end, curve);
|
||||||
return filter;
|
return filter;
|
||||||
}
|
}
|
||||||
|
|
||||||
return filter;
|
return filter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user