Forums > MaxMSP

Platform-specific Stack Overflow problem

March 7, 2007 | 6:29 pm

Hoping someone can help me figure this out.

I am using Max/MSP 4.6.2 on multiple platforms: MacPPC, MacIntel,
and XP. On MacIntel and XP, the following patch works fine – click
the button at the top, and it will do its thing (actually a whole lot
of nothing, in this stripped down patch). On MacPPC though, clicking
the button will yield a Stack Overflow error.

To reproduce the error, create a text file called "Foo.txt" wherever
you save the patch. Also curiously, if you change the number 64 in
the patch to 63 or some other lower number, it will work without the
stack overflow.

What’s going on???

Thanks,
Dan

max v2;
#N vpatcher 212 52 815 1079;
#P origin -121 438;
#P button 34 25 15 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 158 908 77 196617 v current_row;
#P newex 143 948 72 196617 v current_col;
#P newex 143 968 77 196617 v previous_col;
#P newex 158 928 82 196617 v previous_row;
#P newex 365 406 32 196617 sel 1;
#P newex 365 385 29 196617 > -1;
#P newex 365 363 77 196617 v previous_col;
#P newex 411 488 62 196617 v maxsteps;
#N coll grid_default;
#T flags 1 0;
#T 0 -1 -1;
#T 1 -1 -1;
#T 2 -1 -1;
#T 3 -1 -1;
#T 4 -1 -1;
#T 5 -1 -1;
#T 6 -1 -1;
#T 7 -1 -1;
#T 8 -1 -1;
#T 9 -1 -1;
#T 10 -1 -1;
#T 11 -1 -1;
#T 12 -1 -1;
#T 13 -1 -1;
#T 14 -1 -1;
#T 15 -1 -1;
#T 16 -1 -1;
#T 17 -1 -1;
#T 18 -1 -1;
#T 19 -1 -1;
#T 20 -1 -1;
#T 21 -1 -1;
#T 22 -1 -1;
#T 23 -1 -1;
#T 24 -1 -1;
#T 25 -1 -1;
#T 26 -1 -1;
#T 27 -1 -1;
#T 28 -1 -1;
#T 29 -1 -1;
#T 30 -1 -1;
#T 31 -1 -1;
#T 32 -1 -1;
#T 33 -1 -1;
#T 34 -1 -1;
#T 35 -1 -1;
#T 36 -1 -1;
#T 37 -1 -1;
#T 38 -1 -1;
#T 39 -1 -1;
#T 40 -1 -1;
#T 41 -1 -1;
#T 42 -1 -1;
#T 43 -1 -1;
#T 44 -1 -1;
#T 45 -1 -1;
#T 46 -1 -1;
#T 47 -1 -1;
#T 48 -1 -1;
#T 49 -1 -1;
#T 50 -1 -1;
#T 51 -1 -1;
#T 52 -1 -1;
#T 53 -1 -1;
#T 54 -1 -1;
#T 55 -1 -1;
#T 56 -1 -1;
#T 57 -1 -1;
#T 58 -1 -1;
#T 59 -1 -1;
#T 60 -1 -1;
#T 61 -1 -1;
#T 62 -1 -1;
#T 63 -1 -1;
#P newobj 365 605 84 196617 coll grid_default;
#P newex 365 581 57 196617 pack 0 0 0;
#P newex 434 462 77 196617 v previous_col;
#P newex 411 512 27 196617 -;
#P newex 365 555 77 196617 v previous_col;
#P newex 388 534 82 196617 v previous_row;
#P newex 365 430 81 196617 t b b b b;
#P newex 128 887 40 196617 t b b b;
#P newex 174 748 72 196617 v current_col;
#P newex 197 727 77 196617 v previous_col;
#P newex 128 705 80 196617 t b b b b;
#P newex 210 621 72 196617 v current_col;
#P newex 174 769 27 196617 -;
#P newex 128 812 77 196617 v previous_col;
#P newex 151 791 82 196617 v previous_row;
#N coll grid_default;
#T flags 1 0;
#T 0 -1 -1;
#T 1 -1 -1;
#T 2 -1 -1;
#T 3 -1 -1;
#T 4 -1 -1;
#T 5 -1 -1;
#T 6 -1 -1;
#T 7 -1 -1;
#T 8 -1 -1;
#T 9 -1 -1;
#T 10 -1 -1;
#T 11 -1 -1;
#T 12 -1 -1;
#T 13 -1 -1;
#T 14 -1 -1;
#T 15 -1 -1;
#T 16 -1 -1;
#T 17 -1 -1;
#T 18 -1 -1;
#T 19 -1 -1;
#T 20 -1 -1;
#T 21 -1 -1;
#T 22 -1 -1;
#T 23 -1 -1;
#T 24 -1 -1;
#T 25 -1 -1;
#T 26 -1 -1;
#T 27 -1 -1;
#T 28 -1 -1;
#T 29 -1 -1;
#T 30 -1 -1;
#T 31 -1 -1;
#T 32 -1 -1;
#T 33 -1 -1;
#T 34 -1 -1;
#T 35 -1 -1;
#T 36 -1 -1;
#T 37 -1 -1;
#T 38 -1 -1;
#T 39 -1 -1;
#T 40 -1 -1;
#T 41 -1 -1;
#T 42 -1 -1;
#T 43 -1 -1;
#T 44 -1 -1;
#T 45 -1 -1;
#T 46 -1 -1;
#T 47 -1 -1;
#T 48 -1 -1;
#T 49 -1 -1;
#T 50 -1 -1;
#T 51 -1 -1;
#T 52 -1 -1;
#T 53 -1 -1;
#T 54 -1 -1;
#T 55 -1 -1;
#T 56 -1 -1;
#T 57 -1 -1;
#T 58 -1 -1;
#T 59 -1 -1;
#T 60 -1 -1;
#T 61 -1 -1;
#T 62 -1 -1;
#T 63 -1 -1;
#P newobj 140 859 84 196617 coll grid_default;
#P newex 128 835 57 196617 pack 0 0 0;
#P newex 177 523 77 196617 v current_row;
#P newex 128 675 32 196617 sel 1;
#P newex 128 654 29 196617 > -1;
#P newex 128 632 77 196617 v previous_col;
#P message 150 582 14 196617 1;
#P button 150 556 15 0;
#P newex 106 413 32 196617 sel 0;
#P newex 150 601 27 196617 + 0;
#P newex 128 535 32 196617 sel 1;
#P newex 128 514 29 196617 > -1;
#P newex 128 483 58 196617 unpack 0 0;
#N coll grid_default;
#T flags 1 0;
#T 0 -1 -1;
#T 1 -1 -1;
#T 2 -1 -1;
#T 3 -1 -1;
#T 4 -1 -1;
#T 5 -1 -1;
#T 6 -1 -1;
#T 7 -1 -1;
#T 8 -1 -1;
#T 9 -1 -1;
#T 10 -1 -1;
#T 11 -1 -1;
#T 12 -1 -1;
#T 13 -1 -1;
#T 14 -1 -1;
#T 15 -1 -1;
#T 16 -1 -1;
#T 17 -1 -1;
#T 18 -1 -1;
#T 19 -1 -1;
#T 20 -1 -1;
#T 21 -1 -1;
#T 22 -1 -1;
#T 23 -1 -1;
#T 24 -1 -1;
#T 25 -1 -1;
#T 26 -1 -1;
#T 27 -1 -1;
#T 28 -1 -1;
#T 29 -1 -1;
#T 30 -1 -1;
#T 31 -1 -1;
#T 32 -1 -1;
#T 33 -1 -1;
#T 34 -1 -1;
#T 35 -1 -1;
#T 36 -1 -1;
#T 37 -1 -1;
#T 38 -1 -1;
#T 39 -1 -1;
#T 40 -1 -1;
#T 41 -1 -1;
#T 42 -1 -1;
#T 43 -1 -1;
#T 44 -1 -1;
#T 45 -1 -1;
#T 46 -1 -1;
#T 47 -1 -1;
#T 48 -1 -1;
#T 49 -1 -1;
#T 50 -1 -1;
#T 51 -1 -1;
#T 52 -1 -1;
#T 53 -1 -1;
#T 54 -1 -1;
#T 55 -1 -1;
#T 56 -1 -1;
#T 57 -1 -1;
#T 58 -1 -1;
#T 59 -1 -1;
#T 60 -1 -1;
#T 61 -1 -1;
#T 62 -1 -1;
#T 63 -1 -1;
#P newobj 128 458 84 196617 coll grid_default;
#P newex 178 395 77 196617 v previous_col;
#P message 178 375 19 196617 -1;
#P newex 55 378 72 196617 v current_col;
#P newex 55 352 133 196617 t b 0 i b;
#P message 34 45 42 196617 Foo.txt;
#P button 87 200 15 0;
#P button 115 283 15 0;
#N coll ;
#P newobj 87 260 53 196617 coll;
#P newex 87 239 68 196617 prepend read;
#P newex 87 217 59 196617 v file_path;
#P button 99 134 15 0;
#P button 34 134 15 0;
#P message 99 156 14 196617 1;
#P message 34 156 14 196617 0;
#P newex 104 92 59 196617 v file_path;
#P newex 34 113 75 196617 route notfound;
#P newex 34 92 66 196617 absolutepath;
#P newex 34 65 51 196617 tosymbol;
#P newex 58 177 39 196617 sel 0;
#P message 115 302 20 196617 64;
#P newex 128 323 62 196617 v maxsteps;
#P connect 58 0 16 0;
#P connect 16 0 3 0;
#P connect 3 0 4 0;
#P connect 4 0 5 0;
#P connect 5 0 9 0;
#P connect 9 0 7 0;
#P connect 1 0 17 0;
#P connect 17 0 18 0;
#P connect 17 1 18 0;
#P connect 8 0 2 0;
#P connect 7 0 2 0;
#P connect 2 1 15 0;
#P connect 15 0 11 0;
#P connect 11 0 12 0;
#P connect 12 0 13 0;
#P connect 5 1 10 0;
#P connect 10 0 8 0;
#P connect 3 0 6 0;
#P fasten 25 0 26 0 155 622 88 622 88 399 111 399;
#P connect 18 0 26 0;
#P connect 13 2 14 0;
#P connect 14 0 1 0;
#P connect 1 0 0 0;
#P connect 17 2 26 1;
#P connect 26 1 21 0;
#P connect 21 0 22 0;
#P connect 22 0 23 0;
#P connect 23 0 24 0;
#P connect 24 0 29 0;
#P connect 29 0 30 0;
#P connect 30 0 31 0;
#P connect 31 0 39 0;
#P connect 39 0 36 0;
#P connect 36 0 33 0;
#P connect 33 0 42 0;
#P fasten 31 1 42 0 155 699 281 699 281 881 133 881;
#P connect 33 0 34 0;
#P connect 42 1 56 0;
#P connect 56 0 55 0;
#P connect 24 1 27 0;
#P fasten 42 0 28 0 133 925 45 925 45 578 155 578;
#P connect 27 0 28 0;
#P connect 28 0 25 0;
#P connect 39 1 35 0;
#P connect 35 0 33 1;
#P connect 42 2 57 0;
#P connect 57 0 54 0;
#P fasten 26 1 25 1 133 445 222 445 222 515 172 515;
#P connect 39 2 41 0;
#P connect 41 0 37 0;
#P connect 37 0 33 2;
#P connect 22 0 32 0;
#P connect 17 3 19 0;
#P connect 19 0 20 0;
#P connect 40 0 37 1;
#P connect 39 3 40 0;
#P connect 25 0 38 0;
#P fasten 26 0 51 0 111 469 41 469 41 344 370 344;
#P connect 51 0 52 0;
#P connect 52 0 53 0;
#P connect 53 0 43 0;
#P connect 43 0 45 0;
#P connect 45 0 48 0;
#P connect 48 0 49 0;
#P connect 43 1 44 0;
#P connect 44 0 48 1;
#P connect 43 2 50 0;
#P connect 50 0 46 0;
#P connect 46 0 48 2;
#P connect 47 0 46 1;
#P connect 43 3 47 0;
#P pop;


