Forums > Jitter

brainfart – "pushing" a smaller matrix into larger one

October 15, 2006 | 4:11 am

Hello, sorry for the lame question, but I’ve struggled long enough. I’ve tried scanwrap, repos, scanoffet, and just offset messages. I know this is simple, in fact I think I’ve done it before but?.

I just want to insert a matrix into another matrix pushing the data down the line. I can do this with lists, but do I really need to leave the matrix realm?

ie.

bang
|
V
jit.matrix 512 1
|
| (What goes here?)
V
jit.matrix 512 512

I want this data to go in at address 0,0. The rest of the matrix should scroll down to (0,1), what was at (0,1) before now goes to (0,2) etc. Lines that have not been filled should read 0. Data that falls off the end disappears.

Christopher Overstreet


October 15, 2006 | 4:31 am

Try this:
wes

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 129 62 57 196617 qmetro 50;
#P flonum 85 135 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 129 38 15 0;
#P newex 129 216 53 196617 t l b b b;
#P message 171 243 349 196617 srcdimstart 0 0 , srcdimend 511 510 ,
dstdimstart 0 1 , dstdimend 511 511;
#P newex 157 294 94 196617 jit.matrix @thru 0;
#P message 143 263 325 196617 srcdimstart 0 0 , srcdimend 511 0 ,
dstdimstart 0 0 , dstdimend 511 0;
#P user jit.pwindow 21 185 87 20 0 1 0 0 1 0;
#P user jit.pwindow 128 379 87 235 0 1 0 0 1 0;
#P user jit.cellblock 359 380 701 591 3 9 512 512 45 17 0 1 1 0 0 0 1
1 1 0 0 0 255 255 255 0 0 0 0 0 0 191 191 191 0 0 0 215 215 240 1 1 1
0 4 0 0 0;
#P user jit.cellblock 353 187 700 229 3 9 512 1 45 17 0 1 1 0 0 0 1 1
1 0 0 0 255 255 255 0 0 0 0 0 0 191 191 191 0 0 0 215 215 240 1 1 1 0
4 0 0 0;
#P newex 129 109 40 196617 / 511.;
#N counter 0 0 512;
#X flags 0 0;
#P newobj 129 87 83 196617 counter 0 0 512;
#P message 129 135 77 196617 setall $1 , bang;
#P newex 129 323 295 196617 jit.matrix data 1 float32 512 512
@usesrcdim 1 @usedstdim 1;
#P newex 129 157 130 196617 jit.matrix 1 float32 512 1;
#P fasten 0 0 8 0 134 180 27 180;
#P connect 0 0 12 0;
#P fasten 0 0 5 0 134 180 358 180;
#P fasten 4 0 14 0 134 130 90 130;
#P connect 4 0 2 0;
#P connect 1 0 7 0;
#P fasten 1 0 10 0 134 357 429 357 429 286 162 286;
#P fasten 1 0 6 0 134 357 364 357;
#P connect 9 0 1 0;
#P fasten 10 0 1 0 162 317 134 317;
#P connect 12 2 10 0;
#P connect 12 0 1 0;
#P connect 11 0 1 0;
#P connect 12 3 11 0;
#P connect 12 1 9 0;
#P connect 15 0 3 0;
#P connect 13 0 15 0;
#P connect 3 0 4 0;
#P connect 2 0 0 0;
#P window clipboard copycount 16;


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