gaGetOSCNumVars(string)

Syntax

gaGetOSCNumVars(string)

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 reference to the number of OSC value/s associated with the specified label

Parameters

string

Returns

«Int, The number of value/s of all the OSC messages associated with the specified label