Max 5 Application Building

Jul 21, 2008 at 8:09am

Max 5 Application Building

So I’m building an application, and I need to include a bunch of small (<4kb) audio files in it. Including the folder containing all the files, and including them one at a time, does not work. The only way the built app recognizes them is if they're in the same folder as the app itself, which is... messy.

Whenever I put the app on another computer, without the audio files, I get a ‘buffer~: can’t read’ error.

Any thoughts?

#38956
Jul 21, 2008 at 8:53am

There’s a thread about this every couple weeks. Max can only find files in the same directory, or in the search path. I suggest you add your samples folder (which is relative i suppose) to the search path when loading the patch. Use the [filepath] object for this.

Here’s one thread about it:

http://www.cycling74.com/forums/index.php?t=msg&th=34514&start=0&rid=5118&S=7e41d0662ddf6ae6da9211efc580f0fe

#136390
Jul 21, 2008 at 8:59am

Ah, I must have phrased it badly – I’ve got it working quite fine in MaxMSP 5, adding new filepaths is oldschool. The problem is when I try to build it into an application, and tell the build script to include the folder of samples, it just… doesn’t. The application (which I’d like to be fully self contained) has to be sitting in a mess of sample files, because if I send it to someone that doesn’t have a full Max5 install, they can’t very well change their file search paths.

#136391
Jul 21, 2008 at 9:02am

WAIT

I fixed it!

OK, here’s what I had to do: I’ve got all these sample files – instead of putting them in the same folder as the application, open the application as a package (in OSX, ctrl-click and select ‘Show Package Contents.’

From there, go to Contents: MacOS, and drop your files inside that folder.

Your standalone application will now run fine, loading your files when necessary, while staying completely self-contained!

#136392
Jul 22, 2008 at 12:08pm

Ah, i indeed got you wrong there…
Smart solution (although personally i think the Mac package system is not very intuitive, i didn’t know there were folders behind everything at first). But in this case, it works fine.

#136393

You must be logged in to reply to this topic.