Send a UDP packet every 100 ms (Timer?)

I’m building a really simple project (for fun/learning) that converts mouse position into x,y values and then formats them and sends them over UDP.

So far I have a mousemovein, two maths CHOPs to scale x and y, a udpout DAT, and ‘send’ button attached to a panelexec.

The button runs the panelexec which collects the x & y values from the math chops and formats them into a string which gets sent by the udpout.

I’d like to replace the button with a timer such that it just contonously sends the values every 100ms or so. So I think I want to replace the button with a timer.

I’ve been looking at the Operator snippets, but I can’t figure out how to run the panelexec every 100ms from a timer.

Sorry for the simple beginner question!
mouseoutUDP.1.toe (4.9 KB)

Screenshot 2025-02-27 120107
If you set these two parameters, the timer will run continuously and will restart.

However I would probably do something a little different.

If you attach a chopExec to your final Chop, you can send out only when something changes.

if you are concerned about sending too much data you can resample the mouseIn to a slower rate and send less messages.

mouseoutUDP.toe (6.1 KB)

@harveymoon Brilliant thank you!
It’s good when someone with experience can help out a newbie with some cool tips.
Thanks again.

1 Like