annotate resources/osc/node_modules/osc-min/examples/printosc.coffee @ 346:c6a15a8dee02 prerelease

Remapped analog output channels to match 01234567 order on cape. Note: this will change the behaviour of all these existing examples using analog out, notably d-box and cape_test.
author andrewm
date Tue, 07 Jun 2016 18:37:11 +0100
parents fb9c28a4676b
children
rev   line source
l@271 1 osc = require 'osc-min'
l@271 2 udp = require "dgram"
l@271 3
l@271 4 if process.argv[2]?
l@271 5 inport = parseInt process.argv[2]
l@271 6 else
l@271 7 inport = 41234
l@271 8
l@271 9 console.log "OSC listener running at http://localhost:" + inport
l@271 10
l@271 11 `//~verbatim:examples[0]~
l@271 12 //### A simple OSC printer`
l@271 13 sock = udp.createSocket "udp4", (msg, rinfo) ->
l@271 14 try
l@271 15 console.log osc.fromBuffer msg
l@271 16 catch error
l@271 17 console.log "invalid OSC packet"
l@271 18 sock.bind inport