[Pd] Stack Overflow

Frank Barknecht fbar at footils.org
Sun Mar 26 12:45:24 CEST 2006


Hallo,
Chuckk Hubbard hat gesagt: // Chuckk Hubbard wrote:

> But I don't understand why the attached patch doesn't work.

It's actually quite easy: You need to connect the second outlet of the
[pointer] to a [next( message or the [until]'s right inlet as well.
Otherwise if the pointer finds a structure first, that is not of type
"$1", the until will never stop and Pd will freeze. 

However [until] still can be a very dangerous object. In fact, I
stopped using [until] for pointer-traversal, because a similar
freeze will happen, if you bang the JInextB when [pd score] doesn't
exist! And nothing will be able to stop the [until] in that case. A
workaround is possible, though: For that, you don't start the [until]
through the inlet, but you use the first pointer found by [pointer] to
start the [until] loop (with [t p b]). You will have to take care then
to not start the [until] several times ...

I attached a version of JINext which does all this and should be
pretty save now against accidentally starting the [until] without
stopping it.

Ciao
-- 
 Frank Barknecht                 _ ______footils.org_ __goto10.org__
-------------- next part --------------
#N struct test float x float y;
#N struct no-test float x float y;
#N canvas 485 163 688 653 12;
#X obj 127 34 inlet;
#X obj 127 564 outlet;
#X msg 255 323 next;
#X obj 127 69 route bang next;
#X obj 257 563 outlet;
#X obj 255 291 until;
#X obj 257 492 t b b;
#X obj 215 182 t b b;
#X obj 127 490 t p b;
#X msg 203 33 bang;
#X obj 257 593 print EOF;
#X obj 192 455 print MISS;
#X obj 127 593 print HIT;
#X obj 360 257 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1
1;
#N canvas 0 0 450 300 score 0;
#X scalar test 12 0 \;;
#X scalar test 12 0 \;;
#X scalar test 12 0 \;;
#X scalar no-test 12 0 \;;
#X scalar no-test 12 0 \;;
#X scalar no-test 12 0 \;;
#X scalar no-test 12 0 \;;
#X scalar no-test 12 0 \;;
#X scalar no-test 12 0 \;;
#X scalar test 12 0 \;;
#X scalar test 12 0 \;;
#X scalar test 12 0 \;;
#X scalar no-test 12 0 \;;
#X scalar no-test 12 0 \;;
#X scalar no-test 12 0 \;;
#X scalar test 70 0 \;;
#X scalar test 12 0 \;;
#X scalar test 12 0 \;;
#X restore 481 81 pd score;
#N canvas 0 0 450 300 test 0;
#X obj 154 89 struct test float x float y;
#X obj 132 139 drawnumber x;
#X obj 247 243 append test x;
#X obj 345 216 pointer;
#X obj 272 191 until;
#X msg 255 217 12;
#X msg 351 191 traverse pd-score \, bang;
#X obj 302 156 t f b;
#X msg 302 133 3;
#X connect 3 0 2 1;
#X connect 4 0 5 0;
#X connect 5 0 2 0;
#X connect 6 0 3 0;
#X connect 7 0 4 0;
#X connect 7 1 6 0;
#X connect 8 0 7 0;
#X restore 563 82 pd test;
#X obj 308 292 r \$0-STOP;
#X obj 215 159 r \$0-START;
#X obj 297 532 s \$0-STOP;
#X obj 192 416 s \$0-START;
#X msg 360 221 1;
#X msg 322 220 0;
#X obj 255 255 spigot 1;
#X text 409 159 start until-loop only once!;
#X msg 127 133 traverse pd-score \, next;
#X msg 252 34 next;
#X obj 127 366 pointer no-test;
#N canvas 0 0 450 300 no-test 0;
#X obj 132 139 drawnumber x;
#X obj 345 216 pointer;
#X obj 272 191 until;
#X msg 255 217 12;
#X msg 351 191 traverse pd-score \, bang;
#X obj 302 156 t f b;
#X msg 302 133 3;
#X obj 154 89 struct no-test float x float y;
#X obj 247 243 append no-test x;
#X connect 1 0 8 1;
#X connect 2 0 3 0;
#X connect 3 0 8 0;
#X connect 4 0 1 0;
#X connect 5 0 2 0;
#X connect 5 1 4 0;
#X connect 6 0 5 0;
#X restore 564 106 pd no-test;
#X obj 127 102 t b b;
#X msg 192 310 next;
#X obj 192 101 t b b;
#X connect 0 0 3 0;
#X connect 2 0 26 0;
#X connect 3 0 28 0;
#X connect 3 1 30 0;
#X connect 5 0 2 0;
#X connect 6 0 4 0;
#X connect 6 0 10 0;
#X connect 6 1 18 0;
#X connect 7 0 21 0;
#X connect 7 1 22 0;
#X connect 8 0 1 0;
#X connect 8 0 12 0;
#X connect 8 1 18 0;
#X connect 9 0 3 0;
#X connect 16 0 5 1;
#X connect 17 0 7 0;
#X connect 20 0 22 1;
#X connect 20 0 13 0;
#X connect 21 0 22 1;
#X connect 21 0 13 0;
#X connect 22 0 5 0;
#X connect 24 0 26 0;
#X connect 25 0 3 0;
#X connect 26 0 8 0;
#X connect 26 1 11 0;
#X connect 26 1 19 0;
#X connect 26 2 6 0;
#X connect 28 0 24 0;
#X connect 28 1 20 0;
#X connect 29 0 26 0;
#X connect 30 0 29 0;
#X connect 30 1 20 0;


More information about the Pd-list mailing list