All Projects → avantcontra → osc-websocket-example

avantcontra / osc-websocket-example

Licence: MIT license
Examples about receiving OSC data through WebSocket.

Programming Languages

C#
18002 projects
Max
122 projects
javascript
184084 projects - #8 most used programming language
processing
702 projects

osc-websocket-example

Examples about receiving OSC data through WebSocket.

p5js-max

Background

Sometimes I meet situations where I need OSC but cannot use UDP.

Such as sending OSC message from browser-based p5js to Processing / MaxMSP / Unity.
And my OSC controller called BugOSC, a WeChat Mini Program, which also does not support UDP. WeChat Mini Program has supported UDP at May 2019.

However, although they don't support UDP, they support WebSocket, another network transmission protocol.

Here are examples about receiving OSC data through WebSocket sent from p5js for example.
The transporting data are binary packets (ArrayBuffer, byte[]) following the standard OSC format.

p5js-processing

WebSocket Client

The p5js sketch in p5js-client.

Use library osc.js to pack and parse OSC data.
And osc.js itself supports UDP (NodeJS), Serial port, WebSocket (browser and NodeJS) and TCP, Wow!

WebSocket Server

Click the first level links for detail README.

*Bridge

Of course also can make a third party NodeJS/Processing/Python/etc BRIDGE focus on receiving data through WebSocket and forwarding to other OSC receivers:
p5js-client <---WebSocket---> BRIDGE <---OSC---> Max/Processing/Unity/Arduino/etc


Welcome PR! 👏

Cheers~

Contra

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].