[PD] Question about loadbang and dynamic sub-patches

Christof Ressi christof.ressi at gmx.at
Fri Feb 17 11:56:36 CET 2017


Since you too mentioned the |loadbang( message method, do you (or others) have an idea why nested loadbangs fire more than once with this method? [initbang] on the other hand works just as expected. This is not an issue if one uses loadbang only to initialize some variable, but it can induce subtle bugs once it triggers some action which should only happen once (e.g. incrementing a counter, dynamically creating objects etc.)

Is this expected, known behaviour or rather a bug? 

See attached patch.

Christof

> Gesendet: Freitag, 17. Februar 2017 um 10:41 Uhr
> Von: zmoelnig at iem.at
> An: pd-list at lists.iem.at
> Betreff: Re: [PD] Question about loadbang and dynamic sub-patches
>
> On 02/17/2017 02:25 AM, Ivica Ico Bukvic wrote:
> > FWIW in pd-l2ork/purr-data loadbang fires even in dynamically created
> > patches. 
> 
> so does that mean, that if i have an abstraction "foo":
> 
> [loadbang]
> |
> [f 1]
> |
> [outlet]
> 
> and i dynamically create a patch including that abstraction, the
> loadbang will be lost on the created patch?
> (meaning: the following will not print:
>  #X obj 100 100 foo;
>  #X obj 100 200 print;
>  #X connect 0 0 1 0;
> )
> 
> if it does print, i would be interested in the heuristic you used.
> 
> if it does indeed not print, then i think i just hit a bug (as the patch
> behaves different when created dynamically or not¹)
> 
> gfmsrda
> IOhannes
> 
> ¹ it doesnt't in Pd vanilla, if you don't forget to send a "loadbang"
> message after doing the dynamic patching as a kind of "finalize".
> 
> _______________________________________________
> Pd-list at lists.iem.at mailing list
> UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: initbang-abs.pd
Type: application/octet-stream
Size: 338 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20170217/fc423272/attachment-0003.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: loadbang-abs.pd
Type: application/octet-stream
Size: 319 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20170217/fc423272/attachment-0004.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: loadbang-test.pd
Type: application/octet-stream
Size: 438 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20170217/fc423272/attachment-0005.obj>


More information about the Pd-list mailing list