list of any length or ints of any size. Here is xor.pd and help-xor.pd (already a classic).
You should tjek out how xor.pd is constructed. I think this is the way to go when its bitwise. You can easily change the int size (list length).
God Luck Steffen Leve Poulsen
David Powers skrev:
Ah this is interesting - and proof that it's really time I learn dynamic patching ... your approach is probably more efficient, but on the other hard, my approach allows for lists of any length. (Although, I doubt that I'd be doing patterns longer than 64 very often.) Anyway, my point is that with dynamic patching perhaps it would be possible to use your approach, without knowing the length of the list in advance. ~David
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
#N canvas 300 28 797 737 12; #X obj 87 4 inlet; #X obj 263 619 outlet; #X obj 147 227 until; #X msg 147 168 16; #X obj 147 194 t f b; #X msg 282 214 0; #X obj 147 259 f; #X obj 181 260 + 1; #X obj 298 576 f; #X obj 263 575 +; #X obj 199 457 pow; #X msg 199 429 2 $1; #X obj 143 392 f; #X obj 103 392 f; #X obj 103 555 *; #X obj 103 488 &; #X obj 143 488 &; #X obj 148 287 t b b f; #X obj 103 525 !=; #X obj 162 352 inlet; #X obj 87 128 t b f; #X text 272 69 XOR does bitwise xor intersection of two 16 bit integers ; #X text 458 136 XOR:; #X text 429 169 1 xor 1 = 0; #X text 429 199 0 xor 0 = 0; #X text 429 229 1 xor 0 = 1; #X text 429 259 0 xor 1 = 1; #X text 106 669 Steffen Leve Poulsen 2007; #X text 107 689 steffen at menneske dot dk; #X obj 87 36 t b f; #X obj 87 67 del 100; #X obj 87 97 f; #X connect 0 0 29 0; #X connect 2 0 6 0; #X connect 3 0 4 0; #X connect 4 0 2 0; #X connect 4 1 5 0; #X connect 5 0 6 1; #X connect 5 0 9 1; #X connect 6 0 7 0; #X connect 6 0 17 0; #X connect 7 0 6 1; #X connect 8 0 9 1; #X connect 9 0 8 0; #X connect 9 0 1 0; #X connect 10 0 16 1; #X connect 10 0 15 1; #X connect 10 0 14 1; #X connect 11 0 10 0; #X connect 12 0 16 0; #X connect 13 0 15 0; #X connect 14 0 9 0; #X connect 15 0 18 0; #X connect 16 0 18 1; #X connect 17 0 13 0; #X connect 17 1 12 0; #X connect 17 2 11 0; #X connect 18 0 14 0; #X connect 19 0 12 1; #X connect 20 0 3 0; #X connect 20 1 13 1; #X connect 29 0 30 0; #X connect 29 1 31 1; #X connect 30 0 31 0; #X connect 31 0 20 0;
#N canvas 177 35 1060 501 12; #X obj 753 241 until; #X obj 753 206 unpack f f; #X msg 753 179 256 0; #X obj 753 270 f; #X obj 780 270 + 1; #X obj 753 302 t f f; #X obj 753 424 tabwrite vu; #N canvas 0 0 450 300 (subpatch) 0; #X array vu 256 float 0; #X coords 0 256 255 0 200 140 1; #X restore 442 208 graph; #X obj 913 90 f; #X obj 959 90 + 1; #X obj 913 119 mod 256; #X msg 913 33 40; #X msg 952 34 0; #X obj 913 61 metro; #N canvas 0 0 512 223 tobin 0; #X obj 417 44 & 1; #X obj 377 44 & 2; #X obj 337 44 & 4; #X obj 297 44 & 8; #X floatatom 269 103 5 0 0 0 - - -; #X obj 247 44 & 16; #X obj 200 44 & 32; #X obj 157 44 & 64; #X obj 107 44 & 128; #X obj 104 104 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 128; #X obj 124 104 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 64; #X obj 144 104 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 32; #X obj 164 104 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 16; #X obj 184 104 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 8; #X obj 204 104 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 4 4; #X obj 224 104 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 2 2; #X obj 244 104 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1 1; #X obj 269 134 outlet; #X obj 343 102 inlet; #X connect 0 0 16 0; #X connect 1 0 15 0; #X connect 2 0 14 0; #X connect 3 0 13 0; #X connect 4 0 2 0; #X connect 4 0 3 0; #X connect 4 0 1 0; #X connect 4 0 0 0; #X connect 4 0 5 0; #X connect 4 0 6 0; #X connect 4 0 7 0; #X connect 4 0 8 0; #X connect 4 0 17 0; #X connect 5 0 12 0; #X connect 6 0 11 0; #X connect 7 0 10 0; #X connect 8 0 9 0; #X connect 18 0 4 0; #X coords 0 -1 1 1 222 23 2 100 100; #X restore 31 43 pd tobin; #N canvas 0 0 543 205 tobin 0; #X obj 417 44 & 1; #X obj 377 44 & 2; #X obj 337 44 & 4; #X obj 297 44 & 8; #X floatatom 269 103 5 0 0 0 - - -; #X obj 247 44 & 16; #X obj 200 44 & 32; #X obj 157 44 & 64; #X obj 107 44 & 128; #X obj 104 104 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 128; #X obj 124 104 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 64; #X obj 144 104 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 32 32; #X obj 164 104 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 16; #X obj 184 104 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 8; #X obj 204 104 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 4 4; #X obj 224 104 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 2; #X obj 244 104 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 1; #X obj 269 134 outlet; #X obj 343 102 inlet; #X connect 0 0 16 0; #X connect 1 0 15 0; #X connect 2 0 14 0; #X connect 3 0 13 0; #X connect 4 0 2 0; #X connect 4 0 3 0; #X connect 4 0 1 0; #X connect 4 0 0 0; #X connect 4 0 5 0; #X connect 4 0 6 0; #X connect 4 0 7 0; #X connect 4 0 8 0; #X connect 4 0 17 0; #X connect 5 0 12 0; #X connect 6 0 11 0; #X connect 7 0 10 0; #X connect 8 0 9 0; #X connect 18 0 4 0; #X coords 0 -1 1 1 222 23 2 100 100; #X restore 50 91 pd tobin; #N canvas 0 0 587 245 tobin 0; #X obj 417 44 & 1; #X obj 377 44 & 2; #X obj 337 44 & 4; #X obj 297 44 & 8; #X floatatom 269 103 5 0 0 0 - - -; #X obj 247 44 & 16; #X obj 200 44 & 32; #X obj 157 44 & 64; #X obj 107 44 & 128; #X obj 104 104 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 128; #X obj 124 104 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 64; #X obj 144 104 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 32 32; #X obj 164 104 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 16; #X obj 184 104 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 8; #X obj 204 104 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 4; #X obj 224 104 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 2 2; #X obj 244 104 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1 1; #X obj 269 134 outlet; #X obj 343 102 inlet; #X connect 0 0 16 0; #X connect 1 0 15 0; #X connect 2 0 14 0; #X connect 3 0 13 0; #X connect 4 0 2 0; #X connect 4 0 3 0; #X connect 4 0 1 0; #X connect 4 0 0 0; #X connect 4 0 5 0; #X connect 4 0 6 0; #X connect 4 0 7 0; #X connect 4 0 8 0; #X connect 4 0 17 0; #X connect 5 0 12 0; #X connect 6 0 11 0; #X connect 7 0 10 0; #X connect 8 0 9 0; #X connect 18 0 4 0; #X coords 0 -1 1 1 222 23 2 100 100; #X restore 31 171 pd tobin; #X obj 31 138 xor; #X text 575 30 Start to see xor effect on linear ramp ->; #X text 289 87 <- 1 set this numberbox; #X text 289 44 <- 2 set that numberbox; #X text 31 3 XOR does bitwise xor intersection of two 16 bit integers ; #X text 328 196 XOR:; #X text 299 229 1 xor 1 = 0; #X text 299 259 0 xor 0 = 0; #X text 299 289 1 xor 0 = 1; #X text 299 319 0 xor 1 = 1; #X text 26 339 Steffen Leve Poulsen 2007; #X text 27 359 steffen at menneske dot dk; #N canvas 0 0 587 245 tobin 0; #X obj 417 44 & 1; #X obj 377 44 & 2; #X obj 337 44 & 4; #X obj 297 44 & 8; #X floatatom 269 103 5 0 0 0 - - -; #X obj 247 44 & 16; #X obj 200 44 & 32; #X obj 157 44 & 64; #X obj 107 44 & 128; #X obj 104 104 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 128; #X obj 124 104 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 64; #X obj 144 104 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 32; #X obj 164 104 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 16; #X obj 184 104 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 8; #X obj 204 104 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 4 4; #X obj 224 104 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 2 2; #X obj 244 104 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1 1; #X obj 269 134 outlet; #X obj 343 102 inlet; #X connect 0 0 16 0; #X connect 1 0 15 0; #X connect 2 0 14 0; #X connect 3 0 13 0; #X connect 4 0 2 0; #X connect 4 0 3 0; #X connect 4 0 1 0; #X connect 4 0 0 0; #X connect 4 0 5 0; #X connect 4 0 6 0; #X connect 4 0 7 0; #X connect 4 0 8 0; #X connect 4 0 17 0; #X connect 5 0 12 0; #X connect 6 0 11 0; #X connect 7 0 10 0; #X connect 8 0 9 0; #X connect 18 0 4 0; #X coords 0 -1 1 1 222 23 2 100 100; #X restore 31 241 pd tobin; #X obj 753 397 xor; #X obj 31 208 xor; #X connect 0 0 3 0; #X connect 1 0 0 0; #X connect 1 1 3 1; #X connect 2 0 1 0; #X connect 3 0 4 0; #X connect 3 0 5 0; #X connect 4 0 3 1; #X connect 5 0 30 0; #X connect 5 1 6 1; #X connect 8 0 10 0; #X connect 9 0 8 1; #X connect 10 0 9 0; #X connect 10 0 2 0; #X connect 10 0 30 1; #X connect 11 0 13 0; #X connect 11 0 13 1; #X connect 12 0 13 0; #X connect 13 0 8 0; #X connect 14 0 17 0; #X connect 15 0 17 1; #X connect 15 0 31 1; #X connect 16 0 31 0; #X connect 17 0 16 0; #X connect 30 0 6 0; #X connect 31 0 29 0;