Monitoring incoming OSC messages for symbol matching
Hello all,
I am trying to produce a true/false (1/0) result by monitoring incoming lists for matches to specific symbols.
Ideally, the presence of a specified symbol should produce a 1, while its absence should produce 0.
In this patcher, OSC messages are sent from a udpreceive object connected to ZIG SIM (a free app that leverages sensors in smart phones for development purposes) running on my iPhone 8 (iOS 14.1). They are parsed by fromsymbol and zl.ecils objects to retrieve data associated with 4 messages: touch01, touch02, touchradius, and touchforce.
When the screen is touched, OSC messages are sent that contain "touch01" and its associated data. When the screen is not touched, messages are still sent but do not contain "touch01." My goal is to produce a 1 with the former and a 0 with the latter, and to extend this behaviour for individual touch messages. ZIG SIM provides data for up to 5 contact points (touch 01, touch11, touch21, etc.).
I have tried a multitude of objects - zl.compare, change, match, if, - as well as externals. However, I can't seem to get this simple operation to work.
Below is the current patch. Any help is appreciated!
comparing symbols, outside-the-box-style:
zl union -> zl len -> if length is not 2, then true. :)

Hey thanks Roman! This is a cool solution, and one I'll be using lots going forward.
However, I'm still running into troubles when testing for multiple messages at the same time. Perhaps it has to do with the way the messages are being streamed? Attached is a screenshot including a console readout of messages coming from the pack object.
The issue now is that when the second test (touchforce1) is true, the first (touchforce0) reads as false, but a touchforce0 is still being. Am I missing something?
Edit: silly - supplying a more complete list to the zl.union solves for this ^.
I am curious however, why does the test fail in the first configuration? Is it possible to have a streamed list in the style below monitored for multiple messages simultaneously?

if the number of messages is known you could compare stuff one by one and combine the results of the comparators.
if the order is not known or dynamic you might be able to fix that using [pak], [buddy], [bondo] and whatnot.
as far as i can see, one is inable to tell if the order between left and right is secured? i would use a a trigger after the [pack s f] to ensure the order.
you sure that [pack f] is legal now for floats? doesnt work for me in 8.13