Dan Nigrin
Defective Records
202 Hack / PC-1600 User / VSTi Host / OMS Convert / Jack OS X / Major
Malfunction
http://www.defectiverecords.com

http://www.jackosx.com


March 8, 2007 | 1:45 am

Quote: Dan Nigrin wrote on Wed, 07 March 2007 13:29
—————————————————-
> Hoping someone can help me figure this out.
>
> I am using Max/MSP 4.6.2 on multiple platforms: MacPPC, MacIntel,
> and XP. On MacIntel and XP, the following patch works fine – click
> the button at the top, and it will do its thing (actually a whole lot
> of nothing, in this stripped down patch). On MacPPC though, clicking
> the button will yield a Stack Overflow error.
>
> To reproduce the error, create a text file called "Foo.txt" wherever
> you save the patch. Also curiously, if you change the number 64 in
> the patch to 63 or some other lower number, it will work without the
> stack overflow.

OK, here’s a further stripped down patch that still shows the same behavior – only stack overflow on MacPPC (OS 10.4.8), not on MacIntel or XP.

Anyone?

Thanks,
Dan

max v2;
#N vpatcher 256 50 560 650;
#P origin -121 423;
#P button 34 27 15 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P message 159 515 14 196617 1;
#P button 159 489 15 0;
#P newex 115 364 32 196617 sel 0;
#P newex 159 534 27 196617 + 0;
#P newex 137 468 32 196617 sel 1;
#P newex 137 447 29 196617 > -1;
#P newex 137 423 58 196617 unpack 0 0;
#N coll grid_default;
#T flags 1 0;
#T 0 -1 -1;
#T 1 -1 -1;
#T 2 -1 -1;
#T 3 -1 -1;
#T 4 -1 -1;
#T 5 -1 -1;
#T 6 -1 -1;
#T 7 -1 -1;
#T 8 -1 -1;
#T 9 -1 -1;
#T 10 -1 -1;
#T 11 -1 -1;
#T 12 -1 -1;
#T 13 -1 -1;
#T 14 -1 -1;
#T 15 -1 -1;
#T 16 -1 -1;
#T 17 -1 -1;
#T 18 -1 -1;
#T 19 -1 -1;
#T 20 -1 -1;
#T 21 -1 -1;
#T 22 -1 -1;
#T 23 -1 -1;
#T 24 -1 -1;
#T 25 -1 -1;
#T 26 -1 -1;
#T 27 -1 -1;
#T 28 -1 -1;
#T 29 -1 -1;
#T 30 -1 -1;
#T 31 -1 -1;
#T 32 -1 -1;
#T 33 -1 -1;
#T 34 -1 -1;
#T 35 -1 -1;
#T 36 -1 -1;
#T 37 -1 -1;
#T 38 -1 -1;
#T 39 -1 -1;
#T 40 -1 -1;
#T 41 -1 -1;
#T 42 -1 -1;
#T 43 -1 -1;
#T 44 -1 -1;
#T 45 -1 -1;
#T 46 -1 -1;
#T 47 -1 -1;
#T 48 -1 -1;
#T 49 -1 -1;
#T 50 -1 -1;
#T 51 -1 -1;
#T 52 -1 -1;
#T 53 -1 -1;
#T 54 -1 -1;
#T 55 -1 -1;
#T 56 -1 -1;
#T 57 -1 -1;
#T 58 -1 -1;
#T 59 -1 -1;
#T 60 -1 -1;
#T 61 -1 -1;
#T 62 -1 -1;
#T 63 -1 -1;
#P newobj 137 398 84 196617 coll grid_default;
#P newex 115 335 32 196617 t 0 i;
#P message 34 47 42 196617 Foo.txt;
#P button 87 202 15 0;
#P button 115 292 15 0;
#N coll ;
#P newobj 87 267 53 196617 coll;
#P newex 87 244 68 196617 prepend read;
#P newex 87 222 59 196617 v file_path;
#P button 99 136 15 0;
#P button 34 136 15 0;
#P message 99 158 14 196617 1;
#P message 34 158 14 196617 0;
#P newex 104 94 59 196617 v file_path;
#P newex 34 115 75 196617 route notfound;
#P newex 34 94 66 196617 absolutepath;
#P newex 34 67 51 196617 tosymbol;
#P newex 58 179 39 196617 sel 0;
#P message 115 313 20 196617 64;
#P connect 25 0 15 0;
#P connect 15 0 2 0;
#P connect 2 0 3 0;
#P connect 3 0 4 0;
#P connect 4 0 8 0;
#P connect 8 0 6 0;
#P connect 6 0 1 0;
#P connect 7 0 1 0;
#P connect 1 1 14 0;
#P connect 14 0 10 0;
#P connect 10 0 11 0;
#P connect 11 0 12 0;
#P connect 4 1 9 0;
#P connect 9 0 7 0;
#P connect 2 0 5 0;
#P connect 12 2 13 0;
#P connect 13 0 0 0;
#P connect 0 0 16 0;
#P fasten 21 0 22 0 164 560 97 560 97 358 120 358;
#P connect 16 0 22 0;
#P connect 16 1 22 1;
#P connect 22 1 17 0;
#P connect 17 0 18 0;
#P connect 18 0 19 0;
#P connect 19 0 20 0;
#P connect 20 1 23 0;
#P connect 23 0 24 0;
#P connect 24 0 21 0;
#P fasten 22 1 21 1 142 390 231 390 231 466 181 466;
#P pop;


