Mercurial > hg > nodescore
annotate node_modules/node-osc/README.rst @ 101:52e44ee1c791 tip master
enabled all scores in autostart script
author | Rob Canning <rc@kiben.net> |
---|---|
date | Tue, 21 Apr 2015 16:20:57 +0100 |
parents | cd921abc8887 |
children |
rev | line source |
---|---|
rob@77 | 1 -------- |
rob@77 | 2 node-osc |
rob@77 | 3 -------- |
rob@77 | 4 |
rob@77 | 5 A very basic OSC client (so far) implementation based heavily on pyOSC_. |
rob@77 | 6 |
rob@77 | 7 |
rob@77 | 8 Relies on current trunk of node.js for the dgram library. |
rob@77 | 9 |
rob@77 | 10 .. _pyOSC: https://trac.v2.nl/wiki/pyOSC |
rob@77 | 11 |
rob@77 | 12 Install using npm |
rob@77 | 13 |
rob@77 | 14 npm install node-osc |
rob@77 | 15 |
rob@77 | 16 Example |
rob@77 | 17 ------- |
rob@77 | 18 |
rob@77 | 19 Sending OSC messages: |
rob@77 | 20 |
rob@77 | 21 :: |
rob@77 | 22 |
rob@77 | 23 var osc = require('node-osc'); |
rob@77 | 24 |
rob@77 | 25 var client = new osc.Client('127.0.0.1', 3333); |
rob@77 | 26 client.send('/oscAddress', 200); |
rob@77 | 27 |
rob@77 | 28 Listening for OSC messages: |
rob@77 | 29 |
rob@77 | 30 :: |
rob@77 | 31 |
rob@77 | 32 var osc = require('./lib/osc'); |
rob@77 | 33 |
rob@77 | 34 var oscServer = new osc.Server(3333, '0.0.0.0'); |
rob@77 | 35 oscServer.on("message", function (msg, rinfo) { |
rob@77 | 36 console.log("TUIO message:"); |
rob@77 | 37 console.log(msg); |
rob@77 | 38 }); |
rob@77 | 39 |
rob@77 | 40 Example of received TUIO (based on OSC) messages: |
rob@77 | 41 |
rob@77 | 42 :: |
rob@77 | 43 |
rob@77 | 44 TUIO message: |
rob@77 | 45 [ [ '/tuio/2Dcur', 'alive', 3 ], |
rob@77 | 46 [ '/tuio/2Dcur', |
rob@77 | 47 'set', |
rob@77 | 48 3, |
rob@77 | 49 0.5218750238418579, |
rob@77 | 50 0.3895833194255829, |
rob@77 | 51 0, |
rob@77 | 52 0, |
rob@77 | 53 0 ], |
rob@77 | 54 [ '/tuio/2Dcur', 'fseq', 2842 ] ] |
rob@77 | 55 |
rob@77 | 56 TUIO message: |
rob@77 | 57 [ [ '/tuio/2Dcur', 'alive', 3 ], |
rob@77 | 58 [ '/tuio/2Dcur', |
rob@77 | 59 'set', |
rob@77 | 60 3, |
rob@77 | 61 0.5218750238418579, |
rob@77 | 62 0.3895833194255829, |
rob@77 | 63 0, |
rob@77 | 64 0, |
rob@77 | 65 0 ], |
rob@77 | 66 [ '/tuio/2Dcur', 'fseq', 2843 ] ] |
rob@77 | 67 |
rob@77 | 68 TUIO message: |
rob@77 | 69 [ [ '/tuio/2Dcur', 'alive' ], |
rob@77 | 70 [ '/tuio/2Dcur', 'fseq', 2844 ] ] |
rob@77 | 71 |
rob@77 | 72 Licensing |
rob@77 | 73 --------- |
rob@77 | 74 |
rob@77 | 75 LGPL. Please see the file lesser.txt for details. |