Forums > MaxMSP

another expr issue

January 5, 2010 | 3:13 pm

Hello,

I want to manage 2 expr in one [jit.expr] object … without success
Could anyone give help.

This:
jit.expr @expr "((cell[0]*0.1)*2.)-1." "((cell[0]*0.1)*1.5)-0.75"
does not work

but this:
jit.expr @expr "((cell[0]*0.1)*2.)-1."
with
jit.expr @expr "((cell[0]*0.1)*1.5)-0.75"
packed inside [jit.pack 2] , work nice.

In Max5 I tryed:
jit.expr @expr (((cell[0]*0.1)*2.)-1.) (((cell[0]*0.1)*1.5)-0.75)
jit.expr @expr "((cell[0]*0.1)*2.)-1." "((cell[0]*0.1)*1.5)-0.75"
jit.expr @expr ((cell[0]*0.1)*2.)-1. ((cell[0]*0.1)*1.5)-0.75

but it is a hard way …

thanks.

max v2;
#N vpatcher 0 44 319 289;
#P window setfont "Sans Serif" 9.;
#P comment 112 76 137 196617 same within 1 expr … grrrr;
#N vpatcher 47 44 1487 860;
#P window setfont "Sans Serif" 9.;
#P newex 236 532 53 196617 jit.pack 2;
#P newex 430 485 130 196617 jit.matrix 1 float32 10 10;
#P window setfont "Sans Serif" 18.;
#P newex 430 444 366 196626 jit.expr @expr "((cell[0]*0.1)*1.5)-0.75";
#P window setfont "Sans Serif" 9.;
#P message 82 83 209 196617 exprfill "(cell[0]+ 1) + (cell[1]* 10)" , bang;
#P message 92 135 47 196617 plane -1;
#P user jit.cellblock 70 162 1017 372 3 9 10 10 90 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 2 0 0 0;
#P message 78 551 47 196617 plane -1;
#P user jit.cellblock 54 578 1001 788 3 9 10 10 90 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 2 0 0 0;
#P newex 50 494 130 196617 jit.matrix 1 float32 10 10;
#P button 50 50 25 0;
#P newex 50 111 130 196617 jit.matrix 1 float32 10 10;
#P window setfont "Sans Serif" 18.;
#P newex 50 444 330 196626 jit.expr @expr "((cell[0]*0.1)*2.)-1.";
#P connect 2 0 1 0;
#P connect 8 0 1 0;
#P connect 1 0 0 0;
#P connect 0 0 3 0;
#P connect 11 0 4 0;
#P connect 5 0 4 0;
#P connect 1 0 6 0;
#P connect 7 0 6 0;
#P connect 2 0 8 0;
#P connect 3 0 11 0;
#P connect 10 0 11 1;
#P connect 1 0 9 0;
#P connect 9 0 10 0;
#P pop;
#P newobj 55 41 30 196617 p;
#N vpatcher 20 74 1111 856;
#P window setfont "Sans Serif" 9.;
#P message 82 83 209 196617 exprfill "(cell[0]+ 1) + (cell[1]* 10)" , bang;
#P message 100 136 47 196617 plane -1;
#P user jit.cellblock 78 163 1025 373 3 9 10 10 90 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 2 0 0 0;
#P message 74 521 47 196617 plane -1;
#P user jit.cellblock 50 548 997 758 3 9 10 10 90 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 2 0 0 0;
#P newex 50 494 130 196617 jit.matrix 2 float32 10 10;
#P button 50 50 25 0;
#P newex 50 111 130 196617 jit.matrix 1 float32 10 10;
#P window setfont "Sans Serif" 18.;
#P newex 50 444 614 196626 jit.expr @expr "((cell[0]*0.1)*2.)-1." "((cell[0]*0.1)*1.5)-0.75";
#P connect 2 0 1 0;
#P connect 8 0 1 0;
#P connect 1 0 0 0;
#P connect 0 0 3 0;
#P connect 3 0 4 0;
#P connect 5 0 4 0;
#P connect 7 0 6 0;
#P connect 1 0 6 0;
#P connect 2 0 8 0;
#P pop 1;
#P newobj 58 75 30 196617 p;
#P comment 108 43 100 196617 2 expr work nice!;
#P pop;

