Array node

Array Accumulate

Compute running sum or running product of array elements. Each output element is the cumulative result of all previous elements plus itself.

Inputs

PortTypeDefault
ArrayThe list of numbers to accumulate. Cable it from a Variable, an FFT band list or any node that outputs an array; a single point or color also opens up into its components.any—
ModeRunning Sum adds each element to the total, Running Product multiplies. Only 0 and 1 exist; anything else behaves as Running Sum.int0

Outputs

PortType
Resultany
Totalfloat
Countint

How It Works

Array Accumulate produces a new array where each element is the cumulative result of all preceding elements:

  • 0 — Running Sum: [1, 2, 3, 4] → [1, 3, 6, 10]
  • 1 — Running Product: [1, 2, 3, 4] → [1, 2, 6, 24]

Total outputs the final accumulated value (the last element of the result array).

Use Cases

  • Cumulative distribution: Compute a running sum of frequency bins for cumulative spectral analysis.
  • Integration: Approximate discrete integration of a signal by computing the running sum.
  • Position from velocity: Accumulate velocity samples to compute position.
  • Progressive totals: Show running totals in a data dashboard.

Tips

  • For a simple total (not the running array), use Array Sum — it's more efficient when you only need the final number.
  • Running product can overflow quickly with large values — monitor the Total output.

Open Array Accumulate in the interactive catalog →

Array Accumulate 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 Array nodes