can i display getcell with number boxes?

Mar 11, 2007 at 11:49pm

can i display getcell with number boxes?

hello!!

i see that i can use print object to the right outlet of jit.matrix
to see values from getcell…

can i display them in number boxes with unpack or something?
**unpack shows only the cells and not the value!!! ***

#30751
Mar 12, 2007 at 12:10am

This is pretty basic max stuff. Did you look at the help of unpack or
check out the tutorials on it?

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P message 292 215 50 196617 val;
#P newex 292 191 62 196617 prepend set;
#P message 129 199 50 196617 cell;
#P newex 129 175 62 196617 prepend set;
#P number 352 159 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 258 159 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 219 160 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 207 117 83 196617 unpack s 0 0 s 0;
#P newex 136 114 32 196617 print;
#P message 87 60 58 196617 getcell 5 5;
#P newex 78 83 117 196617 jit.matrix 1 char 10 10;
#P connect 3 3 9 0;
#P connect 9 0 10 0;
#P connect 3 4 6 0;
#P connect 3 2 5 0;
#P connect 3 1 4 0;
#P connect 3 0 7 0;
#P connect 7 0 8 0;
#P fasten 0 1 2 0 188 100;
#P connect 0 1 3 0;
#P connect 1 0 0 0;
#P window clipboard copycount 11;

#98851
Mar 12, 2007 at 12:12am

tom skrev:
> hello!!
>
> i see that i can use print object to the right outlet of jit.matrix
> to see values from getcell…
>
> can i display them in number boxes with unpack or something?
> **unpack shows only the cells and not the value!!! ***
>
>
Using an [unpack 0 0 0 0 0 0 0 0] should do it – after all, the output
from jit.matrix when it receives a getcell message is “cell x-coord
y-coord val A R G B”, if I am not mistaken?

Andreas

#98852
Mar 12, 2007 at 12:41am

i checked the help files and tutorials but i dont understand why to put “prepend set” in unpack!!!

also, when its grayscale matrix (with jit.rgb2luma), the values we have arent ARGB ?

I am bit confused although i read the tutorials..

#98853
Mar 12, 2007 at 10:43am

On 12 mars 07, at 01:41, tom wrote:

> i checked the help files and tutorials but i dont understand why
> to put “prepend set” in unpack!!!
>
> also, when its grayscale matrix (with jit.rgb2luma), the values we
> have arent ARGB ?

- set is the message that the object called “message box” understand.
When this message is received the “message box” will change it’s
contents (display something else). The prend object puts whatever it
receives after the “thing” it has as argument.
- jit.rgb2luma convert a 4 planes matrix (ARGB) into a 1 plane matrix
(Grayscale), based on luminance. So at the end, you’ll have only 1
plane.

ej

#98854
Mar 12, 2007 at 11:39am

i don’t know why you want to display cells in a number box. of the top of my
head i think that should only be used as a debugging tool, and not part of
an efficient patch.

check jit.cellblock also. i used it to understand a matrix all the time. not
in actual patch.

#P user jit.cellblock 78 184 398 424 139 9 16 12 20 20 1 0 0 0 0 0 0 0 0 0 0
0 255 255 255 0 0 0 0 0 0 191 191 191 0 0 0 215 215 240 0 0 0 0 1 0 0 1;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 78 160 56 9109513 jit.rgb2luma;
#B color 5;
#P message 123 114 28 9109513 read;
#P toggle 78 94 15 0;
#P newex 78 114 44 9109513 metro 2;
#P newex 78 137 171 9109513 jit.qt.movie 16 12 @interp 1 @unique 1;
#B color 5;
#P connect 4 0 5 0;
#P connect 0 0 4 0;
#P connect 2 0 1 0;
#P fasten 3 0 0 0 128 134 83 134;
#P fasten 1 0 0 0 83 130 83 130;
#P window clipboard copycount 6;

On 3/12/07, Emmanuel Jourdan wrote:
>
> On 12 mars 07, at 01:41, tom wrote:
>
> > i checked the help files and tutorials but i dont understand why
> > to put “prepend set” in unpack!!!
> >
> > also, when its grayscale matrix (with jit.rgb2luma), the values we
> > have arent ARGB ?
>
> – set is the message that the object called “message box” understand.
> When this message is received the “message box” will change it’s
> contents (display something else). The prend object puts whatever it
> receives after the “thing” it has as argument.
> – jit.rgb2luma convert a 4 planes matrix (ARGB) into a 1 plane matrix
> (Grayscale), based on luminance. So at the end, you’ll have only 1
> plane.
>
> ej
>

