Extend to FM, vibrato, etc
This commit is contained in:
parent
99bec835f8
commit
48f6a41683
9 changed files with 112 additions and 64 deletions
|
|
@ -166,7 +166,7 @@ export function registerSoundfonts() {
|
|||
let envEnd = holdEnd + release + 0.01;
|
||||
|
||||
// vibrato
|
||||
let vibratoOscillator = getVibratoOscillator(bufferSource.detune, value, time);
|
||||
const vibratoHandle = getVibratoOscillator(bufferSource.detune, value, time);
|
||||
// pitch envelope
|
||||
getPitchEnvelope(bufferSource.detune, value, time, holdEnd);
|
||||
|
||||
|
|
@ -174,10 +174,10 @@ export function registerSoundfonts() {
|
|||
const stop = (releaseTime) => {};
|
||||
onceEnded(bufferSource, () => {
|
||||
releaseAudioNode(bufferSource);
|
||||
releaseAudioNode(vibratoOscillator);
|
||||
vibratoHandle?.stop();
|
||||
onended();
|
||||
});
|
||||
return { node, stop, source: bufferSource };
|
||||
return { node, stop, nodes: { source: [bufferSource], ...vibratoHandle?.nodes } };
|
||||
},
|
||||
{ type: 'soundfont', prebake: true, fonts },
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue