Forums > MaxMSP

questions about random samples

March 23, 2006 | 9:50 pm

I am working on a patch which randomly (using a metro and a urn-jb) chooses
a different sample out of 10 every so often which will be granularly
synthesized. I am using the play~ object. I am trying to automate
crossfades between the currently playing sample and the just randomly
selected sample (as soon as it is chosen), but I am getting really
frustrutrated with this right now. If anyone could give me some
suggestions, that’d be great. Also, I’d like to give the user 10 toggle
boxes, which would opt certain of the sample in and out of the random
process, is there any easy way to do this? (so for example, only 1, 4, 8,
would be randomally chosen). I can send my patch if need be.

Thanks in advance.


March 23, 2006 | 10:16 pm

hello,
You should probably send along your patch. Your description, though
evocative, gives us little to go on.
When in doubt…

AB


March 24, 2006 | 12:13 am

this’ll give you an idea of what i’m going for. hope this makes sense:

max v2;
#N vpatcher 112 39 1088 707;
#P origin 48 0;
#P window setfont "Sans Serif" 9.;
#P hidden message 531 142 14 9109513 1;
#P hidden newex 532 117 44 9109513 loadbang;
#P comment 530 253 394 9109513 when all are selected , the urn would just
be as default , that is all of the samples are possible , while if only
three choices are ‘ON’ i want the urn to only have the ability choose from
these of these such as a , d , g and switch just between these until
anything else is toggled on;
#P comment 728 233 13 9109513 j;
#P comment 706 233 13 9109513 i;
#P comment 683 233 13 9109513 h;
#P comment 661 233 13 9109513 g;
#P comment 639 233 13 9109513 f;
#P comment 617 233 13 9109513 e;
#P comment 595 233 13 9109513 d;
#P comment 573 233 13 9109513 c;
#P comment 551 233 13 9109513 b;
#P toggle 728 213 15 0;
#P toggle 706 213 15 0;
#P toggle 683 213 15 0;
#P toggle 661 213 15 0;
#P toggle 639 213 15 0;
#P toggle 617 213 15 0;
#P toggle 595 213 15 0;
#P toggle 573 213 15 0;
#P toggle 551 213 15 0;
#P toggle 529 213 15 0;
#P comment 531 176 273 9109513 2. i want the ability for the toggles below
, to be decide the pool that the urn to the left below draws from;
#P user umenu 160 389 100 9109543 1 64 405 1;
#X add a;
#X add b;
#X add c;
#X add d;
#X add e;
#X add f;
#X add g;
#X add h;
#X add i;
#X add j;
#P newex 234 352 27 9109513 + 1;
#P newex 225 268 59 9109513 metro 30000;
#P button 233 300 15 0;
#P newex 232 322 43 9109513 urn-jb 10;
#P newex 250 460 27 9109513 line~;
#P message 250 434 44 9109513 0 , 1 1000;
#P newex 194 496 41 9109513 play~ a;
#P newex 194 434 54 9109513 prepend set;
#P user umenu 167 116 100 9109543 1 64 132 1;
#X add one at once;
#X add random;
#P newex 152 321 27 9109513 line~;
#P message 152 295 44 9109513 0 , 1 1000;
#P newex 96 391 28 9109513 dac~;
#P newex 96 357 41 9109513 play~ a;
#P newex 96 295 54 9109513 prepend set;
#P newex 167 168 27 9109513 + 1;
#P toggle 167 143 15 0;
#P newex 96 212 41 9109513 gate 2 1;
#P user umenu 37 175 100 9109543 1 64 191 1;
#X add a;
#X add b;
#X add c;
#X add d;
#X add e;
#X add f;
#X add g;
#X add h;
#X add i;
#X add j;
#P message 60 389 27 9109513 start;
#P message 60 410 26 9109513 stop;
#P user ubutton 35 147 106 18 0 0;
#P hidden message 36 198 28 9109513 open;
#N vpatcher 351 192 680 379;
#P origin -1 36;
#P window setfont "Sans Serif" 9.;
#P hidden message 256 153 34 9109513 wclose;
#P window setfont "Sans Serif" 12.;
#P comment 255 123 35 9109516 done.;
#B frgb 125 40 7;
#P window setfont "Sans Serif" 9.;
#P hidden message 271 104 34 9109513 replace;
#P hidden message 334 104 34 9109513 replace;
#P hidden message 413 104 34 9109513 replace;
#P hidden message 522 106 34 9109513 replace;
#P hidden message 597 105 34 9109513 replace;
#P hidden message 817 107 60 9109513 replace j.aiff;
#P hidden message 715 104 60 9109513 replace i.aiff;
#P hidden message 619 104 63 9109513 replace h.aiff;
#P hidden message 535 104 63 9109513 replace g.aiff;
#P hidden message 454 104 62 9109513 replace f.aiff;
#P hidden message 375 104 63 9109513 replace e.aiff;
#P hidden message 296 104 63 9109513 replace d.aiff;
#P hidden message 217 104 63 9109513 replace c.aiff;
#P hidden message 121 104 63 9109513 replace b.aiff;
#P hidden message 12 104 63 9109513 replace a.aiff;
#N thispatcher;
#Q end;
#P hidden newobj -7 212 53 9109513 thispatcher;
#P hidden message -8 191 174 9109513 window size 30 30 359 217 , window
exec;
#P hidden newex -9 170 44 9109513 loadbang;
#P hidden inlet 16 26 15 0;
#P hidden message 779 103 34 9109513 replace;
#P hidden message 680 105 34 9109513 replace;
#P hidden message 184 104 34 9109513 replace;
#P hidden message 79 104 34 9109513 replace;
#P hidden message -29 104 34 9109513 replace;
#P hidden newex 753 170 43 9109513 buffer~ j;
#P hidden newex 674 170 43 9109513 buffer~ i;
#P hidden newex 596 170 44 9109513 buffer~ h;
#P hidden newex 517 170 44 9109513 buffer~ g;
#P hidden newex 436 170 44 9109513 buffer~ f;
#P hidden newex 357 170 44 9109513 buffer~ e;
#P hidden newex 278 170 44 9109513 buffer~ d;
#P hidden newex 199 170 44 9109513 buffer~ c;
#P hidden newex 39 170 44 9109513 buffer~ a;
#P hidden newex 118 170 44 9109513 buffer~ b;
#P objectname vo;
#P user ubutton 256 72 39 12 0 0;
#P user ubutton 196 73 39 12 0 0;
#P user ubutton 135 72 39 12 0 0;
#P user ubutton 79 72 39 12 0 0;
#P user ubutton 14 72 39 12 0 0;
#P user ubutton 255 46 39 12 0 0;
#P user ubutton 195 47 39 12 0 0;
#P user ubutton 134 46 39 12 0 0;
#P user ubutton 78 46 39 12 0 0;
#P user ubutton 14 46 39 12 0 0;
#P comment 14 72 40 9109513 sound f;
#P comment 13 46 40 9109513 sound a;
#P comment 78 72 40 9109513 sound g;
#P comment 134 72 40 9109513 sound h;
#P comment 195 73 40 9109513 sound i;
#P comment 255 72 40 9109513 sound j;
#P comment 255 46 40 9109513 sound e;
#P comment 194 47 40 9109513 sound d;
#P comment 133 46 40 9109513 sound c;
#P comment 77 46 40 9109513 sound b;
#P user ubutton 255 123 34 17 0 0;
#P hidden connect 11 1 31 0;
#P hidden connect 56 0 39 0;
#P hidden connect 38 0 39 0;
#P hidden connect 36 0 40 0;
#P hidden connect 40 0 22 0;
#P hidden connect 31 0 22 0;
#P hidden connect 12 1 32 0;
#P hidden connect 41 0 21 0;
#P hidden connect 32 0 21 0;
#P hidden connect 36 0 41 0;
#P hidden connect 13 1 33 0;
#P hidden connect 42 0 23 0;
#P hidden connect 33 0 23 0;
#P hidden connect 36 0 42 0;
#P hidden fasten 0 1 56 0 268 148 261 148;
#P hidden connect 14 1 54 0;
#P hidden fasten 43 0 24 0 253 131;
#P hidden connect 54 0 24 0;
#P hidden connect 36 0 43 0;
#P hidden connect 15 1 53 0;
#P hidden connect 44 0 25 0;
#P hidden connect 53 0 25 0;
#P hidden connect 36 0 44 0;
#P hidden connect 16 1 52 0;
#P hidden connect 45 0 26 0;
#P hidden connect 52 0 26 0;
#P hidden connect 36 0 45 0;
#P hidden connect 46 0 27 0;
#P hidden connect 51 0 27 0;
#P hidden connect 17 1 51 0;
#P hidden connect 36 0 46 0;
#P hidden connect 47 0 28 0;
#P hidden connect 50 0 28 0;
#P hidden connect 18 1 50 0;
#P hidden connect 36 0 47 0;
#P hidden connect 48 0 29 0;
#P hidden connect 34 0 29 0;
#P hidden connect 19 1 34 0;
#P hidden connect 36 0 48 0;
#P hidden connect 49 0 30 0;
#P hidden connect 35 0 30 0;
#P hidden connect 20 1 35 0;
#P hidden connect 36 0 49 0;
#P pop;
#P hidden newobj 36 262 44 9109513 p buffers;
#P hidden newex 36 234 40 9109513 pcontrol;
#P window setfont "Sans Serif" 12.;
#P comment 33 148 111 9109516 change audio files!;
#B frgb 0 24 214;
#P window setfont "Sans Serif" 9.;
#P message 226 245 14 196617 1;
#P objectname vm;
#P window setfont "Sans Serif" 9.;
#P comment 294 313 273 9109513 1. after 30 seconds have passed , i want the
sample that is already playing (and about to be replaced) to be crossfaded
with the newly chosen sample so that its not as sudden as the files suddenly
switching;
#P comment 529 233 13 9109513 a;
#P hidden fasten 7 1 6 0 22 165 22 197 41 197;
#P hidden connect 6 0 4 0;
#P hidden connect 4 0 5 0;
#P fasten 13 0 11 0 172 206 101 206;
#P connect 11 0 14 0;
#P connect 18 0 15 0;
#P connect 14 0 15 0;
#P connect 15 0 16 0;
#P connect 9 0 16 0;
#P connect 8 0 16 0;
#P connect 10 1 11 1;
#P connect 17 0 18 0;
#P fasten 27 0 28 0 239 377 165 377;
#P connect 19 0 12 0;
#P connect 12 0 13 0;
#P fasten 28 1 20 0 255 417 199 417;
#P connect 20 0 21 0;
#P connect 23 0 21 0;
#P connect 2 0 26 0;
#P fasten 11 1 2 0 132 239 231 239;
#P connect 25 0 24 0;
#P fasten 26 0 25 0 230 296 238 296;
#P connect 24 0 27 0;
#P connect 22 0 23 0;
#P hidden connect 51 0 30 0;
#P hidden fasten 50 0 51 0 536 142;
#P hidden connect 51 0 33 0;
#P hidden connect 51 0 36 0;
#P pop;


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