Thanks Julius! Using i like that makes a lot of sense. I had no idea you could substitute it like that.

What does the %03i mean and how does that work?

Brandon Hale

On 10/23/20 12:00 PM, Julius Smith wrote:
Hi Brandon,

You want to use pattern-matching, something like

feedback(i) = hslider("feedback %03i",0,0,0.9,0.01);
echo(i) = +~(de.delay(262144,echoDuration*ma.SR)*feedback(i));
process = _,_ <: par(i,128,echo(i));

Cheers,
Julius

On Fri, Oct 23, 2020 at 8:42 AM Brandon Hale <bthaleproducti...@gmail.com <mailto:bthaleproducti...@gmail.com>> wrote:

    Hello all,

    I just joined the Faust User mailing list, and am excited to be
    here! I have a question about programming with Faust.

    First off, I am writing a multichannel delay by using the par()
    function:

    import("stdfaust.lib");
    echoDuration = hslider("echoDuration",0,0,5,0.01);
    feedback = hslider("feedback",0,0,0.9,0.01);
    echo = +~(de.delay(262144,echoDuration*ma.SR)*feedback);
    process = _,_ <: par(i,128,echo);

    I have followed Romain's 2017 Faust Day videos to get to the point
    where I am now and have got the processing that I want.
    faust2firefox shows exactly what I need: 2in -> 128 separate delay
    lines. Now, I want to have separate slider controls for each delay
    line. How would I do that neatly, without making 128 new variables
    for echoDuration and feedback?

    I saw in the Faust manual that % exists as a way to increment
    names, but I am not 100% sure how that works. Is that the secret
    to crack this code?

    Thank you so much for any help you can provide,

    Brandon Hale

    _______________________________________________
    Faudiostream-users mailing list
    Faudiostream-users@lists.sourceforge.net
    <mailto:Faudiostream-users@lists.sourceforge.net>
    https://lists.sourceforge.net/lists/listinfo/faudiostream-users



--
"Anybody who knows all about nothing knows everything" -- Leonard Susskind
_______________________________________________
Faudiostream-users mailing list
Faudiostream-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/faudiostream-users

Reply via email to