pitch envelope now also works when setting one of the controls (penv not needed)
This commit is contained in:
parent
d3ea4959b4
commit
1c99944a32
3 changed files with 3 additions and 10 deletions
|
|
@ -159,9 +159,7 @@ export function registerSoundfonts() {
|
||||||
// vibrato
|
// vibrato
|
||||||
let vibratoOscillator = getVibratoOscillator(bufferSource.detune, value, time);
|
let vibratoOscillator = getVibratoOscillator(bufferSource.detune, value, time);
|
||||||
// pitch envelope
|
// pitch envelope
|
||||||
if (value.penv) {
|
getPitchEnvelope(bufferSource.detune, value, time, holdEnd);
|
||||||
getPitchEnvelope(bufferSource.detune, value, time, holdEnd);
|
|
||||||
}
|
|
||||||
|
|
||||||
bufferSource.stop(envEnd);
|
bufferSource.stop(envEnd);
|
||||||
const stop = (releaseTime) => {};
|
const stop = (releaseTime) => {};
|
||||||
|
|
|
||||||
|
|
@ -299,9 +299,7 @@ export async function onTriggerSample(t, value, onended, bank, resolveUrl) {
|
||||||
getParamADSR(node.gain, attack, decay, sustain, release, 0, 1, t, holdEnd, 'linear');
|
getParamADSR(node.gain, attack, decay, sustain, release, 0, 1, t, holdEnd, 'linear');
|
||||||
|
|
||||||
// pitch envelope
|
// pitch envelope
|
||||||
if (value.penv) {
|
getPitchEnvelope(bufferSource.detune, value, t, holdEnd);
|
||||||
getPitchEnvelope(bufferSource.detune, value, t, holdEnd);
|
|
||||||
}
|
|
||||||
|
|
||||||
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);
|
||||||
|
|
|
||||||
|
|
@ -182,10 +182,7 @@ export function getOscillator(s, t, value) {
|
||||||
let vibratoOscillator = getVibratoOscillator(o.detune, value, t);
|
let vibratoOscillator = getVibratoOscillator(o.detune, value, t);
|
||||||
|
|
||||||
// pitch envelope
|
// pitch envelope
|
||||||
if (value.penv) {
|
getPitchEnvelope(o.detune, value, t, t + duration);
|
||||||
const holdEnd = t + duration;
|
|
||||||
getPitchEnvelope(o.detune, value, t, holdEnd);
|
|
||||||
}
|
|
||||||
|
|
||||||
let noiseMix;
|
let noiseMix;
|
||||||
if (noise) {
|
if (noise) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue