Forums > Jitter

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

Jan 25 2010 | 6:09 am

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. --

Jan 25 2010 | 12:47 pm

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.


Jan 26 2010 | 7:23 pm

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

Jan 26 2010 | 11:03 pm

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.


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

Forums > Jitter