Forums > Jitter

Index of maximum value in a jitter matrix

December 21, 2008 | 8:08 am

Is there a simple object that will output the coordinate of the maximum value in a matrix? jit.3m tells me what the maximum value is, but not where it happens. I imagine I can build a patch to do it, but it seems like a task that would have a dedicated object. Am I missing something?


December 21, 2008 | 8:16 am

This is what I’m using right now. It gets the job done, but I would really like to avoid using jit.iter.

– Pasted Max Patch, click to expand. –

December 22, 2008 | 9:04 am

Hello,

I don’t know if it is possible without [jit.iter] nor if there is any dedicated object for that, probably senior members could tell us.
For the moment I do that this way (see below)
It gives you the cell which has the bigger value.

#P user jit.pwindow 714 320 82 62 0 1 0 0 1 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 910 209 43 196617 jit.spill;
#P flonum 910 258 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 910 231 65 196617 maximum 0.;
#P user com 923 373 104 196617 9;
#K set 0 42272 28321 8292 25888 27745 8291 25964 30060 27749;
#K end;
#P number 886 371 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 886 331 15 0;
#P newex 886 350 60 196617 gate;
#P newex 886 306 34 196617 == 0.;
#P newex 736 225 29 196617 t b f;
#P newex 736 264 27 196617 i;
#P newex 783 207 40 196617 unpack;
#P newex 783 230 117 196617 expr ($i1+1) + ($i2*2);
#P newex 736 179 41 196617 jit.iter;
#P button 736 122 15 0;
#P newex 736 142 110 196617 jit.noise 1 float32 2 2;
#P fasten 5 0 8 1 741 286 941 286;
#P connect 13 0 7 1;
#P connect 12 0 13 0;
#P connect 14 0 12 0;
#P fasten 0 0 15 0 741 162 720 162;
#P connect 0 0 2 0;
#P fasten 0 0 14 0 741 171 915 171;
#P fasten 4 1 3 1 818 226 895 226;
#P connect 8 0 10 0;
#P connect 9 0 8 0;
#P connect 7 0 9 0;
#P connect 6 1 7 0;
#P connect 4 0 3 0;
#P connect 2 1 4 0;
#P connect 3 0 5 1;
#P connect 6 0 5 0;
#P connect 2 0 6 0;
#P connect 1 0 0 0;
#P window clipboard copycount 16;


December 22, 2008 | 9:23 am

Hi skrasms and Kyred,

Wesley’s great 3rd party object, xray.jit.cellcoords, will help you keep this stuff in Jitter-land.

best,
Zachary

– Pasted Max Patch, click to expand. –

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