CreatorDocumentation 0.3.2 beta
Documentation sectionsIn this article
CREATOR / Collections

Reduce

reduce · v1

Folds a collection through a custom subgraph, starting from Initial.

Reduce
Inputs
Outputs
Select a port to see its purpose and an example connection. Its reference row will highlight.

Ports and connections

The default configuration is shown below. Types and capacity can change in node properties; configure the node before connecting ports.

Port / IDTypeConnection
CollectioncollectionarraySource collection. Select the matching Array or List type in node properties.Required
InitialinitialnumberControls Initial with a number stream. Without a wire, the manual value is 0.Manual value when disconnected
OutputoutnumberThe number result of Reduce, available to other nodes on every sample.Output

An output can feed multiple inputs of the same type. An input has one source; Function also requires matching signatures. All connection rules →

Parameters

Values describe manual settings. A connected stream replaces a parameter’s manual value; disconnecting restores it.

ParameterRangeDefaultControl
Initialinitial-1000000…10000000Input or manualLinear scale

Node properties

These settings are configured before compilation and cannot be modulated by wires.

Value type
Array or List · default Array

The Collection input accepts the selected type; collection outputs use the same type.

Body
Created with the node · default Item → Result

Double-click or choose Open node. Map receives item:Number and index:Integer. Reduce also receives accumulator:Number. The only output is Number.

How to use it

Use a subgraph with accumulator:Number, item:Number and index:Integer inputs, and accumulator + item as its Number output; Initial = 0, [1, 2, 3] → 6.

Things to check

Inputs are identified by item, index and accumulator IDs. The body supports elementary nodes only; its output must be Number.

Check required inputs and matching types. Run Compile before auditioning; a validation failure preserves the previous working module. Troubleshooting →