give umenu with prefix a "title"

Jul 16, 2009 at 7:20pm

give umenu with prefix a "title"

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.

#44755
Jul 17, 2009 at 5:29pm

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

-110

#161046
Jul 17, 2009 at 6:20pm

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

#161047
Jul 17, 2009 at 9:54pm

here is one way:

– Pasted Max Patch, click to expand. –

-Ben

#161048
Jul 17, 2009 at 10:13pm

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.

#161049
Jul 17, 2009 at 10:45pm

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

#161050
Jul 17, 2009 at 10:56pm

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

#161051

You must be logged in to reply to this topic.