Mercurial > hg > beaglert
comparison resources/osc/node_modules/osc-min/examples/printosc.coffee @ 271:fb9c28a4676b prerelease
Added osc example project and node script for testing
author | Liam Donovan <l.b.donovan@qmul.ac.uk> |
---|---|
date | Tue, 17 May 2016 16:01:06 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
270:de37582ce6f3 | 271:fb9c28a4676b |
---|---|
1 osc = require 'osc-min' | |
2 udp = require "dgram" | |
3 | |
4 if process.argv[2]? | |
5 inport = parseInt process.argv[2] | |
6 else | |
7 inport = 41234 | |
8 | |
9 console.log "OSC listener running at http://localhost:" + inport | |
10 | |
11 `//~verbatim:examples[0]~ | |
12 //### A simple OSC printer` | |
13 sock = udp.createSocket "udp4", (msg, rinfo) -> | |
14 try | |
15 console.log osc.fromBuffer msg | |
16 catch error | |
17 console.log "invalid OSC packet" | |
18 sock.bind inport |