this has probably been discussed before, but i don't have internet right now and so cannot check.
i'm trying to build a generic store-anything object. see attached. but i'm having some trouble getting around the weird way Pd seems to handle symbols, particularly with [route].
according to the help patch for [route]:
'To avoid confusion between, say, the number 5 and the list contining only the number 5, both messages match "float", and ditto for symbols. An empty list matches "bang". In Pd these are all considered special cases of lists.'
so, by my reading of this, in particular, the bit that says "and ditto for symbols", if i go
[route symbol float]
and then send in
[mysym (
the 1st outlet should send out 'mysym', yes? this isn't what's happening. in fact, the 3rd outlet is sending out just 'mysym'. if i send in
[symbol mysym (
then the 1st outlet sends out 'symbol mysym'. but, if i want to route the 'mysym' message somewhere:
[route mysym]
it never gets picked up on if it is being sent out as 'symbol mysym'
... so. it seems i need to use [select] and not [route] in this case. if i'm not mistaken, the help patch for [route] needs updating.
chur d
On Sun, 2008-11-23 at 11:41 +0100, Damian Stewart wrote:
this has probably been discussed before, but i don't have internet right now and so cannot check.
i'm trying to build a generic store-anything object. see attached. but i'm having some trouble getting around the weird way Pd seems to handle symbols, particularly with [route].
according to the help patch for [route]:
'To avoid confusion between, say, the number 5 and the list contining only the number 5, both messages match "float", and ditto for symbols.
yeah. from what i understand this means: 'list bla' and 'symbol bla' are treated the same. if i am not totally mistaken, 'list yeah' is converted to 'symbol yeah' by many classes anyway. try
[list yo( | [print]
for lists with only one element, the selector 'list' is converted to either 'float' or 'symbol'. an incoming message with an 'anything' selector (for instance 'mysym') is _not_ converted to a 'symbol' message. i think, that is the cause of your confusion.
An empty list matches "bang". In Pd these are all considered special cases of lists.'
so, by my reading of this, in particular, the bit that says "and ditto for symbols", if i go
[route symbol float]
and then send in
[mysym (
the 1st outlet should send out 'mysym', yes? this isn't what's happening. in fact, the 3rd outlet is sending out just 'mysym'. if i send in
because 'mysym' is not a symbol message, which means in pd lingo: "it does not have the 'symbol' selctor"
[symbol mysym (
then the 1st outlet sends out 'symbol mysym'. but, if i want to route the 'mysym' message somewhere:
[route mysym]
it never gets picked up on if it is being sent out as 'symbol mysym'
yeah, because the selector is 'symbol' then, not 'mysym'.
... so. it seems i need to use [select] and not [route] in this case.
in which case? if you want to match both, 'mysym' and 'symbol mysym', i'd put a [list trim] in front of route.
if i'm not mistaken, the help patch for [route] needs updating.
i guess, the help patch is correct, though a bit a confusing.
roman
___________________________________________________________ Der frühe Vogel fängt den Wurm. Hier gelangen Sie zum neuen Yahoo! Mail: http://mail.yahoo.de
Hallo, Damian Stewart hat gesagt: // Damian Stewart wrote:
'To avoid confusion between, say, the number 5 and the list contining only the number 5, both messages match "float", and ditto for symbols. An empty list matches "bang". In Pd these are all considered special cases of lists.'
so, by my reading of this, in particular, the bit that says "and ditto for symbols", if i go
[route symbol float]
and then send in
[mysym (
the 1st outlet should send out 'mysym', yes?
No.
Well, It's confusing, I admit, but "ditto for symbols" means: If you have a *list* containing only a symbol like "mysym" and a symbol containing "mysym" as data part ("symbol mysym") they are treated the same.
So "list mysym" and "symbol mysym" are equivalent. However a message of just "mysym" is neither a list- nor a symbol-message, instead it is a "mysm"-message. You can use [route mysym] to grab mysym-messages.
Look here: http://puredata.info/dev/PdMessages/ for a broader explanation.
As a general hint: Quite often it is useful to prepend [route] with [list trim] and stop worrying about the bomb, err, the list-messages:
[list trim] | [route freq pitch note]
Frank Barknecht Do You RjDj.me? _ ______footils.org__
On Nov 23, 2008, at 8:01 AM, Frank Barknecht wrote:
Hallo, Damian Stewart hat gesagt: // Damian Stewart wrote:
'To avoid confusion between, say, the number 5 and the list
contining only the number 5, both messages match "float", and ditto for symbols.
An empty list matches "bang". In Pd these are all considered special cases
of lists.'so, by my reading of this, in particular, the bit that says "and
ditto for symbols", if i go[route symbol float]
and then send in
[mysym (
the 1st outlet should send out 'mysym', yes?
No.
Well, It's confusing, I admit, but "ditto for symbols" means: If you have a *list* containing only a symbol like "mysym" and a symbol containing "mysym" as data part ("symbol mysym") they are treated
the same.So "list mysym" and "symbol mysym" are equivalent. However a message of just "mysym" is neither a list- nor a symbol-message, instead it is a "mysm"-message. You can use [route mysym] to grab mysym-messages.
Look here: http://puredata.info/dev/PdMessages/ for a broader explanation.
As a general hint: Quite often it is useful to prepend [route] with [list trim] and stop worrying about the bomb, err, the list-messages:
[list trim] | [route freq pitch note]
You might also want to check the collection of instances where things
break down:
Help -> Browser -> manuals -> MessageOddness
.hc
Ciao
Frank Barknecht Do You RjDj.me? _
______footils.org__
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/ listinfo/pd-list
Man has survived hitherto because he was too ignorant to know how to
realize his wishes. Now that he can realize them, he must either
change them, or perish. -William Carlos Williams
Frank Barknecht wrote:
Hallo, Damian Stewart hat gesagt: // Damian Stewart wrote:
i'm trying to build a generic store-anything object. see attached.
Btw.: I can't see any difference between [d-a] and [list].
Ciao
really? wow. right. i might just use that then :-)
cheers d