Twin Cities Max Users Group

 

maxFiles

Page history last edited by Anonymous 3 yrs ago

Hello

To open the patches, copy the text from "max v2;" all the way to "#P pop;". Paste the text in notePad or textEdit and save the file under any name (without an extension). Open Max and select file open, browse to the text file and click open. I will upload the motion tracking patch later this week. You can also go to the files section of this site (see above button) and download the "write_video" file, it is a max binary file.

---

SavePath

This is the patch that we looked at on Tuesday night. It determines the save path to a particular folder. I have also included a timer for the video. create two folders in the folder where the patch is saved titled "one" and "two".


max v2;

#N vpatcher 99 50 954 274;

#P origin 361 88;

#P window setfont "Sans Serif" 9.;

#P window linecount 3;

#P hidden comment 476 477 128 196617 ^^^^^^^the final string! this message is sent to the jit.grab object.;

#P window setfont Helvetica 12.;

#P window linecount 20;

#P hidden comment 7 56 221 1376268 this patch uses the "sprintf" object and the "tosymbol" object to create a string (a string is a programming term that means a line of code). It also uses a counter to create a unique name for each file that you want to save. Those big bang boxes in the middle go to three places. 1. it sets the message box through the patcher within a patch 2. sends a bang (delayed) to the "write" message (for the "qt.grab") 3. it sends a (delayed) bang to the stop message. (for the "qt.grab");

#B frgb 255 207 43;

#P window setfont "Sans Serif" 9.;

#P window linecount 4;

#P hidden comment 632 191 128 196617 <<<<<<< multiplies the number by 1000 to convert number to miliseconds;

#P user panel 680 66 32 101;

#X brgb 2 49 130;

#X frgb 0 0 0;

#X border 0;

#X rounded 0;

#X shadow 0;

#X done;

#P user panel 658 66 32 101;

#X brgb 2 59 180;

#X frgb 0 0 0;

#X border 0;

#X rounded 0;

#X shadow 0;

#X done;

#P window linecount 1;

#P hidden message 727 108 26 196617 240;

#P hidden message 726 88 26 196617 120;

#P hidden message 726 69 20 196617 60;

#P user panel 703 66 32 101;

#X brgb 22 26 43;

#X frgb 0 0 0;

#X border 0;

#X rounded 0;

#X shadow 0;

#X done;

#P message 545 99 14 196617 3;

#P message 527 99 14 196617 2;

#P message 508 99 14 196617 1;

#P window setfont "Sans Serif" 10.;

#P comment 558 99 59 196618 minutes;

#B frgb 58 58 58;

#P window setfont "Sans Serif" 9.;

#P hidden newex 627 525 94 196617 bgcolor 50 50 100;

#P window linecount 3;

#P hidden comment 636 250 128 196617 <<<<<<< delays stop message for specified number of seconds;

#P hidden number 577 216 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;

#P window setfont "Sans Serif" 12.;

#P window linecount 2;

#P comment 385 128 123 196620 <<#B frgb 255 255 255;

#P button 350 130 29 0;

#P window setfont "Sans Serif" 14.;

#P window linecount 1;

#P comment 659 42 100 196622 close grab;

#B frgb 255 255 255;

#P button 642 44 16 0;

#P window setfont "Sans Serif" 9.;

#P hidden message 306 455 33 196617 close;

#P window setfont "Sans Serif" 14.;

#P comment 659 21 89 196622 open grab;

#B frgb 255 255 255;

#P hidden button 642 23 16 0;

#P window setfont "Sans Serif" 9.;

#P hidden newex 85 382 48 196617 loadbang;

#P user incdec 508 120 15 15 0 0;

#P number 527 120 38 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;

#P hidden newex 576 193 44 196617 * 1000;

#P hidden newex 600 250 34 196617 delay;

#P message 418 103 57 196617 folder two;

#P message 355 103 55 196617 folder one;

#P hidden newex 459 257 55 196617 delay 250;

#P hidden message 460 459 234 196617 write oliver:/Users/admin/Desktop/one/0.mov;

#P hidden button 349 194 39 0;

#P hidden button 478 195 40 0;

#N vpatcher 54 141 1068 776;

#P origin 25 187;

#P window setfont "Sans Serif" 9.;

#P window linecount 1;

#P comment 106 557 100 196617 <<< appends write;

#P message 121 585 227 196617 write oliver:/Users/admin/Desktop/one/0.mov;

