Am 17.08.22 um 18:10 schrieb Robin Gareus:
Hello Faust community,
I'm brushing up my FAUST skills. It's been over a decade and it's
amazing to see how far things have grown. Well now, I just ran into an
issue:
How can I place signal primitive into a list?
e.g. use _,_ as list arguments (_,_) for `an.analyzer(3, HERE)`
If I understand correctly, lists are just parallel composition. So I
expected an extra pair of brackets to work. Why doesn't it?
-8<-
Perhaps the deeper issue is the design-pattern that I'm aiming for. So
let me elaborate. The specific use-case is a multiband effect[1]:
The following works (implementation omitted for readability):
```
apply(fq,g1,g2,g3,g4) = _;
freqs=100,200,300;
process= _ <: par(i,2,_)
: (an.analyzer(6, (freqs)) , _)
: apply (freqs);
```
Now, I'd like to make this generic for arbitrary numbers of frequency
bands, rather than 3 hardcoded band-splits. This is similar how
an.analyzer() or filterbank work, except with an additional gain
parameter for each band:
```
nuapply(freqs, gain) = _
with {
nb = ba.count(freqs);
f(n) = ba.take(n, freqs);
g(n) = ba.take(n, gain); // bm +1 elemements
};
```
So far so good. This works with explicit literal arguments.
However I fails to see how the output of analysis stage can be passed as
list.
I tried another approach using `nu2apply(freqs)` and then
selectn() the gain levels from input bus, but that quickly becomes a mess.
What is the Faustian way to implement this?
Thanks in advance,
robin
This is a example I use
hifr1 =hslider("crossover_b1_b2 [log][name:Crossover B1-B2
(hz)][tooltip: Crossover fi.bandpass frequency]" ,80 , 20, 20000, 1.08);
hifr2 =hslider("crossover_b2_b3 [log][name:Crossover B2-B3
(hz)][tooltip: Crossover fi.bandpass frequency]",210,20,20000,1.08);
hifr3 =hslider("crossover_b3_b4 [log][name:Crossover B3-B4
(hz)][tooltip: Crossover fi.bandpass frequency]",1700,20,20000,1.08);
hifr4 =hslider("crossover_b4_b5 [log][name:Crossover B4-B5
(hz)][tooltip: Crossover fi.bandpass frequency]",5000,20,20000,1.08);
geq = fi.filterbank(3, (hifr1,hifr2,hifr3,hifr4));
process = _: geq: ( dist5s , dist4s , dist3s, dist2s, dist1s) :>
*(gain1) with {
dist1s = ef.cubicnl(drive1,offset1: si.smooth(0.999)) :
fi.dcblockerat(1.0) : vmeter1;
dist2s = ef.cubicnl(drive2,offset2: si.smooth(0.999)) :
fi.dcblockerat(1.0) : vmeter2;
dist3s = ef.cubicnl(drive3,offset3: si.smooth(0.999)) :
fi.dcblockerat(1.0) : vmeter3;
dist4s = ef.cubicnl(drive4,offset4: si.smooth(0.999)) :
fi.dcblockerat(1.0) : vmeter4;
dist5s = ef.cubicnl(drive5,offset5: si.smooth(0.999)) :
fi.dcblockerat(1.0) : vmeter5;
};
were you could put anything you like into the filterbank, when defined,
while set frequency at runtime.
What makes me struggled on the beginning was that the filterbank always
have one channel more then defined, last freq to nyquist.
regards
hermann
_______________________________________________
Faudiostream-users mailing list
Faudiostream-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/faudiostream-users