gaSetOSCValue(string,string)

Syntax

gaSetOSCValue(string,string)

Example

intLabel = "/testINT"
floatLabel = "/testFLOAT"
stringLabel = "/testSTRING"

function setup()
 // init OSC sending labels
 gaSetOSCMessage(intLabel,OSC_INT) 
 gaSetOSCMessage(floatLabel,OSC_FLOAT)
 gaSetOSCMessage(stringLabel,OSC_STRING)
end

function update()
 // send OSC messages
 gaSetOSCValue(intLabel,tostring(gaMouseX()))
 gaSetOSCValue(floatLabel,tostring(ofRandomuf()))
 gaSetOSCValue(stringLabel,"any string")
end

function draw()
 gaBackground(0.0,1.0)
 
 ofSetColor(34,217,179)
 text = string.format("Sending OSC data to IP: %s at port: %s",gaSendingOscTo(),OSC_SENDING_PORT)
 ofDrawBitmapString(text,20,200)
 
end

Description

Set the sending OSC message value, associated to the specified label. The value must be converted to string, even if is actually a number. You can use the <b>tostring()</b> Lua function in order to do that.

Parameters

string,string