Abstractions in subfolders
I’d like to have a patcher that uses abstractions that live in a subfolder that is in the same folder as the main patcher (see below for a potentially clearer explanation…). It doesn’t seem to me to be possible without adding the subfolder to my Max file preferences, which is not an option for me… (I want to distribute the whole package to others, most of whom are using Max/MSP Runtime…)
Is this possible? If not, could this be a feature in a future release of Max/MSP? Please!?
the main difference between search path and not search
path is that you do not need the path to the file when it
is somewhere in the search path.
when you build a project with files located at maxmsp/
myproject/fancysubfolder/ugly.jpg, and later you
distribute the project for use with the runtime, it is
okay to have ugly.jpg in runtime/uglypictures – it will be
With the filepath object it is possible to temporarily add folders to the search path. The thispatcher object reports the current location of the patch. These two things combined would be enough to allow the construction of an autolauncher that searches subfolders.
See this thread: http://cycling74.com/forums/topic.php?id=26716
And take a look at this.
----------begin_max5_patcher---------- 1464.3oc4ZtzaiaCD.9r8uBAs8PKfSrdXIKssWVfdqnE6hM6ofEFzRLwrUuf DcdsX+uWxgT1h1VRLtNNJauvDSRQM7iyLbH07swiLWl+.txz38FWaLZz2FOZ DTEuhQxeOxLE8PTBpB5lYF997k+s4DQST7CTn5jbT7RT1s0MTfnQqHY2tnDG QEius6kVSLr83k9V7RGVowWkOAIFFH1fegc8nbSdFMCkhgV9PIAkT2R15TRV BlBBkcitWQdB5tsC6Mrou4qo61YQUzGKvBwyDDeiuxa86iGyKlnIShxSSwYz 8fxucwEFEkDlPYPwoE4knxGMpvnxnUFL.spx3l7RVEUUj7rNHWXHPNG.cNyB 6hcgujry5DBGIGhwEzUF+bL9Fz5Dpg0uzkFTHnBMGTdrcm2oNzfCDsX4TvT. nWwTO9HWiniYuOL4C8gxfNm6yelycmShAj4FYAjdboDFRZvFdRB9NbInsucf FYtcN53CSLWGXs00FlrtVgammLJeaRdz+fgoqUckL8mm2njWfy19DfFkRgZO IYEk3JlZLhJE9luYtl6hCyN01uAEga8gO35zHyaKIw4YbgP4I4UW+5tV5UkW tUtgdjgJNvCSyySVhJuiTQVlfUVKX5vnLRJhhoDg73Xs44Hof6LkwBm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5djSNVUj z0oMVw0a95zVJTIuzpiOUDU+tCMzDPzU8lalBfIzCZ90EZhpWsTK6zYUPWQp pyPs9PhP6wuyTtz0+kz1nUcE4Ma1vCorg28W7lTlkFl+Ju3cehWBeRTdMJPE FI0aARv3c2vPR58OMeS++srIgxIK1e+gCu2vdq55JQ7Elsa411chbdkocdcG VlBNuXRCIBDa6ylHoCjb8+OPI1O993+0icl7g -----------end_max5_patcher-----------
Thanks very much for your help everyone!
The filepath + thispatcher make a great workaround! Still seems odd to me that it’s necessary, though…
hello cycling team,
this is an ver important unsolved issue since years !
it would be really nice to have a kind of mechanism
where we could set a search path before a path is loaded.
(relative to the loaded path)
define a foldername something like "subPatches" which will be automaticaly
added with all subfolders to the searchpath only for the actual opened patch.
we have this already with the path of the patch we opened.
but one level is not enough for normal sized projects.
beside our main patcher.
most of us are placing our projects in the max5 "patches" folder
which is also not optimal, because the every patch is globaly availible
for all projects.
if we have more than one project, we get into trouble.
or defining unique patcher names, which contains the project name.
also a bit awkward ….
so please cycling team give us a possibility to load subpatches
in subfolders without a preloader patch. (like autolaunch.zip )
then we could place a project wherever we want on our harddisk
open it and all relative content will load.
it would be also very, very helpful, if we are working in a team.
that would make live with max/msp much more easier and
many people would have more fun working with max :-)
Seems I’m not out of the woods yet… The filepath + thispatcher solution doesn’t work the first time I load the patcher after booting Max. It seems that Max decides that it can’t find the abstractions in the subfolder *before* it adds the paths. It works fine if I open the patcher, close the patcher and open it again… but that’s not very slick… Sigh…
So, now I have two questions:
– is it possible to force Max to add the paths before it goes looking for the abstractions?
– is it possible for a Max patcher to open a patcher? That way, I could run a patcher to do the addpath first, then open up a second patcher (my "real" one…) and close the first one….
Adding the path to be searched requires a loadbang, which does not happen before all objects are loaded (presumably). And then it’s too late. This problem is avoided by using a launcher that opens another patch and kills itself after the patch has been loaded successfully, as showed in the example I included. So ‘yes’ would be the answer to your second question.
My apologies for not looking at your original solution more carefully…
Thanks for your help!
So basically the choices are:
Messy patch with all files in the same directory.
Having patch inside the Max folder (not great for sharing).
Having to load the patch twice (for dependencies to show up).
Having a quick pop-up style window that then loads the patch.
Is that correct?
Definitely not ideal.
I took a look at projects, but that doesn’t seem to be a good solution either. It didn’t copy over all my dependencies, and the whole ‘not saving’ thing weirds me out.
you can use projects.
select the "project inspector" in the "manage project" menue.
deselect "keep project folder organized"
all this project options are nearly undocumented.
there are no examples …
and there are still many bugs.
hopefully it will work better in future versions of max.
Yeah that’s what I gathered (undocumented/buggy) about projects. Not exactly an exciting thing to try to commit to, particularly when you share your patches with people (adds another layer of troubleshooting complication).
rodrigo, why same directory? make as many subfolders and you need.
I haven’t even made one (due to the above noted problems). It’s all just sitting there, all unpleasant like.
I’d love to have a different folder for each data type.
yeah sure, but why dont you want it to be in the search path?
I do. Or do you mean why not have the whole patch IN the max folder?
I don’t keep or manage my own patches in there, and also for distributing, it adds another complication (patch must live IN the max folder).
It’s much easier for it to just work, wherever it is on their computer (or mine for that matter).
well ok i see, for distributing the patch without runtime it would of course be nice if a quasi relative path to the main patcher would make it to open its stuff right after unzipping some users download.
but i think that it will also work to tell people to move your project folder into their max runtime folder by hand before starting it. users who have max will know that by heart, and users who dont have max will eventually need to download and install max runtime app anyway.
compared to the installation of a plug-in for photoshop or cubase this isnt not more than the usual work for the user – or for the developer, because you can of course just put your project folder into an apple or alladdin installer package and make it prompt the user with a "where is your max runtime folder" and put an alias of the main patcher onto the desktop.
another alternative, but some people will hate that, would be to make an installer which moves everything in a standard path of the OS (:user:application support: or :preferences: or something like that), then you can use
those parts on your system while developing.
Yeah that is possible but then if they don’t put it there and open it, it spits out a ton of errors. I’d sooner just have a messy folder, but be able to keep it anywhere. (I keep all my max stuff/patches in my Dropbox folder for example).
It would be a total non issue if Max looked into the folders of wherever the main patch was, rather than just the root level.
This has been a feature request going back for well over a decade.
The reason given for *not* implementing this, many years ago, was that a patcher could be at the top level of the desktop and (on Classic Mac OS) adding all subfolders in this situation would mean searching the entire directory hierarchy of every mounted drive.
This is, however, not the case on Mac OS X nor (I believe) on Windows, where the Desktop is simply a special folder inside the user’s home folder.
I am not aware of any other really compelling reasons for not automatically adding subfolders to the working search path (but will stand corrected if someone can present one).
Yeah it seems like it would just be a simple line of code to tweak. Perhaps in the preferences it can limit the depth of search (defaulting at like 2 or something, so if you do have it at root level, it doesn’t go crazy deep).
It’s preposterous that there isn’t a simple way to tidy patches up for sharing.
there are many other places, aside from the desktop, where a patch could be when you click it and causing max to index the system folder or a complete harddrive, or at least the safari downloads folder, where there is already another – the wrong one – "audioplayer.maxpat" side by side.
temporarily including a path outside the search path to the search path seems to remain bullshit, however you try to implement it.
btw, another solution would be to ignore cyclings christmas wishes about EULA and copy rhabarber, and inlcude a max runtime with your shared patches.
if you also include a weblink to cycling.com i dont think they will hunt you down for doing so.
btw2, i know a guy called 110 who once needed 9 moths to find out that there is something like "search path" in programming languages and how to work with them, so be happy that you at least know what it is.
@jvkr: thanks, works like a charm.
Forums > MaxMSP