Forums > MaxMSP

listing directory in listbox

December 28, 2008 | 6:31 am

HI,
Im a newb here but ive been working on a project and have come quite a way. But now im trying to figure out howto have the user browse for a directory and show the wav files in that directory in a listbox of some sort for them to easily switch and choose.

thanks!


December 28, 2008 | 1:27 pm

Moving this topic from the Archives to the MaxMSP forum.


December 28, 2008 | 2:41 pm

An example using [dropfile] to [folder $1] to [umenu] is below. If you want the user to interact via a dialog try the [opendialog] object.

– Pasted Max Patch, click to expand. –

December 28, 2008 | 5:49 pm

Here are two approaches I’ve used before. You can select a folder either by pressing the topmost button to search your directories or by typing the absolute path into the [textedit] object or by draggin a folder onto the [textedit] object. One uses [umenu] to display the files, which is good for when your ui space is small. The other uses [jit.cellblock] which makes viewing and choosing the files a bit easier. You will have to modify some of the values in the subpatch if you change the size of the [jit.cellblock] object. I hope it helps.

lh

– Pasted Max Patch, click to expand. –

December 29, 2008 | 2:09 am

Excellent guys! Just what i was looking for. works great in max 5 demo, unfortunately im using max 4.6 to make VSTs and most of it works there but the COMBINE function doesnt. i was using it to combine the path and filename "combine path filename @triggers 1".

Any suggestions? I dunno howto post text like you guys or else id do it.


December 29, 2008 | 2:15 am

The [combine] object was new in max5, you should be able to replace it with [sprintf %s%s] to join the path and file name together.

lh


December 29, 2008 | 2:54 am

thanks.

that seems like it would work but the problem is the left input triggers the output and the left input is the directory.. so it passes only the directory to the buffer~ when i click it. i need it to wait till the filename is in also. i could do this with PACK and COMBINE, but pack puts a space between them and combine is not available as you know. even append and prepend you can stop input 0 from triggering the output. i cant quite figure out how on this one.


December 29, 2008 | 6:24 am

hi,

try [zl reg] instead of pack to store your path and a [trigger b l],
you also may be interested in symout mode of sprintf or in the use of
"%s%s" syntaxe to set your path as one symbol
best

antoine

2008/12/29 bob

>
> thanks.
>
> that seems like it would work but the problem is the left input triggers
> the output and the left input is the directory.. so it passes only the
> directory to the buffer~ when i click it. i need it to wait till the
> filename is in also. i could do this with PACK and COMBINE, but pack puts a
> space between them and combine is not available as you know. even append and
> prepend you can stop input 0 from triggering the output. i cant quite figure
> out how on this one.
>


do it yourself

http://antoine.villeret.free.fr


December 29, 2008 | 5:09 pm

Yes the ZL REG worked to hold my value until i triggered it. quite a pain to do without combine but its working.

Thanks for your help guys.


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