Perform operations on list elements from coll

bubbleandsquawk's icon

I'm a bit stuck on this. I have a [coll] that is outputting lists of integer pairs (eg. index, val1 val2). I would like to perform an addition on just the first element of the lists (index, (val1+x) val2).

In addition, I would like to perform the calculation only on values that are greater than a given index, so if given an index 1 for a coll containing four lists (0-based), the operation is only calculated on lists indexed 2 and 3.

Finally, I need to join them back up with their associated index.

I have a semi functional patch that just performs the operation on each individual index and downstream selects whether or not it will pass the processed list or the unprocessed lists according to a given index, before collecting it all back into another [coll]. It is pretty clunky though and because the selected index is changing, the indexed data can get a bit scrambled up. I can't help but think there's a more robust solution.

The data is for writing to a [function], essentially mimicking the behaviour of the mouse mode "shift", but for numeric input instead of mousing.

TFL's icon

The thing tht might be tricky with coll is that it outputs the index before the content. A buddy can help here.

You can also use the same coll to store the modified data.


Max Patch
Copy patch and select New From Clipboard in Max.
Source Audio's icon

or split index range if needed

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

bubbleandsquawk's icon

Thanks for the responses folks. Got it working nicely. :)