Forums > MaxMSP

Linking Buffers In Poly~ To The Patch Containing Poly~?

December 1, 2008 | 3:21 am

Hello, here is my beat slicer patch from the other post. I want to be able to use arguments for my buffer~ (such as "[buffer~ #0_buffername]"), but it seems that the poly~ patch produces different numbers for my buffer~ name. If you open this patch as a bpatcher, then look at it as "New View", you’ll see that the buffer ~ name in the main patch is different from the buffer~ name in the poly~ patch, even though they both originally call on the [buffer~ #0_chopper].

Thanks.

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 560 213 51 196617 tosymbol;
#P newex 560 192 56 196617 route text;
#P newex 560 235 81 196617 prepend replace;
#P newex 558 286 105 196617 info~ $0_chopper;
#P newex 560 260 101 196617 buffer~ $0_chopper;
#N comlet Audio out;
#P outlet 314 460 15 0;
#N comlet Bangs in to read through multislider;
#P inlet 7 212 15 0;
#N comlet Toggle reverse on/off;
#P inlet 502 -29 15 0;
#P newex 753 164 114 196617 autopattr @autoname 1;
#X prestore flonum 1 0 335.036835;
#X prestore multiSlider 8 0 7 3 6 3 4 2 5 2;
#X prestore number 1 0 8;
#X prestore number[1] 1 0 8;
#X prestore number[2] 1 0 0;
#X prestore textedit 1 0 SailOn1.wav;
#X prestore toggle 1 0 0;
#P objectname u847000021;
#P hidden message 379 -11 44 196617 max $1;
#P flonum 327 -12 45 9 0 0.125 2 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P objectname flonum;
#P message 52 262 14 196617 1;
#P newex 52 241 42 196617 r reset;
#P objectname receive;
#P number 197 8 35 9 0 2 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P objectname number[2];
#P newex 7 251 30 196617 t b b;
#N counter 1 8;
#X flags 0 0;
#P newobj 238 382 66 196617 counter 1 8;
#P message 238 408 53 196617 target $1;
#P hidden newex 357 9 60 196617 s chopTime;
#P newex 494 144 62 196617 prepend set;
#P newex 405 246 27 196617 t b i;
#P toggle 221 -13 15 0;
#P objectname toggle;
#P newex 314 406 27 196617 i 0;
#P button 7 234 15 0;
#P newex 7 303 71 196617 prepend fetch;
#N counter 1 16;
#X flags 0 0;
#P newobj 7 279 68 196617 counter 1 16;
#P newex 171 282 54 196617 prepend 1;
#P newex 171 302 97 196617 prepend setminmax;
#P number 79 9 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P objectname number[1];
#P newex 6 185 66 196617 prepend size;
#P user multiSlider 4 30 410 77 1. 8. 8 2921 15 0 2 2 0 0 0;
#M frgb 14 85 62;
#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;
#P objectname multiSlider;
#P newex 506 249 29 196617 t b f;
#P newex 506 378 29 196617 !/ 1.;
#P number 317 8 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P objectname number;
#P newex 314 433 87 196617 poly~ polyslice 8;
#P message 122 -12 43 196617 replace;
#P user textedit 20 -12 104 5 32772 3 9 SailOn1.wav;
#P objectname textedit;
#P window linecount 5;
#P hidden comment 424 41 77 196617 VALUE OF SLIDER CORRESPONDS TO A DIVISION OF THE SAMPLE;
#P window linecount 1;
#P comment 250 10 64 196617 # of Slices;
#P comment 186 -13 29 196617 Rev.;
#P comment 20 12 57 196617 # of Steps;
#P comment 144 10 50 196617 Direction;
#P comment 244 -11 79 196617 Slice Len. in MS;
#P user panel 0 -16 419 127;
#X brgb 105 209 192;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P window linecount 3;
#P comment 408 425 100 196617 DOUBLE CLICK POLY~ TO SEE HOW IT WORKS;
#P hidden connect 15 0 14 0;
#P hidden connect 17 0 14 0;
#P hidden connect 20 0 14 0;
#P hidden connect 16 0 15 0;
#P connect 37 0 21 0;
#P connect 21 0 29 0;
#P connect 29 0 19 0;
#P connect 19 0 20 0;
#P hidden fasten 25 0 8 0 499 168 25 168;
#P hidden fasten 30 0 19 1 202 275 26 275;
#P connect 32 0 19 3;
#P connect 31 0 32 0;
#P hidden fasten 16 0 19 4 84 194 68 194;
#P hidden fasten 11 0 18 0 322 265 176 265;
#P connect 18 0 17 0;
#P connect 36 0 23 0;
#P fasten 29 1 28 0 32 332 32 332 32 341 243 341;
#P connect 28 0 27 0;
#P fasten 24 0 22 0 410 352 319 352;
#P connect 22 0 10 0;
#P fasten 27 0 10 0 243 429 319 429;
#P connect 10 0 38 0;
#P hidden connect 34 0 33 0;
#P hidden fasten 23 0 22 1 226 265 336 265;
#P hidden connect 33 0 26 0;
#P hidden fasten 12 0 34 0 511 403 487 403 487 -16 384 -16;
#P hidden fasten 40 6 34 0 641 316 691 316 691 -22 384 -22;
#P fasten 24 1 10 1 427 417 396 417;
#P hidden connect 14 1 24 0;
#P fasten 40 7 25 0 654 316 691 316 691 134 499 134;
#P hidden fasten 11 0 12 0 322 321 427 321 427 353 511 353;
#P connect 13 0 12 0;
#P connect 13 1 12 1;
#P fasten 39 1 40 0 656 281 563 281;
#P hidden fasten 8 0 42 0 25 168 565 168;
#P connect 42 0 43 0;
#P connect 43 0 41 0;
#P hidden fasten 9 0 39 0 127 168 650 168 650 255 565 255;
#P connect 41 0 39 0;
#P window clipboard copycount 44;

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P comment 151 160 15 196617 3.;
#P comment 237 190 15 196617 2.;
#P newex 363 211 48 196617 loadbang;
#P newex 369 26 60 196617 r chopTime;
#P newex 446 212 43 196617 delay 1;
#P newex 245 136 27 196617 f;
#P newex 369 49 27 196617 f;
#P message 508 238 54 196617 1 , mute 0;
#P message 446 238 54 196617 0 , mute 1;
#P newex 446 263 52 196617 thispoly~;
#P newex 307 102 29 196617 * 1.;
#P newex 262 103 29 196617 * 1.;
#P newex 262 187 101 196617 pack 0. 0. 0.;
#P newex 262 68 27 196617 – 1;
#N in 2;
#X comment Slice #;
#P newobj 262 38 25 196617 in 2;
#N in 1;
#X comment trigger sample , 0 for normal playback , 1 for reversed;
#P newobj 137 38 25 196617 in 1;
#P newex 137 59 44 196617 t i b b;
#P newex 137 178 41 196617 sel 0 1;
#P message 262 302 56 196617 $2 , $1 $3;
#P message 137 303 56 196617 $1 , $2 $3;
#P newex 370 69 29 196617 t b f;
#N out~ 1;
#P newobj 138 384 39 196617 out~ 1;
#P newex 137 330 32 196617 line~;
#P newex 137 356 92 196617 play~ $0_chopper;
#P window linecount 3;
#P comment 339 102 100 196617 Determine the length of playback from the buffer;
#P window linecount 16;
#P comment 27 60 79 196617 Use trigger for clarity of message ordering. 1. Turn poly~ DSP on for the targeted instance 2. Send proper arguments to the message boxes for line~ 3. Trigger either forward/backward playback;
#P window linecount 1;
#P comment 523 215 15 196617 1.;
#P fasten 10 2 19 0 176 166 513 166;
#P connect 18 0 17 0;
#P fasten 19 0 17 0 513 259 451 259;
#P connect 22 0 18 0;
#P fasten 24 0 18 0 368 233 451 233;
#P fasten 4 1 22 0 164 352 417 352 417 195 451 195;
#P connect 20 0 6 0;
#P connect 23 0 20 0;
#P fasten 6 1 15 1 394 94 286 94;
#P fasten 6 1 16 1 394 94 331 94;
#P fasten 6 1 14 2 394 161 357 161;
#P connect 16 0 14 1;
#P fasten 6 0 15 0 375 94 267 94;
#P fasten 6 0 16 0 375 94 312 94;
#P connect 12 0 13 0;
#P fasten 12 0 16 0 267 58 312 58;
#P fasten 14 0 7 0 267 278 142 278;
#P connect 14 0 8 0;
#P fasten 9 1 8 0 157 278 267 278;
#P fasten 21 0 14 0 250 173 267 173;
#P connect 15 0 21 1;
#P connect 13 0 15 0;
#P fasten 10 1 21 0 159 119 250 119;
#P connect 3 0 5 0;
#P connect 4 0 3 0;
#P connect 7 0 4 0;
#P fasten 8 0 4 0 267 324 142 324;
#P connect 9 0 7 0;
#P connect 10 0 9 0;
#P connect 11 0 10 0;
#P window clipboard copycount 27;


December 1, 2008 | 4:13 am

The #0 prefix is converted to a unique number inside each abstraction. So if you used it to name your [buffer~] inside a [poly~] with 4 voices you would have 4 individual names. If you want to send messages to all instances then use [send] and [receive] which work globally. If you want to name something in each instance individually then I suggest you bang [thispoly~] which will give you the instance number which you can use (with [sprintf] or [combine]) to assign unique names. You could also look at the "target" message to [poly~] for specifying which instance should receive data sent to its inlets.

lh


December 1, 2008 | 1:07 pm

yes. simply set the buffer or play objects from outside the poly.
loadbang #0_buffername
prepend set to objects in parent
prepend set to objects in poly (or single poly voices!)

-110


December 1, 2008 | 1:24 pm

If you want different buffer names in each voices, you can use [coll] too.


December 1, 2008 | 11:32 pm

thanks!


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