From 4c8ea4f3c6a4123fb3a37728d1b7654ab99d9eb8 Mon Sep 17 00:00:00 2001 From: Sam Carson Date: Wed, 27 Nov 2024 16:37:50 +0000 Subject: [PATCH] Convert numeric socket messages to numbers before sending to OSC --- bridge.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bridge.js b/bridge.js index fe989ad..502c11f 100644 --- a/bridge.js +++ b/bridge.js @@ -18,6 +18,11 @@ io.on('connection', function (socket) { }); socket.on('message', function (obj) { var toSend = obj.split(' '); + + toSend = toSend.map(function (el) { + return isNaN(el) ? el : parseFloat(el); + }); + oscClient.send(...toSend); console.log('sent WS message to OSC', toSend); });