Re: [Faudiostream-users] How to place values in lists?

2022-08-19 Thread Albert Graef
On Fri, Aug 19, 2022 at 6:23 PM Yann Orlarey  wrote:

> We will never thank Albert Graef enough for the black magic of pattern
> matching in Faust ;-)
>

Thanks! So even though nobody uses Pure much these days (including myself),
its pattern-matching code will survive in Faust. ;-)

I was about to chime in to help resolve Robin's troubles making his design
generic, but you beat me to it!

-- 
Dr. Albert Gr"af
Computer Music Research Group, JGU Mainz, Germany
Email: aggr...@gmail.com, web: https://agraef.github.io/
___
Faudiostream-users mailing list
Faudiostream-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/faudiostream-users


Re: [Faudiostream-users] How to place values in lists?

2022-08-19 Thread Yann Orlarey
Hi Robin,

We will never thank Albert Graef enough for the black magic of pattern
matching in Faust ;-)

Concerning "outputs()" it is not exactly the same as "ba.count()" but it
will give the same result for a usual list of numbers (*). But "outputs()"
being primitive, based on internal information already computed by the type
system, it is, therefore, faster in terms of compilation time and doesn't
require importing any library.

Cheers,

Yann

(*)  outputs((1,2,3,4) ==  ba.count((1,2,3,4)) == 4
but outputs(((1,2),3,4) == 4   !=   ba.count(((1,2),3,4)) == 3

Le ven. 19 août 2022 à 17:05, Robin Gareus  a écrit :

> On 8/19/22 08:19, Yann Orlarey wrote:
> > Hi Robin,
> >
> > Here is a generic shelfcascade with an arbitrary list of frequencies. The
> > gains are directly routed. They are in the reverse order (the first input
> > is the gain of the last stage).
> >
> >
> > shelfcascade(lf) = bus(lf), ls3(first(lf)) : sc(lf) // lf : list of
> > frequencies
> > with {
> > sc((f1, f2, lf)) = bus((f2,lf)), bs3(f1,f2) : sc((f2,lf)); // recursive
> > pattern
> > sc((f1, f2)) = _, bs3(f1,f2) : hs3(f2); // halting pattern
> > bus(l) = par(i, outputs(l), _); // a bus of the size of a list
> > first((x,xs)) = x; // first element of a list
> > };
> >
>
> Hello Yann,
>
> Wow. Now that is a brilliant solution, and I have learned a few nice new
> tricks there as well. Splicing the frequency list for the halting
> pattern is something I would never have thought to do. I was too focused
> on using an iterator.
>
> Is there a reason why you have used outputs(l) instead of ba.count(l)?
>
> Thank you!
>
> --
> robin
> ___
> 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


Re: [Faudiostream-users] How to place values in lists?

2022-08-19 Thread Robin Gareus
On 8/19/22 08:19, Yann Orlarey wrote:
> Hi Robin,
> 
> Here is a generic shelfcascade with an arbitrary list of frequencies. The
> gains are directly routed. They are in the reverse order (the first input
> is the gain of the last stage).
> 
> 
> shelfcascade(lf) = bus(lf), ls3(first(lf)) : sc(lf) // lf : list of
> frequencies
> with {
> sc((f1, f2, lf)) = bus((f2,lf)), bs3(f1,f2) : sc((f2,lf)); // recursive
> pattern
> sc((f1, f2)) = _, bs3(f1,f2) : hs3(f2); // halting pattern
> bus(l) = par(i, outputs(l), _); // a bus of the size of a list
> first((x,xs)) = x; // first element of a list
> };
> 

Hello Yann,

Wow. Now that is a brilliant solution, and I have learned a few nice new
tricks there as well. Splicing the frequency list for the halting
pattern is something I would never have thought to do. I was too focused
on using an iterator.

Is there a reason why you have used outputs(l) instead of ba.count(l)?

Thank you!

--
robin


OpenPGP_signature
Description: OpenPGP digital signature
___
Faudiostream-users mailing list
Faudiostream-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/faudiostream-users


Re: [Faudiostream-users] How to place values in lists?

2022-08-19 Thread Yann Orlarey
Hi Robin,

Here is a generic shelfcascade with an arbitrary list of frequencies. The
gains are directly routed. They are in the reverse order (the first input
is the gain of the last stage).


shelfcascade(lf) = bus(lf), ls3(first(lf)) : sc(lf) // lf : list of
frequencies
with {
sc((f1, f2, lf)) = bus((f2,lf)), bs3(f1,f2) : sc((f2,lf)); // recursive
pattern
sc((f1, f2)) = _, bs3(f1,f2) : hs3(f2); // halting pattern
bus(l) = par(i, outputs(l), _); // a bus of the size of a list
first((x,xs)) = x; // first element of a list
};


Cheers,

Yann



Le ven. 19 août 2022 à 01:04, Robin Gareus  a écrit :

> On 8/19/22 00:24, b...@magnetophon.nl wrote:
> > Hi Robin,
> >
> > When I saw your shelving based MB compressor, I also set out to make a
> > generic N band and M channel version of it.  :)
> > I ran into the same problem, and came up with this solution:
> >
> https://github.com/magnetophon/faustExperiments/blob/shelfComp/N_band_Compressor_N_chan.dsp#L47
> >
>
> Hello Bart,
>
> For the analysis stage using HP/LP you can run the filters in parallel,
> like you do in line 68-73. However when applying the gain to each band
> using a shelving filter, like I'd like to, it has to be done in sequence.
>
> > Is your WIP also online already?
>
> It is still the same that I have linked to earlier. - I have mostly
> given up on providing a generic method, and actually believe that it is
> impossible with FAUST at this point in time. But it is trivial to use
> any number of bands by just writing it out, and you don't change the
> [max] number of bands dynamically anyway.
>
> Realistically a four band version is more than sufficient when mixing or
> mastering. For Klaus' project where there's no human operator to set the
> frequencies by ear, an eight band split may be preferable.
>
> --
> robin
> ___
> 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