A problem with table and poly~

Oct 15, 2008 at 12:10pm

A problem with table and poly~

It’s one of these days again …
I am facing the following problem for which i am sure i had solved it before :)

Is it possible to create a table outside a poly~ object and
then refer to it by name inside the various instances in order to read from it ?
I’ve tried both using the name of the table within the poly~ as well as sending a refer message to it without however any success .
In this situation i don’t want to have the table saved first .
I am pretty sure i am doing something wrong but for some reason i can’t seem to find what the problem is .

cheers

Greg

#40348
Oct 15, 2008 at 12:35pm

On 15 Oct 2008, at 14:10, Greg wrote:
>
> It’s one of these days again …
> I am facing the following problem for which i am sure i had solved
> it before :)
>
> Is it possible to create a table outside a poly~ object and
> then refer to it by name inside the various instances in order to
> read from it ?
> I’ve tried both using the name of the table within the poly~ as
> well as sending a refer message to it without however any
> success .
> In this situation i don’t want to have the table saved first .
> I am pretty sure i am doing something wrong but for some reason i
> can’t seem to find what the problem is .
>

it’s not clear from your post, what the problem is. you might like to
send a patch.
using a named table works fine here on max4.6
volker.

/* save as polyTable */

#P window setfont “Sans Serif” 9.;
#P number 74 217 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 179 75 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 165 219 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 134 191 40 196617 unpack;
#P number 126 218 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 179 108 53 196617 target $1;
#P number 134 74 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#N vtable 128 20 74 230 241 0 128 a;
#P newobj 74 142 40 196617 table a;
#P newex 134 143 90 196617 poly~ polyTable 4;
#P comment 169 238 100 196617 instance;
#P connect 3 0 2 0;
#P connect 3 0 1 0;
#P connect 2 0 9 0;
#P connect 6 0 5 0;
#P connect 4 0 1 0;
#P connect 1 0 6 0;
#P connect 6 1 7 0;
#P connect 8 0 4 0;
#P window clipboard copycount 10;

/* main patch */

#P window setfont “Sans Serif” 9.;
#P number 74 217 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 179 75 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 165 219 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 134 191 40 196617 unpack;
#P number 126 218 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 179 108 53 196617 target $1;
#P number 134 74 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#N vtable 128 20 74 230 241 0 128 a;
#P newobj 74 142 40 196617 table a;
#P newex 134 143 90 196617 poly~ polyTable 4;
#P comment 169 238 100 196617 instance;
#P connect 3 0 2 0;
#P connect 3 0 1 0;
#P connect 2 0 9 0;
#P connect 6 0 5 0;
#P connect 4 0 1 0;
#P connect 1 0 6 0;
#P connect 6 1 7 0;
#P connect 8 0 4 0;
#P window clipboard copycount 10;

#142646
Oct 15, 2008 at 1:07pm

Hi Volker
Here is the patch ,
It is quite messy but i indicated where the table i am trying to access is within the grain~ subpatch .

/ save as Grain~ /

