Forums > Jitter

problem with poly~ and openGL objects

February 6, 2007 | 5:28 pm

the idea of the patch is to be able to send midi notes (polyphonic) so that multiple shapes can be drawn simultaneously. the shape "sustains" whilst the note is held down. upon release, the alpha of the shape decays like a volume envelope… currently it’s still monophonic!?

i’m sure it’s something to do with poly~ / or thispoly~ but i have double checked everything and still doesnt work. the idea originated from randy jones’s poly patch, but this uses target to send messages to this poly. this is not so practical for me as i want to be able to track sustained notes.

thanks,

justin

main patch

#P window setfont "Sans Serif" 9.;
#P window linecount 5;
#P comment 426 339 272 196617 the idea of the patch is to be able to send midi notes (polyphonic) so that multiple shapes can be drawn simultaneously. the shape "sustains" whilst the note is held down. upon release , the alpha of the shape decays like a volume envelope… currently it’s still monophonic!?;
#P window linecount 1;
#P comment 431 298 71 196617 current voice;
#P hidden newex 992 79 69 196617 loadmess 0.1;
#P comment 708 167 36 196617 ms;
#P newex 52 136 104 196617 jit.qball @mode usurp;
#P window setfont "Sans Serif" 18.;
#P comment 81 59 67 196626 render;
#P window setfont "Sans Serif" 9.;
#P newex 52 285 235 196617 jit.window GLpolytest @floating 1 @depthbuffer 0;
#P toggle 52 58 28 0;
#P newex 52 100 52 196617 metro 20;
#P newex 52 173 58 196617 t b erase b;
#P window linecount 2;
#P newex 52 253 271 196617 jit.gl.render GLpolytest @depth_enable 1 @blend_enable 1 @blend_mode 6 7 @smooth_shading 0 @lighting_enable 0;
#P window linecount 1;
#P comment 498 48 405 196617 change screen position on midi noteon , so u can differentiate between different voices…;
#P message 457 232 58 196617 allnotesoff;
#P newex 506 73 51 196617 stripnote;
#P newex 506 95 92 196617 scale 0 127 -1. 1.;
#P message 332 186 50 196617 62 0;
#P newex 332 144 62 196617 prepend set;
#P newex 395 114 54 196617 pack 60 0;
#P message 417 232 39 196617 open 4;
#P number 672 166 35 9 0 0 160 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 395 144 86 196617 prepend midinote;
#P hidden newex 662 204 105 196617 scale 0 255 20 4000;
#P hidden newex 662 237 74 196617 prepend decay;
#P user dial 672 130 35 35 256 1 0 0 223 270 1 1. 255 255 255 255 255 255 120 120 120 225 225 225 0 0 0 0 0 0;
#P comment 708 141 36 196617 decay;
#P comment 961 178 68 196617 all (xyz);
#P flonum 920 178 40 9 0. 100. 35 3 0 0 0 255 255 255 255 255 255 0 0 0;
#P flonum 748 178 40 9 0. 100. 35 3 0 0 0 255 255 255 255 255 255 0 0 0;
#P comment 789 179 42 196617 smooth;
#P hidden newex 782 222 98 196617 prepend smooth.pos;
#P hidden newex 768 204 99 196617 pak position 0. 0. 0.;
#P hidden newex 930 205 123 196617 pak scale 0.04 0.04 0.04;
#P comment 919 115 45 196617 scale;
#B frgb 255 0 0;
#P comment 961 163 14 196617 z;
#P comment 961 147 14 196617 y;
#P comment 961 130 14 196617 x;
#P flonum 920 162 40 9 0. 100. 35 3 0 0 0 255 255 255 255 255 255 0 0 0;
#P flonum 920 146 40 9 0. 100. 35 3 0 0 0 255 255 255 255 255 255 0 0 0;
#P flonum 920 130 40 9 0. 100. 35 3 0 0 0 255 255 255 255 255 255 0 0 0;
#P comment 746 115 45 196617 position;
#B frgb 255 0 0;
#P flonum 748 162 40 9 0 0 32 3 0 0 0 255 255 255 255 255 255 0 0 0;
#P comment 789 163 14 196617 z;
#P flonum 748 146 40 9 0 0 32 3 0 0 0 255 255 255 255 255 255 0 0 0;
#P comment 789 147 14 196617 y;
#P flonum 748 130 40 9 0 0 32 3 0 0 0 255 255 255 255 255 255 0 0 0;
#P comment 789 130 46 196617 x – pan;
#P hidden newex 768 271 62 196617 s polyshape;
#P number 395 297 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 395 271 285 196617 poly~ poly.gridshapetest 4 steal 0 args GLpolytest polyshape;
#P newex 395 46 98 196617 notein;
#P fasten 42 0 41 0 57 87 57 87;
#P connect 41 0 45 0;
#P connect 45 0 40 0;
#P connect 40 0 39 0;
#P connect 40 1 39 0;
#P fasten 32 0 33 0 400 137 337 137;
#P connect 33 0 34 0;
#P connect 0 0 32 0;
#P connect 32 0 29 0;
#P fasten 31 0 1 0 422 258 400 258;
#P fasten 37 0 1 0 462 258 400 258;
#P connect 29 0 1 0;
#P connect 1 0 2 0;
#P connect 0 1 32 1;
#P fasten 0 0 36 0 400 68 511 68;
#P connect 36 0 35 0;
#P fasten 0 1 36 1 444 68 552 68;
#P hidden connect 26 0 28 0;
#P hidden connect 28 0 27 0;
#P hidden fasten 28 0 30 0 667 224 677 224;
#P hidden fasten 35 0 5 0 511 114 753 114;
#P hidden connect 27 0 3 0;
#P hidden connect 18 0 3 0;
#P hidden connect 19 0 3 0;
#P hidden connect 22 0 20 0;
#P hidden connect 5 0 19 1;
#P hidden connect 7 0 19 2;
#P hidden connect 9 0 19 3;
#P hidden connect 23 0 11 0;
#P hidden connect 23 0 12 0;
#P hidden connect 23 0 13 0;
#P hidden connect 47 0 23 0;
#P hidden connect 11 0 18 1;
#P hidden connect 12 0 18 2;
#P hidden connect 13 0 18 3;
#P window clipboard copycount 50;

