Expression CHOP - do operation for every sample in a channel

Hi everyone,

With the Expression CHOP, we can easily do an operation on 2 inputs, like this:

But how do I do this operation on every single sample of a channel of say 16 samples?

The solution I’ve been using is the Script CHOP, but surely there is an easier way!

Thanks :slight_smile:

You can feed the expression the current sample and channel index that are evaluated.
abs(me.inputs[0][me.chanIndex][me.sampleIndex] - me.inputs[1][me.chanIndex][me.sampleIndex])

Ah thanks for that! Have been looking for this.

just wanted to point also to the Math CHOP which for the particular case does a great job: