Hi Robin,

Welcome back!

As written, analyzer needs a list of frequencies as a second argument.
These frequencies can be numbers or more complex circuits, but they have to
be number-like, i.e. with no input and only one output. So you can't use
the identity function _ as a frequency (because it has an input), but you
can use sliders (or more complex expressions), like in the following
example :

import("stdfaust.lib");

process = an.analyzer(6, par(i,10, hslider("freq %i[scale:log]", 100*(i+1),
20, 20000, 1)));


As I am not sure to answer your question, don't hesitate to specify in
greater detail what you want to do !

Cheers,

Yann

Le mer. 17 août 2022 à 18:30, Robin Gareus <ro...@gareus.org> a écrit :

> 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
>
> --
>
> [1]
>
> https://gist.github.com/x42/eeb2aa9f9cc4a9083fb2cf2d86645c9a#file-mcomp-dsp-L43-L60
> _______________________________________________
> Faudiostream-users mailing list
> Faudiostream-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/faudiostream-users
>
_______________________________________________
Faudiostream-users mailing list
Faudiostream-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/faudiostream-users

Reply via email to