lcd controller patch – make it in jsui

Mar 15, 2008 at 10:34am

lcd controller patch – make it in jsui

hi all, i made this little controller with lcd using sprites etc actually it works but i would like to make it in jsui adding pattr-exposure and possibly variable arguments (n.squares, square size, linked squares?..)..before going deep into it (..i’m not so good with js) is there someone who has already something similar..

max v2;
#N vpatcher 217 61 1108 828;
#P origin -32 0;
#P window setfont “Sans Serif” 9.;
#P message 697 239 113 196617 paintrect 0 0 40 40 $1;
#P user lcd 697 258 40 40 1 1 0 0 0;
#P number 697 199 35 9 0 255 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 712 222 109 196617 indexed color (0-255);
#N comlet 10y;
#P outlet 530 684 15 0;
#N comlet 10x;
#P outlet 500 684 15 0;
#P newex 500 650 40 196617 unpack;
#N comlet 9y;
#P outlet 475 684 15 0;
#N comlet 9x;
#P outlet 445 684 15 0;
#P newex 445 650 40 196617 unpack;
#N comlet 8y;
#P outlet 422 684 15 0;
#N comlet 8x;
#P outlet 392 684 15 0;
#P newex 392 650 40 196617 unpack;
#N comlet 7y;
#P outlet 369 684 15 0;
#N comlet 7x;
#P outlet 339 684 15 0;
#P newex 339 650 40 196617 unpack;
#N comlet 6y;
#P outlet 316 684 15 0;
#N comlet 6x;
#P outlet 286 684 15 0;
#P newex 286 650 40 196617 unpack;
#N comlet 5y;
#P outlet 264 684 15 0;
#N comlet 5x;
#P outlet 234 684 15 0;
#P newex 234 650 40 196617 unpack;
#N comlet 4y;
#P outlet 209 684 15 0;
#N comlet 4x;
#P outlet 179 684 15 0;
#P newex 179 650 40 196617 unpack;
#N comlet 3y;
#P outlet 156 684 15 0;
#N comlet 3x;
#P outlet 126 684 15 0;
#P newex 126 650 40 196617 unpack;
#N comlet 2y;
#P outlet 103 684 15 0;
#N comlet 2x;
#P outlet 73 684 15 0;
#P newex 73 650 40 196617 unpack;
#N comlet 1y;
#P outlet 50 684 15 0;
#N comlet 1x;
#P outlet 20 684 15 0;
#P newex 20 489 269 196617 gate 10;
#P newex 20 650 40 196617 unpack;
#P number 20 461 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 123 45 30 196617 t b b;
#P newex 123 23 48 196617 loadbang;
#P button 86 57 15 0;
#N vpatcher 601 280 1201 680;
#P window setfont “Sans Serif” 9.;
#P newex 178 264 47 196617 s update;
#P newex 178 237 20 196617 t b;
#P message 274 195 33 196617 clear;
#N coll positions 1;
#P newobj 207 237 78 196617 coll positions 1;
#P newex 207 195 57 196617 pack 1 1 1;
#P outlet 45 252 15 0;
#P window linecount 1;
#P newex 75 137 64 196617 random 201;
#P window linecount 0;
#P newex 60 111 64 196617 random 201;
#P newex 45 75 40 196617 t i b b;
#P inlet 15 22 15 0;
#P newex 45 195 144 196617 sprintf drawsprite s%i %i %i;
#P newex 15 50 40 196617 uzi 10;
#P connect 2 0 0 0;
#P connect 0 2 3 0;
#P connect 3 0 1 0;
#P connect 1 0 6 0;
#P connect 3 1 4 0;
#P connect 3 2 5 0;
#P fasten 4 0 1 1 65 173 117 173;
#P connect 7 0 10 0;
#P connect 10 0 11 0;
#P fasten 5 0 1 2 80 163 184 163;
#P fasten 3 0 7 0 50 185 212 185;
#P connect 9 0 8 0;
#P connect 7 0 8 0;
#P fasten 4 0 7 1 65 173 235 173;
#P fasten 5 0 7 2 80 163 258 163;
#P fasten 2 0 9 0 20 40 279 40;
#P pop;
#P newobj 123 85 86 196617 p random sprites;
#N vpatcher 720 387 1210 786;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#N vpatcher 553 399 1153 799;
#P window setfont “Sans Serif” 9.;
#P window linecount 0;
#P newex 43 41 47 196617 r update;
#P window linecount 1;
#N vpatcher 572 313 1172 713;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 98 169 38 196617 zl join;
#P window linecount 0;
#P message 186 93 14 196617 9;
#P window linecount 1;
#N coll positions 1;
#P newobj 186 115 78 196617 coll positions 1;
#P window linecount 0;
#P newex 15 51 20 196617 t b;
#P message 316 130 14 196617 1;
#P newex 316 95 48 196617 loadbang;
#P toggle 290 156 15 0;
#P window linecount 1;
#P message 290 176 74 196617 scalarmode $1;
#P window linecount 0;
#P newex 15 204 73 196617 vexpr $i1 + 4;
#P newex 15 168 38 196617 zl join;
#P message 15 231 123 196617 linesegment $1 $2 $3 $4;
#P outlet 15 263 15 0;
#P message 98 96 14 196617 8;
#P message 15 92 14 196617 7;
#P window linecount 1;
#N coll positions 1;
#P newobj 98 116 78 196617 coll positions 1;
#P window linecount 0;
#N coll positions 1;
#P newobj 15 116 78 196617 coll positions 1;
#P inlet 15 26 15 0;
#P connect 0 0 13 0;
#P connect 13 0 3 0;
#P connect 3 0 1 0;
#P connect 1 0 7 0;
#P fasten 16 0 8 0 103 196 20 196;
#P fasten 9 0 8 0 295 192 20 192;
#P connect 7 0 8 0;
#P connect 8 0 6 0;
#P connect 6 0 5 0;
#P fasten 2 0 7 1 103 153 48 153;
#P fasten 13 0 4 0 20 82 103 82;
#P connect 4 0 2 0;
#P connect 2 0 16 0;
#P fasten 14 0 16 1 191 139 131 139;
#P fasten 13 0 15 0 20 78 191 78;
#P connect 15 0 14 0;
#P fasten 12 0 10 0 321 154 295 154;
#P connect 10 0 9 0;
#P connect 11 0 12 0;
#P pop;
#P newobj 300 105 85 196617 p drawline7-8-9;
#N vpatcher 572 313 1172 713;
#P window setfont “Sans Serif” 9.;
#P newex 15 51 20 196617 t b;
#P message 178 136 14 196617 1;
#P newex 178 114 48 196617 loadbang;
#P toggle 108 154 15 0;
#P window linecount 1;
#P message 108 174 74 196617 scalarmode $1;
#P window linecount 0;
#P newex 15 196 73 196617 vexpr $i1 + 4;
#P newex 15 158 38 196617 zl join;
#P message 15 231 123 196617 linesegment $1 $2 $3 $4;
#P outlet 15 263 15 0;
#P message 98 96 14 196617 6;
#P message 15 92 14 196617 5;
#P window linecount 1;
#N coll positions 1;
#P newobj 98 116 78 196617 coll positions 1;
#P window linecount 0;
#N coll positions 1;
#P newobj 15 116 78 196617 coll positions 1;
#P inlet 15 26 15 0;
#P connect 0 0 13 0;
#P connect 13 0 3 0;
#P connect 3 0 1 0;
#P connect 1 0 7 0;
#P connect 7 0 8 0;
#P fasten 9 0 8 0 113 192 20 192;
#P connect 8 0 6 0;
#P connect 6 0 5 0;
#P fasten 2 0 7 1 103 151 48 151;
#P fasten 13 0 4 0 20 77 103 77;
#P connect 4 0 2 0;
#P fasten 12 0 10 0 183 152 113 152;
#P connect 10 0 9 0;
#P connect 11 0 12 0;
#P pop;
#P newobj 205 105 74 196617 p drawline5-6;
#N vpatcher 572 313 1172 713;
#P window setfont “Sans Serif” 9.;
#P newex 15 51 20 196617 t b;
#P message 178 136 14 196617 1;
#P newex 178 114 48 196617 loadbang;
#P toggle 108 154 15 0;
#P window linecount 1;
#P message 108 174 74 196617 scalarmode $1;
#P window linecount 0;
#P newex 15 196 73 196617 vexpr $i1 + 4;
#P newex 15 158 38 196617 zl join;
#P message 15 231 123 196617 linesegment $1 $2 $3 $4;
#P outlet 15 263 15 0;
#P message 98 96 14 196617 4;
#P message 15 92 14 196617 3;
#P window linecount 1;
#N coll positions 1;
#P newobj 98 116 78 196617 coll positions 1;
#P window linecount 0;
#N coll positions 1;
#P newobj 15 116 78 196617 coll positions 1;
#P inlet 15 26 15 0;
#P connect 0 0 13 0;
#P connect 13 0 3 0;
#P connect 3 0 1 0;
#P connect 1 0 7 0;
#P fasten 9 0 8 0 113 192 20 192;
#P connect 7 0 8 0;
#P connect 8 0 6 0;
#P connect 6 0 5 0;
#P fasten 2 0 7 1 103 151 48 151;
#P fasten 13 0 4 0 20 77 103 77;
#P connect 4 0 2 0;
#P fasten 12 0 10 0 183 152 113 152;
#P connect 10 0 9 0;
#P connect 11 0 12 0;
#P pop;
#P newobj 110 105 74 196617 p drawline3-4;
#P outlet 15 170 15 0;
#P inlet 15 40 15 0;
#P window linecount 0;
#P newex 15 69 392 196617 t b b b b clear;
#P window linecount 1;
#N vpatcher 572 313 1172 713;
#P window setfont “Sans Serif” 9.;
#P newex 15 51 20 196617 t b;
#P message 178 136 14 196617 1;
#P newex 178 114 48 196617 loadbang;
#P toggle 108 154 15 0;
#P window linecount 1;
#P message 108 174 74 196617 scalarmode $1;
#P window linecount 0;
#P newex 15 196 73 196617 vexpr $i1 + 4;
#P newex 15 158 38 196617 zl join;
#P message 15 231 123 196617 linesegment $1 $2 $3 $4;
#P outlet 15 263 15 0;
#P message 98 96 14 196617 2;
#P message 15 92 14 196617 1;
#P window linecount 1;
#N coll positions 1;
#P newobj 98 116 78 196617 coll positions 1;
#P window linecount 0;
#N coll positions 1;
#P newobj 15 116 78 196617 coll positions 1;
#P inlet 15 26 15 0;
#P connect 0 0 13 0;
#P connect 13 0 3 0;
#P connect 3 0 1 0;
#P connect 1 0 7 0;
#P connect 7 0 8 0;
#P fasten 9 0 8 0 113 192 20 192;
#P connect 8 0 6 0;
#P connect 6 0 5 0;
#P fasten 2 0 7 1 103 151 48 151;
#P fasten 13 0 4 0 20 77 103 77;
#P connect 4 0 2 0;
#P fasten 12 0 10 0 183 152 113 152;
#P connect 10 0 9 0;
#P connect 11 0 12 0;
#P pop;
#P newobj 15 105 70 196617 p drawline1-2;
#P connect 2 0 1 0;
#P fasten 7 0 1 0 48 62 20 62;
#P connect 1 0 0 0;
#P fasten 1 4 3 0 400 145 20 145;
#P fasten 6 0 3 0 305 135 20 135;
#P fasten 5 0 3 0 210 130 20 130;
#P fasten 4 0 3 0 115 126 20 126;
#P connect 0 0 3 0;
#P connect 1 1 4 0;
#P connect 1 2 5 0;
#P connect 1 3 6 0;
#P pop;
#P newobj 264 315 62 196617 p drawlines;
#P newex 200 206 121 196617 sprintf drawsprite s%i;
#N coll positions 1;
#P newobj 57 266 78 196617 coll positions 1;
#P newex 57 238 45 196617 prepend;
#P newex 93 205 62 196617 prepend set;
#P outlet 337 343 15 0;
#P outlet 190 346 15 0;
#P newex 190 313 45 196617 prepend;
#P newex 200 233 62 196617 prepend set;
#N vpatcher 213 96 923 756;
#P window setfont “Sans Serif” 9.;
#P comment 110 219 43 196617 answer;
#P newex 149 398 38 196617 &&;
#P newex 177 377 33 196617 < = 0.;
#P newex 149 377 33 196617 >= 0.;
#P newex 93 398 38 196617 &&;
#P newex 121 377 33 196617 < = 0.;
#P newex 93 377 33 196617 >= 0.;
#P newex 93 236 58 196617 unpack 0 0;
#P newex 93 458 46 196617 select 1;
#P newex 93 489 203 196617 i;
#P newex 93 418 66 196617 &&;
#P newex 259 337 27 196617 + 4;
#P newex 231 337 27 196617 – 4;
#P newex 203 337 27 196617 + 4;
#P newex 175 337 27 196617 – 4;
#P newex 175 236 58 196617 unpack 0 0;
#P outlet 67 567 15 0;
#P newex 67 525 36 196617 i;
#P newex 67 101 119 196617 t b dump l;
#N coll positions 1;
#P newobj 93 185 78 196617 coll positions 1;
#N comlet position;
#P inlet 67 59 15 0;
#P comment 184 219 47 196617 question;
#P connect 1 0 3 0;
#P connect 3 0 4 0;
#P connect 4 0 5 0;
#P fasten 3 1 2 0 126 147 98 147;
#P fasten 2 0 14 0 98 219 98 219;
#P connect 14 0 15 0;
#P connect 15 0 17 0;
#P connect 17 0 11 0;
#P connect 11 0 13 0;
#P connect 13 0 12 0;
#P connect 12 0 4 1;
#P connect 7 0 15 1;
#P connect 14 0 16 0;
#P connect 16 0 17 1;
#P connect 8 0 16 1;
#P connect 14 1 18 0;
#P connect 18 0 20 0;
#P connect 20 0 11 1;
#P connect 9 0 18 1;
#P connect 3 2 6 0;
#P connect 6 0 7 0;
#P connect 14 1 19 0;
#P connect 19 0 20 1;
#P connect 10 0 19 1;
#P connect 6 0 8 0;
#P connect 6 1 9 0;
#P connect 6 1 10 0;
#P fasten 2 1 12 1 120 214 291 214;
#P pop;
#P newobj 337 164 69 196617 p comparison;
#P newex 312 139 21 196617 t 0;
#P newex 337 138 29 196617 gate;
#P newex 333 90 31 196617 t b 1;
#P newex 318 66 41 196617 sel 0 1;
#P inlet 318 41 15 0;
#P inlet 57 39 15 0;
#P newex 57 67 62 196617 t l l b l;
#P comment 56 291 80 196617 update positions;
#P window linecount 2;
#P comment 197 284 45 196617 move sprite;
#P comment 348 191 100 196617 check if mouse position match srites;
#P connect 4 0 3 0;
#P fasten 15 0 16 0 98 231 62 231;
#P connect 3 0 16 0;
#P connect 16 0 17 0;
#P fasten 10 0 15 0 342 194 98 194;
#P fasten 11 0 12 0 205 278 195 278;
#P fasten 3 1 12 0 79 153 195 153;
#P fasten 19 0 13 0 269 337 195 337;
#P connect 12 0 13 0;
#P fasten 10 0 18 0 342 200 205 200;
#P fasten 18 0 11 0 205 230 205 230;
#P fasten 3 2 19 0 96 135 269 135;
#P connect 8 0 9 0;
#P connect 5 0 6 0;
#P connect 6 1 7 0;
#P connect 9 0 8 0;
#P fasten 7 1 8 0 359 116 342 116;
#P connect 8 0 10 0;
#P connect 10 0 14 0;
#P fasten 3 3 8 1 113 123 361 123;
#P pop 1;
#P newobj 123 389 40 196617 p math;
#N vpatcher 536 378 1136 778;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 79 93 27 196617 – 5;
#P window linecount 0;
#P newex 15 102 27 196617 – 5;
#P outlet 15 214 15 0;
#P newex 15 181 48 196617 pack 1 1;
#P window linecount 1;
#P newex 110 130 56 196617 clip 0 200;
#P window linecount 0;
#P newex 15 134 56 196617 clip 0 200;
#P newex 15 63 58 196617 unpack 1 1;
#P inlet 15 35 15 0;
#P connect 0 0 1 0;
#P connect 1 0 6 0;
#P connect 6 0 2 0;
#P connect 2 0 4 0;
#P connect 4 0 5 0;
#P connect 3 0 4 1;
#P connect 1 1 7 0;
#P connect 7 0 3 0;
#P pop;
#P newobj 123 364 34 196617 p clip;
#N vpatcher 4 148 455 630;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P message 161 281 237 196617 recordsprite , paintrect 0 0 8 8 5 , closesprite s10;
#P message 150 259 243 196617 recordsprite , paintrect 0 0 8 8 140 , closesprite s9;
#P message 132 235 243 196617 recordsprite , paintrect 0 0 8 8 226 , closesprite s8;
#P message 116 213 243 196617 recordsprite , paintrect 0 0 8 8 194 , closesprite s7;
#P message 105 191 243 196617 recordsprite , paintrect 0 0 8 8 121 , closesprite s6;
#P message 94 165 243 196617 recordsprite , paintrect 0 0 8 8 168 , closesprite s5;
#P message 83 143 231 196617 recordsprite , paintrect 0 0 8 8 7 , closesprite s4;
#P inlet 143 28 15 0;
#P message 65 119 237 196617 recordsprite , paintrect 0 0 8 8 35 , closesprite s3;
#P message 49 97 237 196617 recordsprite , paintrect 0 0 8 8 10 , closesprite s2;
#P outlet 38 378 15 0;
#P window linecount 0;
#P message 38 75 237 196617 recordsprite , paintrect 0 0 8 8 15 , closesprite s1;
#P connect 4 0 0 0;
#P connect 11 0 1 0;
#P connect 10 0 1 0;
#P connect 9 0 1 0;
#P connect 8 0 1 0;
#P connect 7 0 1 0;
#P connect 6 0 1 0;
#P connect 5 0 1 0;
#P connect 3 0 1 0;
#P connect 2 0 1 0;
#P connect 0 0 1 0;
#P connect 4 0 2 0;
#P connect 4 0 3 0;
#P connect 4 0 5 0;
#P connect 4 0 6 0;
#P connect 4 0 7 0;
#P connect 4 0 8 0;
#P connect 4 0 9 0;
#P connect 4 0 10 0;
#P connect 4 0 11 0;
#P pop;
#P newobj 216 85 50 196617 p sprites;
#P user lcd 123 118 210 210 0 1 0 0 1;
#P fasten 3 1 8 0 158 426 25 426;
#P connect 8 0 10 0;
#P connect 10 0 9 0;
#P connect 9 0 11 0;
#P connect 9 1 12 0;
#P connect 10 1 13 0;
#P connect 13 0 14 0;
#P connect 13 1 15 0;
#P connect 6 0 7 0;
#P connect 7 0 4 0;
#P connect 5 0 4 0;
#P hidden fasten 3 0 0 0 128 414 107 414 107 108 128 108;
#P hidden connect 4 0 0 0;
#P hidden connect 1 0 0 0;
#P hidden connect 0 0 2 0;
#P connect 2 0 3 0;
#P connect 10 2 16 0;
#P connect 16 0 17 0;
#P hidden connect 0 2 3 1;
#P connect 16 1 18 0;
#P connect 10 3 19 0;
#P connect 19 0 20 0;
#P connect 19 1 21 0;
#P fasten 7 1 1 0 148 71 221 71;
#P connect 10 4 22 0;
#P connect 22 0 23 0;
#P connect 22 1 24 0;
#P fasten 2 0 10 1 128 385 95 385 95 481 284 481;
#P connect 10 5 25 0;
#P connect 25 0 26 0;
#P connect 25 1 27 0;
#P connect 10 6 28 0;
#P connect 28 0 29 0;
#P connect 28 1 30 0;
#P connect 10 7 31 0;
#P connect 31 0 32 0;
#P connect 31 1 33 0;
#P connect 10 8 34 0;
#P connect 34 0 35 0;
#P connect 34 1 36 0;
#P connect 10 9 37 0;
#P connect 37 0 38 0;
#P connect 37 1 39 0;
#P connect 41 0 43 0;
#P connect 43 0 42 0;
#P pop;

