wavey-wind/osctl.js

17 lines
324 B
JavaScript
Raw Normal View History

2021-08-12 18:10:19 +02:00
var oscPort = new osc.WebSocketPort({
url: location.origin.replace(/https?/, 'ws'),
metadata: true
});
oscPort.on("ready", function () {
2021-08-14 15:15:16 +02:00
console.log("OSC listening!")
2021-08-12 18:10:19 +02:00
oscPort.on("message", function (msg) {
2022-09-24 14:09:46 +02:00
var cb = oscCallbacks[msg.address]
if (cb) {
cb(msg.args)
}
2021-08-14 15:15:16 +02:00
});
2021-08-12 18:10:19 +02:00
});
2022-09-24 14:09:46 +02:00
oscPort.open();