Forums > Javascript

OpenSoundControl (OSC) and Msgs

Feb 24 2009 | 2:15 am

Hi all,
I’m trying to develop an application that takes HID controls (from a PS2 controller) and send the data via OSC to Reaktor.

Now, I’ve used JavaScript to deal with taking in the HI output values, process the data (mac and pc output different controller values, so i have a few lookup arrays to deal with that) and then fire (using the outlet() command) out the compiled message (outputs a string variable like – /PS2OSC/Ctrl-Tri 127 or /PSC2OSC/Ctrl-Tri 0 etc). The JS outlet is then connected to a ‘TBS’ then to the ‘OpenSoundControl’ object then to a ‘Updsend’.

The problem i have is that Reaktor is playing silly buggers. The OSC Monitor (under OSC Settings in Reaktor) shows the incoming messages fine yet when trying to select the OSC handle (under the object properties) to sync with an object, such as a fader, it doesn’t want to know.

However, and this is where it gets slightly odd, if i use a message object on the Max patch with the same message (ie: /PS2OSC/Ctrl-Tri 127) then send that to the OSC object and then to the ‘Updsend’, not only does Reaktor see the OSC (like before) but you’re then able to select the OSC command to control and object (like a fader etc).

The thing is, the outputs from the JavaScript and message object (with the same OSC msg) is exactly the same (using the ‘print’ object to examine data) on both OSC input message and OSC output (to ‘updsend’) message.
So it seems the ‘updsend’ is receiving the same data, but for some odd reason Reaktor objects see differently.

Does anyone know what the problem is or possibly shed some light to why Reaktor object prefer OSC messages via a Max message object rather than the same command via a JavaScript string variable?

Obviously much appreciated for any help as I’m completely stumped!

Cheers Smile

Feb 25 2009 | 1:18 pm

It’s hard to tell what the problem is without seeing your patch. One thing you might want to try is putting a [fromsymbol] after your [js] outlet. As the patch below demonstrates: if the output is one symbol the OSC routing will fail even though the max window prints the same. I hope this helps.


— Pasted Max Patch, click to expand. —
Feb 25 2009 | 10:00 pm

Brilliant, it worked a treat! Thanks!

Viewing 3 posts - 1 through 3 (of 3 total)

Forums > Javascript