This commit is contained in:
Felix Roos 2022-09-25 20:08:02 +02:00
parent c5342d3eb0
commit 5018669ded
3 changed files with 12 additions and 4 deletions

View File

@ -581,6 +581,11 @@ const generic_params = [
'size',
'a pattern of numbers from 0 to 1. Sets the perceptual size (reverb time) of the `room` to be used in reverb.',
],
[
'f',
'roomsize',
'a pattern of numbers from 0 to 1. Sets the perceptual size (reverb time) of the `room` to be used in reverb.',
],
// ['f', 'sagogo', ''],
// ['f', 'sclap', ''],
// ['f', 'sclaves', ''],

View File

@ -11,8 +11,9 @@ if (typeof AudioContext !== 'undefined') {
const convolver = this.createConvolver();
convolver.setDuration = (d) => {
convolver.buffer = this.impulseResponse(d);
convolver.duration = duration;
return convolver;
};
this.duration = duration;
convolver.setDuration(duration);
return convolver;
};

View File

@ -217,7 +217,8 @@ function getReverb(orbit, duration = 2) {
reverbs[orbit] = reverb;
}
if (reverbs[orbit].duration !== duration) {
reverbs[orbit].setDuration(duration);
reverbs[orbit] = reverbs[orbit].setDuration(duration);
reverbs[orbit].duration = duration;
}
return reverbs[orbit];
}
@ -277,6 +278,7 @@ export const webaudioOutput = async (hap, deadline, hapDuration) => {
orbit = 1,
room,
size = 2,
roomsize = size,
} = hap.value;
const { velocity = 1 } = hap.context;
gain *= velocity; // legacy fix for velocity
@ -405,8 +407,8 @@ export const webaudioOutput = async (hap, deadline, hapDuration) => {
}
// reverb
let reverbSend;
if (room > 0 && size > 0) {
const reverbNode = getReverb(orbit, size);
if (room > 0 && roomsize > 0) {
const reverbNode = getReverb(orbit, roomsize);
reverbSend = effectSend(post, reverbNode, room);
}