Pages: [1]   Go Down
Author Topic: Processing / Touch OSC / Arduino  (Read 712 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 24
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi guys,

i have looked for it but i just cant seem to find it. I'm tinkering around with processing, touch osc and my arduino. I've managed to print out the osc message, but how do i output the values that are represented by the sliders ???  I can retreive the state of a toggle button, but I got that from a sparkfun tutorial and they only use the toggle and no rotary/slider. It seems that whatever I do I just can't retreive them.

Please help.
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The OSC message contains a number of arguments.
Code:
float val = message.get(0).floatValue();
will get the first argument as a float (assuming that it IS a float).

Since you are sending the message(s), you should know what arguments are contained in the message.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 24
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey thanks for the quick answer.
Im getting the values out of TouchOSC i actually dont know what TouchOSC is sending. Thats what im trying to debug and im not getting any values. smiley-sad
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 24
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Heres the answer I was looking for. I just dont know why I've never come around this in all of the tutorials and code examples.
Its VERY simple.
Code:
theOscMessage.print();

Will print out:
Code:
---------------------
/1/fader1
-OscMessage----------
received from /192.168.2.nnn:64414
addrpattern /1/fader1
typetag f
[0] 190.54944

---------------------

and then of course PaulS comment is totally right. I was using code from a tutorial where the value was casted to an int and I never got the values i was looking for. It was either '1' or '0' even if I was using slider or rotary slider.
Logged

Pages: [1]   Go Up
Jump to: