Sections
You are here: Home Forum Bugs, Known Issues, & Requests passing a float threw osc

passing a float threw osc

Up to Bugs, Known Issues, & Requests

passing a float threw osc

Posted by Ryan Chard at September 30. 2008

Hello I'm trying to get a float passed from the OSC to my application on the make board.

  I'm sending a value like "/subsytem/Value 0.01" and I can't get it to pass in correctly.

  I'm trying to use  count = Osc_ExtractData( typedata, "f", &fValue);

this works fine when I send integer values, but the decimal values get hozed when I try to see them again.

Initially the default value is 0.001 and that shows up fine via the OSC request.  When I send a "/subsytem/Value 0.001" then ask for what was set I receive a "1.6495e-33".  the same thing happens when I send a "/subsytem/Value 1.1".  Negative integers work fine.


Am I missing something in the Osc_ExtractData() function, maybe in the formatting field?  I searched for other examples in code, but didn't run across any.  The closest I found is the network address set which just passes the string down then parses it.  I'm not sure if I'm missing something or if something is broken.


Thanks in advance for any assistance.

Ryan



 


Re: passing a float threw osc

Posted by Liam Staskawicz at September 30. 2008
I'm not sure I followed your description of the issue exactly. Can you paste a little more sample code (somewhere like http://pastie.org)?

Re: passing a float threw osc

Posted by Ryan Chard at September 30. 2008

Sure, see http://pastie.org/282395

It's a simplified version that should show you my problem


Thank you,

Ryan

Re: passing a float threw osc

Posted by Forrest McCluer at October 16. 2008

Although the link below does not give specific syntax on how to pass a float they do give examples and provide the bytes in hex that should be sent.  In particular, this cite showed me that you had to pad integers with leading nulls. 

http://opensoundcontrol.org/spec-1_0-examples#OSCstrings

hth,

Forrest

Powered by Ploneboard
Document Actions