#98855
Mar 12, 2007 at 3:58pm

i want to display cells in number boxes cause i dont know yet any other way to control midi messages through webcam triggering..

is there another way??

max v2;
#N vpatcher 53 45 1167 724;
#P origin 0 156;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 664 164 57 9109513 random 120;
#P newex 664 513 55 9109513 noteout a 1;
#P newex 409 560 36 9109513 == 255;
#P toggle 664 78 15 0;
#P user uslider 734 214 18 128 500 100 0 0;
#P number 664 399 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 664 112 50 9109513 metro 500;
#B color 5;
#P user uslider 699 213 18 128 128 1 0 0;
#P user uslider 664 212 18 128 128 1 0 0;
#P newex 664 449 80 9109513 makenote 127 50;
#P message 295 541 50 9109513 val;
#P newex 295 517 62 9109513 prepend set;
#P message 132 525 50 9109513 cell;
#P newex 132 501 62 9109513 prepend set;
#P number 355 485 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 236 478 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 197 479 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 210 443 83 9109513 unpack s 0 0 s 0;
#P comment 115 30 135 9109513 Use live camera input;
#B frgb 255 255 255;
#P message 201 81 46 9109513 settings;
#P message 166 81 33 9109513 close;
#P message 134 81 30 9109513 open;
#P toggle 95 30 15 0;
#P newex 95 54 45 9109513 metro 33;
#P newex 95 116 131 9109513 jit.dx.grab 160 120 @unique 1;
#P message 113 344 70 9109513 getcell 20 20;
#P newex 77 383 27 9109513 t l b;
#P newex 113 394 77 9109513 jit.matrix data;
#P comment 257 286 69 9109513 reduce flicker;
#P newex 77 311 173 9109513 jit.op @op > @val 0.3 @out_name data;
#P newex 77 285 156 9109513 jit.slide @slide_up 1 @slide_down 2;
#P flonum 174 227 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 77 259 106 9109513 jit.op @op > @val 0.2;
#P comment 213 231 68 9109513 set threshold;
#P newex 95 151 66 9109513 jit.rgb2luma;
#P newex 95 186 27 9109513 t l l;
#P newex 76 216 89 9109513 jit.op @op absdiff;
#P user jit.pwindow 334 161 322 242 0 1 0 0 1 0;
#P fasten 2 1 1 0 117 210 81 210;
#P connect 1 0 5 0;
#P connect 5 0 7 0;
#P connect 7 0 8 0;
#P connect 8 0 11 0;
#P connect 15 0 14 0;
#P fasten 18 0 13 0 206 102 100 102;
#P fasten 17 0 13 0 171 102 100 102;
#P fasten 16 0 13 0 139 102 100 102;
#P connect 14 0 13 0;
#P connect 13 0 3 0;
#P connect 3 0 2 0;
#P connect 11 1 12 0;
#P fasten 12 0 10 0 118 377 118 377;
#P fasten 20 0 24 0 215 500 137 500;
#P connect 24 0 25 0;
#P fasten 2 0 1 1 100 210 160 210;
#P connect 6 0 5 1;
#P fasten 20 1 21 0 233 470 202 470;
#P connect 10 1 20 0;
#P fasten 20 2 22 0 251 470 241 470;
#P fasten 20 3 26 0 269 516 300 516;
#P connect 26 0 27 0;
#P connect 11 0 0 0;
#P fasten 20 4 23 0 287 473 360 473;
#P fasten 23 0 35 0 360 530 414 530;
#P connect 34 0 31 0;
#P connect 35 0 31 0;
#P connect 31 0 37 0;
#P fasten 37 0 29 0 669 197 669 197;
#P connect 29 0 32 0;
#P connect 32 0 28 0;
#P connect 28 0 36 0;
#P fasten 28 1 36 1 739 490 691 490;
#P connect 30 0 28 1;
#P connect 33 0 28 2;
#P pop;

i want to do simple things…when something from webcam touchs a cell (or a series of cells) to trigger midi!!

also to get values from a region i used submatrix, but the offset
attribute enlarges the matrix only to the right!!
how can i select a specific location with submatrix??

#98856
Mar 12, 2007 at 4:30pm

i take it back, for what you do thats a good method as any.
look at tutorial 14 (i think) for matrix repositioning.
you can also use a combination of scissors+ glue+ jit.3m

