Animation: FrameDelay, StateMachine, and Timeline
Some nodes need to remember. Not just their parameters, but their history. What was the value last frame? What state are we in? Where are we on this timeline?
These are the state nodes. They give Lux memory.
FrameDelay
Outputs last frame’s input. That’s it. One frame of delay.
Why is this important? Because it enables feedback loops in a DAG.
Lux’s graph is a directed acyclic graph. You can’t wire a node’s output back to its own input, the evaluator would loop forever. But a FrameDelay breaks the cycle. Wire the output of your chain into a FrameDelay, wire the FrameDelay’s output back to the start, and now each frame sees the previous frame’s result.
This is how you build accumulation effects. A position that drifts. A color that slowly shifts. A trail that fades. Reaction-diffusion patterns. Particle simulations. Anything where “what happened before” influences “what happens next.”
I use binary encoding for Number, Int, and Bool values in save/restore to keep it fast, with a JSON fallback for complex types. The state serialization can’t be slow because FrameDelay is going to be in a lot of patches.
StateMachine
Named states with transitions. Define your states (idle, active, cooldown, etc.), define what transitions are valid (idle can go to active, active can go to cooldown, cooldown can go to idle), and then trigger transitions by name.
The node outputs the current state name and index. Wire the index into a select node and you can pick different behaviors per state. Wire the state name into a comparison and you can branch your logic.
State machines are the backbone of anything interactive. An installation that has a standby mode, an attract mode, and an active mode. A visual that has phases. A game-like experience with levels.
You could hack this together with counters and toggles. But naming your states “attract” and “active” instead of “0” and “1” makes the patch readable six months later when you’ve forgotten how it works.
Timeline
Keyframed values over time. Set value A at time 0, value B at time 1.5, value C at time 3.0, and the timeline interpolates between them using whichever easing curve you pick.
This is for choreographed animation. When you know exactly what should happen and when. An installation that has a 30-second loop. A projection piece with timed transitions. A demo reel.
The timeline can play, pause, loop, and scrub. Feed it an external time value and it becomes a lookup table. Feed it the output of a timer and you get precise control over when each keyframe hits.
Why state matters
Without state, every frame is independent. The patch computes the same output for the same inputs regardless of history. That’s fine for pure generative work, but the moment you want interaction, accumulation, or choreography, you need memory.
These three nodes give Lux the ability to remember. FrameDelay for raw frame-to-frame feedback. StateMachine for high-level behavioral states. Timeline for choreographed sequences.
Combined with the oscillators, smoothing, timing, and sequencing nodes, Lux now has a complete animation toolkit. Things move, things flow, things happen at the right time, things remember what came before.
The static patch era is over.