Buffer and UMenu SOS Help!

    Mar 29 2013 | 8:27 am
    I need some SOS help, Im stuck :(
    I have a UMenu with a prefix folder, where are audio files. The audio files after selecting them will be loaded into a buffer. Everything works fine, except that I would like to use the files withoutthe .WAV extension. If I remove the extension from the file, the buffer object can't load them (cause it thinks they aren't wav files).
    My question is that how to add the an extension to the the file, after reading the patch and filename from UMenu.

    • Mar 29 2013 | 10:54 am
      Maybe I wasn't clear enough. I want visible the filename without the extension.
    • Mar 29 2013 | 1:16 pm
      Are you on Mac or on Windows? And which version of Max are you using?
      Here's a solution that works on Mac (Max 5.1.8 and later):
      I had a folder in which half the files had an .aif extension, and the other half didn't have an extension at all. When loaded on the [umenu] it was possible to load all the files on the [buffer~] normally, no problems (even the ones without extension).
      If you're on windows, though, you might have problems, as windows relies on extensions to recognise filetypes and this may affect Max/MSP (pure assumptions, though, because I've never worked Max on windows).
      If this is the case, then this might be a solution: essentially you leave ALL the files in your folder WITH their extensions (assuming all files are .wav files). The patch below removes the extension from the filename before populating [umenu] so that it looks neat, and when you select the file from [umenu] it puts the extension back so that it's possible to load them onto [buffer~]. I'm sure there's an easier way to do this (I'm only starting to learn [regexp]) so I'd be happy if someone offered a more elegant solution! :)
      Hope this helps!
    • Mar 29 2013 | 1:49 pm
      Im on booth :(
      Is it possible to add the extension after loading? (Or during loading)
      If I removes the extensions its OK (the patch works, thank you sooo much), but there will be still wave files inside the folder. I want load files without extension, then add the extension to them :( (I want to hide the file-types from the endusers.)
    • Mar 29 2013 | 1:53 pm
      There will be a UMenu, where users can select the cabinet IR-s. But, AMPEX.WAV looks sht, that is the reason why I wants to remove the extension from the file, then load the folder into the UMenu, then load each file into a buffer (not every file in the same time, just the selected one). And during this liading, I would like to add somehow the extension to the file.
      Is it possible with a banged filetype message to the buffer? When loading, band with the WAV type message? (Its not working anyway :( )
    • Mar 29 2013 | 2:07 pm
      Did you try the first example? On Mac if you remove the extensions from the files in the folder, you can still load the files without extensions and it works fine.
    • Mar 29 2013 | 2:09 pm
      OK, now I see, that part to might help me. How to avoid dropfile? I've a fixed folder....
    • Mar 29 2013 | 2:13 pm
      Yeah, tried, but the device should work under windows too :(
      In the other hands, is there any way to modify the second patch? What if I know that every file is WAV, so I dont need to store the extension :(
    • Mar 29 2013 | 2:29 pm
      Did you try the patch on windows and it didn't work? (I don't know if it works on windows because I don't have windows.)
      Also, on the second example, the files on the computer have the extension, but when they are loaded on [umenu] they have no extensions as menu objects. So, on the Max/MSP patch it will not look "like shit" - why does it matter if the files themselves have or don't have the extension on the computer?
      You might also want to look into the following objects: [sprintf], [regexp], [append] and [folder].
    • Mar 29 2013 | 3:58 pm
      If I understand correctly, you could also use two Umenus, one like you already have and then another with the full sample names (hidden from the user). Like this:
      See the AKG 414 for a working example.
    • Mar 29 2013 | 7:20 pm
      Laonikoss :
      Sorry, I wont be rude or something like this.
      The deal is that this device should be an "IR based colorization unit" :D with lot of IR files. I wont allow users to see that the files in the IR folder are actually WAV files.
      Mark :
      The problem with your idea is that if I load the patch in different platform, the order of the files could be different.
      There must be a way to add extensions to the loaded files, but can't find it in the manual :( (Or declare somehow the filetype for the buffer...)
    • Mar 29 2013 | 7:53 pm
      Tried to append...not working :(
    • Mar 29 2013 | 9:08 pm
      sprintf or combine should get you there.
    • Mar 29 2013 | 9:48 pm
      Oh, Thank you very much!!!
      My last question. This is really really the last one. How can I set the path of my folder.
      Now this is the path :
      Is there any way to set it like this is the patch :
      (The folder will be in the sam folder like the patch)
    • Mar 30 2013 | 12:15 am
      sprintf to the rescue again. Put this in your top level patch:
    • Mar 30 2013 | 10:12 am
      Thank you very much! The only problem with this that if I save your patch into the folder, it shows me the full path, like "DRIVE/etc/etc/"
      If I put this into my patch, it shos only : /IRFOLDER
    • Mar 30 2013 | 10:28 am
      I forget to mention that I used a sub-patcher window!!!!