Forums > MaxMSP

selecting files from hard disk randomly – how in god's name do you do it?

August 14, 2006 | 3:19 pm

greetings – is there a way to randomly load files into a buffer~/sfplay~ object from the hard disk? i can automate a patch to get to the file selection screen up – that’s easy peasy – where i come a cropper is in persuading it to randomly pick sound files from within a given folder and, imagining for a moment that this hypothetical ‘random soundfile’ is located, in sending the mac a ‘choose’ command to clinch the deal
any help would be much appreciated, havn’t been able to find anything on the forum so far


August 14, 2006 | 4:00 pm

may this b of any help ….
cheers

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 347 449 104 196617 t 1 s b;
#P message 456 478 37 196617 loop 1;
#P toggle 356 610 15 0;
#P newex 377 608 31 196617 dac~;
#P flonum 504 522 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 431 553 41 196617 *~ 0.5;
#P newex 377 553 41 196617 *~ 0.5;
#N sfplay~ 2 120960 0 ;
#P newobj 379 510 53 196617 sfplay~ 2;
#P number 400 315 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P button 348 249 34 0;
#P newex 384 476 68 196617 prepend open;
#P newex 400 293 43 196617 random;
#P user ubumenu 302 385 100 196617 0 1 1 0;
#X prefix_set 0 0 0;
#X pattrmode 1;
#P number 433 253 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P button 278 77 15 0;
#P newex 287 135 40 196617 t b s s;
#P newex 278 111 84 196617 opendialog folder;
#P message 287 155 143 196617 types TEXT , types AIFF , bang;
#P newex 302 179 35 196617 folder;
#P comment 325 75 100 196617 choose a folder;
#P window linecount 5;
#P comment 439 145 100 196617 in this case anything but aiff files is left out… check [folder] object for additionnal messages;
#P window linecount 3;
#P comment 477 241 100 196617 total of files in chosen folder gives random range;
#P window linecount 2;
#P comment 242 250 100 196617 choose a random number;
#P window linecount 1;
#P message 406 385 33 196617 clear;
#P hidden connect 0 0 11 0;
#P fasten 19 0 17 1 509 545 413 545;
#P fasten 19 0 18 1 509 545 467 545;
#P connect 23 2 22 0;
#P connect 10 0 12 1;
#P connect 5 1 10 0;
#P connect 16 1 18 0;
#P connect 12 0 15 0;
#P connect 14 0 12 0;
#P connect 18 0 20 1;
#P connect 23 1 13 0;
#P connect 13 0 16 0;
#P connect 23 0 16 0;
#P connect 22 0 16 0;
#P connect 17 0 20 0;
#P connect 21 0 20 0;
#P connect 16 0 17 0;
#P connect 11 1 23 0;
#P connect 5 0 11 0;
#P connect 15 0 11 0;
#P connect 6 0 5 0;
#P connect 8 1 5 0;
#P connect 8 0 6 0;
#P connect 7 0 8 0;
#P connect 9 0 7 0;
#P window clipboard copycount 24;


August 14, 2006 | 6:51 pm

great, thanks muchly il try that tonight


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