[PD] even/odd conditional mod

Piotr Majdak piotr at majdak.com
Wed Aug 2 15:37:27 CEST 2006


João Miguel Pais wrote:

> Hi,
> 
> I have a (variable) flow of ascending numbers triggered from until. I  
> wanted to separate them into even and odd ones, so that each becomes a  
> different treatment (eg. even get 0ed, odd get divided by 2). Is there 
> a  modulo option in expr? With that and an [expr if] it should be easy. 
> Or  does anyone has any other suggestions?

What about the attached patch?

br, Piotr

-- 
Piotr Majdak
Institut für Schallforschung
Österreichische Akademie der Wissenschaften
Reichsratsstr. 17
A-1010 Wien
Tel.: +43-1-4277-29511
Fax: +43-1-4277-9296
E-Mail: piotr at majdak.com
WWW: http://www.kfs.oeaw.ac.at


-------------- next part --------------
#N canvas 0 0 454 304 12;
#X obj 33 66 mod 2;
#X obj 33 259 print even;
#X obj 88 191 print odd;
#X obj 33 35 t f f;
#X obj 33 160 float;
#X obj 88 160 float;
#X floatatom 33 7 5 0 0 0 - - -;
#X obj 33 96 select 0 1;
#X connect 0 0 7 0;
#X connect 3 0 0 0;
#X connect 3 1 5 1;
#X connect 3 1 4 1;
#X connect 4 0 1 0;
#X connect 5 0 2 0;
#X connect 6 0 3 0;
#X connect 7 0 4 0;
#X connect 7 1 5 0;


More information about the PD-list mailing list