In the most simplest scenario you want to switch between two inputs according to the result of some boolean operation (0 and 1).
This is what the Switch (Value Input) is for.
By default the Switch node has 2 inputs to switch between: in case of 0 Input 1 and in case of 1 Input 2.
The Switch node can accept any number of inputs to switch between by setting the Input Count via the Inspektor. The Switch input then takes an integer value ranging from 0 to Count-1 to switch between the inputs.
- If you want to apply a LERP (linear interpolation) between the inputs instead of switching between them have a look at InputMorph (Value).
- In order to switch Values according to a String, have a look at Case (Value Input).
Alternatively to switching between multiple individual values you can use the GetSlice (Spreads) as shown to switch between the slices of a spread.
There is no special Boolean datatype in vvvv. Boolean values are simply represented by 0 (false, off) and 1 (true, on). Use the following nodes for basic boolean operations:
- AND (Boolean)
- OR (Boolean)
- NOT (Boolean)
- XOR (Boolean)
, <, =,... return 0 or 1.
There are some special nodes that return a Boolean according to a change in state.
- Detect if a value was changed: Change (Animation)
- Detect a change from 0 to 1 or 1 to 0: TogEdge (Animation)
- Toggle the output on and off by every bang on the input: Toggle (Animation)
- Set the output to 1 until there is a bang on Reset: FlipFlop (Animation)
- Set the output to 1 for a specified amount of time: MonoFlop (Animation)
See the helppatches of these nodes for details.
When patching anything that can be separated into a series of states and events that cause transition from one state to another you are likely looking for Automata (Animation). Also the Automata has an automata built in.