March 8, 2007 | 3:59 pm

On Mar 7, 2007, at 5:45 PM, Dan Nigrin wrote:

>> I am using Max/MSP 4.6.2 on multiple platforms: MacPPC, MacIntel,
>> and XP. On MacIntel and XP, the following patch works fine – click
>> the button at the top, and it will do its thing (actually a whole lot
>> of nothing, in this stripped down patch). On MacPPC though, clicking
>> the button will yield a Stack Overflow error.
>>
>> To reproduce the error, create a text file called "Foo.txt" wherever
>> you save the patch. Also curiously, if you change the number 64 in
>> the patch to 63 or some other lower number, it will work without the
>> stack overflow.

On different machines, different stack sizes are permitted.
Everywhere you have non terminal feedback in your patch, you are
growing the stack size. You have recursion in your patch that you
should try to change to an iterative approach. Most recursive
algorithms can be represented in an iterative form–e.g. rather than
using non terminal feedback, use something like uzi to trigger an
single graph traversal one at a time. If you need more complex case
handling you can use a gate to exit the calculation (as I’ve done in
the example below), and if you need to cache values for each
sequential iteration you can use the right inlet of the float or int
object to store the result of one iteration for use the next time.

http://www.google.com/search?q=recursive+iterative+algorithms+comparison