max v2;
#N vpatcher 0 44 319 289;
#P window setfont "Sans Serif" 9.;
#P comment 112 76 137 196617 same within 1 expr … grrrr;
#N vpatcher 47 44 1487 860;
#P window setfont "Sans Serif" 9.;
#P newex 236 532 53 196617 jit.pack 2;
#P newex 430 485 130 196617 jit.matrix 1 float32 10 10;
#P window setfont "Sans Serif" 18.;
#P newex 430 444 366 196626 jit.expr @expr "((cell[0]*0.1)*1.5)-0.75";
#P window setfont "Sans Serif" 9.;
#P message 82 83 209 196617 exprfill "(cell[0]+ 1) + (cell[1]* 10)" , bang;
#P message 92 135 47 196617 plane -1;
#P user jit.cellblock 70 162 1017 372 3 9 10 10 90 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 2 0 0 0;
#P message 78 551 47 196617 plane -1;
#P user jit.cellblock 54 578 1001 788 3 9 10 10 90 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 2 0 0 0;
#P newex 50 494 130 196617 jit.matrix 1 float32 10 10;
#P button 50 50 25 0;
#P newex 50 111 130 196617 jit.matrix 1 float32 10 10;
#P window setfont "Sans Serif" 18.;
#P newex 50 444 330 196626 jit.expr @expr "((cell[0]*0.1)*2.)-1.";
#P connect 2 0 1 0;
#P connect 8 0 1 0;
#P connect 1 0 0 0;
#P connect 0 0 3 0;
#P connect 11 0 4 0;
#P connect 5 0 4 0;
#P connect 1 0 6 0;
#P connect 7 0 6 0;
#P connect 2 0 8 0;
#P connect 3 0 11 0;
#P connect 10 0 11 1;
#P connect 1 0 9 0;
#P connect 9 0 10 0;
#P pop;
#P newobj 55 41 30 196617 p;
#N vpatcher 20 74 1111 856;
#P window setfont "Sans Serif" 9.;
#P message 82 83 209 196617 exprfill "(cell[0]+ 1) + (cell[1]* 10)" , bang;
#P message 100 136 47 196617 plane -1;
#P user jit.cellblock 78 163 1025 373 3 9 10 10 90 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 2 0 0 0;
#P message 74 521 47 196617 plane -1;
#P user jit.cellblock 50 548 997 758 3 9 10 10 90 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 2 0 0 0;
#P newex 50 494 130 196617 jit.matrix 2 float32 10 10;
#P button 50 50 25 0;
#P newex 50 111 130 196617 jit.matrix 1 float32 10 10;
#P window setfont "Sans Serif" 18.;
#P newex 50 444 614 196626 jit.expr @expr "((cell[0]*0.1)*2.)-1." "((cell[0]*0.1)*1.5)-0.75";
#P connect 2 0 1 0;
#P connect 8 0 1 0;
#P connect 1 0 0 0;
#P connect 0 0 3 0;
#P connect 3 0 4 0;
#P connect 5 0 4 0;
#P connect 7 0 6 0;
#P connect 1 0 6 0;
#P connect 2 0 8 0;
#P pop 1;
#P newobj 58 75 30 196617 p;
#P comment 108 43 100 196617 2 expr work nice!;
#P pop;


January 5, 2010 | 9:11 pm

Here’s a similar problem.
the side with [expr] is good but my [jit.expr] gives bas result.

Any help would be greatly appreciated.

– Pasted Max Patch, click to expand. –

January 5, 2010 | 10:09 pm

aren’t you looking for in[0] instead of cell[0]?

– Pasted Max Patch, click to expand. –

January 12, 2010 | 1:58 pm

Thx e.j

———

Hello,

I want to multiply the expr by its inverse, no success within one [jit.expr],
and I don’t want the [jit.op @op * @val -1.]

Any idea?

– Pasted Max Patch, click to expand. –

January 12, 2010 | 3:42 pm

jit.expr @expr "(in[0] * -1.)" just works fine. jit.pwindow represent negative values by black… which is the reason why it gives the impression of not working properly.

– Pasted Max Patch, click to expand. –

January 14, 2010 | 8:32 am

wow! stupid boy!

So the inverse would be @expr "abs(norm[0] *-1.)"

Thanks again e.j


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