Forums > MaxMSP

file preferences in runtime

February 27, 2009 | 6:38 am

Hi there,

I just realized that Max runtime doesn’t have the option to configure file preferences. My patch (distributed as zip) uses a hierarchical file structure, and it seems as if the patchers in the sub dirs are not found.

Does that mean, the only way to run this is to put the app into the Max5 directory, or is there a secret way to tell Runtime where to look for files ?

cheers, nick


February 27, 2009 | 8:24 am

If you make a collective, and not a standalone, then this issue occurs. There is a way to tell a patch were it sits with the thispatcher object. (Although I think to remember that this actually does not work in a collective; search the forum.) From there you can point to specific folders. Does this mean you want to be dynamically loading subpatches? Of course in a standalone there’s not such an issue.

_
johan


February 27, 2009 | 8:42 am

not completely sure about the terms "collective" vs. "standalone".

I reckon "Collective" refers to an mxf file compiled with Max to contain all necessary files. At the moment,I am not using that as there are some files within the distribution which end users will need access to (in order to customize). Obviously, not possible to get to the inner workings of an mxf.

What do you exactly mean by "standalone" ?

Basically, what I am referring to is a simple plain zip archive which has some sub folders in it. When starting the main patch out of the zip file, the helper patches in the sub directories are not found, and one can’t tweak the file prefs of Runtime to look in the subdirs too.

Of course, there is always the option of providing a flat archive (no subdirs), and eventually, I might go back to mxf.


February 27, 2009 | 8:53 am

A collective is everything bundled in a single item (indeed mxf), a standalone is that thing combined with the runtime version and has the appearance of an app.

If you’re using patches, then what I suggested with the thispatcheer might work. But if the folders contain patches that need to be loaded; I don’t know if this is going to work. Take a look at the filepath object as well.

_
johan


February 27, 2009 | 9:00 am
jvkr wrote on Fri, 27 February 2009 09:53
If you’re using patches, then what I suggested with the thispatcheer might work. But if the folders contain patches that need to be loaded; I don’t know if this is going to work. Take a look at the filepath object as well.

You can temporary add a path in the search path using [filepath] with the 0 option.

p


February 27, 2009 | 9:13 am

As you said, although thispatcher can tell me the specific location of the mainpatch, loading of subpatchers is handled transparently by Max itself, and I don’t think, one can influence the load process. Just to add, no dynamic subpatcher loading, just normal object instantiation.

I tried the same thing with my Max full version, removing the recursive flag on my patch dir, and the sub dir patchers weren’t loaded anymore.

The problem with mxf is that firstly, one can’t open it (get to the sources), and secondly, it is harder to do a cross platform distribution. One has to provide 3rd party externals for Mac and PC. But then again, that’s the same as with patchers

Not ideal…


February 27, 2009 | 10:45 am

I did try the filepath option, doesn’t work as obviously the patcher hierarchy is created before the loadbangs are executed.

Means I get the "no such object" messages before the search path has been adjusted properly.

For dynamic loading probably fine, otherwise not.

As I said in another thread, I can’t use mxf as there is no low level control over the included files, and it seems I can’t use multi-level zip archives as Runtime doesn’t support recursive searches and/or file prefs.

The only way would be to distribute as a flat archive or potentially drop the app into the Max app dir (not sure whether there is default recursion)…


February 27, 2009 | 11:09 am
monohusche wrote on Fri, 27 February 2009 11:45
I did try the filepath option, doesn’t work as obviously the patcher hierarchy is created before the loadbangs are executed.

Means I get the "no such object" messages before the search path has been adjusted properly.

I know it’s not a very elegant technique, but you could use [filepath] in your main patch to set the search path, and afterwards use [pcontrol] to load the "real" patch. The problem is that you don’t know when [filepath] is done, and it can take a while.



zoe
March 3, 2009 | 5:33 pm

By the way, the "clear" or "clear 4" (for instance) message to a [filepath search] object doesn’t seem to clear a search path in the file preferences.
Also, dealing with this filepath object often seems to crash Max.
Any issues?
Thanks
Zoe
Max 5.0.6 on a MBkPro 2.4GHz OSX.5.6


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