Best sample playing option?

coralie's icon

Hi,
A simple – but not so obvious – question.
If you had to use play a sound file from a sound file library in a patch that needs to be as less CPU demanding as possible, which object would you use?
Buffer~, Playlist~, or sfplay~?
The principle is: if event A occurs, play a random sample from sample pack 1. If event B occurs, play a random sample form sample pack 2, etc.
The samples are not longer that a few seconds each time, but there are quite a few.

Regards
Coralie

Jean-Francois Charles's icon

[buffer~]: will usually play faster, nothing to stream from disk. buffer~ will load the whole sound in "RAM".
If you work with lots of samples, you can create and load the buffers automatically via scripting.

coralie's icon

Thank you Jean-François. I'm not very comfortable with scripting yet. I have browsed the polybuffer~ help patches and the scripting tutorials in order to find examples, but I am still a bit confused.
Is there any kind of relevant example somewhere?
Regards
coralie

Jean-Francois Charles's icon

Using polybuffer~ might be your best option. Ignore what I said about scripting, that would be if you didn't use polybuffer~. Just spend some time with polybuffer~, it should fit your needs.

coralie's icon

Hi,
Jean François,
Thank you that's just what I did and it works. I have had another problem loading the folders automatically (I want to be able to change the folders depending on the user choices). I have created another topic about that.

Regards
Coralie