Does anyone know a way to get the name of a patch or subpatch from
within Pd? Basically I want to dynamically get the name that you
would use like this:
[; pd-myobject.pd(
The actual filename would work too. It seems to me that this should
be part of a standard, message-based querying mechanism which could
also be used for patch meta data like local namespace, current dir, etc.
.hc
If you are not part of the solution, you are part of the
problem. - Eldridge Cleaver
Hi hc,
I presume you saw the announcement about my external which does this, and this is by way of follow up...
On Wed, 12 Jul 2006 14:00:40 -0400 Hans-Christoph Steiner hans@eds.org wrote:
Does anyone know a way to get the name of a patch or subpatch from
within Pd? Basically I want to dynamically get the name that you
would use like this:[; pd-myobject.pd(
The actual filename would work too. It seems to me that this should
be part of a standard, message-based querying mechanism which could
also be used for patch meta data like local namespace, current dir, etc.
I think all that it would take, is for PD to map a patch's unique ID to it's filename. Then you could do:
[bang( | [f $0] | [makefilename pd-%d.pd] | |$1(
It's a shame you can't just do :
[s $0]
But $0 isn't expanded to a symbol when used alone.
Jamie
Hallo, Jamie Bullock hat gesagt: // Jamie Bullock wrote:
I think all that it would take, is for PD to map a patch's unique ID to it's filename. Then you could do:
[bang( | [f $0] | [makefilename pd-%d.pd] | |$1(
However a filename is not unique, if it's used as an abstraction several times. The filename will stay the same, $0 won't.
Frank Barknecht _ ______footils.org_ __goto10.org__
On Wed, Jul 12, 2006 at 08:16:57PM +0100, Jamie Bullock wrote:
I think all that it would take, is for PD to map a patch's unique ID to it's filename. Then you could do:
[bang( | [f $0] | [makefilename pd-%d.pd] | |$1(
I think it would be really cool if this was possible. It would make it much easier to make patches that store persistant data from all of their abstractions as you could just pass $0 to abstractions as an argument. Though come to think of it you could do this now by making a subpatch called $0-datastore.
Best,
Chris.
chris@mccormick.cx http://mccormick.cx
On Wed, 12 Jul 2006, Hans-Christoph Steiner wrote:
Does anyone know a way to get the name of a patch or subpatch from within Pd? Basically I want to dynamically get the name that you would use like this:
[; pd-myobject.pd(
The actual filename would work too. It seems to me that this should be part of a standard, message-based querying mechanism which could also be used for patch meta data like local namespace, current dir, etc.
this can be done by modifying [getpatchname] (supposing its canvas_getcurrent bug gets fixed).
For a root t_canvas *x, instead of looking up x->gl_name, look up canvas_getenv(x)->ce_dir, which is also a t_symbol *.
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - tél:+1.514.383.3801 - http://artengine.ca/matju | Freelance Digital Arts Engineer, Montréal QC Canada