Force set() to send OSC

I have a reset function that's triggered by my DAW sending an OSC command; this reset function calls 'set' on a number of widgets, with the intention of those widgets sending out their default value and resetting things in the DAW. I've set {send:true}, but the OSC doesn't send. I'm guessing this is because the initial call of the function wasn't triggered by user interaction. Is there any way to force the widget to send it's OSC command when it's not triggered by user interaction?

If you're triggering this from a custom module, you can either send these messages directly from the custom module, or use /SET to mimic a user interaction in the interface. /SCRIPT would also work.

Thank you!

Hmm this doesn't seem to be working..i'm in version 1.17.0. It just doesn't send the values. Also, I've tried using set() with the send:true flag, and it's really odd...i'm doing it in a for loop, and all the widgets update correctly in the UI, but only half of them send their values.

set() called from a widget script will only send if there was a user interaction, no flag that can override that.

Hmm this doesn't seem to be working

Can you elaborate on what you did exactly and what didn't work as expected?

I think the issue was that I was trying to use send() in the custom module rather than receive().

What I ended up doing was:
receive("/SET", "reset_looper", args[0].value)
from the custom module, and then inside the method, doing:
set(id,df,{send: true})

After re-reading the documentation, I still don't quite get the difference between those two methods (send and receive)

This seemed to work.

send() is for sending a message from the osc server to another application, receive() is to send a message from the osc server to the osc clients (as if received from another application).

1 Like

Thank you!