mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-14 23:28:30 +00:00
simplify createReverb
This commit is contained in:
parent
508af7eb72
commit
ce842f7561
@ -2,12 +2,12 @@ import reverbGen from './reverbGen.mjs';
|
||||
|
||||
if (typeof AudioContext !== 'undefined') {
|
||||
AudioContext.prototype.generateReverb = reverbGen.generateReverb;
|
||||
AudioContext.prototype.createReverb = function (audioContext, duration, fade, revlp, revdim) {
|
||||
AudioContext.prototype.createReverb = function (duration, fade, revlp, revdim) {
|
||||
const convolver = this.createConvolver();
|
||||
convolver.setDuration = (d, fade, revlp, revdim) => {
|
||||
this.generateReverb(
|
||||
{
|
||||
audioContext,
|
||||
audioContext: this,
|
||||
sampleRate: 44100,
|
||||
numChannels: 2,
|
||||
decayTime: d,
|
||||
|
||||
@ -112,7 +112,7 @@ function getReverb(orbit, duration = 2, fade, lp, dim) {
|
||||
// If no reverb has been created for a given orbit, create one
|
||||
if (!reverbs[orbit]) {
|
||||
const ac = getAudioContext();
|
||||
const reverb = ac.createReverb(getAudioContext(), duration, fade, lp, dim);
|
||||
const reverb = ac.createReverb(duration, fade, lp, dim);
|
||||
reverb.connect(getDestination());
|
||||
reverbs[orbit] = reverb;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user