#36359
Mar 15, 2008 at 4:16pm

Hi Michele

I did some work in this area about a year and a half ago

You can download the patches here:

http://www.pixelmechanics.com/jr_xy_maxpatches.zip

I’m using LCD but all the functionality is in JS and should be pretty easy to port to JSUI. I just never found the time, and at the time found it easier to cope with LCD rather than screen-to-world/world-to-screen type stuff.

I’m hoping to revisit this work soon, but also happy for others to hack at it…

Cheers

Jules

#124726
Mar 17, 2008 at 8:17pm

#124727
Mar 17, 2008 at 11:31pm

Very very cool.

b

On Mar 15, 2008, at 9:16 AM, Jules Rawlinson wrote:

>
> Hi Michele
>
> I did some work in this area about a year and a half ago
>
> You can download the patches here:
>
> http://www.pixelmechanics.com/jr_xy_maxpatches.zip
>
> I’m using LCD but all the functionality is in JS and should be
> pretty easy to port to JSUI. I just never found the time, and at the
> time found it easier to cope with LCD rather than screen-to-world/
> world-to-screen type stuff.
>
> I’m hoping to revisit this work soon, but also happy for others to
> hack at it…
>
> Cheers
>
> Jules
> –
> http://www.pixelmechanics.com
> http://ddm.caad.ed.ac.uk

barry threw
Media Art and Technology

San Francisco, CA
Work: 857-544-3967
Email: bthrew (at) gmail (dot) com
Web: http://www.barrythrew.com

#124728
Mar 19, 2008 at 8:35pm

Yes great work jules! at the moment i don’t have time to get more into js so i’d say i want just to pattr-fy this simple lcd plain-max patch..anyone any suggestions?
any help greatly appreciated

#124729

You must be logged in to reply to this topic.