I would like to make a patch that loads randomly a sample from a folder (if I can make it open randomly any file begging with P01 ie. P01*.wav) and when the sample ends loads automatically another sample randomly (ie. P02*.wav).
thank you in advance
loading random samples
I would like to make a patch that loads randomly a sample from a folder (if I can make it open randomly any file begging with P01 ie. P01*.wav) and when the sample ends loads automatically another sample randomly (ie. P02*.wav).
thank you in advance
@Spyros Hello Spyros......
If you are using Pd extended..........
You will need to use the objects....
[random] to randomly select
[tof/folderpanel] to open a folder
[ext13/strippath] to remove the path from the file names
[readsf~] to play the file (the right outlet bangs when it has finished playing and you can use that to open and start the next one).
If you are using Vanilla..........
or if you just want to use one folder of audio, and you know where the folder is (it's path) and you know the names of the files......... then you will need only [random] and [readsf~].........
David.
Thank you very much David!
very helpful answer.
Hi Whale Av/Spyros,
I am trying to attempt the same thing but am unclear as to which object box I put the file name in; do you mean to suggest that it goes after readsf~, so for example, readsf~example1?
Many thanks, Peter
@peeshder Hello Peter..... this will do what you want.
If you are studying...... do not submit it as it is. I worked it through for someone else, and they added the randomness........ and since then it has been used for teaching somewhere...... beware.
Work through it and understand it and try to make your own version (maybe better?).
I have hacked out the bit you want from a larger patch....... so there will be some messages being sent that are unnecessary, and receive objects that will never receive anything...... and some error messages to the terminal.............. its up to you to make it perfect.......
madness.zip
If you leave it playing it will play "random" and if you re-click the toggle it will play the next (random track) immediately.....
You will need pd-extended.........
By the way..... [random] is not random in the "human" sense of the word..... it is a predetermined series of values that do not repeat before the end of the series...... a very "lame" mathematical definition of a "group" of values that do not repeat more often than "expected" and feed an "even distribution" of the said values.........never mind......... I am not a fan ( a thing that turns rapidly (maybe) propelling atoms of oxygen, hydrogen, carbon dioxide (and monoxide (but not much fortunately) and nitrogen with a little bit of argon and (non-exhaustive list) other elements to the output of the said "FAN".....
David.
Oops! Looks like something went wrong!