On 3/12/07, tom wrote:
>
>
> i want to display cells in number boxes cause i dont know yet any other
> way to control midi messages through webcam triggering..
>
> is there another way??
>
> max v2;
> #N vpatcher 53 45 1167 724;
> #P origin 0 156;
> #P window setfont “Sans Serif” 9.;
> #P window linecount 1;
> #P newex 664 164 57 9109513 random 120;
> #P newex 664 513 55 9109513 noteout a 1;
> #P newex 409 560 36 9109513 == 255;
> #P toggle 664 78 15 0;
> #P user uslider 734 214 18 128 500 100 0 0;
> #P number 664 399 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
> #P newex 664 112 50 9109513 metro 500;
> #B color 5;
> #P user uslider 699 213 18 128 128 1 0 0;
> #P user uslider 664 212 18 128 128 1 0 0;
> #P newex 664 449 80 9109513 makenote 127 50;
> #P message 295 541 50 9109513 val;
> #P newex 295 517 62 9109513 prepend set;
> #P message 132 525 50 9109513 cell;
> #P newex 132 501 62 9109513 prepend set;
> #P number 355 485 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
> #P number 236 478 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
> #P number 197 479 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
> #P newex 210 443 83 9109513 unpack s 0 0 s 0;
> #P comment 115 30 135 9109513 Use live camera input;
> #B frgb 255 255 255;
> #P message 201 81 46 9109513 settings;
> #P message 166 81 33 9109513 close;
> #P message 134 81 30 9109513 open;
> #P toggle 95 30 15 0;
> #P newex 95 54 45 9109513 metro 33;
> #P newex 95 116 131 9109513 jit.dx.grab 160 120 @unique 1;
> #P message 113 344 70 9109513 getcell 20 20;
> #P newex 77 383 27 9109513 t l b;
> #P newex 113 394 77 9109513 jit.matrix data;
> #P comment 257 286 69 9109513 reduce flicker;
> #P newex 77 311 173 9109513 jit.op @op > @val 0.3 @out_name data;
> #P newex 77 285 156 9109513 jit.slide @slide_up 1 @slide_down 2;
> #P flonum 174 227 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
> #P newex 77 259 106 9109513 jit.op @op > @val 0.2;
> #P comment 213 231 68 9109513 set threshold;
> #P newex 95 151 66 9109513 jit.rgb2luma;
> #P newex 95 186 27 9109513 t l l;
> #P newex 76 216 89 9109513 jit.op @op absdiff;
> #P user jit.pwindow 334 161 322 242 0 1 0 0 1 0;
> #P fasten 2 1 1 0 117 210 81 210;
> #P connect 1 0 5 0;
> #P connect 5 0 7 0;
> #P connect 7 0 8 0;
> #P connect 8 0 11 0;
> #P connect 15 0 14 0;
> #P fasten 18 0 13 0 206 102 100 102;
> #P fasten 17 0 13 0 171 102 100 102;
> #P fasten 16 0 13 0 139 102 100 102;
> #P connect 14 0 13 0;
> #P connect 13 0 3 0;
> #P connect 3 0 2 0;
> #P connect 11 1 12 0;
> #P fasten 12 0 10 0 118 377 118 377;
> #P fasten 20 0 24 0 215 500 137 500;
> #P connect 24 0 25 0;
> #P fasten 2 0 1 1 100 210 160 210;
> #P connect 6 0 5 1;
> #P fasten 20 1 21 0 233 470 202 470;
> #P connect 10 1 20 0;
> #P fasten 20 2 22 0 251 470 241 470;
> #P fasten 20 3 26 0 269 516 300 516;
> #P connect 26 0 27 0;
> #P connect 11 0 0 0;
> #P fasten 20 4 23 0 287 473 360 473;
> #P fasten 23 0 35 0 360 530 414 530;
> #P connect 34 0 31 0;
> #P connect 35 0 31 0;
> #P connect 31 0 37 0;
> #P fasten 37 0 29 0 669 197 669 197;
> #P connect 29 0 32 0;
> #P connect 32 0 28 0;
> #P connect 28 0 36 0;
> #P fasten 28 1 36 1 739 490 691 490;
> #P connect 30 0 28 1;
> #P connect 33 0 28 2;
> #P pop;
>
>
> i want to do simple things…when something from webcam touchs a cell (or
> a series of cells) to trigger midi!!
>
> also to get values from a region i used submatrix, but the offset
> attribute enlarges the matrix only to the right!!
> how can i select a specific location with submatrix??
>

#98857

You must be logged in to reply to this topic.