Readfolder in Polybuffer~

coralie's icon

Hi all,
I'm trying to do something very simple, but I always get confused with that kind of things. I want to load automatically an aif files folder in a polybuffer at startup. Eventually, my patch should be usable as a standalone.
I have seen in the help file of polybuffer~ that the folder can be loaded directly , with the message "loadfile ./examples/sounds" or that the folder can be chosen from a dialogue window with "loadfile".
I have copied my sound files folder in the same folder as the patch I'm using, but I get a message of the type "soundfolder is not a folder".
Can anyone tell me where the folder should be located and how I should formulate the path to the folder? I also have added the folder to my searchpaths via the file preferences. Thanks !

5499.polybuffer.zip
zip
Luke Woodbury's icon

I've had this issue before and ended up doing something that's probably far more complicated than it needs to be, but here it is and it works:

Max Patch
Copy patch and select New From Clipboard in Max.

NB - the [thispatcher] needs to be in the main patcher window, not in a subpatch

coralie's icon

That's great! Thanks Luke!

blue's icon

sorry if this is a completely stupid question but how do you get the data you pasted from your patch back into a .maxpat format that I can read?
I tried copying your code into text edit, saving it as blah.txt, then changing the file extension to .maxpat in finder but max gives me some funny errors when I double-click on the file:

error parsing patcher file Polybuffer.maxpat;
parsing object: line=1, char=3, text=’…{\’

Any help greatly appreciated!

Luke Woodbury's icon

There are no stupid questions... just ones that are covered in the forum guidelines :)

You just need to copy it and then either open a new patcher window in Max and paste it straight in, or in the 'File' menu choose 'New from clipboard'.

Unlimitedliam21's icon

Hiya Luke, I'm trying your method above but I don't quite understand how it reads the folder? Do I input my folder name where you typed 'folder?' in the combine object?And regarding the 'filepath' in the combine object, do I leave this as 'filepath'?

I've attached my attempt below. 'Ambience' is my folder name.

Max Patch
Copy patch and select New From Clipboard in Max.

Luke Woodbury's icon

Whew, I’ll have to blow the cobwebs off that one! I’m away for the week but can have a look when I am back, feel free to bump if I forget.