hello,
I've built a filter interface with O-S-C, and for enabling the filter, the message "true" and "false" has to be sent to the widget, then I'm using a button on 'toggle' mode.
I'd like to send the same message in my osc target for enabling/disabling the filter but it receives 'undefined'.
I've tried to set type tags to string, then nothing is received, just the 'T' and 'F' type tags that are not recognized by PureData.
If I add another symbol like 'on':'true 1'
and 'off':'false 0'
, the message is received as one symbol with spaces inside, and by using I've found a way to correct this by using 'on': 'JS{{ return ["true", 1] }}'
I finally receive my symbol but the widget don't work anymore.
Is there something more elegant than using 'onvalue' script to correct this?
cheers
When setting typetags
to s
, on
to true
and off
to false
, the button correctly sends and receives "true"
and "false"
as strings, is that what you want to do ?
This is what I want to do but PureData receives tags it doesn't understand, the pd console shows:
oscparse: unknown tag 'F' (70)
oscparse: unknown tag 'T' (84)
the PureData [oscparse] object unfortunately doesn't parse these tags.
Before trying to add these tags in a PR I'd like to know if it's necessary.
Please enable open stage control's debug option to check what's actually being sent by the server, a button configured as specified above does not use these typetags.
Debug mode doesn't work with using node-js, it's too complicated to make it work yet, so I'm using O-S-C app for macos on arm.
Firstable, the osc message is not sent when using the app. The message is filtered by my custom module for broadcasting to all targets like this:
if (address === '/broadcast') {
machines.forEach((machine, i) => {
let newHost = machine.ipAddress;
if (moduleStates[i].state === 1) {
send(newHost, "4000", val, args[1].value);
}
});
return;
}
I'm using 'preArgs' for setting address.
But it works when I'm using 'onvalue' script like this:
send("localhost:4000","/broadcast " + getProp(this,"preArgs"),value)
The result from debugger on console looks like that:
(DEBUG, OSC) Out: { address: '/broadcast /filter/f0/onOff', args: [ { type: 'F' } ] } To: localhost:4000
Ok, try replacing args[1].value
with args[1]
, args[1]
also contain the typetag which is needed here to cast the boolean value to a string.
If I replace args[1].value with args[1], and use 's' tag it works. Meanwhile it would be awsome if the boolean could be converted to an integer. Thanks for help.
Yes, that's what I've done using onValue script in the widget before trying to send a symbol.
I guess using an integer uses less bandwidth than using a boolean converted to symbol, that's why at the end using onValue script looks like a better solution. As an awkward user, I'd expect an internal function for doing it silently.
In this topic I've learned that my broadcast function in the custom module was not correct because it was filtering typetags.