function is malfunctioning!

May 24, 2008 at 6:00pm

function is malfunctioning!

Hi,

I’m working on a patch in which I want to use function to control filter parameters. With every first metro tick, I wish to delete a random point, and with every second to add a new random point, etc. The problem I’m running into is that function does something funny with the “clear $1″ message. Many times this has actually caused Max to crash. Can anyone look at my patch and suggest what might be the problem?

Thanks,
Jay

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 417 389 27 9109513 + 1;
#P user function 406 466 767 564 1 1 0 0;
#X frgb 82 82 82;
#X brgb 204 204 204;
#X rgb2 85 85 85;
#X rgb3 255 255 255;
#X rgb4 0 0 0;
#X rgb5 0 0 0;
#X add 0. 0.616438 0;
#X add 249.283676 0.90411 0;
#X add 438.395416 0.315068 0;
#X add 679.08313 0.808219 0;
#X add 1383.954224 0.328767 0;
#X add 1719.197754 0.561644 0;
#X add 1865.32959 0.273973 0;
#X add 2123.209229 1. 0;
#X add 2793.696289 0.246575 0;
#X add 3000. 0.534247 0;
#X domain 3000.;
#X range 0. 1.;
#X done;
#P newex 470 414 73 9109513 0 0.;
#P newex 533 389 33 9109513 * 0.01;
#P newex 533 366 57 9109513 random 100;
#P newex 470 366 62 9109513 random 3000;
#P newex 417 366 47 9109513 random 9;
#P message 520 439 74 9109513 setdomain 3000;
#P message 491 439 28 9109513 clear;
#P message 459 439 31 9109513 $1 $2;
#P message 417 439 41 9109513 clear $1;
#P newex 417 340 116 9109513 sel 1 2;
#N counter 0 1 2;
#X flags 0 0;
#P newobj 417 317 66 9109513 counter 0 1 2;
#P toggle 406 266 15 0;
#P newex 406 291 55 9109513 metro 3000;
#P connect 5 0 13 0;
#P connect 0 0 13 0;
#P connect 0 0 2 0;
#P connect 4 0 13 0;
#P connect 11 0 12 1;
#P connect 10 0 11 0;
#P connect 3 1 10 0;
#P connect 9 0 12 0;
#P connect 3 1 9 0;
#P connect 12 0 5 0;
#P connect 14 0 4 0;
#P connect 8 0 14 0;
#P connect 3 0 8 0;
#P connect 2 0 3 0;
#P connect 6 0 13 0;
#P connect 7 0 13 0;
#P connect 1 0 0 0;
#P window clipboard copycount 15;

#38038
May 24, 2008 at 7:14pm

Hi.

I just tried this in Max 5 and it works fine for me.

I even set it to metro 1 and left it for a few minutes, no crash.

Cheers

Andy

#131873
May 25, 2008 at 7:04am

Jay Bodley schrieb:
> Many times this has actually caused Max to crash.

Crashes are usually OS specific. You need to tell which sort of computer
you are running. If its OS X you can post the crash log…

Stefan


Stefan Tiedje————x——-
–_____———–|————–
–(_|_ —-|—–|—–()——-
– _|_)—-|—–()————–
———-()——–www.ccmix.com

#131874
May 25, 2008 at 6:56pm

here’s a better picture of what’s going on. note the huge number which is somehow generated by function.

btw, i’m on a macbook running windows xp.

