Devine Lu Linvega 70fa2b420f *
2019-07-21 19:27:45 +09:00

24 lines
482 B
JavaScript

'use strict'
function Osc (ronin) {
const osc = require('osc')
this.msg = {}
this.start = function () {
const udpPort = new osc.UDPPort({
localAddress: '0.0.0.0',
localPort: 49162,
metadata: true
})
udpPort.on('message', this.onMsg)
udpPort.open()
ronin.log('OSC', 'Started.')
}
this.onMsg = (msg, timeTag, info) => {
this.msg[msg.address] = msg.args
// ronin.log(`${info.address}:${info.port} > ${msg.args}`, info)
}
}