loading a umenu properly

Aug 6, 2011 at 8:01pm

loading a umenu properly

I’ve been having an issue as of late while working on a remixer patch that involves loading midi files. My goal is to load a [umenu] object with a group of midi files and then plug the [umenu] into a [seq] object. I’ve gotten to the point where i can use a [read $1] message but it makes me load the files manually. I’ve also tried to configure a drop file section using a [folder] and [filepath] objects but it will not load the midi files within the folder, it only will load up .maxpat and. rtf into the umenu. I did try to [loadmess] the file type into the [folder] object. Again, my goal is to load a umenu with midi files within a folder where my patch is and to be able to load the .mid into a [seq] object. Hopefully someone can help me! I know its probably so simple that i’m overlooking it. I’m sick of typing them all into the umenu myself then they won’t save. Please help!

#58369
Aug 6, 2011 at 8:32pm

Post your patch.

#209770
Aug 6, 2011 at 9:22pm

you must send the [folder] object an empty types-message to make it list ALL files. see the patch beneath.

for midi just add up some extra filter sorting out by filename/extension, maybe there is something better but you can use [spell] and [atoi] for easy string-analysis.

– Pasted Max Patch, click to expand. –
#209771
Aug 7, 2011 at 3:35pm

Sorry for the delay but i will fiddle those with that idea today involving the folder object. Don’t you hate it when your brain hits the wall like this? Also i tried to copy the patch, save then open the text but it was opening as text even after trying many times and on two different computers. I’ll try on a third computer today if i can get to it but maybe its me. If you could repost the patch that would be great and thank you so much for reading and caring about my problem :)

#209772
Aug 7, 2011 at 4:25pm

sure sometimes you need a little patience.

don´t know if that matches your requirements, let me know.

– Pasted Max Patch, click to expand. –
#209773
Aug 7, 2011 at 4:43pm

if you have problems with using copy/paste use the attachment.

Attachments:
  1. midipicker.maxpat
#209774
Aug 7, 2011 at 11:04pm

Good news is that it works! I got it to load the umenu but the bad news is it will only play 1 .mid file out of the list for every option I choose. So half of it is complete but i’m just baffled as to why that is happening, have any ideas? Thanks again for the help by the way :)

#209775
Aug 7, 2011 at 11:14pm

sorry, i don´t get the point right now. of course it plays only the selected file, thats why you have a menu?

#209776

cbm
Aug 7, 2011 at 11:32pm

argotjunction, you should really post your file, otherwise people will just be guessing.

There’s no need for all the string manipulation. There is a file called “max-fileformats.txt” which defines all the extension mappings, and Midi files are in there.

– Pasted Max Patch, click to expand. –
#209777
Aug 7, 2011 at 11:35pm

hey good stuff with the [zl] and [atoi]. But the [umenu] file types can be set directly. I don’t think you need to change the types in [folder], just put in “Midi” (no quotes) in the File Types line of [umenu] Inspector, see example below. This one has the default folder depth of 0, so if you have subfolders, you need to change that so it’ll see them.

For all the file type codes look to the Max app folder: Cycling ’74–>Max 5.0–>Init–>max-fileformats.txt. Not all of them are the same as the extension, for example .mov becomes MooV.

– Pasted Max Patch, click to expand. –
#209778
Aug 7, 2011 at 11:41pm

(sorry I’m also cbm, above)

#209779
Aug 7, 2011 at 11:57pm

ah ok, didn´t ever look much inside the [umenu]-inspector (nice feature!) and just tried “types mid” instead of “types midi”. wasting time again ;)

#209780
Aug 8, 2011 at 1:44am

I got it! I had to route the [umenu] object to a [read] message and then into a [seq] object. Thanks for looking into it for me, I highly appreciate it. Patience paid off :)

#209781

You must be logged in to reply to this topic.