Replacing old reverb by better convolution
This commit is contained in:
parent
8a741952df
commit
0ad0046a76
3 changed files with 236 additions and 16 deletions
|
|
@ -107,17 +107,24 @@ function getDelay(orbit, delaytime, delayfeedback, t) {
|
|||
}
|
||||
|
||||
let reverbs = {};
|
||||
|
||||
function getReverb(orbit, duration = 2) {
|
||||
|
||||
// If no reverb has been created for a given orbit, create one
|
||||
if (!reverbs[orbit]) {
|
||||
const ac = getAudioContext();
|
||||
const reverb = ac.createReverb(duration);
|
||||
const reverb = ac.createReverb(duration, getAudioContext());
|
||||
reverb.connect(getDestination());
|
||||
console.log(reverb)
|
||||
reverbs[orbit] = reverb;
|
||||
}
|
||||
|
||||
// Update the reverb duration if needed after instanciation
|
||||
if (reverbs[orbit].duration !== duration) {
|
||||
reverbs[orbit] = reverbs[orbit].setDuration(duration);
|
||||
reverbs[orbit].duration = duration;
|
||||
}
|
||||
|
||||
return reverbs[orbit];
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue