Hi list,
I've been doing some patching with [route] and came across a problem - I'd love it if someone could explain why this happens otherwise I think it's a bug.
Basically I'm sending a message with one item to a route object with an argument of the same name. For example:
[start ( | [route start]
This is connected to a [pack f]. When I bang the start message the route object outputs a bang, which in turn should output the stored number in the pack object. However, this does not happen (which is the problem).
If I connect a [t b] after the [route] and before the [pack f] it works. It also works with [f ] instead of [pack f] and a [select] object will correctly bang the pack. I've attached a patch to show this.
What seems weird is that it is not a problem with either [route] or [pack f] on their own, but rather only when they are connected.
Thanks, Joe
Yep, there is a bug. For a workaround, you can add a [bang( message between [route] and [pack]. ++
Jack
Le jeudi 07 juillet 2011 à 17:44 +0100, Joe White a écrit :
Hi list,
I've been doing some patching with [route] and came across a problem - I'd love it if someone could explain why this happens otherwise I think it's a bug.
Basically I'm sending a message with one item to a route object with an argument of the same name. For example:
[start ( | [route start]
This is connected to a [pack f]. When I bang the start message the route object outputs a bang, which in turn should output the stored number in the pack object. However, this does not happen (which is the problem).
If I connect a [t b] after the [route] and before the [pack f] it works. It also works with [f ] instead of [pack f] and a [select] object will correctly bang the pack. I've attached a patch to show this.
What seems weird is that it is not a problem with either [route] or [pack f] on their own, but rather only when they are connected.
Thanks, Joe
_______________________________________________ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Yeah, thought as much. Just a bit annoying.
Thanks, Joe
On 7 July 2011 17:57, Jack jack@rybn.org wrote:
Yep, there is a bug. For a workaround, you can add a [bang( message between [route] and [pack]. ++
Jack
Le jeudi 07 juillet 2011 à 17:44 +0100, Joe White a écrit :
Hi list,
I've been doing some patching with [route] and came across a problem - I'd love it if someone could explain why this happens otherwise I think it's a bug.
Basically I'm sending a message with one item to a route object with an argument of the same name. For example:
[start ( | [route start]
This is connected to a [pack f]. When I bang the start message the route object outputs a bang, which in turn should output the stored number in the pack object. However, this does not happen (which is the problem).
If I connect a [t b] after the [route] and before the [pack f] it works. It also works with [f ] instead of [pack f] and a [select] object will correctly bang the pack. I've attached a patch to show this.
What seems weird is that it is not a problem with either [route] or [pack f] on their own, but rather only when they are connected.
Thanks, Joe _______________________________________________ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management ->
[route] outputs an empty list which, for simplicity's sake, is supposed to be interpreted as a "bang" message. But [pack] isn't doing this:
[list( | [pack] | [print]
Should be a pretty easy fix-- just check for an empty list in pack_list and if so, call pack_bang.
-Jonathan
--- On Thu, 7/7/11, Jack jack@rybn.org wrote:
From: Jack jack@rybn.org Subject: Re: [PD] route - pack issue To: "Joe White" white.joe4@gmail.com Cc: "pd-list" pd-list@iem.at Date: Thursday, July 7, 2011, 6:57 PM Yep, there is a bug. For a workaround, you can add a [bang( message between [route] and [pack]. ++
Jack
Le jeudi 07 juillet 2011 à 17:44 +0100, Joe White a écrit :
Hi list,
I've been doing some patching with [route] and came
across a problem -
I'd love it if someone could explain why this happens
otherwise I
think it's a bug.
Basically I'm sending a message with one item to a
route object with
an argument of the same name. For example:
[start ( | [route start]
This is connected to a [pack f]. When I bang the start
message the
route object outputs a bang, which in turn should
output the stored
number in the pack object. However, this does not
happen (which is the
problem).
If I connect a [t b] after the [route] and before the
[pack f] it
works. It also works with [f ] instead of [pack f] and
a [select]
object will correctly bang the pack. I've attached a
patch to show
this.
What seems weird is that it is not a problem with
either [route] or
[pack f] on their own, but rather only when they are
connected.
Thanks, Joe _______________________________________________ Pd-list@iem.at
mailing list
UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
-----Inline Attachment Follows-----
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
More specifically, a simple conditional in pack_list in x_connective.c seems to work:
static void pack_list(t_pack *x, t_symbol *s, int ac, t_atom *av) { if (ac==0) pack_bang(x); else obj_list(&x->x_obj, 0, ac, av); }
-Jonathan
--- On Thu, 7/7/11, Jonathan Wilkes jancsika@yahoo.com wrote:
From: Jonathan Wilkes jancsika@yahoo.com Subject: Re: [PD] route - pack issue To: "Joe White" white.joe4@gmail.com, "Jack" jack@rybn.org Cc: "pd-list" pd-list@iem.at Date: Thursday, July 7, 2011, 7:44 PM [route] outputs an empty list which, for simplicity's sake, is supposed to be interpreted as a "bang" message. But [pack] isn't doing this:
[list( | [pack] | [print]
Should be a pretty easy fix-- just check for an empty list in pack_list and if so, call pack_bang.
-Jonathan
--- On Thu, 7/7/11, Jack jack@rybn.org wrote:
From: Jack jack@rybn.org Subject: Re: [PD] route - pack issue To: "Joe White" white.joe4@gmail.com Cc: "pd-list" pd-list@iem.at Date: Thursday, July 7, 2011, 6:57 PM Yep, there is a bug. For a workaround, you can add a [bang( message between [route] and [pack]. ++
Jack
Le jeudi 07 juillet 2011 à 17:44 +0100, Joe White a
écrit
:
Hi list,
I've been doing some patching with [route] and
came
across a problem -
I'd love it if someone could explain why this
happens
otherwise I
think it's a bug.
Basically I'm sending a message with one item to
a
route object with
an argument of the same name. For example:
[start ( | [route start]
This is connected to a [pack f]. When I bang the
start
message the
route object outputs a bang, which in turn
should
output the stored
number in the pack object. However, this does
not
happen (which is the
problem).
If I connect a [t b] after the [route] and before
the
[pack f] it
works. It also works with [f ] instead of [pack
f] and
a [select]
object will correctly bang the pack. I've
attached a
patch to show
this.
What seems weird is that it is not a problem
with
either [route] or
[pack f] on their own, but rather only when they
are
connected.
Thanks, Joe _______________________________________________ Pd-list@iem.at
mailing list
UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
-----Inline Attachment Follows-----
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
static void pack_list(t_pack *x, t_symbol *s, int ac, t_atom *av) { if (ac==0) pack_bang(x); else obj_list(&x->x_obj, 0, ac, av); }
Many thanks for this contribution! I will add this to pd-l2ork. However, shouldn't also route output bang when having an empty list?
Best wishes,
Ico
--- On Fri, 7/8/11, Ivica Ico Bukvic ico@vt.edu wrote:
From: Ivica Ico Bukvic ico@vt.edu Subject: RE: [PD] route - pack issue To: "'Jonathan Wilkes'" jancsika@yahoo.com Cc: pd-list@iem.at Date: Friday, July 8, 2011, 4:54 PM
static void pack_list(t_pack *x,
t_symbol *s, int ac, t_atom *av)
{ if (ac==0) pack_bang(x); else
obj_list(&x->x_obj, 0, ac, av);
}
Many thanks for this contribution! I will add this to pd-l2ork. However, shouldn't also route output bang when having an empty list?
[route] already does this.
Best wishes,
Ico
Jonathan Wilkes jancsika@yahoo.com wrote:
--- On Fri, 7/8/11, Ivica Ico Bukvic ico@vt.edu wrote:
From: Ivica Ico Bukvic ico@vt.edu Subject: RE: [PD] route - pack issue To: "'Jonathan Wilkes'" jancsika@yahoo.com Cc: pd-list@iem.at Date: Friday, July 8, 2011, 4:54 PM
static void pack_list(t_pack *x,
t_symbol *s, int ac, t_atom *av)
{ if (ac==0) pack_bang(x); else
obj_list(&x->x_obj, 0, ac, av);
}
Many thanks for this contribution! I will add this to pd-l2ork. However, shouldn't also route output bang when having an empty list?
[route] already does this.
But I thought OP suggested [route start] -> [pack] did not work since pack received empty list instead of bang and did not know what to do with it.
Best wishes,
Ico
Ivica Ico Bukvic, D.M.A Composition, Music Technology Director, DISIS Interactive Sound & Intermedia Studio Director, L2Ork LinuxLaptop Orchestra Assistant Co-Director, CCTAD CHCI, CS, and Art (by courtesy) Virginia Tech Department of Music Blacksburg, VA 24061-0240 (540) 231-6139 (540) 231-5034 (fax) disis.music.vt.edu l2ork.music.vt.edu ico.bukvic.net
--- On Fri, 7/8/11, Ivica Ico Bukvic ico@vt.edu wrote:
From: Ivica Ico Bukvic ico@vt.edu Subject: RE: [PD] route - pack issue To: "Jonathan Wilkes" jancsika@yahoo.com Cc: pd-list@iem.at Date: Friday, July 8, 2011, 8:12 PM
Jonathan Wilkes jancsika@yahoo.com wrote:
--- On Fri, 7/8/11, Ivica Ico Bukvic ico@vt.edu wrote:
From: Ivica Ico Bukvic ico@vt.edu Subject: RE: [PD] route - pack issue To: "'Jonathan Wilkes'" jancsika@yahoo.com Cc: pd-list@iem.at Date: Friday, July 8, 2011, 4:54 PM
static void pack_list(t_pack *x,
t_symbol *s, int ac, t_atom *av)
{ if (ac==0) pack_bang(x); else
obj_list(&x->x_obj, 0, ac, av);
}
Many thanks for this contribution! I will add this
to
pd-l2ork. However, shouldn't also route output
bang when
having an empty list?
[route] already does this.
But I thought OP suggested [route start] -> [pack] did not work since pack received empty list instead of bang and did not know what to do with it.
Well, [route] isn't the only one that can output an empty list-- the [list] family objects, [trigger], and probably others do, too.
Anyway, I think there are only some special cases where this gets tricky: when an object class defines both a bang method and a list method like [pack] does, or with an object like [route] which just has a list method as a catchall in which "bang", "float", and "symbol" messages are parsed manually.
Otherwise, Pd does some automagic message conversion (defined in m_class.c) so that, for example, if [foo] only has a "bang" method and no list method, it will just call the "bang" method when an empty list is received at its inlet. So one needn't worry whether or not an object outputs an empty list, just if the special case objects like [pack] and [route] handle them correctly.
-Jonathan
Best wishes,
Ico
Ivica Ico Bukvic, D.M.A Composition, Music Technology Director, DISIS Interactive Sound & Intermedia Studio Director, L2Ork LinuxLaptop Orchestra Assistant Co-Director, CCTAD CHCI, CS, and Art (by courtesy) Virginia Tech Department of Music Blacksburg, VA 24061-0240 (540) 231-6139 (540) 231-5034 (fax) disis.music.vt.edu l2ork.music.vt.edu ico.bukvic.net
Jonathan Wilkes jancsika@yahoo.com wrote:
--- On Fri, 7/8/11, Ivica Ico Bukvic ico@vt.edu wrote:
From: Ivica Ico Bukvic ico@vt.edu Subject: RE: [PD] route - pack issue To: "Jonathan Wilkes" jancsika@yahoo.com Cc: pd-list@iem.at Date: Friday, July 8, 2011, 8:12 PM
Jonathan Wilkes jancsika@yahoo.com wrote:
--- On Fri, 7/8/11, Ivica Ico Bukvic ico@vt.edu wrote:
From: Ivica Ico Bukvic ico@vt.edu Subject: RE: [PD] route - pack issue To: "'Jonathan Wilkes'" jancsika@yahoo.com Cc: pd-list@iem.at Date: Friday, July 8, 2011, 4:54 PM
static void pack_list(t_pack *x,
t_symbol *s, int ac, t_atom *av)
{ if (ac==0) pack_bang(x); else
obj_list(&x->x_obj, 0, ac, av);
}
Many thanks for this contribution! I will add this
to
pd-l2ork. However, shouldn't also route output
bang when
having an empty list?
[route] already does this.
But I thought OP suggested [route start] -> [pack] did not work since pack received empty list instead of bang and did not know what to do with it.
Well, [route] isn't the only one that can output an empty list-- the [list] family objects, [trigger], and probably others do, too.
Anyway, I think there are only some special cases where this gets tricky: when an object class defines both a bang method and a list method like [pack] does, or with an object like [route] which just has a list method as a catchall in which "bang", "float", and "symbol" messages are parsed manually.
Otherwise, Pd does some automagic message conversion (defined in m_class.c) so that, for example, if [foo] only has a "bang" method and no list method, it will just call the "bang" method when an empty list is received at its inlet. So one needn't worry whether or not an object outputs an empty list, just if the special case objects like [pack] and [route] handle them correctly.
So, are you suggesting therefore that route needs to be fixed as well or just pack?
-Jonathan
Best wishes,
Ico
Ivica Ico Bukvic, D.M.A Composition, Music Technology Director, DISIS Interactive Sound & Intermedia Studio Director, L2Ork LinuxLaptop Orchestra Assistant Co-Director, CCTAD CHCI, CS, and Art (by courtesy) Virginia Tech Department of Music Blacksburg, VA 24061-0240 (540) 231-6139 (540) 231-5034 (fax) disis.music.vt.edu l2ork.music.vt.edu ico.bukvic.net
Ivica Ico Bukvic, D.M.A Composition, Music Technology Director, DISIS Interactive Sound & Intermedia Studio Director, L2Ork LinuxLaptop Orchestra Assistant Co-Director, CCTAD CHCI, CS, and Art (by courtesy) Virginia Tech Department of Music Blacksburg, VA 24061-0240 (540) 231-6139 (540) 231-5034 (fax) disis.music.vt.edu l2ork.music.vt.edu ico.bukvic.net
--- On Sat, 7/9/11, Ivica Ico Bukvic ico@vt.edu wrote:
From: Ivica Ico Bukvic ico@vt.edu Subject: RE: [PD] route - pack issue To: "Jonathan Wilkes" jancsika@yahoo.com Cc: pd-list@iem.at Date: Saturday, July 9, 2011, 10:33 AM
Jonathan Wilkes jancsika@yahoo.com wrote:
--- On Fri, 7/8/11, Ivica Ico Bukvic ico@vt.edu wrote:
From: Ivica Ico Bukvic ico@vt.edu Subject: RE: [PD] route - pack issue To: "Jonathan Wilkes" jancsika@yahoo.com Cc: pd-list@iem.at Date: Friday, July 8, 2011, 8:12 PM
Jonathan Wilkes jancsika@yahoo.com wrote:
--- On Fri, 7/8/11, Ivica Ico Bukvic ico@vt.edu wrote:
From: Ivica Ico Bukvic ico@vt.edu Subject: RE: [PD] route - pack issue To: "'Jonathan Wilkes'" jancsika@yahoo.com Cc: pd-list@iem.at Date: Friday, July 8, 2011, 4:54 PM
static void pack_list(t_pack *x,
t_symbol *s, int ac, t_atom *av)
{ if (ac==0) pack_bang(x); else
obj_list(&x->x_obj, 0, ac,
av);
}
Many thanks for this contribution! I will
add this
to
pd-l2ork. However, shouldn't also route
output
bang when
having an empty list?
[route] already does this.
But I thought OP suggested [route start] ->
[pack] did
not work since pack received empty list instead of
bang and
did not know what to do with it.
Well, [route] isn't the only one that can output an
empty list-- the
[list] family objects, [trigger], and probably others
do, too.
Anyway, I think there are only some special cases where
this gets
tricky: when an object class defines both a bang method
and a list
method like [pack] does, or with an object like [route]
which just has
a list method as a catchall in which "bang", "float",
and "symbol"
messages are parsed manually.
Otherwise, Pd does some automagic message conversion
(defined in
m_class.c) so that, for example, if [foo] only has a
"bang" method and
no list method, it will just call the "bang" method
when an empty list
is received at its inlet. So one needn't worry
whether or not an
object outputs an empty list, just if the special case
objects like
[pack] and [route] handle them correctly.
What I mean is that you only need to insure that the special case objects handle messages at their inlet correctly. And in this case, I think [route] already does the correct thing.
So, are you suggesting therefore that route needs to be fixed as well or just pack?
Just [pack].
-Jonathan
Best wishes,
Ico
Ivica Ico Bukvic, D.M.A Composition, Music Technology Director, DISIS Interactive Sound & Intermedia
Studio
Director, L2Ork LinuxLaptop Orchestra Assistant Co-Director, CCTAD CHCI, CS, and Art (by courtesy) Virginia Tech Department of Music Blacksburg, VA 24061-0240 (540) 231-6139 (540) 231-5034 (fax) disis.music.vt.edu l2ork.music.vt.edu ico.bukvic.net
Ivica Ico Bukvic, D.M.A Composition, Music Technology Director, DISIS Interactive Sound & Intermedia Studio Director, L2Ork LinuxLaptop Orchestra Assistant Co-Director, CCTAD CHCI, CS, and Art (by courtesy) Virginia Tech Department of Music Blacksburg, VA 24061-0240 (540) 231-6139 (540) 231-5034 (fax) disis.music.vt.edu l2ork.music.vt.edu ico.bukvic.net
On Fri, 8 Jul 2011, Ivica Ico Bukvic wrote:
Many thanks for this contribution! I will add this to pd-l2ork. However, shouldn't also route output bang when having an empty list?
Should pd's message system leave this responsibility to each individual class ? If it does, problems like this will pile up endlessly, as new externals introduce similar problems, because the message system makes it easy to create such problems.
| Mathieu Bouchard ---- tél: +1.514.383.3801 ---- Villeray, Montréal, QC
On Jul 12, 2011, at 2:13 PM, Mathieu Bouchard wrote:
On Fri, 8 Jul 2011, Ivica Ico Bukvic wrote:
Many thanks for this contribution! I will add this to pd-l2ork.
However, shouldn't also route output bang when having an empty list?Should pd's message system leave this responsibility to each
individual class ? If it does, problems like this will pile up
endlessly, as new externals introduce similar problems, because the
message system makes it easy to create such problems.
How do you propose fixing it, Matju? It seems like the type system
should automagically handle this but perhaps it might cause issues for
external writers.
.hc
"We have nothing to fear from love and commitment." - New York Senator
Diane Savino, trying to convince the NY Senate to pass a gay marriage
bill
On Thu, 7 Jul 2011, Joe White wrote:
This is connected to a [pack f]. When I bang the start message the route object outputs a bang, which in turn should output the stored number in the pack object. However, this does not happen (which is the problem).
If I connect a [t b] after the [route] and before the [pack f] it works. It also works with [f ] instead of [pack f] and a [select] object will correctly bang the pack. I've attached a patch to show this.
What seems weird is that it is not a problem with either [route] or [pack f] on their own, but rather only when they are connected.
[print], and most other classes, are designed to hide some differences from you. "bang" and "list" are two different messages. So are "float 42" and "list 42". But in both cases, they get generally treated the same... except when they don't !
There are some tools that can help, like [gf/selector] that can tell you what's the real selector (header) of a message.
Consider this as a small hole in Pd's message-system.
| Mathieu Bouchard ---- tél: +1.514.383.3801 ---- Villeray, Montréal, QC