[PD] Testing for empty creation args?

Matt Barber brbrofsvl at gmail.com
Fri Nov 28 18:30:17 CET 2008


(Attached is a better solution than my previous one -- read below for
details)  =o)

On Fri, Nov 28, 2008 at 7:23 AM, IOhannes m zmoelnig <zmoelnig at iem.at> wrote:
> Matt Barber wrote:
>> Actually, after using it for a while the worst downside is that it
>> uses so many "key" events in the dynamic patching, which trigger [key]
>> elsewhere in the patch.
>
> since you approach required both an abstraction and a specially named
> subpatch on the parent, why don't you just copy the code needed directly
> into your abstraction? no dynamic patching required whatsoever :-)
>
> fgamdr
> IOhannes
>


Right,

But the idea is that it might be nice to make an abstraction which
outputs its parent's creation arguments at the main outlet when it
receives a float.  If the float is out of range (e.g. if you're
looking for the 5th argument in a 3-argument list), it should output a
bang at another outlet.  With an abstraction, you can quickly iterate
over the creation args (useful if you want to set default values in
the parent, say), and it scales to any number of creation arguments --
but the price is one extra subpatch on the parent.

The problem I had, which I think was HC's original problem when he
tried to make it an abstraction, was that any dollar argument that's
out of range becomes a 0 (zero) rather than "no argument" when it's
passed to a child abstraction, so it doesn't seem to work to put the
code for your [makefilename] solution in an abstraction.

My solution dynamically instantiates your original solution directly
onto the parent (in the helper subpatch on the parent).  I had been
having trouble getting dollarsigns to dynamically patch.  My
brute-force method was to dynamically "type" the dollarsign arguments
in, which can be done only when the subpatch is visible, sets the
dirty flag, and triggers [key]...  but I found out what I was doing
wrong, and have attached a much better solution whose only downside is
the helper subpatch on the parent - it no longer needs the helper
abstractions and doesn't have any key or mouse events.


Best,

Matt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: getcreationargs.zip
Type: application/zip
Size: 2235 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20081128/11577dc8/attachment.zip>


More information about the Pd-list mailing list