Forums > MaxMSP

Play list of SFs in folder in any order using arbitrary integer string


KCQ
January 21, 2013 | 8:39 pm

Howdy! First time posting, I’m a composer, I love MAX blah blah blah.

I have a general objective, and a specific question.

Objective: I want to create a patch that will play a folder of sound files in any order I so choose, and I want to control the ordering by inputting a list of integers somewhere in the patch. Example: I have a folder of six sound files, so in the patch I want to be able to put in a list like "531204" and have it play back to me in that order, where sound "5" is played first, sound "3" is played second, etc.

Problem: I’ve designed the patch to do exactly this, but I need to get a bang to the sfplay object to get it to play the next soundfile in the list once my patch selects it. I’ve tried using a convoluted string of cues, but it doesn’t work because it ties the cues to whatever specific soundfile was loaded at the time. The message "open" to sfplay also doesn’t work, obviously.

So I have two questions:
1) Is there any way to make my patch work by correcting this small step in getting the sfplay object to play the next sf in the list?
2) Is there a more efficient way of doing this whole thing? Right now the patch looks a little too complicated, and I suspect there are better ways of doing it. It also might get unwieldy in very large lists due to the large amount of connections that need to be made. I’m guessing I can probably correct this later on with poly~, but still.

Here’s the patch; in the top left folder object, substitute any folder of 6 sound files on your computer to try it out.

Tips, clues, ideas all appreciated. Thanks!

– Pasted Max Patch, click to expand. –

January 21, 2013 | 9:35 pm

With sfplay you can "preload" multiple sound files. I would open the folder and have it iterate through the folder preloading the files into sfplay~. Then you can use your list of random number to play through each file.

GW


January 21, 2013 | 10:55 pm

here’s a solution using [umenu]

– Pasted Max Patch, click to expand. –

and one (a little trickier) using "preload":

– Pasted Max Patch, click to expand. –

January 22, 2013 | 8:40 am

perhaps you can use polybuffer~


January 22, 2013 | 9:24 am

something like this

– Pasted Max Patch, click to expand. –


KCQ
January 24, 2013 | 5:10 am

A diverse number of ideas here, thanks all.

I’ve yet to try them all out, but one issue I’ve found with the 1st one Lska posted is that Umenu jumbles the order in very large lists. I have a folder of 265 files, named 1.aiff through 265.aiff, and when loaded into the umenu object, the order is slightly jumbled (in odd, consistent ways too, like it goes 1, 10, 100, 101-109, 11, etc.). I’m wondering if renaming the SF’s might fix this. It seems that the umenu objects reads the integer titles to the soundfiles in a specific way and maybe avoiding integers as titles would fix this.


January 24, 2013 | 10:27 am

I think it depends on the way your OS orders file names. You may fix it by renaming the files like 001, 002, 003, etc.


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