max v2;
#N vpatcher 6 40 1376 949;
#P window setfont “Sans Serif” 9.;
#P message 322 597 14 9109513 1;
#P message 256 620 14 9109513 6;
#P newex 256 595 28 9109513 sel 0;
#P newex 256 569 27 9109513 % 6;
#P newex 256 543 46 9109513 thispoly~;
#N vpatcher 350 51 1321 852;
#N comlet Loadbang;
#P inlet 197 132 15 0;
#P window setfont “Sans Serif” 9.;
#N vpatcher 699 145 1336 676;
#P toggle 452 236 15 0;
#P window setfont “Sans Serif” 9.;
#P window linecount 0;
#P message 429 235 14 9109513 1;
#P message 384 236 42 9109513 0 , 1 100;
#N comlet Loadbang;
#P inlet 384 89 15 0;
#P window linecount 1;
#P newex 10 207 27 9109513 + 1;
#P newex 10 182 77 9109513 receive direction;
#P newex 314 199 27 9109513 + 1;
#P newex 314 170 47 9109513 random 2;
#P newex 108 271 84 9109513 switch 2;
#P newex 60 324 58 9109513 switch 3;
#N comlet Duration (int);
#P inlet 210 75 15 0;
#N comlet Bang;
#P inlet 145 66 15 0;
#N comlet Output To Line;
#P outlet 60 383 15 0;
#P message 182 197 37 9109513 1 , 0 $1;
#P message 145 197 34 9109513 0 , 1 $1;
#P newex 145 127 75 9109513 float;
#P connect 10 0 11 0;
#P fasten 14 0 6 0 434 315 65 315;
#P lcolor 6;
#P fasten 11 0 6 0 15 252 65 252;
#P fasten 13 0 3 0 389 352 65 352;
#P lcolor 6;
#P connect 6 0 3 0;
#P fasten 1 0 6 1 150 226 81 226;
#P lcolor 15;
#P fasten 2 0 6 2 187 226 97 226;
#P lcolor 15;
#P fasten 9 0 7 0 319 235 113 235;
#P connect 7 0 6 3;
#P connect 4 0 0 0;
#P connect 0 0 1 0;
#P fasten 1 0 7 1 150 224 150 224;
#P lcolor 15;
#P fasten 0 0 2 0 150 161 187 161;
#P fasten 2 0 7 2 187 223 187 223;
#P lcolor 15;
#P connect 5 0 0 1;
#P fasten 4 0 8 0 150 102 319 102;
#P lcolor 13;
#P connect 8 0 9 0;
#P connect 12 0 13 0;
#P lcolor 6;
#P fasten 12 0 14 0 389 199 434 199;
#P lcolor 6;
#P fasten 12 0 15 0 389 194 457 194;
#P pop;
#P newobj 59 177 77 9109513 p lineparameters;
#N vpatcher 682 428 1318 885;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 107 61 37 9109513 r delay;
#P newex 70 131 107 9109513 * 1.;
#P newex 70 104 47 9109513 random 0;
#P newex 50 70 30 9109513 t b b;
#P newex 50 176 30 9109513 delay;
#N comlet GrainSize;
#P inlet 167 86 15 0;
#N comlet Bang;
#P inlet 50 25 15 0;
#N comlet Bang;
#P outlet 50 222 15 0;
#P window setfont “Sans Serif” 14.;
#P window linecount 0;
#P comment 187 67 101 9109518 By delaying the line Bang i can control te density of the grain cloud !!;
#B color 14;
#P connect 2 0 5 0;
#P connect 5 0 4 0;
#P connect 4 0 1 0;
#P connect 5 1 6 0;
#P connect 6 0 7 0;
#P connect 7 0 4 1;
#P connect 8 0 6 1;
#P connect 3 0 7 1;
#P pop;
#P newobj 158 292 78 9109513 p Density;
#N comlet Duration;
#P inlet 92 79 15 0;
#N comlet Line~;
#P outlet 60 311 15 0;
#N comlet Line Bang;
#P outlet 158 354 15 0;
#P window linecount 1;
#P newex 92 103 60 9109513 maximum 2.;
#P newex 59 228 76 9109513 line~;
#P window setfont “Sans Serif” 14.;
#P window linecount 0;
#P comment 294 52 140 9109518 Select grain direction;
#B color 8;
#P comment 294 70 140 9109518 Normal , Reverse , Random selection;
#B color 8;
#P fasten 7 0 8 0 163 323 248 323 248 163 64 163;
#P lcolor 13;
#P connect 8 0 2 0;
#P connect 2 0 5 0;
#P connect 6 0 3 0;
#P connect 3 0 8 1;
#P fasten 9 0 8 2 202 152 130 152;
#P fasten 2 1 7 0 130 261 163 261;
#P connect 7 0 4 0;
#P fasten 3 0 7 1 97 130 231 130;
#P pop;
#P newobj 346 252 93 9109513 p directionandDense;
#P newex 274 687 79 9109513 gate~ 6;
#N out~ 6;
#P newobj 395 740 34 9109513 out~ 6;
#N out~ 5;
#P newobj 361 740 34 9109513 out~ 5;
#N out~ 4;
#P newobj 327 740 34 9109513 out~ 4;
#N out~ 3;
#P newobj 293 740 34 9109513 out~ 3;
#P newex 256 216 45 9109513 loadbang;
#N out~ 2;
#P newobj 259 740 34 9109513 out~ 2;
#N vpatcher 251 306 1214 1079;
#P window setfont “Sans Serif” 14.;
#P window linecount 7;
#P comment 502 22 302 9109518 Options : A] Grainmode : 1-move through the loop frame by frame. 2-move through the loop choosing random frames . B] Stepmode: 1- constant repetition of each frame. 2- random repetition of each frame. 3- Propability repetition of each frame based on the table Steps.;
#B color 14;
#P window setfont “Sans Serif” 9.;
#P window linecount 0;
#N vpatcher 633 306 1233 706;
#P window setfont “Sans Serif” 9.;
#P message 405 201 14 9109513 1;
#P window linecount 1;
#P newex 9 188 27 9109513 + 1;
#P newex 9 164 55 9109513 r stepmode;
#B color 14;
#P toggle 315 211 15 0;
#P window linecount 0;
#P message 249 203 54 9109513 refer steps;
#P window linecount 1;
#P comment 69 165 44 9109513 Constant;
#B color 14;
#P comment 214 165 49 9109513 Propability;
#B color 14;
#N comlet Loadbang;
#P inlet 405 128 15 0;
#N vtable 128 15 55 225 222 4 128;
#P newobj 209 239 40 9109513 table;
#P newex 107 115 27 9109513 + 1;
#P newex 166 207 27 9109513 t i b;
#P newex 56 301 165 9109513 switch 3;
#P newex 158 239 39 9109513 random;
#P newex 107 89 37 9109513 r steps;
#P window setfont “Sans Serif” 14.;
#P comment 29 20 213 9109518 number of repetetions per frame;
#B color 14;
#N comlet Bang Selection;
#P inlet 209 128 15 0;
#N comlet Number Of Steps;
#P outlet 56 353 15 0;
#P window setfont “Sans Serif” 9.;
#P window linecount 0;
#P comment 143 165 44 9109513 Random;
#B color 14;
#P comment 411 164 100 9109513 Bang initial conditions;
#P connect 16 0 17 0;
#P fasten 17 0 7 0 14 235 61 235;
#P fasten 18 0 7 0 410 274 61 274;
#P lcolor 15;
#P connect 7 0 2 0;
#P connect 5 0 9 0;
#P connect 9 0 7 1;
#P fasten 3 0 6 0 214 179 163 179;
#P lcolor 13;
#P connect 8 1 6 0;
#P connect 6 0 7 2;
#P fasten 9 0 8 0 112 179 171 179;
#P connect 8 0 6 1;
#P connect 14 0 10 0;
#P connect 3 0 10 0;
#P lcolor 13;
#P connect 10 0 7 3;
#P fasten 11 0 14 0 410 185 254 185;
#P lcolor 15;
#P fasten 11 0 15 0 410 176 320 176;
#P lcolor 15;
#P connect 11 0 18 0;
#P lcolor 15;
#P pop;
#P newobj 183 160 54 9109513 p repetition;
#P window linecount 1;
#P newex 296 324 76 9109513 r SegmentNumb;
#B color 14;
#P newex 157 581 25 9109513 sig~;
#N comlet New_Loopsize;
#P inlet 190 491 15 0;
#P window linecount 0;
#P newex 189 531 33 9109513 r start;
#P newex 157 556 27 9109513 +;
#P number 259 417 52 9 0 0 0 139 0 0 0 40 204 140 222 222 222 0 0 0;
#P newex 330 407 27 9109513 + 1;
#P newex 330 370 85 9109513 receive grainmode;
#B color 14;
#P newex 157 473 73 9109513 switch;
#P newex 259 364 47 9109513 random 2;
#P button 163 306 20 0;
#N comlet Loadbang;
#P inlet 424 85 15 0;
#P window linecount 1;
#P newex 163 275 28 9109513 sel 1;
#N counter 0 0 1;
#X flags 0 0;
#P newobj 127 246 66 9109513 counter 0 0 1;
#N comlet Offset (signal);
#P outlet 157 609 15 0;
#P window linecount 0;
#P newex 157 523 27 9109513 * 1.;
#N comlet Line Bang;
#P inlet 127 167 15 0;
#N counter 0 0 2;
#X flags 0 0;
#P newobj 127 365 66 9109513 counter 0 0 2;
#P window linecount 1;
#P newex 183 325 76 9109513 r SegmentNumb;
#B color 14;
#P window setfont “Sans Serif” 14.;
#P window linecount 0;
#P comment 20 21 238 9109518 Define how to move through out loop;
#B color 14;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P message 424 123 14 9109513 1;
#P window setfont “Sans Serif” 18.;
#P comment 236 153 130 9109522 < - open this to find the Table;
#B color 14;
#P connect 5 0 8 0;
#P fasten 9 0 4 0 168 302 132 302;
#P lcolor 13;
#P fasten 15 0 13 0 335 438 162 438;
#P lcolor 15;
#P fasten 1 0 13 0 429 447 162 447;
#P lcolor 15;
#P connect 13 0 6 0;
#P connect 6 0 17 0;
#P connect 17 0 20 0;
#P connect 20 0 7 0;
#P connect 8 2 9 0;
#P fasten 9 0 11 0 168 302 168 302;
#P lcolor 13;
#P fasten 19 0 6 1 195 513 179 513;
#P connect 18 0 17 1;
#P fasten 9 0 22 0 168 302 316 302 316 88 188 88;
#P lcolor 13;
#P connect 22 0 8 4;
#P connect 3 0 4 4;
#P fasten 4 0 13 1 132 399 193 399;
#P fasten 12 0 13 2 264 400 224 400;
#P fasten 10 0 22 1 429 119 232 119;
#P lcolor 15;
#P fasten 9 0 12 0 168 302 264 302;
#P lcolor 13;
#P connect 12 0 16 0;
#P connect 21 0 12 1;
#P connect 14 0 15 0;
#P lcolor 15;
#P connect 10 0 1 0;
#P pop;
#P newobj 556 419 147 9109513 p offset;
#P newex 346 164 55 9109513 bondo 1. 1.;
#N vpatcher 93 14 898 680;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 175 159 44 9109513 r release;
#P newex 117 173 40 9109513 r attack;
#P flonum 175 181 73 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 117 197 57 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 59 225 126 9109513 trapezoid~ 0.1 0.8;
#P window setfont “Sans Serif” 14.;
#P comment 268 26 105 9109518 Grain_envelope;
#B color 12;
#N comlet Input Signal (0- 1);
#P inlet 59 79 15 0;
#N comlet Envelope;
#P outlet 58 380 15 0;
#N comlet Trigger bang (signal);
#P outlet 287 381 15 0;
#P window setfont “Sans Serif” 10.;
#P window linecount 0;
#P comment 23 78 36 9109514 Signal;
#B color 12;
#P window setfont “Sans Serif” 9.;
#P comment 448 81 60 9109513 relation between transposition amount and envelope duration;
#B color 12;
#P connect 6 0 3 0;
#P connect 4 0 6 0;
#P connect 9 0 7 0;
#P connect 7 0 6 1;
#P connect 10 0 8 0;
#P connect 8 0 6 2;
#P fasten 6 0 2 0 64 271 292 271;
#P pop;
#P newobj 489 600 83 9109513 p Grain envelope;
#N vpatcher 618 107 1232 583;
#P origin 0 21;
#P window setfont “Sans Serif” 9.;
#P window linecount 0;
#P newex 50 365 27 9109513 int;
#P newex 50 223 28 9109513 * 0.5;
#P newex 50 132 49 9109513 change 0.;
#P newex 50 338 66 9109513 + 0.;
#N comlet Trigger snap;
#P inlet 125 21 15 0;
#N comlet Transposition Factor;
#P outlet 50 409 15 0;
#P window linecount 1;
#P newex 50 180 55 9109513 * 1.;
#P newex 103 133 50 9109513 r loop_var;
#P newex 50 107 51 9109513 snapshot~;
#P newex 50 291 55 9109513 * 1.;
#P newex 50 26 35 9109513 noise~;
#P newex 95 235 50 9109513 r grainsize;
#P comment 206 114 100 9109513 Randomness Amount;
#B color 12;
#P fasten 8 0 4 0 130 55 55 55;
#P connect 2 0 4 0;
#P connect 4 0 10 0;
#P connect 10 0 6 0;
#P connect 6 0 11 0;
#P connect 11 0 3 0;
#P connect 3 0 9 0;
#P connect 9 0 12 0;
#P connect 12 0 7 0;
#P fasten 5 0 6 1 108 165 100 165;
#P connect 1 0 3 1;
#P fasten 1 0 9 1 100 257 111 257;
#P pop;
#P newobj 346 81 52 9109513 p loopsizer;
#N vpatcher 656 61 1276 644;
#P window setfont “Sans Serif” 9.;
#P newex 116 386 27 9109513 !/ 1.;
#P newex 95 360 31 9109513 sel 0.;
#P newex 95 254 28 9109513 * 0.5;
#P newex 95 332 98 9109513 + 0.;
#N comlet Trigger~;
#P inlet 117 94 15 0;
#N comlet Transposition Factor;
#P outlet 116 420 15 0;
#P window linecount 1;
#P newex 95 224 55 9109513 * 1.;
#P newex 166 78 59 9109513 r trnsSpread;
#B color 14;
#P newex 95 180 51 9109513 snapshot~;
#B color 12;
#P newex 95 295 55 9109513 * 1.;
#P newex 95 50 35 9109513 noise~;
#B color 12;
#P newex 233 78 30 9109513 r trns;
#B color 14;
#P window linecount 3;
#P comment 166 40 63 9109513 Randomness transposition Amount;
#B color 12;
#P window linecount 0;
#P comment 142 388 86 9109513 transposition factor;
#B color 12;
#P connect 3 0 5 0;
#P connect 9 0 5 0;
#P connect 5 0 7 0;
#P connect 7 0 11 0;
#P connect 11 0 4 0;
#P connect 4 0 10 0;
#P connect 10 0 12 0;
#P connect 12 1 13 0;
#P connect 13 0 8 0;
#P fasten 6 0 7 1 171 207 145 207;
#P fasten 2 0 4 1 238 263 145 263;
#P fasten 2 0 10 1 238 293 188 293;
#P pop;
#P newobj 497 123 71 9109513 p Transposition;
#P newex 346 199 55 9109513 * 1.;
#N out~ 1;
#P newobj 225 740 34 9109513 out~ 1;
#P flonum 507 182 55 9 0 0 0 139 0 0 0 40 204 140 222 222 222 0 0 0;
#P window setfont “Sans Serif” 12.;
#P newex 344 642 156 9109516 *~;
#P newex 345 568 84 9109516 +~;
#P window setfont “Sans Serif” 10.;
#P flonum 436 226 64 10 0 0 0 139 0 0 0 40 204 140 222 222 222 0 0 0;
#P newex 345 420 102 9109514 *~;
#P window setfont “Sans Serif” 12.;
#P newex 345 606 79 9109516 play~ sound;
#P window setfont “Sans Serif” 14.;
#P comment 500 231 97 9109518 loop size in ms;
#B color 12;
#P window setfont “Sans Serif” 12.;
#P comment 559 179 82 9109516 Transposition;
#B color 12;
#P window setfont “Sans Serif” 9.;
#P comment 78 43 80 9109513 Granulation Kernel;
#B color 12;
#P user panel 71 35 98 30;
#X brgb 191 191 191;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P window setfont “Sans Serif” 12.;
#P comment 769 594 61 9109516 Triggers;
#P user panel 754 594 96 17;
#X brgb 164 166 216;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P window setfont “Sans Serif” 18.;
#P window linecount 5;
#P comment 594 435 100 9109522 Within this Patcher is the patcher repetition !!!!!!;
#B color 14;
#P connect 26 0 13 0;
#P connect 21 0 28 0;
#P connect 28 0 29 0;
#P connect 29 0 30 0;
#P connect 30 0 31 0;
#P connect 26 1 20 0;
#P connect 32 0 26 0;
#P fasten 31 0 26 0 261 648 279 648;
#P connect 30 1 26 0;
#P connect 26 2 22 0;
#P fasten 21 0 32 0 261 538 327 538;
#P lcolor 15;
#P connect 26 3 23 0;
#P connect 11 0 26 1;
#P connect 7 0 11 0;
#P connect 27 0 8 0;
#P connect 8 0 10 0;
#P connect 10 0 7 0;
#P fasten 27 1 16 0 434 305 653 305 653 70 351 70;
#P lcolor 13;
#P connect 16 0 18 0;
#P connect 18 0 14 0;
#P connect 14 0 27 0;
#P connect 26 4 24 0;
#P fasten 15 0 18 1 502 154 396 154;
#P connect 18 1 14 1;
#P connect 26 5 25 0;
#P fasten 19 0 10 1 561 475 424 475;
#P fasten 21 0 27 1 261 245 434 245;
#P lcolor 15;
#P fasten 16 0 9 0 351 125 441 125;
#P fasten 9 0 8 1 441 304 442 304;
#P fasten 27 0 17 0 351 344 494 344;
#P connect 17 0 11 1;
#P fasten 27 1 15 0 434 296 638 296 638 87 502 87;
#P lcolor 13;
#P fasten 15 0 12 0 502 154 512 154;
#P fasten 27 1 19 0 434 312 561 312;
#P lcolor 13;
#P fasten 14 0 19 1 351 224 629 224;
#P fasten 21 0 19 2 261 249 697 249;
#P lcolor 15;
#P pop;

