jit.expr help! normalize from center outwards? hypot() comes close…

Jan 25, 2010 at 6:09am

jit.expr help! normalize from center outwards? hypot() comes close…

I’m trying with jit.expr to scale some numbers from the center outwards.
example patch included- any help is much appreciated!
-brian c

– Pasted Max Patch, click to expand. –
#48004
Jan 25, 2010 at 12:47pm

Try using [jit.expr @expr (abs(snorm[0]+snorm[1])+abs(snorm[0]-snorm[1]))*12.5] will work. The last number should be half what you want the outside values to be. There’s probably a much neater way of doing it.

lh

#172612
Jan 26, 2010 at 7:23pm

that is exactly what i was looking for, thank you! now if i could just figure out why that works!

#172613
Jan 26, 2010 at 11:03pm

Well snorm[0] and snorm[1] gives you the signed normalised cell values about the central column/row. Finding the sum and difference gives you the same values running down each of the diagonals. If you find the absolute values of each of these and sum them you’ll get the concentric rings of values where the maximum is 2. Multiplying this by 12.5 scales it from 0 to 50. Try using each of these expressions one by one to see what is happening. I’m not a jitter pro so I did it half trial-and-error half basic maths. There might be an easier way to do it still.

lh

#172614

You must be logged in to reply to this topic.