Not fully, because [expr] can't route input to different outlets based on some conditions. But it's trivial to do: [expr if($f1<3 && $f2<3,$f2*2+$f1-2,0)] | [sel 1 2 3 4]
-Jonathan ----- Original Message ----- > From: "Pagano, Patrick" <[email protected]> > To: Mathieu Bouchard <[email protected]> > Cc: "[email protected]" <[email protected]> > Sent: Saturday, March 10, 2012 1:46 PM > Subject: Re: [PD] question about moses/gate/split?? > > is this possible to do with expr? > > ________________________________________ > From: Mathieu Bouchard [[email protected]] > Sent: Saturday, March 10, 2012 1:42 PM > To: Pagano, Patrick > Cc: [email protected] > Subject: Re: [PD] question about moses/gate/split?? > > Le 2012-03-10 à 18:23:00, Pagano, Patrick a écrit : > >> If x can equal 1,2,3,4 and y can equal 1,2,3,4 how to send a bang when >> x=1 && y=1 BANG 1 >> x=1 && y=2 BANG 2 >> x=2 && y=1 BANG 3 >> x=2 && y=2 BANG 4 > > if x<3 && y<3 then bang y*2+x-2 > > [moses 3] for x > > [moses 3] for y > > once you have computed y*2+x-2, use [sel 1 2 3 4] to turn them into bangs. > > alternately, don't use moses, use y*4+x-4, now all your combinations are > numbered from 1 to 16, and you can use [sel 1 2 5 6] to pick the four > you're currently interested in, and you can later pick other combinations > by changing the sel. > > Whenever you change the range of x, change the multiplier of y and the > subtracted constant. > > ______________________________________________________________________ > | Mathieu BOUCHARD ----- téléphone : +1.514.383.3801 ----- Montréal, QC > > _______________________________________________ > [email protected] mailing list > UNSUBSCRIBE and account-management -> > http://lists.puredata.info/listinfo/pd-list > _______________________________________________ [email protected] mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
