Array node
Array Set
Accumulate values into a local array with append, insert, replace, remove, clear, and set all operations. Supports time-windowed buffering, duplicate avoidance, reverse order, and maximum length trimming — the primary node for building dynamic arrays.
Inputs
| Port | Type | Default |
|---|---|---|
| ValueThe value written into the stored list whenever the gate is open. Anything can be cabled here — a float, a string, a color, a point. | any | — |
| SetThe gate that lets values in. This is a level, not a pulse: while it stays true the operation runs every frame, so cable a trigger if you want one write. | bool | false |
| OperationWhat happens on each write: append to the end, insert, replace, remove, clear, or set the whole list at once. Values outside the list fall back to append. | int | 0 |
| IndexWhere insert, replace and remove act. Negative counts back from the end, and out-of-range values are pulled to the nearest existing position. | int | 0 |
| ReverseFlips the order on the way out only. The stored list itself keeps its original order. | bool | false |
| Avoid DuplicateSkips a write when the value is identical to the one already there, so a held signal does not flood the list. Ignored in the time window modes, where every sample must land. | bool | true |
| SourceA second list for the set all operation, used when nothing is cabled to the array input. Expects a bundle of elements, not a single value. | structure | — |
| ArrayThe replacement list for the set all operation — cable it from Array Make or any node that outputs an array. It takes priority over the source input. | any | — |
| Trim ModeHow the list is kept from growing forever: by a maximum count, by a time window with a declared rate, or by a time window that accepts whatever arrives. Unknown values fall back to max length. | int | 0 |
| Max LengthThe largest number of elements kept; older ones drop off the front. 0 means no limit, so the list grows until something clears it. | int | 0 |
| Time WindowHow many seconds of history to keep. Not clamped; a fraction of a second gives a twitchy buffer, and very long windows quietly hold a lot of samples. | float | 2.0 |
| Sample RateHow many samples per second the fixed window accepts, and what it uses to size the buffer. 0 or less removes the gate and lets every frame through. | int | 25 |
Outputs
| Port | Type |
|---|---|
| ArrayThe replacement list for the set all operation — cable it from Array Make or any node that outputs an array. It takes priority over the source input. | any |
| Count | int |
| First | any |
| Last | any |
| Actual Rate | float |
| Ready | bool |
How It Works
Array Set maintains an internal array that persists between frames. When Set receives a true pulse, the node performs the selected Operation on the array:
- 0 — Append: Adds the Value to the end of the array.
- 1 — Insert: Inserts the Value at the specified Index, shifting subsequent elements.
- 2 — Replace: Overwrites the element at Index with Value.
- 3 — Remove: Removes the element at Index.
- 4 — Clear: Empties the entire array.
- 5 — Set All: Replaces the entire array contents from the Source input.
Trim Mode controls automatic size limits:
- 0 — None: Array grows without limit.
- 1 — Max Length: When the array exceeds Max Length, oldest elements are removed.
- 2 — Time Window: Keeps only elements from the last N seconds, sampled at the specified rate.
Use Cases
- Data recording: Append sensor readings each frame to build a time series for plotting or analysis.
- Rolling buffers: Use Time Window trim mode to maintain a sliding window of recent values — ideal for EEG visualization or real-time spectrograms.
- Dynamic lists: Build user-editable lists by combining with UI Text interactive inputs for add/remove operations.
- Batch collection: Accumulate results from multiple processing steps, then pass the complete array to downstream nodes.
Tips
- Avoid Duplicate prevents the same value from being appended twice in a row — useful when the Set trigger fires faster than data changes.
- Reverse flips the array order in the output (newest first instead of oldest first).
- The Ready output becomes true when Time Window buffering has filled the requested window duration.
- Actual Rate reports the effective sample rate, accounting for any throttling — useful for verifying buffer timing.
- Use Operation 5 (Set All) with a Source structure to bulk-load data from JSON or other structured sources.
Open Array Set in the interactive catalog →
Array Set 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.