Is it possible for an abstraction to get the path of the parent patch?
I have an abstraction called sample.pd that takes the name of a
soundfile to load as an argument, and I would like it to look for the
soundfile in the parent patch's directory, rather than my abstractions
directory.
Thanks, Ben
hi, I also messed around with that directory stuff for a long time, but here is my state of the art answer: usually the working directory, is that directory from where you start pd. and it has nothing to do with the abstractions directory or the directory where the pd binaries are located. BUT if you start pd with a patch argument, than the directory of the patch is the working directory... paths in your patch are always relative to the working directory. so your parents patch directory will not help you much. anyway, if you use the -path flag with the path to your soundsamples all samples should be found just by name. if you still want to handle directory stuff one possible way is to use a py/pyext object. marius.
----- Original Message ----- From: "Ben Saylor" bensaylor@fastmail.fm To: pd-list@iem.at Sent: Wednesday, March 24, 2004 11:29 PM Subject: [PD] get path of parent patch
Is it possible for an abstraction to get the path of the parent patch? I have an abstraction called sample.pd that takes the name of a soundfile to load as an argument, and I would like it to look for the soundfile in the parent patch's directory, rather than my abstractions directory.
Thanks, Ben
PD-list mailing list PD-list@iem.at http://iem.at/cgi-bin/mailman/listinfo/pd-list
Thanks for the information. I'd rather not put all of my samples in the pd path, so I guess I'll have to keep the soundfiler object outside of the abstraction, in the parent patch.
Ben
On Wednesday 24 March 2004 11:54 pm, marius schebella wrote:
hi, I also messed around with that directory stuff for a long time, but here is my state of the art answer: usually the working directory, is that directory from where you start pd. and it has nothing to do with the abstractions directory or the directory where the pd binaries are located. BUT if you start pd with a patch argument, than the directory of the patch is the working directory... paths in your patch are always relative to the working directory. so your parents patch directory will not help you much. anyway, if you use the -path flag with the path to your soundsamples all samples should be found just by name. if you still want to handle directory stuff one possible way is to use a py/pyext object. marius.
----- Original Message ----- From: "Ben Saylor" bensaylor@fastmail.fm To: pd-list@iem.at Sent: Wednesday, March 24, 2004 11:29 PM Subject: [PD] get path of parent patch
Is it possible for an abstraction to get the path of the parent patch? I have an abstraction called sample.pd that takes the name of a soundfile to load as an argument, and I would like it to look for the soundfile in the parent patch's directory, rather than my abstractions directory.
Thanks, Ben
PD-list mailing list PD-list@iem.at http://iem.at/cgi-bin/mailman/listinfo/pd-list
Hallo, Ben Saylor hat gesagt: // Ben Saylor wrote:
Thanks for the information. I'd rather not put all of my samples in the pd path, so I guess I'll have to keep the soundfiler object outside of the abstraction, in the parent patch.
Maybe a state saving system like Memento in RRADical would help: http://footils.org/cms/pydiddy/wiki/RradicalPd
This can be used to save sample information inside state files. Note the usage of the rrad.minipli sample player abstraction for an example. This does not solve the problem of having to specify absolute paths (as is the only thing that really works in the long run as far as my experience goes), it just makes it easier and more readable to do so.
Frank Barknecht _ ______footils.org__
Ben,
I had the same issue when it came to saving abstraction's gui settings in the path of the parent patch. My solution was to have a sort of Mother sub-patch that I copied into all of my patches. My abstractions then communicate with the mother patch, and it knows what path the parent's in because it's a sub-patch, not an abstraction.
So I guess no, there is no way. I asked this... many months ago and got the same response.
David __ _ _ _ _ __ ___ _ ___ __ _ _ _ ____ __ Music wants to be free http://sintheta.org
Ben Saylor wrote:
Is it possible for an abstraction to get the path of the parent patch?
I have an abstraction called sample.pd that takes the name of a soundfile to load as an argument, and I would like it to look for the soundfile in the parent patch's directory, rather than my abstractions directory.Thanks, Ben