#P window setfont “Sans Serif” 14.;
#P window linecount 2;
#P comment 751 391 188 9109518 state after function received “clear 2″ message;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P comment 659 25 79 9109513 add new point;
#P newex 632 231 60 9109513 print addnew;
#P newex 572 231 49 9109513 print clear;
#P newex 759 348 43 9109513 print line;
#P newex 622 134 31 9109513 + 100;
#P message 662 195 100 9109513 clear , setdomain 3000;
#P button 572 40 15 0;
#P button 685 40 15 0;
#P button 766 195 15 0;
#P message 622 195 31 9109513 $1 $2;
#P message 572 195 41 9109513 clear $1;
#P newex 622 158 73 9109513 0 0.;
#P newex 685 134 33 9109513 * 0.01;
#P newex 685 111 57 9109513 random 100;
#P newex 572 134 27 9109513 + 1;
#P newex 572 111 47 9109513 random 8;
#P newex 622 111 62 9109513 random 2800;
#P user function 622 262 1043 340 1 1 1 0;
#X frgb 82 82 82;
#X brgb 204 204 204;
#X rgb2 85 85 85;
#X rgb3 255 255 255;
#X rgb4 0 0 0;
#X rgb5 0 0 0;
#X add 0. 0.493827 0;
#X add 243.564362 0.283951 0;
#X add 339. 0.94 0;
#X add 866. 0.53 0;
#X add 1227. 0.99 0;
#X add 1445. 0.09 0;
#X add 2298. 0.9 0;
#X add 2737. 0.8 0;
#X add 3000. 0.444444 0;
#X add 100000002004087730000. 0.38 0;
#X domain 3000.;
#X range 0. 1.;
#X done;
#P comment 542 25 79 9109513 clear a point (1-8);
#P comment 120 25 79 9109513 add new point;
#P newex 93 231 60 9109513 print addnew;
#P newex 33 231 49 9109513 print clear;
#P newex 220 348 43 9109513 print line;
#P newex 83 134 31 9109513 + 100;
#P message 123 195 100 9109513 clear , setdomain 3000;
#P button 33 40 15 0;
#P button 146 40 15 0;
#P button 227 195 15 0;
#P message 83 195 31 9109513 $1 $2;
#P message 33 195 41 9109513 clear $1;
#P newex 83 158 73 9109513 0 0.;
#P newex 146 134 33 9109513 * 0.01;
#P newex 146 111 57 9109513 random 100;
#P newex 33 134 27 9109513 + 1;
#P newex 33 111 47 9109513 random 8;
#P newex 83 111 62 9109513 random 2800;
#P user function 83 262 504 340 1 1 1 0;
#X frgb 82 82 82;
#X brgb 204 204 204;
#X rgb2 85 85 85;
#X rgb3 255 255 255;
#X rgb4 0 0 0;
#X rgb5 0 0 0;
#X add 0. 0.493827 0;
#X add 243.564362 0.283951 0;
#X add 315. 0.38 0;
#X add 339. 0.94 0;
#X add 866. 0.53 0;
#X add 1227. 0.99 0;
#X add 1445. 0.09 0;
#X add 2298. 0.9 0;
#X add 2737. 0.8 0;
#X add 3000. 0.444444 0;
#X domain 3000.;
#X range 0. 1.;
#X done;
#P comment 3 25 79 9109513 clear a point (1-8);
#P newex 766 173 45 9109513 loadbang;
#P window setfont “Sans Serif” 14.;
#P comment 238 391 106 9109518 original state;
#P window setfont “Sans Serif” 9.;
#P window linecount 2;
#P comment 751 430 152 9109513 look in Max window: where did the incredibly big number come from?;
#P connect 2 0 32 0;
#P connect 23 1 37 0;
#P connect 28 0 29 1;
#P connect 27 0 28 0;
#P connect 33 0 24 0;
#P connect 33 0 27 0;
#P connect 31 0 39 0;
#P fasten 32 0 23 0 771 219 627 219;
#P fasten 35 0 23 0 667 219 627 219;
#P connect 30 0 38 0;
#P fasten 30 0 23 0 577 219 627 219;
#P connect 31 0 23 0;
#P connect 29 0 31 0;
#P connect 36 0 29 0;
#P connect 24 0 36 0;
#P connect 26 0 30 0;
#P connect 25 0 26 0;
#P connect 34 0 25 0;
#P connect 4 1 18 0;
#P connect 9 0 10 1;
#P connect 8 0 9 0;
#P connect 14 0 5 0;
#P connect 14 0 8 0;
#P connect 12 0 20 0;
#P fasten 16 0 4 0 128 219 88 219;
#P fasten 13 0 4 0 232 219 88 219;
#P connect 11 0 19 0;
#P fasten 11 0 4 0 38 219 88 219;
#P connect 12 0 4 0;
#P connect 10 0 12 0;
#P connect 17 0 10 0;
#P connect 5 0 17 0;
#P connect 7 0 11 0;
#P connect 6 0 7 0;
#P connect 15 0 6 0;
#P window clipboard copycount 42;

#131875
May 26, 2008 at 8:59pm

On 24 mai 08, at 20:00, Jay Bodley wrote:

> I’m working on a patch in which I want to use function to control
> filter parameters. With every first metro tick, I wish to delete a
> random point, and with every second to add a new random point, etc.
> The problem I’m running into is that function does something funny
> with the “clear $1″ message. Many times this has actually caused
> Max to crash. Can anyone look at my patch and suggest what might be
> the problem?

Don’t use “clear” with an argument under Max 4.x, it was broken. This
has been fixed in Max 5.

ej

#131876
May 26, 2008 at 11:47pm

so that means I can’t remove points from function without the mouse, doesn’t it?

#131877
May 27, 2008 at 12:09am

On 27 mai 08, at 01:47, Jay Bodley wrote:

> so that means I can’t remove points from function without the mouse,
> doesn’t it?

You can with the clear message. But don’t put an argument, it didn’t
work.

ej

#131878

You must be logged in to reply to this topic.