Re: better vector mean value


    Jun 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;
    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;
    >
    >