/the main patch /

max v2;
#N vpatcher 17 20 1417 929;
#P origin 0 48;
#N vpreset 2;
#X append 1 2 13 79 156 flonum float 6. ; 14 96 210 flonum float 0.02 ; 15 96 271 flonum float 1. ; 17 711 417 gain~ list 107 10. ; 21 96 312 flonum float 0.31 ; 22 96 360 flonum;
#X append 1 2 float 0.35 ; 24 132 15 flonum float 0. ; 26 96 406 number int 24 ; 27 711 443 gain~ list 107 10. ; 30 182 385 umenu int 0 ; 31 182 280 umenu int 0 ; 32 466 1150;
#X append 1 2 umenu int 0 ; 34 537 1150 flonum float 19690.521484 ; 37 131 71 number int 32 ; 48 185 495 umenu int 0 ; 54 463 1255 flonum float 0. ; 56 96 444 number int 0 ; 63 518 829;
#X append 1 2 multiSlider list 58 58 58 58 58 58 58 57 57 57 57 57 57 57 57 57 ; 65 249 141 number int 163 ;;
#X append 2 2 13 79 156 flonum float 50. ; 14 96 210 flonum float 0.05 ; 15 96 271 flonum float 1. ; 17 711 417 gain~ list 107 10. ; 21 96 312 flonum float 0.16 ; 22 96 360 flonum;
#X append 2 2 float 0.29 ; 24 132 15 flonum float 0. ; 26 96 406 number int 16 ; 27 711 443 gain~ list 107 10. ; 30 182 385 umenu int 0 ; 31 182 280 umenu int 0 ; 32 466 1150;
#X append 2 2 umenu int 0 ; 34 537 1150 flonum float 19690.521484 ; 37 131 71 number int 32 ; 48 185 495 umenu int 0 ; 54 463 1255 flonum float 0. ; 56 96 444 number int 0 ; 63 518 829;
#X append 2 2 multiSlider list 78 50 74 89 70 42 22 19 42 68 62 38 32 27 11 0 ; 65 249 141 number int 18 ;;
#P preset 497 56 100 17;
#P window setfont “Sans Serif” 9.;
#P window linecount 2;
#P comment 386 154 100 9109513 One segment at a time or random;
#B color 14;
#P number 141 249 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 829 616 46 9109513 listfunnel;
#P user multiSlider 829 518 210 76 0. 100. 16 2921 15 0 0 2 16 45 0;
#M frgb 0 0 0;
#M brgb 255 255 255;
#M rgb2 127 127 127;
#M rgb3 0 0 0;
#M rgb4 37 52 91;
#M rgb5 74 105 182;
#M rgb6 112 158 18;
#M rgb7 149 211 110;
#M rgb8 187 9 201;
#M rgb9 224 62 37;
#M rgb10 7 114 128;
#N vtable 16 15 55 225 222 980004 101;
#P newobj 829 647 54 9109513 table steps;
#P window setfont “Sans Serif” 14.;
#P comment 238 78 38 9109518 Pitch;
#B color 14;
#P window setfont “Sans Serif” 9.;
#P newex 141 287 78 9109513 s SegmentNumb;
#N vpatcher 487 361 1087 761;
#P window setfont “Sans Serif” 12.;
#P window linecount 2;
#P comment 128 301 71 9109516 Number Of Segments;
#B color 12;
#N comlet LoopSize;
#P inlet 50 98 15 0;
#P window setfont “Sans Serif” 9.;
#P number 131 288 62 9 0 0 0 139 0 0 0 255 92 174 222 222 222 0 0 0;
#N comlet NumberOfSegments;
#P outlet 65 299 15 0;
#P window linecount 1;
#P newex 104 84 56 9109513 !- 0.;
#P newex 150 61 29 9109513 r end;
#B color 14;
#P newex 104 61 33 9109513 r start;
#B color 14;
#P newex 50 246 27 9109513 int;
#P newex 50 224 118 9109513 / 1.;
#P newex 50 186 64 9109513 !- 0.;
#P newex 50 150 64 9109513 bondo 1. 1.;
#P window setfont “Sans Serif” 12.;
#P window linecount 0;
#P comment 159 83 73 9109516 Audio Loop Points;
#B color 12;
#P fasten 10 0 1 0 55 141 55 141;
#P connect 1 0 2 0;
#P connect 2 0 3 0;
#P connect 3 0 4 0;
#P fasten 4 0 8 0 55 278 70 278;
#P connect 5 0 7 0;
#P fasten 7 0 1 1 109 140 109 140;
#P connect 1 1 2 1;
#P fasten 4 0 9 0 55 274 136 274;
#P fasten 6 0 7 1 155 79 155 79;
#P fasten 10 0 3 1 55 125 163 125;
#P pop;
#P newobj 141 208 102 9109513 p NumberOfSegments;
#P newex 995 389 46 9109513 send end;
#P newex 894 387 50 9109513 send start;
#P number 444 96 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 444 117 39 9109513 s delay;
#P flonum 1255 463 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 832 157 35 9109513 r Bang;
#P message 692 175 110 9109513 unit samples , grid 44100;
#P message 692 160 48 9109513 snap zero;
#P message 801 175 49 9109513 set sound;
#P user waveform~ 692 192 515 177 139 9;
#W mode select;
#W snap zero;
#W mouseoutput continuous;
#W unit samples;
#W grid 44100.;
#W ticks 0;
#W labels 1;
#W vlabels 0;
#W vticks 1;
#W bpm 120. 4.;
#W frgb 33 0 0;
#W brgb 243 252 246;
#W rgb2 8 255 47;
#W rgb3 181 181 181;
#W rgb4 229 249 241;
#W rgb5 254 186 44;
#W rgb6 100 100 100;
#W rgb7 86 76 64;
#P user umenu 495 185 100 9109543 1 64 201 1;
#X add normal;
#X add random;
#X add propability;
#P newex 495 207 57 9109513 s stepmode;
#P user meter~ 652 482 665 568 50 0 168 0 103 103 103 255 153 0 255 0 0 217 217 0 153 186 0 12 3 3 3 3;
#P user meter~ 634 482 647 568 50 0 168 0 103 103 103 255 153 0 255 0 0 217 217 0 153 186 0 12 3 3 3 3;
#P user meter~ 613 482 626 568 50 0 168 0 103 103 103 255 153 0 255 0 0 217 217 0 153 186 0 12 3 3 3 3;
#P user meter~ 570 481 583 567 50 0 168 0 103 103 103 255 153 0 255 0 0 217 217 0 153 186 0 12 3 3 3 3;
#P user meter~ 553 481 566 567 50 0 168 0 103 103 103 255 153 0 255 0 0 217 217 0 153 186 0 12 3 3 3 3;
#P user meter~ 536 481 549 567 50 0 168 0 103 103 103 255 153 0 255 0 0 217 217 0 153 186 0 12 3 3 3 3;
#P newex 415 359 40 9109513 r topoly;
#P comment 59 117 67 9109513 Grain_density;
#B color 12;
#P newex 71 147 55 9109513 mousefilter;
#P number 71 131 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#N vpatcher 405 38 1005 438;
#P window setfont “Sans Serif” 9.;
#P newex 301 312 26 9109513 print;
#N comlet Number_of_grains;
#P inlet 192 40 15 0;
#P newex 222 323 42 9109513 s topoly;
#P window linecount 1;
#P message 293 271 50 9109513 mute $1 1;
#P window linecount 0;
#P newex 293 242 27 9109513 +;
#P newex 262 202 40 9109513 uzi;
#P newex 262 127 72 9109513 t b i i;
#P newex 293 166 27 9109513 !- 32;
#P message 222 252 50 9109513 mute $1 0;
#P newex 192 159 27 9109513 t b i;
#P newex 192 202 40 9109513 uzi;
#P flonum 192 83 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P connect 10 0 0 0;
#P connect 0 0 2 0;
#P connect 2 0 1 0;
#P fasten 2 1 1 1 214 182 227 182;
#P connect 1 2 3 0;
#P connect 3 0 9 0;
#P fasten 8 0 9 0 298 307 227 307;
#P fasten 0 0 5 0 197 121 267 121;
#P connect 5 0 6 0;
#P connect 4 0 6 1;
#P connect 5 1 4 0;
#P connect 6 2 7 0;
#P connect 7 0 8 0;
#P connect 8 0 11 0;
#P connect 3 0 11 0;
#P fasten 5 2 7 1 329 226 315 226;
#P pop;
#P newobj 71 164 71 9109513 p grain_desnse;
#P comment 1150 524 100 9109513 duration in mseconds;
#B color 12;
#P flonum 1150 537 102 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#N vpatcher 15 55 719 769;
#N comlet Divisor;
#P inlet 121 231 15 0;
#P window setfont “Sans Serif” 9.;
#P newex 121 291 57 9109513 send Points;
#P window linecount 1;
#N vpatcher 343 312 1092 866;
#N comlet Segment Length (ms);
#P outlet 185 265 15 0;
#N comlet SoundfileDuration;
#P inlet 215 48 15 0;
#N comlet Divide Sample in #1 of segments;
#P inlet 118 46 15 0;
#P window setfont “Sans Serif” 9.;
#P flonum 185 199 47 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 118 118 65 9109513 bondo 100. 0.;
#P flonum 118 93 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 118 162 65 9109513 !/ 100.;
#P newex 62 197 123 9109513 pack 0. 0. 0.;
#P flonum 215 88 50 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#N comlet Segmentation info (list) (duration , segment , diviser);
#P outlet 62 265 15 0;
#P fasten 5 0 2 0 123 156 67 156;
#P connect 2 0 0 0;
#P connect 7 0 4 0;
#P connect 4 0 5 0;
#P connect 5 0 3 0;
#P connect 3 0 2 1;
#P fasten 1 0 5 1 220 108 178 108;
#P connect 5 1 3 1;
#P fasten 1 0 2 2 220 184 179 184;
#P fasten 3 0 6 0 123 184 190 184;
#P connect 6 0 9 0;
#P connect 8 0 1 0;
#P pop;
#P newobj 121 260 72 9109513 p divideSample;
#P flonum 213 365 77 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#N comlet Duration;
#P outlet 401 334 15 0;
#P window linecount 0;
#P newex 27 478 103 9109513 prepend Sample_Info :;
#P newex 27 504 26 9109513 print;
#N comlet Select;
#P inlet 60 62 15 0;
#P flonum 266 250 87 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 241 196 52 9109513 send Bang;
#P newex 27 452 52 9109513 pack 0. ga;
#P message 60 90 38 9109513 replace;
#P button 135 163 15 0;
#P newex 135 196 105 9109513 info~ sound;
#P newex 60 130 85 9109513 buffer~ sound -1;
#P fasten 1 6 4 0 218 331 32 331;
#P connect 4 0 9 0;
#P connect 9 0 8 0;
#P connect 7 0 3 0;
#P connect 3 0 0 0;
#P fasten 1 7 4 1 231 330 74 330;
#P connect 14 0 12 0;
#P connect 12 0 13 0;
#P connect 0 1 2 0;
#P connect 2 0 1 0;
#P fasten 1 6 12 1 218 234 188 234;
#P connect 1 6 11 0;
#P fasten 2 0 5 0 140 184 246 184;
#P fasten 1 6 6 0 218 233 271 233;
#P fasten 6 0 10 0 271 274 406 274;
#P pop;
#P newobj 1150 503 59 9109513 p openAudio;
#B color 11;
#P user umenu 1150 466 100 9109543 1 64 482 1;
#X setrgb 102 102 204 221 221 221 255 255 255 221 221 221 170 170 170 119 119 119 187 187 187;
#X add openWave;
#P user umenu 280 182 100 9109543 1 64 198 1;
#X add normal;
#X add reverse;
#X add random;
#P user umenu 385 182 100 9109543 1 64 198 1;
#X add ordered;
#X add random order;
#P newex 385 208 74 9109513 send grainmode;
#P newex 280 208 51 9109513 s direction;
#P user gain~ 443 711 24 100 158 0 1.071519 7.94321 10.;
#P number 406 96 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 406 117 39 9109513 s steps;
#P flonum 15 132 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 15 163 52 9109513 s loop_var;
#P flonum 360 96 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 312 96 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 360 117 46 9109513 s release;
#P newex 312 117 42 9109513 s attack;
#P user ezdac~ 407 861 451 894 0;
#P user gain~ 417 711 24 100 158 0 1.071519 7.94321 10.;
#P newex 406 388 131 9109513 poly~ grain~ 32;
#P flonum 271 96 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 210 96 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 156 79 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 210 117 61 9109513 s trnsSpread;
#P newex 271 117 32 9109513 s trns;
#P newex 156 117 52 9109513 s grainsize;
#P window linecount 4;
#P comment 36 548 100 9109513 find a relation between the duration and the loop size , use it within each kernel;
#P window linecount 3;
#P comment 616 793 100 9109513 there is definately a problem with scrubing , Find it !!!;
#P window linecount 1;
#P comment 63 622 100 9109513 change the envelope;
#P window setfont “Sans Serif” 14.;
#P comment 309 78 96 9109518 Amp Envelope;
#B color 14;
#P window setfont “Sans Serif” 18.;
#P window linecount 2;
#P comment 1150 420 84 9109522 select an Audio file;
#B color 14;
#P comment 828 470 224 9109522 The Table i’d like to be accesed within poly;
#B color 14;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P comment 442 82 44 9109513 Density;
#B color 14;
#P window linecount 2;
#P comment 281 157 100 9109513 Envelope reading through the grain loop;
#B color 14;
#P window linecount 1;
#P comment 1077 178 187 9109513 Choose part of the sample to be granulated;
#B color 14;
#P window setfont “Sans Serif” 20.;
#P window linecount 6;
#P comment 964 593 126 9109524 Table location : Grain~ / offset / repetition Patcher;
#B color 14;
#P connect 24 0 23 0;
#P hidden connect 37 0 38 0;
#P hidden connect 38 0 36 0;
#P fasten 13 0 59 0 161 108 146 108 146 185 146 185;
#P connect 59 0 65 0;
#P connect 65 0 60 0;
#P connect 13 0 10 0;
#P connect 14 0 12 0;
#P connect 15 0 11 0;
#P connect 31 0 28 0;
#P connect 21 0 19 0;
#P connect 22 0 20 0;
#P connect 30 0 29 0;
#P connect 26 0 25 0;
#P connect 40 0 16 0;
#P connect 17 0 18 0;
#P connect 16 4 17 0;
#P connect 16 2 17 0;
#P connect 16 0 17 0;
#P connect 27 0 18 1;
#P connect 16 5 27 0;
#P connect 16 3 27 0;
#P connect 16 1 27 0;
#P connect 17 1 27 0;
#P connect 56 0 55 0;
#P connect 48 0 47 0;
#P connect 16 0 41 0;
#P connect 16 1 42 0;
#P connect 16 2 43 0;
#P connect 16 3 44 0;
#P connect 16 4 45 0;
#P connect 16 5 46 0;
#P hidden fasten 53 0 51 0 837 175 697 175;
#P fasten 53 0 52 0 837 176 697 176;
#P hidden connect 51 0 49 0;
#P hidden fasten 50 0 49 0 806 189 697 189;
#P hidden connect 52 0 49 0;
#P hidden connect 53 0 50 0;
#P connect 63 0 64 0;
#P connect 64 0 62 0;
#P connect 49 2 57 0;
#P connect 49 3 58 0;
#P hidden connect 32 0 33 0;
#P hidden connect 33 0 34 0;
#P fasten 54 0 33 1 1260 489 1204 489;
#P pop;

