On Tue, 22 Mar 2011, Rich E wrote:

Thanks for the insight into more pd internals, although I think I prefer an approach that does not heavily rely on public pointers floating around, like pd_newest

pd_newest is a function returning a pointer, not a pointer itself. that's an easy mistake to do, especially as the return value of it gets almost always cast to a more specific type such as :

  t_my_something_tilde *stuff = (t_my_something_tilde *)pd_newest();

(it is funny that it is declared in m_pd.h, but then there is a comment above its implementation that it is a hack, maybe be removed or redesigned).

No, it's not funny. Miller will call "hacks" things that are quite normal to be doing, and then forget about them entirely, and 15 years later, people like you still assume that the comments mean something, even though in the meantime 13 or 42 developers had to call pd_newest() somewhere because it's the only way to do a rather basic thing.

 By the way, if I call pd_newest after glob_evalfile(), will it give me
a reference to the patch?

From what I know and from what I can read quickly, you wouldn't get it,
you'd get the last object created in the patch, but I didn't try it.

However, canvas_popabstraction does set pd_newest, so you can already use pd_newest() if you pretend that the patch is an abstraction.

About namecanvas, there were two issues that I found when I had a system for dynamically loading/unloading and linking together patches that contained audio: 1) DSP had to be shut off and then turned back on once the linking was done.  Sometimes I wouldn't even get audio out of an object until this happened.

Ah ok, this is not the responsibility of [namecanvas], but I know what you mean.

2) closing a patch that had audio receivers containing $ variables via the menuclose message was unstable, and would sometimes crash pd.  

I don't see how this could ever happen. Is there a way to make a very small patch that causes that crash to happen ?

I didn't ever get to the bottom of these issues, but from what I understand, [namecanvas] doesn't handle deallocation too well.  I lost all this code anyway,

What do you mean you "lost" it ?

so the new approach I am using for patch maintainence is through libpd and an object oriented language (objective C at the moment, although I think I would prefer python for running pd on a laptop/desktop).

So why don't you use libpd's python bindings ?

 _______________________________________________________________________
| Mathieu Bouchard ---- tél: +1.514.383.3801 ---- Villeray, Montréal, QC
_______________________________________________
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list

Reply via email to