Relative paths or thispatcher inside an abstraction
I’ve searched on the archives for this but I’m really trying to make the issue of relative paths simpler for myself.
I have a very simple patch to get the absolute path of my main patch and then append sub-folders to it to open files. So far nothing exiting, there are plenty of examples to do this on the forum. My first problem with previous posted solutions is that there are several objects involved in doing this and I’m constantly loading external files from all over my patch. So I would have to move (or copy around) a group of objects just to feed files to my objects that need it. My ideal solution of course would be to just use the "message" object and simply write "open /mysubfolder/myfile.myext". Since that is not possible my current solution is to have the following:
message object—"open subfolder/subfolder/myfile.myext
sfolder———- My patch that deals with the details
My object that needs a file from a subfolder.
This works to a certain extent, but If I try to use "sfolder" as an abstraction it breaks, as the "thispatcher" object will report the absolute path of the original patch (somewhere in the C74 folder) and not the path of the patch that is loading the abstraction. Also if I try to put the contents of "sfolder" in a sub-patch the "thispatcher" objects seems to get lost and reports "/" as it’s location.
Is it possible to use "thispatcher" inside of an abstraction the way I am trying to do?
At the moment what I have to do is manually copy the "sfolder" patch to the root folder of every project next to the main patch. Should I call it a day and just keep doing it that way?
The patches need to be saved to the same folder, in this case it is looking for a file called "01.wav" on a subfolder called "snd"
Thanks in advance
----------begin_max5_patcher---------- 946.3ocuW0ziaaCD8r8uhAJXQt3HHR8EUBPA5kBjKEn.EnGpKJnknWqrRjpj Tc2sA4+dGRI00wq6Z6Xk0GnsGNb3adyaHk97xEAaTOHLAv6geGVr3yKWrvax YXw3+WDzxenrga7tETpZaERavpg4rhGrd6+1NgD9HzaD.WB8x5+pW.kptGA0 Vvtq1.cba4NnqgWJpfZIZT.ZkxBaUMUBsyu1GgNs5ShRKTag6U56Lq.tw6pY zMtrx4WKGCwPHM63ZwfO7VAznJ41ZkLDf0xeEshgbSinEPLX0OVKuErJOPw8 .CNBW9FiUyKcqB1pUsXze3sF.yMgVxaLiPz.aDkb2JWG3RI+1KzqCf6qaZ.s nSosdfLgggjW.Jc8s0XjvENlG3hFPuKejpiurmRRLwK4MMdviSrGfCmJE3jh RUuzWOXiF2pjVIxJ9ZzOpq4MStK6aqkMBqurRFMVW4cTs4SuiDErWLL0+iOF EgQOsdUucJ.SV8fEQ4epwh3fthjlGlSRhhRWAEogYTBKmtBnTBFKfgQD9C2h +xxktgUWoP7cG94GBtZtfMSTQQbHIlQXIq.BIIjlTjRPpHK2wDj7YlI9Iktk OHrZEFC+VgWrY5675zsJsSasyfpWK1E0gMlliqlnWMClNaho3v3r7zXFpfHQ gIEzXJJrHoQNNjN2bnQzw0bqqiW0IjXWq+7AGmtstQ.e7ssXWq5NWiIRngWu VKdtXpXbQrr3LjcRXgIwDVJRZDF8pDaCa94lLTVvkhaZD1WfsHtiHhQTVvXI YC.dB1iKdpl41rfugTwi7ilIQGISxOdlPdgJPgWRF6ANaZ7+f+PPrO1IFbOH X1xLo3dDyOSLagMf45UnzKRhReABJxyJ49V2XRHKuHJmcPU9YzzFt71fUd5Z 9nFSmtVZ2B2Xf0qWGbi4Fi66KjrhOx0nEWBYQNu9BR1S8ECWi9xT1rRU8R7l h6.ybHkHYykTx2qk3GGkUmfRlaEzdOP30yK4yDsDm3YBh+LnzzylVFm1v+6o IdyO6l5qRRH3Ctg27KtQgrZvx2DmN97IOiTcOexExlzibf0L0BNvlEY9iqng 9G637a6794etpCdgK+N4r+0DjQ0qKmB0zQIvSaWkvXw2ov8N.64j6F28bZWc UkPt+cZs0UcJ7rtQP7+TtNWL4tK.Hm.SdfSe0vj6PkSxSGPle24o7yASYu90 tSpmtLHQviWbumm+J8j3oeOGUzSoxNHc9dyd4mqvm75UPOi5Y9UPR3e9xx+E HpGXCA -----------end_max5_patcher-----------
----------begin_max5_patcher---------- 722.3ocuVtsbZCCDF9Z3oPi5sDEczxt8p9Bz9.T5zQXK.0wVhAKRHISxydkj wIjzbfSgKvCd8pke8s+dE2Mb.bhastEB9J3WfACta3fAoPw.C1b+.XiZcYsp MkFrz0znsd3ntm40q8o3Vm2TpA945kZfoEXcfwvKGCAJeLHn0qV5Atoc2rZx TWckdIvpZzH.nub0FqtzsxlpIcSvoNqOlW5246KMp59zsqZL1ZsOIMxlflpT htI+8BNbqRzZtMUhBD9ok6V46WeezEJe4bic1eVpK8cnQlixyyw7rQfKvHof vHguRIwRAnRDF763Zue3v3kQGIJ+oM.o.B0qUMKpCzLvsEZaaBcSMgHXB5Z0 UfqmaJmGgsw9BrNF1ZqFCeUrxNZrROQXkHoHrffkjQ.l.wHDYAeDfHvQtxxO Pt1n85kOrqaFh.9p5l7N5lyRMdJFkQX3r7Qf7jjIrnj2rvtZ4uYgtaUvo0NU nBGxVxpuNn0+yoz10tgGcGkrWuo7NnQJQEBYAiFPBCQ44Y44csx.cjuGcfGX utsUMSumDf9JDfchH.IShnXBSHh9AYmqNv.ZVxzPDe5P3Q6QbpAHLH3xt4Em .HgO81DVVmMI7hur3yhPd2rY05c8sg78dhffiDTVVV3TARXpP3SgHdBQZpP7 5augL1Cblf91JU4C6ZqKCt2G58TOhhCMIIuPVLBvEw8DWbfCmeyIYKpU27vw aQE6iCktS6dRn61OmmU7wSxZMyrQACfST1YvGSrUcUeJe4GwG+3lNXqCEM4c JxB0G2EA9sm6LRUJcX9K9KaI8Gi+bv25Vsrr+mbCb.OI7Jcq2XUdiytUNYOK m4lpJscamRioZgKXZ2Hg2vDbpUD4ron7cPQh8iQYbDte5.mDMP4RDu2cEibF nHQbVarwiJ9XMwOuZhuKZhse1ssakzBTNCG9FOLyW1+m.1D8bH9ioGGt49g+ CDEiAwA -----------end_max5_patcher-----------
thispatcher has to live in the main patch, not an abstraction. i guess you’ve figured that out.
my solution is to have at load time, thispatcher spit it’s path to a send object. the abstractions have the receive object which concats the path with their local paths.
it seems that [rtcmix~]’s help file handles this subfolder file issue pretty well.
I was afraid that there would be no way to use [thispatcher] on the way I wante. Well I guess I’ll just have to deal with it.
I don’t have [rtcmix~] on my machine but I would imagine that the help file would be inside max’s search path. Is this the case?
or is there any particular relative-folder wizardry in the patch?
On Jan 13, 2009, at 6:21 PM, Miguel Ortiz wrote:
> I don’t have [rtcmix~] on my machine but I would imagine that the
> help file would be inside max’s search path. Is this the case?
> or is there any particular relative-folder wizardry in the patch?
I use the [thispatcher] at the top-level and use that as a base for
where any sub-folders live, then send that out to various [sprintf]
objects that properly construct the pathname. Then they send a [set]
message to message boxes to capture the relevant info. Then I bang
the message boxes when I need the path/file/whatever.
Don’t download any of my stuff until tomorrow, though. :-)
Forums > MaxMSP