Forum

Question about averaging numbers

Hi, newbie here.

So, I am trying to make a patch where I get data from processing via UDP and use it in vvvv. I am tracking a face in processing, sending the x value to vvvv, so far so good.

My problem is, the data is coming every n milliseconds, thus making my vvvv object move to x and 0 back and forth every n milliseconds, much like a blinking motion.

So, I thought, maybe I could average the received values and move my object every 5 seconds or so to the averaged value.

I would appreciate some guidance with this :)

Another solution would be to not take the 0’s into account, so if(0)skip. I am not sure how to do an if statement in vvvv though. A pointer in that matter would also be appreciated since I am sure I will absolutely need it at somepoint.

Thanks in advance.

Hi, newbie.

Try to use Transient (Animation)
or IIR (Animation) from Kalle Modules Animation Page.

Hello there try this it should solve the problem , you are probably getting a null from your values , hope it helps ;D

Avoid_0.v4p (6.9 kB)

Thanks all :)

colorsound, the patched worked exactly as how I needed :)