Forums > MaxMSP

equation

June 22, 2011 | 11:13 am

hi

i try to make the equation on the pict.

corresponding to Multiply the x coordinate of each vertex by the y coordinate of the next vertex.

like this : ($1 * $4) + ($3 * $6) + ($5 * $8) + ($7 * $10) + ($9 * $12)

if anyone can help me !
thanks
f

[attachment=164828,2384]

Attachments:
  1. area.tiff


Jan
June 22, 2011 | 11:17 am

This seems to a perfect task for [expr].


June 22, 2011 | 11:57 am

yes sure…. but if i write it on the form : ($i1 * $i4) + ($i3 * $i6) + ($i5 * $i8) + ($i7 * $i10) + ($i9 * $i12) expr don’t work, be in black and max window say $ symbol variable out of range…
i don’t know what kind of operators used or is it necessary to used several expr ?

thanks
f


June 22, 2011 | 12:05 pm

like this is ok but maybe tyey are a most effective way ?

– Pasted Max Patch, click to expand. –

thanks
f



Jan
June 22, 2011 | 12:12 pm

cant’ see your patch here. but the error message is because [expr] takes only up to nine arguments. so you could split the tasks into two expressions or maybe do it in Javascript using a single [js].


June 22, 2011 | 12:21 pm

ok

thanks
f


June 22, 2011 | 12:59 pm

split it up.

if it is a list, use something like zl iter 2 or zl iter 4, then write an an expr.


June 22, 2011 | 10:33 pm

Throw some iteration in there and do the maths:

– Pasted Max Patch, click to expand. –

June 23, 2011 | 11:03 am

hi

thanks Luke, this run good and seems me the most efficiently, and can run with different size of list…

all the best
f


June 23, 2011 | 10:09 pm

Not a problem, scalability is always good. This way you can change the list length and the offset, happy to help!


Viewing 10 posts - 1 through 10 (of 10 total)