OSC protocol library for Node.js
Clone or download
Latest commit 4244b6c Nov 20, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples get examples linting Jan 22, 2016
lib chore: remove support for node < 6 Nov 20, 2018
test tape -> tap Mar 28, 2017
.eslintrc Linting May 18, 2015
.gitignore ignore node_modules (#14) Apr 15, 2016
README.rst Update readme May 18, 2015
lesser.txt add clarified licensing terms Apr 26, 2011
package-lock.json 3.0.0 Nov 20, 2018
package.json 3.0.0 Nov 20, 2018

README.rst

node-osc

A very basic OSC client (so far) implementation based heavily on pyOSC.

Relies on current trunk of node.js for the dgram library.

Install using npm

npm install node-osc

Example

Sending OSC messages:

var osc = require('node-osc');

var client = new osc.Client('127.0.0.1', 3333);
client.send('/oscAddress', 200, function () {
  client.kill();
});

Listening for OSC messages:

var osc = require('node-osc');

var oscServer = new osc.Server(3333, '0.0.0.0');
oscServer.on("message", function (msg, rinfo) {
      console.log("TUIO message:");
      console.log(msg);
});

Example of received TUIO (based on OSC) messages:

TUIO message:
[ [ '/tuio/2Dcur', 'alive', 3 ],
  [ '/tuio/2Dcur',
    'set',
    3,
    0.5218750238418579,
    0.3895833194255829,
    0,
    0,
    0 ],
  [ '/tuio/2Dcur', 'fseq', 2842 ] ]

TUIO message:
[ [ '/tuio/2Dcur', 'alive', 3 ],
  [ '/tuio/2Dcur',
    'set',
    3,
    0.5218750238418579,
    0.3895833194255829,
    0,
    0,
    0 ],
  [ '/tuio/2Dcur', 'fseq', 2843 ] ]

TUIO message:
[ [ '/tuio/2Dcur', 'alive' ],
  [ '/tuio/2Dcur', 'fseq', 2844 ] ]

Licensing

LGPL. Please see the file lesser.txt for details.