Logic node

Hold Value

A sample-and-hold gate for any data type. While Update is true the input flows straight through and is continuously stored; the moment Update goes false the node freezes and keeps emitting the last value it saw. Use it to latch a measurement, freeze an animation mid-flight, or snapshot live data for later comparison. The Value ports adopt whatever type and array-ness is connected, so floats, colors, strings, structures, and arrays all hold correctly.

Inputs

PortTypeDefault
ValueThe data to pass or freeze. Any type works — the port adopts whatever you connect, single values or arrays, and the output follows it.any—
UpdateWhile on, data flows straight through and is stored; while off the last stored value keeps coming out. Unconnected it defaults to on.booltrue

Outputs

PortType
ValueThe data to pass or freeze. Any type works — the port adopts whatever you connect, single values or arrays, and the output follows it.any

How It Works

Pass-through vs. hold. Each frame the node resolves Update:

UpdateBehavior
trueThe live input is stored and output — the node is transparent.
falseThe stored value is output; the live input is ignored.

Unlike an edge-triggered node, Hold Value is level-driven: it is the state of Update that matters, not its transitions. Holding starts and ends the instant Update flips.

First-frame / fresh-load capture. If Update is false and nothing has been stored yet (a freshly loaded project whose Update cable is already false), the node captures the current live value on that frame and freezes it. It never streams live data against a false gate, and it never outputs a stale nothing. If there is no live value and nothing stored, the output falls back to Float(0).

Load-safe Update resolution. The Update port is resolved with three cases, in order:

  1. A resolvable cable value — used, and remembered as the last known cable state.
  2. Connected but not yet resolvable (typical during the first frames after a project load) — the last known cable value is used, or false if there is none. A false cable must never be mistaken for the unconnected default.
  3. Not connected — the node's own model value is used, defaulting to true (transparent pass-through).

Port type adoption. The Value input and Value output both adopt the connected source's port type and its array flag, so the held type is visible in the graph (cable colors) and carried downstream. Adoption also runs immediately on connect, disconnect, and project load — without that, a Hold Value whose output nothing consumes yet would be lazy (never processed) and its ports would stay gray until data first flowed. When the type changes, the held value is discarded: a value stored under the previous type is meaningless after a re-type. Disconnecting reverts the ports to .any.

State lifecycle. The held value, the last synced type, and the last known Update state are runtime-only — never written to the node's persistent storage. Per Grafit's event-logic conventions, the held value re-initializes on project load (and per-frame writes must not touch editor-observed storage, which would keep the on-demand editor awake). Deleting the node clears its state.

Parameters in Depth

Value (any) — the data to pass through or hold. The port type is not fixed: it becomes the type of whatever is connected, including array-ness, so a Points structure, a color, a JSON string, or a plain float are all handled identically. Reconnecting a different type resets the held contents.

Update (bool, default true) — the gate level. True = transparent (store and pass); false = frozen (emit the stored value). Accepts bool or float cables (a float above 0.5 reads as true). With nothing connected the default true makes the node a no-op, so you can insert it into a chain first and add the gating logic afterwards. Note the load-safe rule above: while a connected Update is momentarily unresolvable, the node assumes false rather than true, so a project reopens in a held state instead of leaking a frame of live data.

Value (output, any) — the passed or held data, typed to match the input.

Use Cases

  • Freeze-frame on a beat: Audio Beat Detection (Kick) → Logic (NOT) → Hold Value (Update), with Mouse (X) → Hold Value (Value) → Canvas (Position X) — the position freezes for the duration of every kick and resumes between hits.
  • Latch a peak reading: Audio Analysis (level) → Compare (above threshold) → Do Once → Hold Value (Update) captures the exact value at the moment a threshold was first crossed, then displays it via Text as Image → Canvas.
  • Manual snapshot button: Keyboard (key) → Logic (NOT) → Hold Value (Update) lets a performer freeze an entire live parameter set — Hold Value works on structures, so a single Make Structure bundle can be frozen with one node.
  • Stabilize noisy input: Vision Tracking (landmark position) → Hold Value gated by a confidence Compare keeps the last good position on screen whenever tracking confidence drops, instead of snapping to garbage.
  • Frozen backdrop layer: Camera Input (Image) → Hold Value (Update from a Timer) → Canvas holds a still camera frame as a background plate while a live layer animates in front of it.
  • Before/after comparison: one branch goes live to a Canvas, the other through Hold Value into a second Canvas, so a frozen reference sits beside the evolving image for A/B judging during a set.

Tips

  • Hold Value is level-driven, not edge-driven — invert an event-like signal with Logic (NOT) when you want "hold while something is true".
  • Changing the connected type intentionally clears whatever was held; re-patching a Hold Value mid-show starts it empty rather than emitting a mismatched leftover.
  • It holds any type, including arrays and structures — freezing a whole Points set or a Make Named Structure bundle costs one node instead of one per channel.
  • With Update unconnected the node is fully transparent (default true), so it is safe to leave in a chain while you build the gating logic.
  • The held value does not survive a save/load: the node reopens holding whatever it captures on its first processed frame. Use Set Variable / Get Variable if a value must persist across sessions.
  • Related nodes: Do Once (gate a trigger once instead of holding data), Switch (choose between sources rather than freeze one), Delay (recall a value from N seconds ago instead of freezing indefinitely), Smooth (soften a signal instead of stopping it).

Open Hold Value in the interactive catalog →

Hold Value is one of 381 nodes in Grafit Pro.

Free download. Every feature for 7 days, no card. Then €99.99 once — or keep playing your projects as a Player.

More Logic nodes