#P hidden newex 19 573 62 196617 prepend set;

#P hidden newex 18 553 86 196617 sprintf write %s;

#P window linecount 0;

#P newex 843 139 48 196617 loadbang;

#P comment 181 475 100 196617 <<#P comment 991 225 100 196617 append folder two;

#P comment 749 225 100 196617 append folder one;

#P outlet 20 605 15 0;

#P inlet 744 125 15 0;

#P inlet 475 120 15 0;

#P newex 1010 288 78 196617 prepend symbol;

#P message 1052 313 35 196617 set \$1;

#P newex 1010 266 51 196617 tosymbol;

#B color 5;

#P message 1052 333 203 196617 oliver:/Users/admin/Desktop/two/;

#P newex 1010 241 84 196617 sprintf %s two/;

#P button 1010 177 15 0;

#P newex 1010 200 78 196617 filepath default;

#B color 5;

#P button 473 150 15 0;

#P hidden newex 220 453 98 196617 loadmess separator;

#P newex 125 496 78 196617 prepend symbol;

#P message 125 517 35 196617 set \$1;

#P newex 125 470 51 196617 tosymbol;

#B color 5;

#P message 125 537 227 196617 oliver:/Users/admin/Desktop/one/0.mov;

#P button 740 150 15 0;

#P newex 125 405 62 196617 prepend set;

#P message 125 428 218 196617 oliver:/Users/admin/Desktop/one/ 0.mov;

#P newex 125 382 75 196617 sprintf %s %s;

#P button 511 270 15 0;

#P button 530 269 15 0;

#P message 571 195 57 196617 folder two;

#P message 496 195 55 196617 folder one;

#P message 511 298 14 196617 0;

#P message 530 298 14 196617 1;

#P user gswitch2 521 331 39 32 0 0;

#P newex 385 291 62 196617 prepend set;

#P message 385 314 45 196617 0.mov;

#P button 360 226 15 0;

#P newex 386 267 79 196617 sprintf %s.mov;

#N counter 0 100;

#X flags 0 0;

#P newobj 385 242 73 196617 counter 0 100;

#P hidden newex 870 229 98 196617 loadmess separator;

#P newex 767 289 78 196617 prepend symbol;

#P message 809 314 35 196617 set \$1;

#P newex 767 267 51 196617 tosymbol;

#B color 5;

#P message 809 334 203 196617 oliver:/Users/admin/Desktop/one/;

#P newex 767 242 82 196617 sprintf %s one/;

#P button 767 176 15 0;

#P newex 767 199 78 196617 filepath default;

#B color 5;

#P comment 312 269 100 196617 append $i.mov;

#P comment 833 269 171 196617 <<<<----- take out spaces ----->>>>;

#P comment 204 384 100 196617 join the two strings;

#P user panel 485 188 189 31;

#X brgb 191 191 191;

#X frgb 0 0 0;

#X border 1;

#X rounded 0;

#X shadow 0;

#X done;

#P background;

#P connect 31 0 48 0;

#P hidden connect 48 0 49 0;

#P connect 49 0 43 0;

#P connect 49 0 50 0;

#P fasten 40 0 24 0 1015 397 130 397;

#P fasten 33 0 24 0 478 422 130 422;

#P fasten 27 0 24 0 745 176 130 176;

#P fasten 10 0 24 0 772 402 130 402;

#P connect 24 0 26 0;

#P connect 26 0 25 0;

#P connect 24 0 29 0;

#P connect 32 0 29 0;

#P connect 25 0 29 0;

#P connect 29 0 31 0;

#P connect 31 0 30 0;

#P connect 30 0 28 0;

#P fasten 17 0 24 1 526 509 195 509;

#P fasten 17 1 24 1 555 383 195 383;

#P fasten 21 0 14 0 576 211 365 211;

#P fasten 20 0 14 0 501 214 365 214;

#P connect 14 0 12 0;

#P fasten 13 0 16 0 391 286 390 286;

#P connect 16 0 15 0;

#P connect 12 0 13 0;

#P fasten 41 0 33 0 480 142 478 142;

#P fasten 33 0 20 0 478 168 501 168;

#P connect 20 0 23 0;

#P fasten 23 0 19 0 516 294 516 294;

#P fasten 18 0 17 0 535 320 526 320;

#P fasten 19 0 17 0 516 320 526 320;

#P connect 21 0 22 0;

#P fasten 22 0 18 0 535 293 535 293;

