give umenu with prefix a "title"

cudnylon's icon

i'm using umenu to call up samples such as drums for examples. one umenu for kicks, one for snares, etc. each group is in a different folder. i have the menus populated but it gets confusing as to what umenu is for what so i want each one to display a title in the first slot. so for one umenu it'll say "snares" and then in the drop down will be "dry1.aif", "reverb1.aif" etc.

could i have a umenu with just the "snares" as the menu text and then append the file names? i tried to do this with autopopulate on and it just erased the "snares" option. could i prepend "snares" on load to an autopopulated menu? i just see append and setitem options.

Roman Thilenius's icon

you could not use autopopulate but only "append" for
loading the filenames, then it is easy to make the
item 0 something custom.

-110

cudnylon's icon

i'm still confused how to append the list of files. an example patch would be of great help.

Ben Bracken's icon

here is one way:

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

-Ben

cudnylon's icon

now i'm feeling foolish. i loaded a folder into the menu using the bang but it still just says "SNARES" only now the prefix inside inspector is set to the folder i chose. no files were added to the menu. is there a step i missed? i'm sorry for all the trouble.

Ben Bracken's icon

You will need to send the folder object a 'types' message with the type of file that you want to see. folder defaults to type TEXT.

If you want to see all file types, you can just send the 'types' message without any typecode.

-Ben

cudnylon's icon

ah! thank you! i'm not very experienced with the folder object so i forgot about the types message. problem sovled.