pitch envelope for sampler and soundfonts

+ added getPitchEnvelope helper
This commit is contained in:
Felix Roos 2024-01-15 23:55:49 +01:00
parent bdc2af9733
commit 32456d6966
4 changed files with 37 additions and 17 deletions

View file

@ -144,3 +144,16 @@ export function drywet(dry, wet, wetAmount = 0) {
wet_gain.connect(mix);
return mix;
}
export function getPitchEnvelope(param, value, t, holdEnd) {
if (value.penv) {
let [pattack, pdecay, psustain, prelease] = getADSRValues([
value.pattack,
value.pdecay,
value.psustain,
value.prelease,
]);
const cents = value.penv * 100;
getParamADSR(param, pattack, pdecay, psustain, prelease, 0, cents, t, holdEnd, 'linear');
}
}