Join a spread of custom datatype from OSC input

Bonsoir all,

This topics derives from a conversation we had on the chat. Here’s the case :

You have a custom datatype that you wanna create a spread of with values coming from OSC.

First, as @Elias pointed out, you cannot use CastAs to convert your Spread<Object> to Spread<Int32> (for instance) to feed your Foreach loop. Instead, you have to use OfType (Sequence) that is available in the DevLib package (more details about on this post from @gregsn).

In the attached patch, the Splicers of the Foreach region are annotated, this is because OfType has to infer its type from downstream.

Here’s what I noticed : if you annotate just one of your splicers with the wrong datatype, all splicers will return No Value Observed.

Of course this is not meant to happen in real life because then you couldn’t connect your splicers to the join node, but I wonder why all splicers would fail if just one of them is not annotated correctly and not linked anywhere ?

Thanks !

seb

EDIT : wow, typing Spread<type> (without flipped quotes) results in just Spread being displayed in the post !

VVVV.Value.OSCStuff.vl (24.5 KB)

hei seb,

apart from the problem… are you aware of the GetValue and GetValues and GetVectorX Nodes in the OSC category?

Nope, I overlooked those, solves the CastAs part :)

Thanks for the pointer !

Ah now I see what you mean. Well if you annotate the splicer with String, the type infered to the OfType node is a Sequence of String and this will be empty as your upstream spread contains only floats, so the whole loop can’t iterate anymore.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.