#P fasten 13 0 17 1 391 290 555 290;

#P fasten 27 0 21 0 745 409 576 409;

#P fasten 42 0 27 0 749 145 745 145;

#P fasten 33 0 5 0 478 171 772 171;

#P connect 47 0 5 0;

#P connect 5 0 4 0;

#P connect 4 0 6 0;

#P hidden fasten 11 0 8 0 875 252 772 252;

#P connect 6 0 8 0;

#P connect 8 0 10 0;

#P connect 10 0 9 0;

#P connect 9 0 7 0;

#P fasten 27 0 35 0 745 165 1015 165;

#P connect 47 0 35 0;

#P connect 35 0 34 0;

#P connect 34 0 36 0;

#P fasten 11 0 38 0 875 261 1015 261;

#P connect 36 0 38 0;

#P connect 38 0 40 0;

#P connect 40 0 39 0;

#P connect 39 0 37 0;

#P pop;

#P hidden newobj 349 353 112 196617 p file_concatenator;

#P user jit.pwindow 253 86 82 62 1 1 0 0 1 0;

#P hidden message 263 455 30 196617 open;

#P hidden flonum 197 436 35 9 0.5 0 1 3 0 0 0 221 221 221 222 222 222 0 0 0;

#P hidden toggle 163 436 15 0;

#P hidden newex 163 455 44 196617 metro 2;

#P hidden newex 163 478 95 196617 jit.qt.grab 320 240;

#B color 5;

#P hidden toggle 85 436 15 0;

#P hidden message 85 455 75 196617 write_audio \$1;

#P hidden toggle 0 438 15 0;

#P hidden message 0 456 78 196617 write_video \$1;

#P hidden message 344 455 27 196617 stop;

#P hidden message 223 455 33 196617 write;

#P window setfont "Sans Serif" 10.;

#P comment 569 122 53 196618 seconds;

#B frgb 150 0 0;

#P window setfont "Sans Serif" 12.;

#P comment 352 80 135 196620 start record///////;

#B frgb 150 0 0;

#P comment 498 79 117 196620 time of movie////;

#B frgb 150 0 0;

#P window setfont Helvetica 20.;

#P comment 320 43 371 1376276 set movie time before you record!;

#B frgb 255 207 43;

#P user panel 350 79 140 45;

#X brgb 246 183 187;

#X frgb 0 0 0;

#X border 0;

#X rounded 0;

#X shadow 0;

#X done;

#P user panel 245 79 82 78;

#X brgb 255 248 190;

#X frgb 0 0 0;

#X border 0;

#X rounded 22;

#X shadow 0;

#X done;

#P user panel 496 79 122 63;

#X brgb 246 183 187;

#X frgb 0 0 0;

#X border 0;

#X rounded 0;

#X shadow 0;

#X done;

#P user panel 298 79 44 78;

#X brgb 255 248 190;

#X frgb 0 0 0;

#X border 0;

#X rounded 0;

#X shadow 0;

#X done;

#P window setfont "Sans Serif" 9.;

#P window linecount 2;

#P hidden comment 464 275 128 196617 ^^^^^^^delays bang until message has been writen;

#P user panel 578 79 51 63;

#X brgb 246 183 187;

#X frgb 0 0 0;

#X border 0;

#X rounded 15;

#X shadow 0;

#X done;

#P user panel 236 66 434 101;

#X brgb 42 73 238;

#X frgb 0 0 0;

#X border 0;

#X rounded 33;

#X shadow 0;

#X done;

#P window linecount 6;

#P hidden comment 357 278 100 196617 this is a patcher within a patch. "apple" double click (cntl click on windows) to open this patcher>>>>>;

#P hidden connect 35 0 15 0;

#P hidden connect 15 0 14 0;

#P hidden connect 35 0 17 0;

#P hidden connect 17 0 16 0;

#P hidden connect 35 0 20 0;

#P hidden connect 20 0 19 0;


 

*******************************

*******************************

**following is the motion tracker

*********************************

*******************************

 


 

max v2;

#N vpatcher 20 74 942 697;

#P user jit.pwindow 163 292 82 62 0 1 0 0 1 0;

#P user jit.pwindow 82 292 82 62 0 1 0 0 1 0;

#P user jit.pwindow 164 230 82 62 0 1 0 0 1 0;

#P user jit.pwindow 83 230 82 62 0 1 0 0 1 0;

#P window setfont "Sans Serif" 9.;

#P window linecount 1;

