Adding all values in a list.

fresh's icon

Is there any object or external that will take a list of integers and add all the values, outputting a single value.

In my case i have a patch which includes a constantly changing list of 25 integer values, for which i need the total value.

I currently have it set up like so:

[list] -> [unpack] -> [expr $i1 + $i2...] -> [number]

This works but is kinda messy, what with 25 values being outputted from the [unpack], and [expr] only supporting 9 inputs (meaning i need 3 of them, plus a further one to add the outputs of those).

Thanks in advance.

:)

Peter Castine's icon

Have you looked at LObjects?

For that matter, you should try maxobjects.com, which would certainly point you to LObjects.

Zachary Seldess's icon

Here's a simple solution using accum:

Zachary

Max Patch
Copy patch and select New From Clipboard in Max.

Ben Bracken's icon

yet another option is [mxj list.sum]

-b