save as poly.gridshapetest

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P message 53 354 14 196617 0;
#P newex 53 332 48 196617 loadbang;
#P window linecount 2;
#P comment 94 430 211 196617 set busy (1) on note on , set busy (0) on note off after envelope decay;
#P toggle 82 458 15 0;
#P window linecount 1;
#N out 1;
#P newobj 40 458 33 196617 out 1;
#P newex 40 430 52 196617 thispoly~;
#P newex 461 366 27 196617 1.;
#P newex 373 411 99 196617 pak color 1. 0. 0. 1.;
#P comment 291 165 100 196617 set alpha amt;
#P comment 353 258 100 196617 alpha decay duration;
#P newex 282 257 69 196617 pack 1. 1000;
#P message 146 305 97 196617 0.637795 , 0. 1000;
#P message 282 278 79 196617 set $1 \, 0. $2;
#P newex 146 322 40 196617 line 0.;
#P newex 282 180 40 196617 / 127.;
#P newex 104 132 40 196617 t b 1 i;
#P newex 34 65 58 196617 unpack 0 0;
#P newex 82 109 32 196617 sel 0;
#P newex 313 49 31 196617 r $2;
#P newex 313 81 289 196617 route duration decay midipan;
#P newex 176 348 27 196617 0;
#P message 300 374 53 196617 enable $1;
#P window linecount 2;
#P newex 373 473 343 196617 jit.gl.gridshape $1 @shape plane @enable 0 @depth_enable 1 @blend_enable 1 @blend_mode 6 7 @smooth_shading 0 @lighting_enable 0;
#P window linecount 1;
#N in 1;
#P newobj 34 29 25 196617 in 1;
#P comment 61 29 149 196617 midi note msg;
#P connect 18 0 17 4;
#P fasten 11 0 18 0 151 345 466 345;
#P connect 10 0 14 0;
#P fasten 10 0 18 0 287 210 466 210;
#P connect 5 3 2 0;
#P connect 17 0 2 0;
#P connect 3 0 2 0;
#P connect 5 1 14 1;
#P fasten 6 0 5 0 318 76 318 76;
#P fasten 4 0 3 0 181 369 305 369;
#P fasten 9 1 19 0 124 289 45 289;
#P connect 9 1 3 0;
#P connect 14 0 12 0;
#P connect 9 2 10 0;
#P connect 11 1 4 0;
#P connect 13 0 11 0;
#P fasten 12 0 13 0 287 301 151 301;
#P connect 7 0 13 0;
#P connect 7 1 9 0;
#P connect 19 1 21 0;
#P connect 8 1 7 0;
#P connect 23 0 24 0;
#P connect 19 0 20 0;
#P connect 24 0 19 0;
#P fasten 9 0 19 0 109 289 45 289;
#P fasten 4 0 19 0 181 386 45 386;
#P connect 1 0 8 0;
#P window clipboard copycount 25;


February 6, 2007 | 5:52 pm

please ignore this post, found the problem…

:)


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