Forums > MaxMSP

loading a umenu properly

August 6, 2011 | 8:01 pm

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!


August 6, 2011 | 8:32 pm

Post your patch.


August 6, 2011 | 9:22 pm

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. –

August 7, 2011 | 3:35 pm

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 :)


August 7, 2011 | 4:25 pm

sure sometimes you need a little patience.

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

– Pasted Max Patch, click to expand. –

August 7, 2011 | 4:43 pm

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

Attachments:
  1. midipicker.maxpat

August 7, 2011 | 11:04 pm

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 :)


August 7, 2011 | 11:14 pm

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



cbm
August 7, 2011 | 11:32 pm

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. –

August 7, 2011 | 11:35 pm

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. –

August 7, 2011 | 11:41 pm

(sorry I’m also cbm, above)


August 7, 2011 | 11:57 pm

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 ;)


August 8, 2011 | 1:44 am

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 :)


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