Forums > MaxMSP

Smoothing data – aka.wiiremote

June 22, 2008 | 6:03 pm

Hi Guys

Hope you’re all OK.

Right, I have just hooked up a patch I am creating which allows waveshaping using wiiremotes, with visual feedback. So far….so good with a cycle wave.

However, at the moment my infrared remote, is acting very strange. It keeps going all over the place, and can go unstable or sometimes be the in the wrong place.

Can you guys think of way I could smooth the data?

Cheers
Mark


June 22, 2008 | 6:28 pm

smoothing sensor data (a.k.a filtering) is a bitch.
there are a couple of externals that can help like slide, lbyl (look before
you leap, its in maxobjects) and several others. each does something else,
and all have their cons.
you have to know your sensor, what r its limits. whats the best
environmental conditions to make it work the best (is there direct light
source other then the wiibar? sunlight? maybe get stronger leds?).
you can also do some averaging (fill a bucket with n samples and Davide by
n)
a good way is to record a sample stream, leave the sensor alone, play and
try to optimize.

On Sun, Jun 22, 2008 at 9:03 PM, Mark Jennings
wrote:

>
> Hi Guys
>
> Hope you’re all OK.
>
> Right, I have just hooked up a patch I am creating which allows waveshaping
> using wiiremotes, with visual feedback. So far….so good with a cycle wave.
>
> However, at the moment my infrared remote, is acting very strange. It keeps
> going all over the place, and can go unstable or sometimes be the in the
> wrong place.
>
> Can you guys think of way I could smooth the data?
>
> Cheers
> Mark
>


June 22, 2008 | 11:23 pm

this is a nice patch i got from gregory taylor

#P window setfont "Sans Serif" 18.;
#P window linecount 1;
#P newex 47 111 59 196626 t b b;
#P user multiSlider 14 269 262 125 0. 1. 1 3962 61 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 521 542 262 126 -0.1 0.1 1 3962 61 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;
#N vpatcher 220 342 820 742;
#P outlet 111 260 29 0;
#P inlet 111 81 29 0;
#P window setfont "Sans Serif" 18.;
#P newex 111 173 46 196626 !- 0.;
#P flonum 111 219 105 18 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 111 127 95 196626 bucket 2;
#P connect 3 0 0 0;
#P connect 0 0 2 0;
#P connect 2 0 1 0;
#P connect 1 0 4 0;
#P fasten 0 1 2 1 201 162 152 162;
#P pop;
#P newobj 521 504 174 196626 p derivative;
#N vpatcher 220 342 820 742;
#P outlet 105 247 29 0;
#P inlet 105 68 29 0;
#P window setfont "Sans Serif" 18.;
#P newex 105 160 46 196626 !- 0.;
#P flonum 105 206 105 18 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 105 114 95 196626 bucket 2;
#P connect 3 0 0 0;
#P connect 0 0 2 0;
#P connect 2 0 1 0;
#P connect 1 0 4 0;
#P fasten 0 1 2 1 195 149 146 149;
#P pop;
#P newobj 521 333 174 196626 p derivative;
#P number 222 111 67 18 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 96 188 75 196626 * 0.01;
#P newex 96 150 136 196626 drunk 100 10;
#P window setfont "Sans Serif" 12.;
#P comment 784 542 124 196620 acceleration;
#P comment 788 389 88 196620 velocity;
#P comment 790 238 203 196620 numbers (smoothed);
#P user multiSlider 521 370 262 126 -0.1 0.1 1 3962 61 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" 18.;
#P newex 390 351 64 196626 * 0.9;
#P newex 309 390 91 196626 + 0.;
#P newex 309 352 64 196626 * 0.1;
#P toggle 47 33 24 0;
#P newex 47 73 101 196626 metro 33;
#P newex 309 314 52 196626 f;
#P user multiSlider 521 200 262 125 0. 1. 1 3962 61 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 flonum 351 278 90 18 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window setfont "Sans Serif" 12.;
#P comment 694 -23 146 196620 numbers (raw);
#P connect 17 0 18 0;
#P connect 9 0 17 0;
#P connect 16 0 9 0;
#P connect 2 0 16 0;
#P fasten 7 0 8 0 314 444 464 444 464 339 395 339;
#P fasten 7 0 2 0 314 444 502 444 502 187 526 187;
#P connect 8 0 7 1;
#P connect 1 0 3 1;
#P connect 14 0 19 0;
#P fasten 14 0 1 0 101 226 356 226;
#P connect 6 0 7 0;
#P connect 3 0 6 0;
#P fasten 20 0 3 0 52 252 314 252;
#P connect 15 0 13 2;
#P connect 13 0 14 0;
#P connect 20 1 13 0;
#P connect 4 0 20 0;
#P connect 5 0 4 0;
#P window clipboard copycount 21;


June 23, 2008 | 12:36 pm

Another solution is lp.stacey in window mode. There is an example in Litter Extras/X-amples called "Smoothing (Sensor) Data" which, umm, might do what you want.

lp.stacey and the sample patch are in both the Litter Starter Pack and Litter Pro. So there you go. URL below.


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