-
Notifications
You must be signed in to change notification settings - Fork 15
/
Osc.pde
35 lines (31 loc) · 977 Bytes
/
Osc.pde
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import oscP5.*;
import netP5.*;
String ipNumber = "127.0.0.1";
int sendPort = 7110;
int receivePort = 33333;
OscP5 oscP5;
NetAddress myRemoteLocation;
void oscSetup() {
oscP5 = new OscP5(this, receivePort);
myRemoteLocation = new NetAddress(ipNumber, sendPort);
}
void oscTester(){
OscMessage myMessage;
myMessage = new OscMessage("/test");
float testData = random(1);
myMessage.add(testData);
oscP5.send(myMessage, myRemoteLocation);
}
void sendActiveOsc() {
OscMessage myMessage;
try{
//myMessage = new OscMessage("/" + "finger" + idHand + "-" + idPointable);
myMessage = new OscMessage("/active");
myMessage.add(activeHands);
myMessage.add(activeFingers);
myMessage.add(activeTools);
myMessage.add(activeOrigins);
oscP5.send(myMessage, myRemoteLocation);
}catch(Exception e){ }
//println("Active hands: " + activeHands + " fingers: " + activeFingers + " tools: " + activeTools + " origins: " + activeOrigins);
}