Devine Lu Linvega a3d0856c6e Fixed osc
2019-07-23 13:21:38 +09:00

19 lines
355 B
JavaScript

'use strict'
function Osc (ronin) {
const osc = require('node-osc')
this.port = 49162
this.start = function () {
const server = new osc.Server(49162, '0.0.0.0')
server.on('message', this.onMsg)
}
this.onMsg = (msg) => {
const address = msg.shift()
if (ronin.bindings[address]) {
ronin.bindings[address](msg)
}
}
}