Multiplying two lists against each other.

Rob Hinnenthal's icon

I feel like a complete moron searching for the answer for this and coming up with nothing. What I am looking for is how to take 2 lists of numbers and multiply them based on their index. for example:

[1 2 3 4 5] [2 1 2 3 2] would return [2 2 6 12 10]

just taking the number and multiplying it against it's corresponding number in the list.

jvkr's icon

vexpr does the trick.

Rob Hinnenthal's icon

you're my hero

Peter McCulloch's icon

Something to add to the memory bank: vexpr with @scalarmode 1 lets you do operations on combinations of lists and single values. ("I want to scale this list of delay times by x...")

You can save a ton of patch cords with this.