Forums > Jitter

Re: better vector mean value

June 25, 2006 | 4:50 pm

for sake of it. this is a bit better,
but i get unaccpected results with [expr pow(2,$i1)] it works only with
positive init. when i plug a negative i get nulls. the usual pow object does
it good.

max v2;
#N vpatcher 15 55 615 455;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 526 532 59 9109513 slide 20. 20.;
#P user multiSlider 526 556 151 157 0. 15. 1 3193 15 0 0 2 0 0 0;
#M frgb 0 0 0;
#M brgb 255 255 255;
#M rgb2 127 127 127;
#M rgb3 0 0 0;
#M rgb4 37 52 91;
#M rgb5 74 105 182;
#M rgb6 112 158 18;
#M rgb7 149 211 110;
#M rgb8 187 9 201;
#M rgb9 224 62 37;
#M rgb10 7 114 128;
#P newex 526 508 80 9109513 expr sqrt($i1+$i2);
#P number 572 394 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 620 472 32 9109513 pow 2;
#P newex 620 448 27 9109513 -;
#P newex 496 472 32 9109513 pow 2;
#P newex 496 449 27 9109513 -;
#P newex 620 391 27 9109513 t i i;
#P newex 637 423 38 9109513 pipe 33;
#P newex 496 393 27 9109513 t i i;
#P newex 513 420 38 9109513 pipe 33;
#P window setfont "Sans Serif" 12.;
#P newex 540 207 77 9109516 speedlim 33;
#P window setfont "Sans Serif" 9.;
#P number 627 167 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P window setfont "Sans Serif" 12.;
#P message 562 139 15 9109516 1;
#P newex 541 112 60 9109516 loadbang;
#P toggle 539 147 15 0;
#P newex 538 167 50 9109516 metro 2;
#P user pictslider 520 272 100 100 4 4 4 4 SliderDefaultKnob.pct 1
SliderDefaultBkgnd.pct 1 2163 0 7864320 160 1. 1.;
#N vpatcher 5 40 605 440;
#P window setfont "Sans Serif" 12.;
#P window linecount 1;
#P message 19 50 42 9109516 nopoll;
#P inlet 100 50 16 0;
#P window linecount 0;
#P newex 109 133 106 9109516 zmap 768 0 120 0;
#P newex 69 158 113 9109516 zmap 0 1024 0 160;
#P number 68 134 35 12 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 91 111 42 12 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 68 50 29 9109516 poll;
#P newex 52 80 74 9109516 mousestate;
#P inlet 68 30 16 0;
#P outlet 109 160 15 0;
#P outlet 69 185 15 0;
#P connect 4 0 3 0;
#P connect 9 0 3 0;
#P connect 10 0 3 0;
#P connect 2 0 4 0;
#P connect 3 1 6 0;
#P connect 6 0 7 0;
#P connect 7 0 0 0;
#P connect 3 2 5 0;
#P connect 5 0 8 0;
#P connect 8 0 1 0;
#P pop;
#P newobj 538 243 60 9109516 p;
#P connect 1 0 9 0;
#P connect 9 0 12 0;
#P connect 12 0 13 0;
#P connect 9 1 8 0;
#P fasten 8 0 12 1 518 445 518 445;
#P connect 0 0 1 0;
#P connect 13 0 17 0;
#P connect 17 0 19 0;
#P connect 19 0 18 0;
#P connect 3 0 2 0;
#P connect 5 0 3 0;
#P connect 2 0 7 0;
#P fasten 16 0 8 1 577 416 546 416;
#P connect 4 0 5 0;
#P connect 6 0 2 1;
#P connect 7 0 0 1;
#P connect 15 0 17 1;
#P connect 0 1 1 1;
#P connect 1 1 11 0;
#P connect 11 0 14 0;
#P connect 14 0 15 0;
#P connect 11 1 10 0;
#P fasten 10 0 14 1 642 445 642 445;
#P fasten 16 0 10 1 577 416 670 416;
#P pop;

2006/6/24, yair reshef :
>
> hi all,
> i need to find if a dot is changing position or staying in the same place,
> give or take a few pixels.
> this works, but i am sure there is a better cleaner smarter way of doing
> stuff like this.
>
> max v2;
> #N vpatcher 4 25 845 886;
> #P origin 185 141;
> #P window setfont "Sans Serif" 12.;
> #P window linecount 1;
> #P message 254 148 15 9109516 1;
> #P newex 233 121 60 9109516 loadbang;
> #P toggle 231 156 15 0;
> #P newex 230 176 50 9109516 metro 2;
> #P window setfont "Sans Serif" 9.;
> #P newex 116 701 28 9109513 sel 1;
> #P newex 123 574 27 9109513 t 6 0;
> #P newex 150 602 27 9109513 gate;
> #P newex 115 678 27 9109513 >= 6;
> #P message 186 635 34 9109513 set $1;
> #P newex 186 611 27 9109513 t 0 1;
> #P window setfont "Sans Serif" 36.;
> #P number 152 693 35 36 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
> #P window setfont "Sans Serif" 9.;
> #P newex 150 626 27 9109513 t b 1;
> #P newex 150 655 40 9109513 accum;
> #P newex 219 541 63 9109513 speedlim 400;
> #P newex 235 357 27 9109513 t i i;
> #P number 264 519 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
> #P newex 252 389 38 9109513 pipe 33;
> #P number 219 520 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
> #P newex 265 420 27 9109513 + 5;
> #P newex 237 420 27 9109513 – 5;
> #P number 253 454 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
> #P number 237 471 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
> #P newex 222 494 40 9109513 split;
> #P user pictslider 213 232 100 100 4 4 4 4 SliderDefaultKnob.pct 1
> SliderDefaultBkgnd.pct 1 2163 0 7864320 160 1. 1.;
> #P window setfont "Sans Serif" 12.;
> #N vpatcher 5 40 605 440;
> #P window setfont "Sans Serif" 12.;
> #P window linecount 1;
> #P message 19 50 42 9109516 nopoll;
> #P inlet 100 50 16 0;
> #P window linecount 0;
> #P newex 109 133 106 9109516 zmap 768 0 120 0;
> #P newex 69 158 113 9109516 zmap 0 1024 0 160;
> #P number 68 134 35 12 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
> #P number 91 111 42 12 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
> #P message 68 50 29 9109516 poll;
> #P newex 52 80 74 9109516 mousestate;
> #P inlet 68 30 16 0;
> #P outlet 109 160 15 0;
> #P outlet 69 185 15 0;
> #P connect 10 0 3 0;
> #P connect 9 0 3 0;
> #P connect 4 0 3 0;
> #P connect 2 0 4 0;
> #P connect 3 1 6 0;
> #P connect 6 0 7 0;
> #P connect 7 0 0 0;
> #P connect 3 2 5 0;
> #P connect 5 0 8 0;
> #P connect 8 0 1 0;
> #P pop;
> #P newobj 231 203 60 9109516 p;
> #P window linecount 3;
> #P comment 94 506 113 9109516 searching for a better way to watch for
> static movment;
> #P fasten 13 0 18 0 120 674;
> #P connect 18 0 21 0;
> #P fasten 21 0 20 0 121 729 90 729 90 571 128 571;
> #P fasten 16 1 19 0 208 631 216 631 216 573 155 573;
> #P connect 20 1 19 0;
> #P connect 19 0 14 0;
> #P fasten 17 0 13 0 191 653 155 653;
> #P connect 14 0 13 0;
> #P connect 13 0 15 0;
> #P connect 14 1 13 1;
> #P fasten 12 0 19 1 172 560;
> #P fasten 10 0 16 0 269 565 191 565;
> #P connect 20 0 17 0;
> #P connect 16 0 17 0;
> #P connect 1 0 2 0;
> #P connect 3 0 8 0;
> #P connect 8 0 12 0;
> #P fasten 11 0 3 0 227 376;
> #P connect 23 0 22 0;
> #P connect 25 0 23 0;
> #P fasten 2 0 11 0 218 344 240 344;
> #P connect 9 0 6 0;
> #P connect 6 0 4 0;
> #P connect 4 0 3 1;
> #P connect 11 1 9 0;
> #P connect 5 0 3 2;
> #P fasten 7 0 5 0 270 446 258 446;
> #P connect 24 0 25 0;
> #P connect 3 1 10 0;
> #P connect 9 0 7 0;
> #P fasten 22 0 1 1 286 198;
> #P connect 1 1 2 1;
> #P pop;
>
>


Viewing 1 post (of 1 total)