On Fri, 22 May 2020 at 08:20, Oleg Nesterov <[email protected]> wrote: > On 05/22, Dario Sanfilippo wrote: > > > > > As for ifN. Perhaps something like this can work for you: > > > > > > ifN(N, inp) = par(n, N, line(n,C)) with { > > > C = (outputs(inp) - N) / (N + 1); > > > take(i) = inp : route(outputs(inp),1,i+1,1); > > > cond(c) = take((N+1) * c) != 0; > > > else(n) = take((N+1) * C + n); > > > then(n,c) = take((N+1) * c + n + 1); > > > > > > line(n,0) = else(n); > > > line(n,c) = select2(cond(C-c), line(n,c-1), > then(n,C-c)); > > > }; > > > > > > the 1st arg N is the number of outputs. Example: > > > > > > prtcess = ifN(3, C1,t11,t12,t13, C2,t21,t22,t23, ..., > > > Cn,tn1,tn2,tn3, e1,e2,e3). > > Sorry, I meant > > process = ifN(3, (C1,t11,t12,t13, C2,t21,t22,t23, ..., > Cn,tn1,tn2,tn3, e1,e2,e3)); > > the 2nd arg is list. >
Cool, thanks. > > > If I run > > > > process = ifN(3, _<-100,-1,-1,-1, _==0,0,0,0, _>100,1,1,1, 10,10,10); > > > > I get ERROR : stack overflow in eval. > > See above. try > > process(3, (_<-100,-1,-1,-1, _==0,0,0,0, _>100,1,1,1, 10,10,10)); > > But note that it has 9 inputs, probably not what you want. Use "_ <: > ifN(...)" > or "_,_,_ <: ifN(...)" depending on what do you need. > I'm actually seeing 3*3*7 inputs. > > > Going a bit back: you said that Faust doesn't distinguish between (1,2,3) > > and ((1,2,3)) and that it obviously makes sense; could you elaborate why? > > Well, to me "expr", "(expr)", "(((((expre)))))" should be the same thing. > Unless "expr" is the list of expressions, so "1,2" and "(1,2)" is obviously > not the same thing. > > But this doesn't really matter. What (I think) does matter is that, say, > ((((1,2)))) should match (x,xs), no matter how many parentheses you add. > What is the reason why this is not happening? As a workaround, could it be possible to rewrite take so that a dummy element is attached at the end of the list? I'll try. > > > Personally, regardless of the complexity of the issue, I'd love to see > > emails here on the list on a daily basis. > > Me too! > > > Here is the link: > > https://discord.com/channels/382895736356077570/651037481017409595. > > thanks... Needs registration. Not for me. > (Damn yes, I joined faustaudio and I am ashamed I did this, but this is > because I like faust too much ;) > I still hope we'll hear from you there too sometimes! Ciao :)
_______________________________________________ Faudiostream-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/faudiostream-users
