wavey-wind/osctl.js

17 lines
324 B
JavaScript

var oscPort = new osc.WebSocketPort({
url: location.origin.replace(/https?/, 'ws'),
metadata: true
});
oscPort.on("ready", function () {
console.log("OSC listening!")
oscPort.on("message", function (msg) {
var cb = oscCallbacks[msg.address]
if (cb) {
cb(msg.args)
}
});
});
oscPort.open();