it seems the custom handler wasn't being used

This commit is contained in:
alex 2022-03-29 17:04:00 +01:00
parent d0d19778a4
commit 330263028e

View File

@ -1,3 +1,4 @@
const dgram = require('dgram')
const OSC = require('osc-js');
const config = {
@ -18,6 +19,9 @@ const config = {
port: 8080, // @param {number} Port of WebSocket server
},
};
const osc = new OSC({ plugin: new OSC.BridgePlugin(config) });
osc.open(); // start a WebSocket server on port 8080
@ -27,15 +31,15 @@ console.log('osc server running on port', config.udpServer.port);
console.log('websocket server running on port', config.wsServer.port);
// listen for messages from the client
osc.on('*', (m) => {
console.log("hmm!");
const ts = m.args.shift();
const message = new OSC.Message(m.address, ...m.args);
console.log(m.args);
const bundle = new OSC.Bundle([message], new Date(ts))
osc.send(bundle);
console.log('forward:', bundle);
});
// osc.on('*', (m) => {
// console.log("hmm!");
// const ts = m.args.shift();
// const message = new OSC.Message(m.address, ...m.args);
// console.log(m.args);
// const bundle = new OSC.Bundle([message], new Date(ts))
// osc.send(bundle);
// console.log('forward:', bundle);
// });
/*
example tidal messages: