Skip to content

Commit

Permalink
Connecting all parameters to convolution generator
Browse files Browse the repository at this point in the history
  • Loading branch information
Bubobubobubobubo committed Oct 1, 2023
1 parent e600b91 commit 2d07eeb
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
5 changes: 4 additions & 1 deletion packages/superdough/reverb.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,11 @@ if (typeof AudioContext !== 'undefined') {
}
);
convolver.duration = d;
convolver.fade = fade;
convolver.revlp = revlp;
convolver.revdim = revdim;
};
convolver.setDuration(duration);
convolver.setDuration(duration, fade, revlp, revdim);
return convolver;
};
}
20 changes: 16 additions & 4 deletions packages/superdough/superdough.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -118,17 +118,29 @@ function getReverb(orbit, duration = 2, fade, revlp, revdim) {
duration,
fade,
revlp,
revdim,
);
reverb.connect(getDestination());
console.log(reverb)
reverbs[orbit] = reverb;
console.log(reverbs[orbit]);
}
// Update the reverb duration if needed after instanciation
if (reverbs[orbit].duration !== duration) {

if (
reverbs[orbit].duration !== duration ||
reverbs[orbit].fade !== fade ||
reverbs[orbit].revlp !== revlp ||
reverbs[orbit].revdim !== revdim
) {
reverbs[orbit] = reverbs[orbit].setDuration(
duration, fade, revlp, revdim);
duration, fade, revlp, revdim
);
reverbs[orbit].duration = duration;
reverbs[orbit].fade = fade;
reverbs[orbit].revlp = revlp;
reverbs[orbit].revdim = revdim;

}

return reverbs[orbit];
}

Expand Down

0 comments on commit 2d07eeb

Please sign in to comment.