Forums > MaxMSP

detect sudden change

September 20, 2006 | 4:31 pm

i have pair of floats i wish to monitor for sudden changes, i use [split]
with dynamic +5 -5 on the range pins. that does detect the changes, my
problem is…
1] given 2 a pair of numbers, is there some kind of calculation that can set
them apart as a pair or do i need to run the split after [unpack].
i now use [Lcent] for this, but maybe there is a better way.
2] watch the lower pair of [multisliders], they make the jump to the new
value but then return to the smoothed output and climb from there.

i am sure there is a method or order of doing thing i miss.
ideal is an object that only slidessmooths a list if it is in a predefined
range otherwise it jumps straight to the new value.

max v2;
#N vpatcher 15 55 872 637;
#P origin 50 -196;
#P user multiSlider 163 611 87 79 -1. 1. 1 3193 63 0 0 2 0 0 1;
#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 user multiSlider 73 611 87 79 -1. 1. 1 3193 63 0 0 2 0 0 1;
#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 window setfont "Sans Serif" 9.;
#P newex 73 586 52 9109513 unpack f f;
#P newex 94 539 42 9109513 pack f f;
#P newex 155 518 59 9109513 slide 10. 10.;
#P newex 94 518 59 9109513 slide 10. 10.;
#P newex 73 562 50 9109513 switch 2 1;
#P newex 93 474 16 9109513 t l;
#P newex 247 469 19 9109513 t b;
#P newex 247 505 30 9109513 zl reg;
#P window setfont "Sans Serif" 12.;
#P comment 122 286 63 9109516 accept list;
#P window setfont "Sans Serif" 9.;
#P newex 73 406 43 9109513 onebang;
#P message 120 426 14 9109513 2;
#P message 73 429 14 9109513 1;
#P newex 100 134 50 9109513 pack 0. 0.;
#P newex 68 112 86 9109513 scale 0 1280 -1. 1.;
#P newex 167 113 86 9109513 scale 0 1024 -1. 1.;
#P window setfont "Sans Serif" 12.;
#P number 135 334 35 12 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P window setfont "Sans Serif" 9.;
#P newex 90 311 67 9109513 expr $f1*1000;
#P newex 90 334 40 9109513 t i i i;
#P newex 137 360 27 9109513 + 50;
#P newex 105 360 27 9109513 – 50;
#P newex 90 383 40 9109513 split;
#P newex 90 286 31 9109513 Lcent;
#P newex 90 251 39 9109513 pak 0 0;
#P user multiSlider 64 160 87 79 0. 1024. 1 3193 63 0 0 2 0 0 1;
#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 64 90 66 9109513 expr 1204-$f1;
#P user multiSlider 154 159 87 79 0. 1024. 1 3193 63 0 0 2 0 0 1;
#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 154 89 78 9109513 expr 1024-$f1;
#P newex 89 60 66 9109513 MouseState;
#P newex 89 40 45 9109513 metro 30;
#P toggle 89 22 15 0;
#P user panel 54 278 160 185;
#X brgb 191 191 191;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P newex 94 497 52 9109513 unpack f f;
#P window setfont "Sans Serif" 12.;
#P comment 106 22 22 9109516 < <;
#P fasten 5 1 8 0 108 84 69 84;
#P connect 8 0 9 0;
#P fasten 8 0 19 0 69 110 73 110;
#P connect 12 0 23 0;
#P connect 23 0 21 0;
#P connect 21 0 28 0;
#P fasten 22 0 28 0 125 456 78 456;
#P connect 28 0 32 0;
#P connect 32 0 33 0;
#P connect 3 0 4 0;
#P connect 4 0 5 0;
#P fasten 8 0 10 0 60 155 60 245 95 245;
#P connect 10 0 11 0;
#P fasten 11 0 16 0 95 308 95 308;
#P connect 16 0 15 0;
#P fasten 15 2 12 0 95 360;
#P fasten 20 0 27 0 48 153 48 467 98 467;
#P connect 31 0 28 1;
#P connect 27 0 1 0;
#P connect 1 0 29 0;
#P connect 29 0 31 0;
#P connect 19 0 20 0;
#P connect 15 0 13 0;
#P connect 13 0 12 1;
#P connect 12 1 23 1;
#P fasten 25 0 28 2 252 560 118 560;
#P fasten 6 0 10 1 159 156 246 156 246 244 124 244;
#P connect 14 0 12 2;
#P connect 12 1 22 0;
#P connect 17 0 13 1;
#P connect 30 0 31 1;
#P connect 15 1 14 0;
#P connect 18 0 20 1;
#P fasten 5 2 6 0 122 81 159 81;
#P connect 6 0 7 0;
#P connect 17 0 14 1;
#P connect 1 1 30 0;
#P connect 32 1 34 0;
#P fasten 6 0 18 0 159 110 172 110;
#P connect 21 0 26 0;
#P connect 26 0 25 0;
#P fasten 27 0 25 1 98 494 272 494;
#P pop;


Viewing 1 post (of 1 total)