Hi! I'm working on a patch that would play samples from a folder. I got the basics on how to open a sample and load it into soundfiler using openpanel, but I'd like that process to be automatic instead. And I want to use a drunk object to pick which one to get in the folder (and then play it instantly). So how do I go about this? Any help is appreciated.
-
Playing samples from a folder?
-
the easiest approach would be to name the sample files using numbers (1.wav, 2.wav and so on) and then use something like [random] -> [open $1.wav( -> [soundfiler].
another way is a combination of [hcs/folder_list] and [ggee/getdir] to get informations on the folder and then load samples accordingly. this will require some more complex logic work.
that said, if you want to load samples on the go, play and then skip to another sample i'm not sure [soundfiler] is the best solution. maybe [readsf~] is better for playing a file just once?
-
I was planning on naming the samples from from 01 to 20 so the first solution is just what I was looking for, also I would like to play them in full if possible. I guess that would be trickier?
-
if you play with [readsf~], then the right outlet sends a bang when the file has finished playing. You can use that to trigger the next file.