mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-27 21:48:27 +00:00
bugfixes for parameter passing
This commit is contained in:
parent
abff279707
commit
e600b91a85
@ -3,14 +3,14 @@ import reverbGen from './reverbGen.mjs';
|
|||||||
if (typeof AudioContext !== 'undefined') {
|
if (typeof AudioContext !== 'undefined') {
|
||||||
AudioContext.prototype.generateReverb = reverbGen.generateReverb;
|
AudioContext.prototype.generateReverb = reverbGen.generateReverb;
|
||||||
AudioContext.prototype.createReverb = function(
|
AudioContext.prototype.createReverb = function(
|
||||||
duration,
|
|
||||||
audioContext,
|
audioContext,
|
||||||
|
duration,
|
||||||
fade,
|
fade,
|
||||||
revlp,
|
revlp,
|
||||||
revdim
|
revdim
|
||||||
) {
|
) {
|
||||||
const convolver = this.createConvolver();
|
const convolver = this.createConvolver();
|
||||||
convolver.setDuration = (d) => {
|
convolver.setDuration = (d, fade, revlp, revdim) => {
|
||||||
this.generateReverb(
|
this.generateReverb(
|
||||||
{
|
{
|
||||||
audioContext,
|
audioContext,
|
||||||
|
|||||||
@ -108,29 +108,27 @@ function getDelay(orbit, delaytime, delayfeedback, t) {
|
|||||||
|
|
||||||
let reverbs = {};
|
let reverbs = {};
|
||||||
|
|
||||||
function getReverb(orbit, duration = 2) {
|
function getReverb(orbit, duration = 2, fade, revlp, revdim) {
|
||||||
|
|
||||||
// If no reverb has been created for a given orbit, create one
|
// If no reverb has been created for a given orbit, create one
|
||||||
if (!reverbs[orbit]) {
|
if (!reverbs[orbit]) {
|
||||||
const ac = getAudioContext();
|
const ac = getAudioContext();
|
||||||
const reverb = ac.createReverb(
|
const reverb = ac.createReverb(
|
||||||
duration,
|
|
||||||
getAudioContext(),
|
getAudioContext(),
|
||||||
|
duration,
|
||||||
fade,
|
fade,
|
||||||
revlp,
|
revlp,
|
||||||
revdim,
|
|
||||||
);
|
);
|
||||||
reverb.connect(getDestination());
|
reverb.connect(getDestination());
|
||||||
console.log(reverb)
|
console.log(reverb)
|
||||||
reverbs[orbit] = reverb;
|
reverbs[orbit] = reverb;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update the reverb duration if needed after instanciation
|
// Update the reverb duration if needed after instanciation
|
||||||
if (reverbs[orbit].duration !== duration) {
|
if (reverbs[orbit].duration !== duration) {
|
||||||
reverbs[orbit] = reverbs[orbit].setDuration(duration);
|
reverbs[orbit] = reverbs[orbit].setDuration(
|
||||||
|
duration, fade, revlp, revdim);
|
||||||
reverbs[orbit].duration = duration;
|
reverbs[orbit].duration = duration;
|
||||||
}
|
}
|
||||||
|
|
||||||
return reverbs[orbit];
|
return reverbs[orbit];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -370,7 +368,7 @@ export const superdough = async (value, deadline, hapDuration) => {
|
|||||||
// reverb
|
// reverb
|
||||||
let reverbSend;
|
let reverbSend;
|
||||||
if (room > 0 && size > 0) {
|
if (room > 0 && size > 0) {
|
||||||
const reverbNode = getReverb(orbit, size);
|
const reverbNode = getReverb(orbit, size, fade, revlp, revdim);
|
||||||
reverbSend = effectSend(post, reverbNode, room);
|
reverbSend = effectSend(post, reverbNode, room);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user