Hello,
Happy new year pd-list !
With pd-0.46-7, loadbang method was called only once when patcher loads. Now with 0.47-1, loadbang method are now called twice. Why loadbang method is called twice ?
As far as I understand, loadbang method could be called not only on patcher load (LB_LOAD), but also when closing an abstraction (LB_CLOSE) and before the object is connected to parent patcher (LB_INIT).
Many externals uses this loadbang method to initiate their state. This new behavior trig a lots of "wrong argument for loadbang method" error in pd console.
Is it a good practice to rely on loadbang call to initiate objects ? or should we avoid it and use [loadbang] object and/or make initialisation in object_new method ? -- do it yourself http://antoine.villeret.free.fr
Happy new year to you...
I don't get this behavior - can you send a sample patch?
thanks Miller
On Mon, Jan 02, 2017 at 04:50:47PM +0100, Antoine Villeret wrote:
Hello,
Happy new year pd-list !
With pd-0.46-7, loadbang method was called only once when patcher loads. Now with 0.47-1, loadbang method are now called twice. Why loadbang method is called twice ?
As far as I understand, loadbang method could be called not only on patcher load (LB_LOAD), but also when closing an abstraction (LB_CLOSE) and before the object is connected to parent patcher (LB_INIT).
Many externals uses this loadbang method to initiate their state. This new behavior trig a lots of "wrong argument for loadbang method" error in pd console.
Is it a good practice to rely on loadbang call to initiate objects ? or should we avoid it and use [loadbang] object and/or make initialisation in object_new method ? -- do it yourself http://antoine.villeret.free.fr
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
here is a sample code that demonstrate the issue : https://raw.githubusercontent.com/avilleret/helloworld/loadbang_issue/hellow...
When the object is created, loadbang method is called. Save the patch. Close it Reopen it, then the loadbang method is called twice (maybe one time at object loading and one more at patcher loadbang).
-- do it yourself http://antoine.villeret.free.fr
2017-01-02 17:25 GMT+01:00 Miller Puckette msp@ucsd.edu:
Happy new year to you...
I don't get this behavior - can you send a sample patch?
thanks Miller
On Mon, Jan 02, 2017 at 04:50:47PM +0100, Antoine Villeret wrote:
Hello,
Happy new year pd-list !
With pd-0.46-7, loadbang method was called only once when patcher loads. Now with 0.47-1, loadbang method are now called twice. Why loadbang method is called twice ?
As far as I understand, loadbang method could be called not only on
patcher
load (LB_LOAD), but also when closing an abstraction (LB_CLOSE) and
before
the object is connected to parent patcher (LB_INIT).
Many externals uses this loadbang method to initiate their state. This new behavior trig a lots of "wrong argument for loadbang method"
error
in pd console.
Is it a good practice to rely on loadbang call to initiate objects ? or should we avoid it and use [loadbang] object and/or make initialisation
in
object_new method ?
do it yourself http://antoine.villeret.free.fr
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/
listinfo/pd-list
Oh, I see :)
the "loadbang" method is now called with a floating-point argument, so you can do this:
static void loadbang_loadbang(t_loadbang *x, t_floatarg action) { if (action == LB_LOAD) outlet_bang(x->x_obj.ob_outlet); }
and just get the one bang. This was done to allow "init" and "Close" bangs as well.
cheers Miller
On Mon, Jan 02, 2017 at 05:34:02PM +0100, Antoine Villeret wrote:
here is a sample code that demonstrate the issue : https://raw.githubusercontent.com/avilleret/helloworld/loadbang_issue/hellow...
When the object is created, loadbang method is called. Save the patch. Close it Reopen it, then the loadbang method is called twice (maybe one time at object loading and one more at patcher loadbang).
-- do it yourself http://antoine.villeret.free.fr
2017-01-02 17:25 GMT+01:00 Miller Puckette msp@ucsd.edu:
Happy new year to you...
I don't get this behavior - can you send a sample patch?
thanks Miller
On Mon, Jan 02, 2017 at 04:50:47PM +0100, Antoine Villeret wrote:
Hello,
Happy new year pd-list !
With pd-0.46-7, loadbang method was called only once when patcher loads. Now with 0.47-1, loadbang method are now called twice. Why loadbang method is called twice ?
As far as I understand, loadbang method could be called not only on
patcher
load (LB_LOAD), but also when closing an abstraction (LB_CLOSE) and
before
the object is connected to parent patcher (LB_INIT).
Many externals uses this loadbang method to initiate their state. This new behavior trig a lots of "wrong argument for loadbang method"
error
in pd console.
Is it a good practice to rely on loadbang call to initiate objects ? or should we avoid it and use [loadbang] object and/or make initialisation
in
object_new method ?
do it yourself http://antoine.villeret.free.fr
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/
listinfo/pd-list
This explains the "wrong argument for loadbang method" but not why the method is called twice at patcher loading.
-- do it yourself http://antoine.villeret.free.fr
2017-01-02 17:52 GMT+01:00 Miller Puckette msp@ucsd.edu:
Oh, I see :)
the "loadbang" method is now called with a floating-point argument, so you can do this:
static void loadbang_loadbang(t_loadbang *x, t_floatarg action) { if (action == LB_LOAD) outlet_bang(x->x_obj.ob_outlet); }
and just get the one bang. This was done to allow "init" and "Close" bangs as well.
cheers Miller
On Mon, Jan 02, 2017 at 05:34:02PM +0100, Antoine Villeret wrote:
here is a sample code that demonstrate the issue : https://raw.githubusercontent.com/avilleret/helloworld/
loadbang_issue/helloworld.c
When the object is created, loadbang method is called. Save the patch. Close it Reopen it, then the loadbang method is called twice (maybe one time at object loading and one more at patcher loadbang).
-- do it yourself http://antoine.villeret.free.fr
2017-01-02 17:25 GMT+01:00 Miller Puckette msp@ucsd.edu:
Happy new year to you...
I don't get this behavior - can you send a sample patch?
thanks Miller
On Mon, Jan 02, 2017 at 04:50:47PM +0100, Antoine Villeret wrote:
Hello,
Happy new year pd-list !
With pd-0.46-7, loadbang method was called only once when patcher
loads.
Now with 0.47-1, loadbang method are now called twice. Why loadbang method is called twice ?
As far as I understand, loadbang method could be called not only on
patcher
load (LB_LOAD), but also when closing an abstraction (LB_CLOSE) and
before
the object is connected to parent patcher (LB_INIT).
Many externals uses this loadbang method to initiate their state. This new behavior trig a lots of "wrong argument for loadbang method"
error
in pd console.
Is it a good practice to rely on loadbang call to initiate objects ?
or
should we avoid it and use [loadbang] object and/or make
initialisation
in
object_new method ?
do it yourself http://antoine.villeret.free.fr
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/
listinfo/pd-list
Am 02. Jänner 2017 17:57:11 MEZ, schrieb Antoine Villeret antoine.villeret@gmail.com:
This explains the "wrong argument for loadbang method" but not why the method is called twice at patcher loading.
Does it not? Once for "init", once for "load".
the "loadbang" method is now called with a floating-point argument,
so you
can do this:
static void loadbang_loadbang(t_loadbang *x, t_floatarg action) { if (action == LB_LOAD) outlet_bang(x->x_obj.ob_outlet); }
mfg.ugd.fhj IOhannes
-- Sent from my pdp-11
I only get "1" aka LB_INIT, I didn't get the LB_LOAD ("0")
-- do it yourself http://antoine.villeret.free.fr
2017-01-02 18:35 GMT+01:00 IOhannes zmölnig zmoelnig@iem.at:
Am 02. Jänner 2017 17:57:11 MEZ, schrieb Antoine Villeret < antoine.villeret@gmail.com>:
This explains the "wrong argument for loadbang method" but not why the method is called twice at patcher loading.
Does it not? Once for "init", once for "load".
the "loadbang" method is now called with a floating-point argument,
so you
can do this:
static void loadbang_loadbang(t_loadbang *x, t_floatarg action) { if (action == LB_LOAD) outlet_bang(x->x_obj.ob_outlet); }
mfg.ugd.fhj IOhannes
-- Sent from my pdp-11
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/ listinfo/pd-list
Odd... you're doing this, right:
class_addmethod(helloworld_class, (t_method) helloworld_loadbang, gensym("loadbang"), A_FLOAT, 0);
?
cheers Miller On Mon, Jan 02, 2017 at 06:50:57PM +0100, Antoine Villeret wrote:
I only get "1" aka LB_INIT, I didn't get the LB_LOAD ("0")
-- do it yourself http://antoine.villeret.free.fr
2017-01-02 18:35 GMT+01:00 IOhannes zmölnig zmoelnig@iem.at:
Am 02. Jänner 2017 17:57:11 MEZ, schrieb Antoine Villeret < antoine.villeret@gmail.com>:
This explains the "wrong argument for loadbang method" but not why the method is called twice at patcher loading.
Does it not? Once for "init", once for "load".
the "loadbang" method is now called with a floating-point argument,
so you
can do this:
static void loadbang_loadbang(t_loadbang *x, t_floatarg action) { if (action == LB_LOAD) outlet_bang(x->x_obj.ob_outlet); }
mfg.ugd.fhj IOhannes
-- Sent from my pdp-11
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
no I wasn't
now it's working as expected, thanks
-- do it yourself http://antoine.villeret.free.fr
2017-01-02 19:15 GMT+01:00 Miller Puckette msp@ucsd.edu:
Odd... you're doing this, right:
class_addmethod(helloworld_class, (t_method) helloworld_loadbang, gensym("loadbang"), A_FLOAT, 0);
?
cheers Miller On Mon, Jan 02, 2017 at 06:50:57PM +0100, Antoine Villeret wrote:
I only get "1" aka LB_INIT, I didn't get the LB_LOAD ("0")
-- do it yourself http://antoine.villeret.free.fr
2017-01-02 18:35 GMT+01:00 IOhannes zmölnig zmoelnig@iem.at:
Am 02. Jänner 2017 17:57:11 MEZ, schrieb Antoine Villeret < antoine.villeret@gmail.com>:
This explains the "wrong argument for loadbang method" but not why the method is called twice at patcher loading.
Does it not? Once for "init", once for "load".
the "loadbang" method is now called with a floating-point argument,
so you
can do this:
static void loadbang_loadbang(t_loadbang *x, t_floatarg action) { if (action == LB_LOAD) outlet_bang(x->x_obj.ob_outlet); }
mfg.ugd.fhj IOhannes
-- Sent from my pdp-11
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