can i display getcell with number boxes?

tomaso's icon

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!!! ***

Wesley Smith's icon

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

Max Patch
Copy patch and select New From Clipboard in Max.

Wetterberg's icon

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

tomaso's icon

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

Emmanuel Jourdan's icon

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

yair reshef's icon

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.

Max Patch
Copy patch and select New From Clipboard in Max.

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
>

tomaso's icon

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 Patch
Copy patch and select New From Clipboard in Max.

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

yair reshef's icon

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