[OSC_dev] handling nil/inf in oscpack

Andy W. Schmeder andy at cnmat.berkeley.edu
Mon Mar 31 10:22:06 PDT 2008


Typically "N" goes to NULL or its equivalent in the target environment  
(C: int 0, Python: None, etc).

Mapping "I" to infinity is redundant with the existing capabilities of  
"f", and also doesn't cover the standard use cases of that number  
class (e.g. positive and negative infinity) --  if this was the  
original intention then it wasn't well thought-out (I have no idea...).

In Open Sound World, we mapped "I" to the impulse (i.e., "bang" for  
MaxMSP/PD users).  Also in CNMAT's resonators~ object the bang input  
is equivalent to a dirac impulse, so this sort of makes sense on that  
level.

I've seen other implementations setup some sort of class or typedef  
for these "weird" types and just pass that on to the user to interpret.


On Mar 29, 2008, at 12:16 AM, Ross Bencina wrote:

> Probably the correct fix for the stream interface would be to return  
> INF as a float with value numeric_limits<float>::infinity() and Nil  
> perhaps as an int with value 0.
>

---

Andy W. Schmeder
andy [at] cnmat.berkeley.edu
phone:	+1-510-643-9990 x.313

Programmer/Analyst II
Center for New Music and Audio Technologies
University of California at Berkeley
http://cnmat.berkeley.edu

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.create.ucsb.edu/pipermail/osc_dev/attachments/20080331/03387c9c/attachment.html 


More information about the OSC_dev mailing list