Created
September 12, 2019 21:04
-
-
Save colinbdclark/0b6366237688353ca0b84100b097c979 to your computer and use it in GitHub Desktop.
Relay OSC message to multiple targets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var incomingUDPPort = new osc.UDPPort({...}); | |
var outgoingUDPPortToSuperCollider = new osc.UDPPort({...}); | |
wss.on("connection", function (socket) { | |
console.log("A Web Socket connection has been established!"); | |
var socketPort = new osc.WebSocketPort({ | |
socket: socket | |
}); | |
// Whenever we get an incoming OSC message, forward it on to SuperCollider and the Web Socket. | |
incomingUDPPort.on("raw", function (packet) { | |
outgoingUDPPortToSuperCollider.sendRaw(packet); | |
socketPort.sendRaw(packet); | |
}); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment