C2_RemokonResponder Register functions for use with Remokon (an iPhone platform OSC controller)
Remokon info is available at: http://akamatsu.org/aka/?page_id=3408 and http://akamatsu.org/aka/?page_id=3567.
This class relies on other classes that should be present in the files C2_Monome.sc and C2_OSCGridInterface.sc, which should also be placed for access by the SuperCollider language.
Class Methods
*new
Create a new instance. There is no point making more than one, as a single instance can handle many Remokons. Multiple instances may interfere with each other.
x = C2_RemokonResponder.new;
Instance Methods
enable
disable
Enable / disable responses.
x.enable;
x.disable;
addDevice(deviceID, hostname, port)
Go to the utility page in the Remokon app and enter the information found there:
deviceID: the number shown as "Device ID". There should be a unique ID for each device added.
hostname: the i.p. address given as "Local Address".
port: the number given as "Input Port".
x.addDevice(2061, "10.0.2.2", 5700);
NB: you should have entered the i.p. of your computer in the field "Host Address", and the port that the SuperCollider language app is listening to in "Output Port".
You can get the port that SC is listening to by executing:
NetAddr.langPort.postln;
It is usually 57120.
NB 2: Make sure the ports are enabled through any operational firewalls.
addActionByName(deviceID, screenName, widgetName, action)
x.addActionByName(2061, "mix", "slider1", {|status, val| [status, val].postln});
screenName: from left to right, the pages are specified as "mix", "pad", "xy" and "grid".
Here are the strings to be given as widgetName:
"mix" page:
Buttons: "button1" .. "button4"
Sliders: "slider1" .. "slider4"
Crossfader: "xfader"
"pad" page:
Top Buttons: "button1" .. "button4"
Pad Buttons: "pad1" .. "pad16"
"xy" page:
Buttons: "button1" .. "button4"
XY: "xy"
XY gets two values:
x.addActionByName(2061, "xy", "xy", {|status, val1, val2| [status, val1, val2].postln});
"grid" page:
Buttons: "button1" .. "button4"
Grid buttons: "grid1" .. "grid64"
(buttons are numbered starting with 1, in rows)
x.addActionByName(2061, "grid", "grid5", {|status, val| [status, val].postln});
addActionByID(deviceID, screenID, widgetID, action)
Actions may also be added by their numerical IDs, details of which can be found here:
http://akamatsu.org/aka/?page_id=3622
setValueByName(deviceID, screenName, widgetName, val1, val2)
Use the same names as specified above to change a value in the Remokon app.
x.setValueByName(2061, "xy", "xy", 0.2, 0.9);
x.setValueByName(2061, "xy", "button1", 1);
setValueByID(deviceID, screenID, widgetID, val1, val2)
Set values by their numerical IDs.
x.setValueByID(2061, 0, 10, 0.1)
getValueByName(deviceID, screenName, widgetName)
getValueByID(deviceID, screenID, widgetID)
Returns values of certain objects by name / numerical ID.