Switch(Value) with spreaded switch and inputs OR cap numbers

Hi everyone,

I havent used vvvv in a while and just working on something again. I cant think of the right node to use for this.

So I am comparing a spread of numbers to a single number seeing if it is bigger than or not. Using that result I want to switch to either input 1 or input 2, but for each slice individually.

As far as I can tell the switch(value) only accepts a single switch value and not one for each slice of the inputs.

What I need is a way to pass a slice from either input 1 or input 2.

In the end I just want to cap numbers at a certain value (but not remapping). There might be a different node for this as well, but it would be great to find a solution to spreaded switching as well.

Thanks for your help.

pick_and_choose.v4p (7.5 KB)

first: the “Switch” input of the Switch (Value Input) is indeed spreadable. you can find out if a pin in spreadable via the inspektor as described here: https://vvvv.org/documentation/tutorial-inspektor#viewing-a-pins-slices

then: i don’t really understand the role of Scroll (Spreads) in your patch but if you’re actually only looking for a way to clamp (as we call it) values to a certain range, then try Map (Value) with its “Mapping” input set to Clamp and both source/destination min and source/destination max set to the same values (so you don’t get any mapping).

Thank you Joreg, I just realized now that I am an idiot and didnt look properly (it was getting late). I simply should be using a > and not <. Doh!

But if there is a clamp mode in Map, that IS good to know and will serve much better in this case!

The scroll was there to have spreads of equal size, but I guess that is not needed here. I have been using too many other visual programming tools, I get mixed up where data needs to match and where not after not using a tool for a while.

What about Min (Value)?

Min.v4p (5.9 KB)

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