-
Notifications
You must be signed in to change notification settings - Fork 1
/
osc-server.js
33 lines (29 loc) · 1.16 KB
/
osc-server.js
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
var osc = require('osc')
// Create an osc.js UDP Port listening on port 57121.
var udpPort = new osc.UDPPort({
localAddress: "0.0.0.0",
localPort: 23456
});
// Listen for incoming OSC bundles.
udpPort.on("/blabla", function (oscBundle, timeTag, info) {
console.log("An OSC bundle just arrived for time tag", timeTag, ":", oscBundle);
console.log("Remote info is: ", info);
});
udpPort.on("message", function (oscBundle, timeTag, info) {
console.log("An OSC message just arrived for time tag", timeTag, ":", oscBundle);
console.log("Remote info is: ", info);
});
udpPort.on("osc", function (oscBundle, timeTag, info) {
console.log("An OSC osc just arrived for time tag", timeTag, ":", oscBundle);
console.log("Remote info is: ", info);
});
udpPort.on("raw", function (oscBundle, timeTag, info) {
console.log("An OSC raw just arrived for time tag", timeTag, ":", oscBundle);
console.log("Remote info is: ", info);
});
udpPort.on("error", function (oscBundle, timeTag, info) {
console.log("An OSC error just arrived for time tag", timeTag, ":", oscBundle);
console.log("Remote info is: ", info);
});
// Open the socket.
udpPort.open();