Logic and Comparison Nodes
Math makes things move. Logic makes things decide.
Until now, Lux could generate values, smooth them, sequence them, and display them. But it couldn’t ask questions. Is this value bigger than that one? Is the mouse inside this region? Is the counter between 5 and 10?
Now it can.
Comparison: 7 nodes
Equal checks if two values are the same. For Numbers, it uses an epsilon comparison (0.000001 tolerance) because floating point equality is a trap. 0.1 + 0.2 doesn’t equal 0.3 in IEEE 754, and I’m not going to make that anyone’s problem.
NotEqual is the opposite. Greater, Less, GreaterEqual, LessEqual do what you’d expect. They all output a Bool (0.0 or 1.0) that you can feed into switches, toggles, and gates.
InRange checks if a value falls between a min and max. One node instead of combining Greater and Less with an And. It’s the kind of convenience that saves you three nodes and a tangle of wires every time you need it.
Boolean: 6 nodes
And, Or, Not, Xor, Nand, Nor. The full set.
These work on Bool values (anything > 0.5 is true, anything <= 0.5 is false). They’re the glue between comparison outputs and control flow nodes like Switch, Toggle, and Select.
A typical pattern: compare a value to a threshold, feed the Bool result into an And with another condition, feed that into a Switch that picks between two visual states. It reads left to right in the node graph, which is the whole point of visual programming.
Why this matters
Logic nodes are what turn a pretty animation into an interactive installation. Without them, your patch does the same thing forever. With them, it responds.
Mouse position compared to a boundary. Counter value compared to a limit. Audio level compared to a threshold. Timer progress compared to a cue point. Each comparison is a decision, and each decision can change what the audience sees.
Combined with the sequencing nodes (Counter, Select, Switch, StateMachine) and the timing nodes (Timer, Metro, OnChange), logic nodes complete the control flow toolkit. Lux can now sense, decide, and act.
That’s 110 nodes total. We’re getting somewhere.