colour tracking question…

Jul 7, 2006 at 1:10am

colour tracking question…

I just started working my way through the Jitter tutorials and came uppon the tracking colour patch. I modified it a bit and can now track X,Y and to a degree Z.
I was wondering if anybody had any suggestion on how to improve the whole thing. X and Y work pretty well but Z isn’t good at all. Maybe a different approach is needed. Any pointers would be deeply appreciated.
Also, is it possible to avoid the jump to 0 and 239 when the colour leaves the screen? I was trying to set it up in a way that the last “good” values would be used but since jit.findbounds continually sends out that message, I don’t know how to get around it.
Thanks a lot, and please, be patient with me. This is a whole new world for me…

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P message 716 394 14 196617 1;
#P newex 665 394 48 196617 loadbang;
#P message 268 131 33 196617 close;
#P message 236 131 30 196617 open;
#P number 486 524 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 166 524 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 message 280 618 54 196620 Volume;
#P message 223 618 45 196620 speed;
#P message 166 618 51 196620 panning;
#P window setfont “Sans Serif” 18.;
#P flonum 280 590 55 18 0 0 0 3 0 0 0 255 192 191 222 222 222 0 0 0;
#P flonum 223 590 55 18 0 0 0 3 0 0 0 255 173 173 222 222 222 0 0 0;
#P flonum 166 590 55 18 0 0 0 3 0 0 0 255 173 173 222 222 222 0 0 0;
#P window setfont “Sans Serif” 9.;
#P newex 166 69 38 196617 sel 32;
#P newex 166 48 40 196617 key;
#N vpatcher 27 44 582 626;
#P window setfont “Sans Serif” 9.;
#P flonum 60 196 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 60 217 43 196617 $1 160;
#P flonum 60 254 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 60 233 40 196617 line 0.;
#P flonum 344 423 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 344 443 43 196617 $1 160;
#P flonum 345 478 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 344 459 40 196617 line 0.;
#P flonum 256 264 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 256 284 43 196617 $1 160;
#P flonum 256 321 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 256 305 40 196617 line 0.;
#P newex 344 402 70 196617 speedlim 150;
#P newex 60 176 70 196617 speedlim 150;
#P newex 256 245 70 196617 speedlim 150;
#N vpatcher 37 59 267 292;
#P window setfont “Sans Serif” 9.;
#P newex 19 140 33 196617 s rbg;
#P message 21 118 164 196617 0. 0.337255 0.015686 0.;
#P window setfont “Fixedwidth Serif” 10.;
#P newex 22 72 92 1441802 vexpr $i1/255.;
#P newex 22 96 76 1441802 prepend set;
#P newex 22 49 62 1441802 prepend 0;
#P inlet 22 29 15 0;
#P connect 3 0 5 0;
#P connect 2 0 4 0;
#P connect 0 0 1 0;
#P connect 1 0 3 0;
#P connect 3 0 2 0;
#P pop;
#P newobj 191 65 62 196617 p color calc;
#P newex 344 386 99 196617 zmap 10 95 65 158;
#P flonum 344 284 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 344 264 30 196617 !- 0.;
#P flonum 332 226 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 332 203 64 196617 unpack 0. 0.;
#P flonum 424 226 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 424 203 64 196617 unpack 0. 0.;
#P newex 60 91 105 196617 scale 87 220 220 87;
#P newex 60 157 36 196617 – 100;
#P flonum 60 138 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 60 115 99 196617 zmap 87 220 0 200;
#P newex 287 226 27 196617 – 2.;
#P flonum 287 203 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 287 179 87 196617 scale 0 239 0. 6.;
#P window setfont “Fixedwidth Serif” 10.;
#P number 287 71 35 10 0 0 0 22 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 60 60 35 10 0 0 0 22 0 0 0 221 221 221 222 222 222 0 0 0;
#P inlet 424 51 15 0;
#P inlet 332 179 15 0;
#P inlet 287 51 15 0;
#P inlet 60 40 15 0;
#P inlet 191 45 15 0;
#P outlet 60 309 15 0;
#P outlet 345 537 14 0;
#P outlet 256 456 15 0;
#P connect 4 0 8 0;
#P connect 8 0 16 0;
#P connect 16 0 13 0;
#P connect 13 0 14 0;
#P connect 14 0 15 0;
#P connect 15 0 26 0;
#P connect 26 0 39 0;
#P connect 39 0 38 0;
#P connect 38 0 36 0;
#P connect 36 0 37 0;
#P connect 37 0 2 0;
#P connect 3 0 24 0;
#P fasten 12 0 25 0 292 243 261 243;
#P connect 25 0 31 0;
#P connect 31 0 30 0;
#P connect 30 0 28 0;
#P connect 28 0 29 0;
#P connect 29 0 0 0;
#P connect 5 0 9 0;
#P connect 9 0 10 0;
#P connect 10 0 11 0;
#P connect 11 0 12 0;
#P connect 6 0 19 0;
#P connect 19 0 20 0;
#P fasten 20 0 21 0 337 251 349 251;
#P connect 21 0 22 0;
#P connect 22 0 23 0;
#P connect 23 0 27 0;
#P connect 27 0 35 0;
#P connect 35 0 34 0;
#P connect 34 0 32 0;
#P connect 32 0 33 0;
#P connect 33 0 1 0;
#P fasten 18 0 21 1 429 251 369 251;
#P connect 7 0 17 0;
#P connect 17 0 18 0;
#P pop;
#P newobj 166 557 124 196617 p numbergame;
#P window setfont “Sans Serif” 18.;
#N vpatcher 37 59 313 278;
#P window setfont “Fixedwidth Serif” 10.;
#P user ubumenu 50 70 140 1441802 0 1 1 0;
#X add 0 = Produce No Sound;
#X add 1 = Play MIDI Notes;
#X add 2 = Play MSP Tones;
#X prefix_set 0 0 0;
#X pattrmode 1;
#P window linecount 0;
#N vpatcher 235 227 784 539;
#P origin -68 -16;
#P window setfont Times 10.;
#P comment 295 94 28 1310730 Freq.;
#P comment 128 94 28 1310730 Freq.;
#P window setfont “Fixedwidth Serif” 10.;
#P number 258 94 37 10 0 0 0 22 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 26 43 241 1441802 unpack 0 0 0 0;
#P number 91 94 37 10 0 0 0 22 0 0 0 221 221 221 222 222 222 0 0 0;
#P window setfont Times 10.;
#P comment 112 167 83 1310730 Add a little vibrato;
#P comment 41 22 206 1310730 Use horizontal and vertical location as frequencies;
#P window setfont “Fixedwidth Serif” 10.;
#P newex 210 164 63 1441802 *~;
#P newex 210 141 50 1441802 *~ 0.02;
#P newex 193 114 38 1441802 line~;
#P newex 193 93 62 1441802 pack 0 50;
#P newex 193 187 27 1441802 +~;
#P newex 193 210 43 1441802 cycle~;
#P newex 263 141 53 1441802 cycle~ 5;
#P newex 193 68 200 1441802 expr (239-($i1+(($i2-$i1)/2)))*7;
#P newex 43 164 63 1441802 *~;
#P newex 43 141 50 1441802 *~ 0.02;
#P newex 26 114 38 1441802 line~;
#P newex 26 93 62 1441802 pack 0 50;
#P newex 26 68 164 1441802 expr ($i1+(($i2-$i1)/2))*5;
#P newex 26 187 27 1441802 +~;
#P newex 26 210 43 1441802 cycle~;
#P newex 96 141 68 1441802 cycle~ 4.5;
#P newex 328 112 26 1441802 b 1;
#P newex 243 244 27 1441802 *~;
#P newex 293 244 27 1441802 *~;
#P message 398 167 32 1441802 stop;
#P message 398 244 14 1441802 0;
#P message 382 244 14 1441802 1;
#P newex 398 192 68 1441802 delay 1000;
#P newex 469 167 62 1441802 delay 201;
#P message 469 192 50 1441802 0. 1000;
#P message 328 167 53 1441802 0.5 1000;
#P newex 328 141 62 1441802 onebang 1;
#P newex 328 217 38 1441802 line~;
#P newex 243 269 60 1441802 dac~;
#N comlet rectangle from jit.findbounds;
#P inlet 26 21 15 0;
#P window setfont Times 10.;
#P comment 358 107 93 1310730 Turn DSP on/off and fade sound in/out;
#P connect 1 0 34 0;
#P connect 34 0 18 0;
#P connect 18 0 19 0;
#P connect 19 0 20 0;
#P connect 20 0 17 0;
#P connect 17 0 16 0;
#P fasten 20 0 21 0 31 136 48 136;
#P connect 21 0 22 0;
#P connect 22 0 17 1;
#P fasten 18 0 33 0 31 89 96 89;
#P connect 15 0 22 1;
#P connect 34 2 18 1;
#P fasten 34 1 23 0 108 64 198 64;
#P connect 23 0 27 0;
#P connect 27 0 28 0;
#P connect 28 0 26 0;
#P connect 26 0 25 0;
#P fasten 28 0 29 0 198 136 215 136;
#P connect 29 0 30 0;
#P connect 30 0 26 1;
#P fasten 16 0 13 0 31 236 248 236;
#P fasten 10 0 2 0 403 265 248 265;
#P fasten 9 0 2 0 387 265 248 265;
#P connect 13 0 2 0;
#P fasten 23 0 35 0 198 89 263 89;
#P fasten 3 0 13 1 333 239 265 239;
#P connect 24 0 30 1;
#P fasten 25 0 12 0 198 231 298 231;
#P connect 12 0 2 1;
#P fasten 3 0 12 1 333 239 315 239;
#P fasten 1 0 14 0 31 39 396 39 396 89 333 89;
#P connect 14 0 4 0;
#P connect 4 0 5 0;
#P connect 5 0 3 0;
#P fasten 6 0 3 0 474 213 333 213;
#P fasten 7 0 4 1 474 188 465 188 465 137 385 137;
#P fasten 4 0 9 0 333 162 387 162;
#P fasten 34 3 23 1 262 64 388 64;
#P fasten 4 0 11 0 333 162 403 162;
#P fasten 7 0 8 0 474 188 403 188;
#P connect 11 0 8 0;
#P connect 8 0 10 0;
#P fasten 14 0 7 0 333 133 474 133;
#P connect 7 0 6 0;
#P pop;
#P newobj 113 138 60 1441802 patcher playtones;
#P window linecount 1;
#P newex 50 117 73 1441802 gate 2;
#P newex 113 96 80 1441802 pack 0 0 0 0;
#P window linecount 2;
#N vpatcher 381 48 730 311;
#P window setfont “Fixedwidth Serif” 10.;
#P newex 77 52 112 1441802 unpack 0 0 0 0;
#P window setfont Times 10.;
#P comment 94 35 148 1310730 Use coordinates to play MIDI notes;
#P comment 158 144 40 1310730 velocity;
#P comment 49 144 28 1310730 pitch;
#P comment 145 109 119 1310730 put in usable velocity range;
#P comment 1 125 72 1310730 look up in scale;
#P comment 1 104 75 1310730 ignore duplicates;
#P window setfont “Fixedwidth Serif” 10.;
#P newex 77 81 170 1441802 expr ($i1+(($i2-$i1)/2))/16;
#P newex 123 123 200 1441802 expr (239-($i1+(($i2-$i1)/2)))/2;
#P newex 77 187 62 1441802 noteout a;
#P newex 77 162 102 1441802 makenote 100 200;
#P number 123 144 35 10 0 0 0 22 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 77 144 35 10 0 0 256 22 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 77 102 44 1441802 change;
#N vtable 20 40 55 250 222 980020 128;
#T set 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;
#P newobj 77 123 38 1441802 table;
#N comlet rectangle from jit.findbounds;
#P inlet 77 34 15 0;
#P window setfont Times 10.;
#P comment 1 83 76 1310730 put in range 0-19;
#P connect 1 0 16 0;
#P connect 16 0 9 0;
#P connect 9 0 3 0;
#P connect 3 0 2 0;
#P connect 2 0 4 0;
#P connect 4 0 6 0;
#P connect 6 0 7 0;
#P fasten 6 1 7 1 174 183 108 183;
#P fasten 16 1 8 0 116 77 128 77;
#P connect 8 0 5 0;
#P connect 5 0 6 1;
#P fasten 16 2 9 1 150 77 242 77;
#P fasten 16 3 8 1 184 73 318 73;
#P pop;
#P newobj 50 138 60 1441802 patcher playnotes;
#P inlet 159 30 15 0;
#P inlet 113 30 15 0;
#P connect 6 0 4 0;
#P connect 4 0 2 0;
#P connect 0 0 3 0;
#P connect 3 0 4 1;
#P connect 4 1 5 0;
#P connect 1 0 3 2;
#P pop;
#P newobj 506 327 142 196626 p tutorial sound;
#P window setfont “Sans Serif” 9.;
#N vpatcher 37 59 326 277;
#P window setfont “Sans Serif” 9.;
#P newex 214 153 27 196617 + 0.;
#P newex 214 132 34 196617 / 10.;
#P newex 179 153 27 196617 + 0.;
#P newex 179 132 34 196617 / 10.;
#P newex 144 153 27 196617 + 0.;
#P newex 144 132 34 196617 / 10.;
#P newex 107 154 27 196617 – 0.;
#P newex 107 133 34 196617 / 10.;
#P newex 72 154 27 196617 – 0.;
#P newex 72 133 34 196617 / 10.;
#P newex 37 154 27 196617 – 0.;
#P newex 37 133 34 196617 / 10.;
#P newex 11 29 33 196617 r rbg;
#P newex 11 52 88 196617 unpack 0. 0. 0. 0.;
#P outlet 214 175 15 0;
#P outlet 179 175 15 0;
#P outlet 144 175 15 0;
#P outlet 107 176 15 0;
#P outlet 72 176 15 0;
#P outlet 37 176 15 0;
#P connect 7 0 6 0;
#P connect 6 1 8 0;
#P connect 6 1 9 0;
#P connect 9 0 0 0;
#P fasten 8 0 9 1 42 152 59 152;
#P fasten 6 2 10 0 68 99 77 99;
#P fasten 6 2 11 0 68 110 77 110;
#P connect 11 0 1 0;
#P fasten 10 0 11 1 77 152 94 152;
#P fasten 6 3 12 0 94 99 112 99;
#P fasten 6 3 13 0 94 110 112 110;
#P connect 13 0 2 0;
#P fasten 12 0 13 1 112 152 129 152;
#P fasten 6 1 14 0 42 99 149 99;
#P fasten 6 1 15 0 42 110 149 110;
#P connect 15 0 3 0;
#P fasten 14 0 15 1 149 151 166 151;
#P fasten 6 2 16 0 68 99 184 99;
#P fasten 6 2 17 0 68 110 184 110;
#P connect 17 0 4 0;
#P fasten 16 0 17 1 184 151 201 151;
#P fasten 6 3 18 0 94 99 219 99;
#P fasten 6 3 19 0 94 110 219 110;
#P connect 19 0 5 0;
#P fasten 18 0 19 1 219 151 236 151;
#P pop;
#P newobj 391 141 202 196617 p color min/max;
#N vpatcher 37 59 380 305;
#P window setfont Times 10.;
#P comment 169 86 36 1310730 bottom;
#P comment 131 86 27 1310730 right;
#P comment 93 86 21 1310730 top;
#P window setfont “Fixedwidth Serif” 10.;
#P newex 50 108 140 1441802 expr $i1+(($i2-$i1)/2);
#P newex 88 129 173 1441802 expr 239-($i1+(($i2-$i1)/2));
#P number 164 71 35 10 0 0 0 22 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 126 71 35 10 0 0 0 22 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 88 71 35 10 0 0 0 22 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 50 71 35 10 0 0 0 22 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 126 50 48 1441802 unpack;
#P newex 50 50 48 1441802 unpack;
#P window setfont Times 10.;
#P comment 55 86 20 1310730 left;
#P inlet 50 30 15 0;
#P inlet 126 30 15 0;
#P outlet 50 131 15 0;
#P outlet 88 152 15 0;
#P connect 3 0 5 0;
#P connect 5 0 7 0;
#P connect 7 0 12 0;
#P connect 12 0 1 0;
#P connect 5 1 8 0;
#P connect 8 0 11 0;
#P connect 11 0 0 0;
#P connect 2 0 6 0;
#P connect 6 0 9 0;
#P connect 6 1 10 0;
#P fasten 9 0 12 1 131 104 185 104;
#P fasten 10 0 11 1 169 100 256 100;
#P pop;
#P newobj 506 362 49 196617 p sliders;
#P flonum 638 166 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 600 166 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 562 166 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 524 166 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 486 199 164 196617 pak max 1. 0. 0. 0.;
#P flonum 467 168 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 429 168 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 391 168 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 353 168 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 315 201 163 196617 pak min 0. 0. 0. 0.;
#P user hslider 166 503 13 305 320 1 0 0;
#P user uslider 486 263 13 225 240 1 0 0;
#P newex 231 158 98 196617 jit.qt.grab 320 240;
#P user jit.pwindow 524 443 89 67 0 1 0 0 1 0;
#P window setfont “Fixedwidth Serif” 10.;
#P newex 525 421 68 1441802 jit.matrix;
#P newex 598 366 110 1441802 prepend srcdimend;
#P toggle 613 411 15 0;
#P objectname usesrcdim;
#P message 613 429 80 1441802 usesrcdim $1;
#P newex 535 392 122 1441802 prepend srcdimstart;
#P window linecount 2;
#P newex 506 292 195 1441802 jit.findbounds @min 0. 0. 0.25 0.5 @max 1. 0.006 0.45 0.75;
#B color 5;
#P toggle 166 91 35 0;
#P window linecount 1;
#P newex 166 132 53 1441802 metro 50;
#P user suckah 168 262 320 241;
#P user jit.pwindow 165 262 322 242 0 1 0 0 1 0;
#P connect 41 0 7 0;
#P connect 40 0 41 0;
#P connect 39 0 11 0;
#P connect 38 0 11 0;
#P connect 28 0 29 0;
#P connect 29 0 3 0;
#P fasten 24 0 13 0 511 503 171 503;
#P fasten 1 0 27 1 173 552 199 552;
#P fasten 2 0 11 0 171 154 236 154;
#P connect 15 0 14 1;
#P connect 25 0 16 0;
#P connect 16 0 14 2;
#P connect 25 1 17 0;
#P connect 17 0 14 3;
#P connect 25 2 18 0;
#P connect 18 0 14 4;
#P fasten 24 1 12 0 550 389 503 389 503 254 491 254;
#P fasten 19 0 4 0 491 254 511 254;
#P fasten 14 0 4 0 320 254 511 254;
#P connect 20 0 19 1;
#P fasten 5 0 9 0 540 413 530 413;
#P fasten 8 0 9 0 603 388 530 388;
#P fasten 6 0 9 0 618 454 608 454 608 417 530 417;
#P connect 9 0 10 0;
#P fasten 25 3 21 0 510 162 567 162;
#P connect 21 0 19 2;
#P fasten 25 4 22 0 548 162 605 162;
#P connect 22 0 19 3;
#P connect 7 0 6 0;
#P fasten 25 5 23 0 586 162 643 162;
#P connect 23 0 19 4;
#P connect 3 0 2 0;
#P fasten 4 0 5 0 511 359 540 359;
#P connect 4 0 24 0;
#P connect 4 0 26 0;
#P fasten 4 0 27 3 511 553 255 553;
#P fasten 4 1 26 1 603 324 643 324;
#P connect 4 1 8 0;
#P fasten 4 1 24 1 603 359 550 359;
#P fasten 4 1 27 4 603 553 283 553;
#P fasten 11 0 9 0 236 259 530 259;
#P fasten 11 0 4 0 236 237 511 237;
#P fasten 11 0 0 0 236 238 171 238;
#P connect 12 0 37 0;
#P fasten 12 0 27 2 491 553 227 553;
#P connect 13 0 27 0;
#P connect 13 0 36 0;
#P connect 27 0 30 0;
#P connect 27 1 31 0;
#P connect 27 2 32 0;
#P window clipboard copycount 42;

#26707
Jul 23, 2006 at 12:11pm

#80151

You must be logged in to reply to this topic.