Array node
Array Rotate
Cyclic shift array elements. Positive Steps shift right (elements at the end wrap to the beginning), negative Steps shift left (elements at the beginning wrap to the end).
Inputs
| Port | Type | Default |
|---|---|---|
| ArrayThe list to shift around. Cable any array here; an empty one passes through untouched. | any | — |
| StepsHow far the list slides, positive to the right and negative to the left. Any value works — it wraps around the length, so 1 and length plus 1 look the same. | int | 1 |
Outputs
| Port | Type |
|---|---|
| Result | any |
| Count | int |
How It Works
Array Rotate performs a circular shift on the array by the specified number of Steps:
- Positive Steps (right rotation): Elements at the end of the array wrap around to the beginning.
[1,2,3,4,5]rotated by 2 →[4,5,1,2,3] - Negative Steps (left rotation): Elements at the beginning wrap around to the end.
[1,2,3,4,5]rotated by -1 →[2,3,4,5,1]
Steps larger than the array length wrap around (modulo operation).
Use Cases
- Scrolling displays: Animate a rotation to create a scrolling data ticker or marquee effect.
- Phase shifting: Rotate a waveform array to shift its phase.
- Round-robin selection: Rotate through a set of options by incrementing Steps each frame.
- Data alignment: Shift two arrays relative to each other to align correlated signals.
Tips
- Rotating by the array length (or any multiple) returns the same array — it completes a full cycle.
- Connect a Timer or counter to Steps for animated rotation.
Open Array Rotate in the interactive catalog →
Array Rotate 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.