l@271: // Generated by CoffeeScript 1.10.0 l@271: var inport, osc, sock, udp; l@271: l@271: osc = require('osc-min'); l@271: l@271: udp = require("dgram"); l@271: l@271: if (process.argv[2] != null) { l@271: inport = parseInt(process.argv[2]); l@271: } else { l@271: inport = 41234; l@271: } l@271: l@271: console.log("OSC listener running at http://localhost:" + inport); l@271: l@271: //~verbatim:examples[0]~ l@271: //### A simple OSC printer; l@271: l@271: sock = udp.createSocket("udp4", function(msg, rinfo) { l@271: var error, error1; l@271: try { l@271: return console.log(osc.fromBuffer(msg)); l@271: } catch (error1) { l@271: error = error1; l@271: return console.log("invalid OSC packet"); l@271: } l@271: }); l@271: l@271: sock.bind(inport);