[PD] overriding objects

Jonathan Wilkes jancsika at yahoo.com
Tue Jun 15 20:46:53 CEST 2010


Oh, I see, I didn't check about expr.  Well, a better example of what I'm talking about would be [polymap] in ekext, as well as (older versions of) [pddplink].  Both 
post a message about the particular object, both post only once, and both do so by using post in the setup routine for that object.  Neither messages are posted when 
you load the respective libraries.  So I'm confused by your example of this hypothetical object posting 86 messages when a patch is loaded-- I've never seen that 
happen.  Do you have an example of this behavior?

I think such an initial post to the console saying that the object the user just created/loaded is an alias for gf.print, and that the old print is now pd/print, would be 
nice.  But like I said, I haven't used the most recent version of GF-- if there's already some such message when the library is loaded then that works, too.

So I guess you're using this complicated Gem example to say that the user doesn't need to worry about which [print] is being used since GF just loads its own 
when the necessity for printing grids arises (i.e., when the gridflow library is loaded).  Setting aside the issue of bugs for the moment, how does Pd's 
development model deal with another developer releasing library x which, when loaded, uses [print] as an alias for yet another object so it can display its atom type? 
Seems like the user would be stuck in the place you're trying to avoid-- having to use gf.print for GF and x/print for x, and also figuring out which of 
the three prints are the least buggy to use with everything else.

-Jonathan



________________________________
From: IOhannes m zmoelnig <zmoelnig at iem.at>
To: Jonathan Wilkes <jancsika at yahoo.com>
Cc: Mathieu Bouchard <matju at artengine.ca>; Roman Haefeli <reduzierer at yahoo.de>; pd-list <pd-list at iem.at>; Kim Cascone <kim at anechoicmedia.com>
Sent: Tue, June 15, 2010 6:57:14 AM
Subject: Re: overriding objects

On 2010-06-15 12:32, Jonathan Wilkes wrote:
> Thanks for changing the subject line.
> 
> In your example, why wouldn't the developer just add a method so the user can send a message to set 
> hardware or software acceleration (or query to see if hw accel. is available) if they wish to do so explicitly?

because openGL does not allow you to set hw/sw rendering.
it is the very concept of openGL, that the implementation (whether
rendering is done in hw, sw or quantum dimensions) is abstracted away
and you should not need to wory about that.

> Anyway, I think my [post] vs. [print] question is really beside the point.  What I want to know is if 
> [gf.print] is an improvement over the current [print], why doesn't it just get incorporated into Pd?  It 
> doesn't make sense that someone should have to download and install GF to get a less buggy [print] object.

yes, but that's the nature of Pd's development model.
furthermore, in reality i suspect GF's [print] to have dependencies on
GF, so you would be unable to run this [print] without GF installed.

> Most objects that post 
> a console message only do so when the first instance is created, whether by actively patching or by opening 
> a file.  (See [expr] for an example of this.)

[expr] doesn't do that. it's only the way you use [expr] that makes you
believe it does.

you get a splashscreen when you load the "expr"-library (that is the
file "expr.pd_linux" on your linux-system), which happens to provide the
[expr] class. normally you are loading the library when creating the
first instance of [expr] (because that's one way of Pd to load a
library) but you could force the loading of the expr-library by starting
Pd with "-lib expr" (or add "expr" to the libraries loaded at startup),
which will give you the message without having created a single [expr].

with GF it is a bit different, as you have to load the whole library
first in order to create GF's [print] then.
if matju used Pd's mechanics to override the class (sidenote: Pd
provides infrastracture to override built-in classes; so it seems that
while some consider this "bad practice", others are not so religious
about this), Pd would print out a warning about the print-class being
overriden (while loading GF).

this is "mainly" what was asked for, no?

fgmasdr
IOhannes


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20100615/72054aa2/attachment-0001.htm>


More information about the Pd-list mailing list