On 2/17/2017 4:41 AM, zmoel...@iem.at wrote:

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 you had a print inside the abstraction it would print. If you dynamically create objects, chances are you will first dynamically create the abstraction which can initialize itself using a loadbang, then the print, then the connection. In this respect its behavior is synonymous to, for example [f 42] which initializes itself to 42 but does not output anything until asked to do so. This way initialization of individual abstractions is handled gracefully, whereas the example you are suggesting would require manual interaction regardless whether you are using an abstraction foo or an [f 42]. In other words, pd-l2ork/purr-data's loadbang implementation allows for parity between built-in objects and abstractions. This feature is used extensively inside pd-l2ork's k12 mode.

As a side-note, pd-l2ork also has an internal pre-loadbang call that is reserved for dealing with presets and occurs before the loadbang. This way you can gracefully handle multiple instances of the same abstraction (as is the case inside K12) and store their states through a single preset_hub object located on the parent canvas.

Best,

Ico



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@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list

_______________________________________________
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list

Reply via email to