Thanks for your help

Greg

#142647
Oct 15, 2008 at 1:19pm

In this simple example everything seems to work fine , also in 4.6 …

/ save as something /

max v2;
#N vpatcher 298 351 898 751;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#N out 1;
#P newobj 195 136 29 9109513 out 1;
#N in 1;
#P newobj 196 59 23 9109513 in 1;
#N vpatcher 168 266 768 666;
#N comlet Loadbang;
#P inlet 131 48 15 0;
#P window setfont “Sans Serif” 9.;
#P message 131 76 46 9109513 refer xxx;
#P window linecount 1;
#N vtable 50 432 298 642 465 4 128 xxx;
#P newobj 93 124 31 9109513 table;
#P connect 1 0 0 0;
#P connect 2 0 1 0;
#P pop;
#P newobj 196 93 52 9109513 p mpourda;
#P connect 1 0 0 0;
#P pop;

/ the main patch /

max v2;
#N vpatcher 15 55 615 455;
#P button 322 158 15 0;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 323 189 77 9109513 poly~ something;
#P newex 85 213 44 9109513 send ab;
#P user multiSlider 136 57 195 71 0. 100. 70 2681 15 0 0 2 0 0 0;
#M frgb 0 0 0;
#M brgb 255 255 255;
#M rgb2 127 127 127;
#M rgb3 0 0 0;
#M rgb4 37 52 91;
#M rgb5 74 105 182;
#M rgb6 112 158 18;
#M rgb7 149 211 110;
#M rgb8 187 9 201;
#M rgb9 224 62 37;
#M rgb10 7 114 128;
#N vtable 70 432 298 642 465 4 101 xxx;
#P newobj 136 212 46 9109513 table xxx;
#P newex 136 164 46 9109513 listfunnel;
#P connect 0 0 3 0;
#P connect 2 0 0 0;
#P connect 0 0 1 0;
#P connect 5 0 4 0;
#P pop;

cheers

G

#142648
Oct 15, 2008 at 1:37pm

On 15 Oct 2008, at 15:07, Greg wrote:
>
> Hi Volker
> Here is the patch ,
> It is quite messy but i indicated where the table i am trying to
> access is within the grain~ subpatch .

without going into details, i think you have a naming conflict here.
you should be careful not to choose the same names for tables, colls
etc. and send/receive addresses.

choosing a name like ‘mySteps’ and using that same name for the table
inside the poly~ seems to work in the ‘messy’ patch you have posted.
hth,
volker.

#142649
Oct 15, 2008 at 2:00pm

Thanks a lot for you valuable help Volker
Your suggestion solved problem :)

cheers

Greg

#142650

You must be logged in to reply to this topic.