Add control aliases (#497)

* add and simplify control aliases, fixes #496
* roomsize now alias of room
* simplify webaudio param handling
---------

Co-authored-by: Felix Roos <flix91@gmail.com>
This commit is contained in:
Alex McLean 2023-03-02 13:17:12 +00:00 committed by GitHub
parent 06cffbc31b
commit db4d0f26a8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 320 additions and 523 deletions

View file

@ -208,20 +208,14 @@ export const webaudioOutput = async (hap, deadline, hapDuration) => {
note,
gain = 0.8,
// low pass
lpf,
cutoff = lpf,
lpq = 1,
resonance = lpq,
cutoff,
resonance = 1,
// high pass
hpf,
hcutoff = hpf,
hpq = 1,
hresonance = hpq,
hcutoff,
hresonance = 1,
// band pass
bpf,
bandf = bpf,
bpq = 1,
bandq = bpq,
bandf,
bandq = 1,
//
coarse,
crush,
@ -241,7 +235,6 @@ 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
@ -373,8 +366,8 @@ export const webaudioOutput = async (hap, deadline, hapDuration) => {
}
// reverb
let reverbSend;
if (room > 0 && roomsize > 0) {
const reverbNode = getReverb(orbit, roomsize);
if (room > 0 && size > 0) {
const reverbNode = getReverb(orbit, size);
reverbSend = effectSend(post, reverbNode, room);
}