gaGetOSCValue(string,int)

Syntax

gaGetOSCValue(string,int)

Example

faderValue = {}
faderLabel = "/fader"
toggleValue = {}
toggleLabel = "/toggle"

function setup()
 // init OSC receiving labels
 gaGetOSCMessage(faderLabel,1)
 gaGetOSCMessage(toggleLabel,1)
 
 for i=0, gaGetOSCNumVars(faderLabel) do
 faderValue[i] = ""
 end
 
 for i=0, gaGetOSCNumVars(toggleLabel) do
 toggleValue[i] = ""
 end
 
end

function update()
 // capture OSC values
 for i=0, gaGetOSCNumVars(faderLabel) do
 faderValue[i] = gaGetOSCValue(faderLabel,i)
 end
 for i=0, gaGetOSCNumVars(toggleLabel) do
 toggleValue[i] = gaGetOSCValue(toggleLabel,i)
 end
end

function draw()
 gaBackground(0.0,1.0)
 
 ofSetColor(34,217,179)
 ofDrawBitmapString(string.format("Receiving OSC data at Port: %s",OSC_RECEIVING_PORT),20,200)
 ofDrawBitmapString(string.format("Message labeled \"%s\" value: %s", faderLabel, faderValue[0]),20,260)

 if toggleValue[0] == "0" then
 ofSetColor(255)
 else
 ofSetColor(34,217,179)
 end
 
 ofCircle(OUTPUT_W/2,OUTPUT_H/2,ofToFloat(faderValue[0])*400)
end

Description

A realtime reading at the OSC message value associated to the specified label, passed to the function as parameter, and at the specified index in the message list (the simpler list is with one message/value only).

Parameters

string,int

Returns

«String, The receiving OSC message value