[jitter] getcell equivalent in jit.expr?
Aaron Faulstich
afaulsti at hotmail.com
Mon Dec 31 10:03:46 MST 2007
- Previous message: [jitter] cc.colormap help
- Next message: [jitter] getcell equivalent in jit.expr?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I've been simplifying some patches with jit.expr, and I'd like to use specific scalar cell values from an input matrix within the calculations. Is there a simple way to do this? The only way I have been able is by making a separate matrix that takes getcell messages and outputs to additional inputs of a jit.expr object. Such a method works, but seems very wasteful to me. It's also not easy to expand to multiple simultaneous cells without making a new matrix for finding each value needed. Is there a way of doing this inside the jit.expr itself? For example, with a 1D vector I want the value when cell[0]==50 Initially I tried "sum((cell[0]==50)*in(0))", but found there was no summation command. Here is a simple patch to hopefully explain visually. #P window setfont "Sans Serif" 9.; #P window linecount 1; #P newex 237 152 26 9109513 print; #P message 311 115 56 9109513 getcell \$1 0; #P window setfont "Sans Serif" 14.; #P comment 177 341 444 9109518 This pwindow shows the point from which I'd like to get a scalar value; #P window linecount 2; #P comment 359 239 157 9109518 Trying to get scalar value at this input cell; #P window setfont "Sans Serif" 9.; #P number 310 252 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0; #P user jit.pwindow 135 283 514 52 0 1 0 0 1 0; #P toggle 66 89 15 0; #P window linecount 1; #P newex 66 113 50 9109513 qmetro 50; #P newex 136 250 153 9109513 jit.expr @expr (cell[0]==in[1])*in[0]; #P button 137 46 15 0; #P newex 137 61 45 9109513 loadbang; #P newex 137 133 110 9109513 jit.matrix 1 float32 512 1; #P user jit.pwindow 136 178 514 52 0 1 0 0 1 0; #P newex 137 97 160 9109513 jit.expr @expr "abs(sin(norm[0]*10))"; #P newex 137 79 110 9109513 jit.matrix 1 float32 512 1; #P window setfont "Sans Serif" 14.; #P window linecount 2; #P comment 256 51 117 9109518 Starting Matrix \, arbitrary function; #P connect 9 0 8 0; #P fasten 4 0 7 0 142 165 123 165 123 243 141 243; #P connect 7 0 10 0; #P connect 6 0 5 0; #P connect 5 0 1 0; #P connect 1 0 2 0; #P connect 2 0 4 0; #P connect 14 0 4 0; #P connect 8 0 4 0; #P connect 4 0 3 0; #P connect 4 1 15 0; #P fasten 11 0 7 1 315 274 298 274 298 240 284 240; #P connect 11 0 14 0; #P window clipboard copycount 16;
- Previous message: [jitter] cc.colormap help
- Next message: [jitter] getcell equivalent in jit.expr?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