Hope this helps. In general, it’s something important to learn for
advanced max use.

-Joshua

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 257 153 31 196617 t b 1;
#P newex 265 279 75 196617 print iterative;
#P newex 112 244 79 196617 print recursive;
#P window setfont "Sans Serif" 12.;
#P window linecount 3;
#P comment 243 75 135 196620 (graph depth doesn’t grow…gate left
inlet is terminal);
#P window setfont "Sans Serif" 18.;
#P window linecount 1;
#P comment 44 51 100 196626 recursive;
#P window setfont "Sans Serif" 9.;
#P newex 250 246 47 196617 gate 1 1;
#P newex 250 362 35 196617 < = -1;
#P newex 250 338 58 196617 unpack 0 0;
#N coll grid_default;
#T flags 1 0;
#T 0 -1 -1;
#T 1 -1 -1;
#T 2 -1 -1;
#T 3 -1 -1;
#T 4 -1 -1;
#T 5 -1 -1;
#T 6 -1 -1;
#T 7 -1 -1;
#T 8 -1 -1;
#T 9 -1 -1;
#T 10 -1 -1;
#T 11 -1 -1;
#T 12 -1 -1;
#T 13 -1 -1;
#T 14 -1 -1;
#T 15 -1 -1;
#T 16 -1 -1;
#T 17 -1 -1;
#T 18 -1 -1;
#T 19 -1 -1;
#T 20 -1 -1;
#T 21 -1 -1;
#T 22 -1 -1;
#T 23 -1 -1;
#T 24 -1 -1;
#T 25 -1 -1;
#T 26 -1 -1;
#T 27 -1 -1;
#T 28 -1 -1;
#T 29 -1 -1;
#T 30 -1 -1;
#T 31 -1 -1;
#T 32 -1 -1;
#T 33 -1 -1;
#T 34 -1 -1;
#T 35 -1 -1;
#T 36 -1 -1;
#T 37 -1 -1;
#T 38 -1 -1;
#T 39 -1 -1;
#T 40 -1 -1;
#T 41 -1 -1;
#T 42 -1 -1;
#T 43 -1 -1;
#T 44 -1 -1;
#T 45 -1 -1;
#T 46 -1 -1;
#T 47 -1 -1;
#T 48 -1 -1;
#T 49 -1 -1;
#T 50 -1 -1;
#T 51 -1 -1;
#T 52 -1 -1;
#T 53 -1 -1;
#T 54 -1 -1;
#T 55 -1 -1;
#T 56 -1 -1;
#T 57 -1 -1;
#T 58 -1 -1;
#T 59 -1 -1;
#T 60 -1 -1;
#T 61 -1 -1;
#T 62 -1 -1;
#T 63 -1 -1;
#P newobj 250 307 84 196617 coll grid_default;
#P newex 287 220 27 196617 – 1;
#P button 257 129 15 0;
#P newex 257 188 40 196617 uzi 64;
#P window setfont "Sans Serif" 18.;
#P comment 243 46 100 196626 iterative;
#P window setfont "Sans Serif" 9.;
#P message 124 367 14 196617 1;
#P button 124 341 15 0;
#P newex 80 175 32 196617 sel 0;
#P newex 124 386 27 196617 + 0;
#P newex 102 320 32 196617 sel 1;
#P newex 102 299 29 196617 > -1;
#P newex 102 275 58 196617 unpack 0 0;
#N coll grid_default;
#T flags 1 0;
#T 0 -1 -1;
#T 1 -1 -1;
#T 2 -1 -1;
#T 3 -1 -1;
#T 4 -1 -1;
#T 5 -1 -1;
#T 6 -1 -1;
#T 7 -1 -1;
#T 8 -1 -1;
#T 9 -1 -1;
#T 10 -1 -1;
#T 11 -1 -1;
#T 12 -1 -1;
#T 13 -1 -1;
#T 14 -1 -1;
#T 15 -1 -1;
#T 16 -1 -1;
#T 17 -1 -1;
#T 18 -1 -1;
#T 19 -1 -1;
#T 20 -1 -1;
#T 21 -1 -1;
#T 22 -1 -1;
#T 23 -1 -1;
#T 24 -1 -1;
#T 25 -1 -1;
#T 26 -1 -1;
#T 27 -1 -1;
#T 28 -1 -1;
#T 29 -1 -1;
#T 30 -1 -1;
#T 31 -1 -1;
#T 32 -1 -1;
#T 33 -1 -1;
#T 34 -1 -1;
#T 35 -1 -1;
#T 36 -1 -1;
#T 37 -1 -1;
#T 38 -1 -1;
#T 39 -1 -1;
#T 40 -1 -1;
#T 41 -1 -1;
#T 42 -1 -1;
#T 43 -1 -1;
#T 44 -1 -1;
#T 45 -1 -1;
#T 46 -1 -1;
#T 47 -1 -1;
#T 48 -1 -1;
#T 49 -1 -1;
#T 50 -1 -1;
#T 51 -1 -1;
#T 52 -1 -1;
#T 53 -1 -1;
#T 54 -1 -1;
#T 55 -1 -1;
#T 56 -1 -1;
#T 57 -1 -1;
#T 58 -1 -1;
#T 59 -1 -1;
#T 60 -1 -1;
#T 61 -1 -1;
#T 62 -1 -1;
#T 63 -1 -1;
#P newobj 102 209 84 196617 coll grid_default;
#P newex 80 146 32 196617 t 0 i;
#P message 80 124 20 196617 64;
#P window setfont "Sans Serif" 12.;
#P window linecount 2;
#P comment 43 80 156 196620 (graph depth increases with each
calculation);
#P connect 1 0 2 0;
#P fasten 7 0 8 0 129 417 63 417 63 169 85 169;
#P connect 2 0 8 0;
#P connect 2 1 8 1;
#P connect 8 1 3 0;
#P connect 3 0 4 0;
#P connect 4 0 5 0;
#P connect 5 0 6 0;
#P connect 3 0 21 0;
#P connect 6 1 9 0;
#P connect 9 0 10 0;
#P connect 10 0 7 0;
#P fasten 8 1 7 1 107 201 196 201 196 341 146 341;
#P fasten 17 0 18 0 255 391 237 391 237 237 255 237;
#P connect 23 1 18 0;
#P connect 18 0 15 0;
#P connect 15 0 16 0;
#P connect 16 0 17 0;
#P connect 13 0 23 0;
#P connect 23 0 12 0;
#P connect 18 0 22 0;
#P connect 12 2 14 0;
#P connect 14 0 18 1;
#P window clipboard copycount 24;


March 8, 2007 | 4:15 pm

At 7:59 AM -0800 3/8/07, Joshua Kit Clayton wrote:
>On different machines, different stack sizes are permitted.
>Everywhere you have non terminal feedback in your patch, you are
>growing the stack size. You have recursion in your patch that you
>should try to change to an iterative approach. Most recursive
>algorithms can be represented in an iterative form–e.g. rather than
>using non terminal feedback, use something like uzi to trigger an
>single graph traversal one at a time. If you need more complex case
>handling you can use a gate to exit the calculation (as I’ve done in
>the example below), and if you need to cache values for each
>sequential iteration you can use the right inlet of the float or int
>object to store the result of one iteration for use the next time.
>
>http://www.google.com/search?q=recursive+iterative+algorithms+comparison
>
>Hope this helps. In general, it’s something important to learn for
>advanced max use.

Perfectly clear and extremely helpful – thanks Joshua!!

Dan

Dan Nigrin
Defective Records
202 Hack / PC-1600 User / VSTi Host / OMS Convert / Jack OS X / Major
Malfunction
http://www.defectiverecords.com

http://www.jackosx.com


Viewing 4 posts - 1 through 4 (of 4 total)