Forums > MaxMSP

File Paths?

August 20, 2009 | 5:23 pm

Hi All,

I’m wondering if someone could give me a straight forward answer here. I’m a bit confused about things.

I’m in the process of creating a Max/MSP setup that I will eventually want to save as a standalone application. One of the things that I need this to do, is to ‘Import’ a series of MP3′s into various buffer objects upon startup.

My question:

How do I program things so that no matter who’s computer the app is running on, Max will find the right MP3′s? Anytime I’ve successfully done this, I’ve needed to include my harddrive name in the file path. How can I be sure that Max will find the right files when it’s running off of someone else’s hard drive?

Sorry if this is a basic question, but since this is work for a client, I need to be absolutely sure that this app will reliably run… anyone’s expertise would be hugely appreciated.

Cheers,
Joel


August 20, 2009 | 5:47 pm

You will need to [loadbang] a "; max sendapppath somename" and the location of your app will be sent to a [receive somename]. Then you can use [sprintf] to set the desired location inside your application, for example [sprintf symout %s/App Name/Contents/support] is a good place to put your audio files. You can do this after building your application by right-clicking, then selecting "show package contents". I hope this helps.

lh


August 20, 2009 | 6:13 pm

Thank you for this!

I must admit, that this does not immediately make sense to me – but that has to do with my limitations as a MAX programmer – I am very comfortable with patching knobs, dials, etc. but things like ‘sprint’ scare me a little Smile.

This will definitely give me a direction though, thank you for putting me on the right (file)path.

Cheers,
Joel


August 20, 2009 | 7:13 pm

I’m eating my words.

This took me about 10 minutes to wrap my brain around. Your explanation was perfect.

Thank you so much for your help!

Cheers,
Joel


August 21, 2009 | 9:40 am
Quote:
[sprintf symout %s/App Name/Contents/support] is a good place to put your audio files. You can do this after building your application by right-clicking, then selecting "show package contents".

I wouldn’t put the mp3 there if they’re big. If you need to regulary update your app for your client, you’ll then have to put the mp3 yourself in the package and send him a very big app.

But of course, tthe package is a good location to "hide" the mp3 to the client and make sure the app will find them.


October 16, 2013 | 8:16 pm

i’m having problems with this.
for a standalone app, trying to load a preset file on start, and save the same file on close.

so i’m using
(sprintf symout %s/App Name/file.maxpresets)
but for some reason, the write ends up in the same folder as the app (rather than in the app).
and the read cant find the file even when i place it manually.
i’ve tried a variety of paths inside the app and none seem to work for me :p

directing it to the same folder as the app does actually work.
(sprintf symout %s/file.maxpresets)

i’m running Max 5.1.9 with Mountain Lion 10.8.5

<code>

– Pasted Max Patch, click to expand. –

</code>


October 16, 2013 | 11:13 pm

i just noticed that Max wont create a folder.
in this case the folder "presets"
(sprintf symout %s/presets/file.maxpresets)
and instead will put them with the app, rather than the non-existent folder. so i’m guessing that Max is not seeing the app as a folder ?


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