[PD] convert symbol to int

IOhannes m zmoelnig zmoelnig at iem.at
Mon Jun 13 12:04:52 CEST 2005


federico wrote:
> B. Bogart ha scritto:
> 
> 
>>Maybe [set float $1 < ?
>>
>>I dunno...
> 
> nope.

this does not work since pd tries to parse as few messages as possible.
creating a message [float 123( will make pd parse this message resulting 
in an atom of type float with the value 123.
however, sending a symbol "123" to [set float $1( will produce a message 
that looks like [float 123(
but this message is already parsed (and internally saved as an 
identifier "float" followed by a symbol "123"), so this is a no go.

using roman's suggestion with using [netsend]/[netreceive], you ensure 
that the message is parsed again (since pd doesn't know what is coming 
in over the net)

> 
> with set float $1 any symbol is converted to zero.
> 
> do i really need an atoi() (or stoi()) external?

[atoi] is part of zexy.


mfg.a.dr
iOhannes




More information about the Pd-list mailing list