Hello. I'm trying to create a sample-player that plays random files from within the folder of the patch.
Right now it's composed of a [random] object sending out values between, say, 0 and 10 to a [select] object that then routes the bang to a message containing the specific filename, which is sent to an [open $1.wav] message for [readsf~], which is then read. No problem, it works just fine.
But as the patch grows and the number of samples I want to use increases, I want to be able to swap out filenames faster and with more ease, and typing in the individual filenames of each file quickly becomes a hassle. A workaround I did was to simply re-name the local samples to the values 0 through 10, so that I could skip the use of the [select]-object altogether, but having to re-name samples every time I want to use it in the patch is likewise a hassle.
Is there a way to create an index of symbols (for filenames) that can be used in a similar fashion to [table] and [tabread]? Input a number, it spits out the information sitting in the relevant index. Would [list] be a way to achieve this? I haven't worked too much with the object, but from what I gathered, it didn't seem to be the best choice. But please do enlighten me if I'm wrong.
I'm using Pd-extended for what it's worth.
Thank you.
M.