#P newex 86 202 161 196617 jit.scissors @rows 2 @columns 2;

#P comment 725 190 130 196617 bang when this # passed;

#P comment 600 189 70 196617 set threshold;

#P comment 630 310 100 196617 amount of mvmt.;

#P comment 734 415 100 196617 using split;

#P user jit.pwindow 432 346 82 62 0 1 0 0 1 0;

#P flonum 735 207 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;

#P flonum 642 207 35 9 0. 1. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;

#P button 737 342 64 0;

#P flonum 667 288 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;

#P button 547 346 64 0;

#P message 438 122 46 196617 settings;

#B color 9;

#N vpatcher 165 500 765 900;

#P window setfont "Sans Serif" 9.;

#P window linecount 0;

#P comment 82 114 175 196617 drops rgb all video in alpha channel;

#P window linecount 2;

#P comment 106 133 162 196617 trigger list list \, compares second frame against the first;

#N comlet past;

#P outlet 46 272 15 0;

#P inlet 124 88 15 0;

#N comlet amount of mvmt;

#P outlet 434 203 15 0;

#P window linecount 1;

#P newex 469 154 40 196617 split;

#N comlet split;

#P outlet 502 196 15 0;

#P flonum 347 79 56 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;

#P flonum 294 173 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;

#P button 294 218 15 0;

#P window linecount 0;

#P message 294 149 39 196617 set \$1;

#P newex 338 207 29 196617 past;

#N comlet set past;

#P inlet 294 93 15 0;

#N comlet past;

#P outlet 338 240 15 0;

#P inlet 21 75 15 0;

#P window linecount 1;

#P comment 195 211 69 196617 reduce flicker;

#P newex 305 42 53 196617 jit.3m;

#P newex 16 233 106 196617 jit.op @op > @val 0.3;

#P newex 16 210 178 196617 jit.slide @slide_up 2 @slide_down 10;

#P flonum 112 168 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;

#P newex 16 188 106 196617 jit.op @op > @val 0.2;

#P newex 15 113 66 196617 jit.rgb2luma;

#P newex 16 162 89 196617 jit.op @op absdiff;

#P newex 15 134 90 196617 t l l;

#P comment 147 170 68 196617 set threshold;

#P connect 10 0 3 0;

#P connect 3 0 1 0;

#P connect 1 1 2 0;

#P connect 2 0 4 0;

#P connect 4 0 6 0;

#P connect 6 0 7 0;

#P connect 7 0 22 0;

#P connect 1 0 2 1;

#P connect 21 0 5 0;

#P connect 5 0 4 1;

#P connect 12 0 14 0;

#P connect 14 0 16 0;

#P connect 13 0 15 0;

#P fasten 7 0 8 0 21 262 278 262 278 38 310 38;

#P fasten 17 0 13 0 352 150 343 150;

#P connect 14 0 13 0;

#P connect 13 0 11 0;

#P connect 8 1 17 0;

#P fasten 17 0 20 0 352 148 439 148;

#P fasten 17 0 19 0 352 128 474 128;

#P connect 12 0 19 2;

#P connect 19 1 18 0;

#P pop;

#P newobj 547 258 201 196617 p yeoldmotiontracker;

#P user jit.pwindow 334 201 82 62 0 1 0 0 1 0;

#P toggle 303 97 15 0;

#P newex 303 123 52 196617 metro 50;

#P message 360 123 28 196617 open;

#B color 9;

#P message 401 123 31 196617 close;

#B color 9;

#P newex 335 147 98 196617 jit.qt.grab 320 240;

#P comment 290 394 138 196617 white pixels being tracked>>>;

#P comment 545 415 100 196617 using past;

#P window linecount 2;

#P comment 82 364 100 196617 try combining with jit.scissors;

#P connect 21 2 24 0;

#P connect 21 0 22 0;

#P connect 3 0 21 0;

#P connect 21 3 25 0;

#P connect 21 1 23 0;

#P connect 7 0 6 0;

#P connect 10 0 3 0;

#P connect 4 0 3 0;

#P connect 5 0 3 0;

#P connect 6 0 3 0;

#P connect 3 0 8 0;

#P connect 9 0 16 0;

#P connect 3 0 9 0;

#P connect 9 1 11 0;

#P connect 14 0 9 1;

#P connect 9 2 12 0;

#P connect 15 0 9 2;

#P connect 9 3 13 0;

#P pop;

Comments (0)

You don't have permission to comment on this page.