Socket
Socket
Sign inDemoInstall

osc

Package Overview
Dependencies
178
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.2.0 to 1.2.1

2

bower.json
{
"name": "osc.js",
"version": "1.2.0",
"version": "1.2.1",
"main": "dist/osc.min.js",

@@ -5,0 +5,0 @@ "ignore": [

@@ -1,3 +0,3 @@

/*! osc.js 1.2.0, Copyright 2015 Colin Clark | github.com/colinbdclark/osc.js */
/*! osc.js 1.2.1, Copyright 2015 Colin Clark | github.com/colinbdclark/osc.js */
var osc=osc||{};!function(){"use strict";osc.SECS_70YRS=2208988800,osc.TWO_32=4294967296,osc.defaults={metadata:!1,unpackSingleArgs:!0},osc.isBufferEnv="undefined"!=typeof Buffer,osc.isCommonJS="undefined"!=typeof module&&module.exports,osc.isNode=osc.isCommonJS&&"undefined"==typeof window,osc.isArray=function(a){return a&&"[object Array]"===Object.prototype.toString.call(a)},osc.isTypedArrayView=function(a){return a.buffer&&a.buffer instanceof ArrayBuffer},osc.isBuffer=function(a){return osc.isBufferEnv&&a instanceof Buffer};var a=osc.isNode?require("buffer-dataview"):void 0,b="undefined"!=typeof dcodeIO?dcodeIO.Long:"undefined"!=typeof b?b:osc.isNode?require("long"):void 0;osc.dataView=function(b){return b instanceof DataView?b:"undefined"!=typeof a&&b instanceof a?b:osc.isBufferEnv&&b instanceof Buffer?new a(b):b.buffer?new DataView(b.buffer):b instanceof ArrayBuffer?new DataView(b):new DataView(new Uint8Array(b))},osc.byteArray=function(a){if(a instanceof Uint8Array)return a;var b=a.buffer?a.buffer:a;if("undefined"==typeof a.length||"string"==typeof a)throw new Error("Can't wrap a non-array-like object as Uint8Array. Object was: "+JSON.stringify(a,null,2));return new Uint8Array(b)},osc.makeByteArray=function(a){return osc.isBufferEnv?new Buffer(a):new Uint8Array(a)},osc.copyByteArray=function(a,b,c){if(osc.isTypedArrayView(a)&&osc.isTypedArrayView(b))b.set(a,c);else if(osc.isBuffer(a)&&osc.isBuffer(b))a.copy(b,c);else for(var d=void 0===c?0:c,e=Math.min(b.length-c,a.length),f=0,g=d;e>f;f++,g++)b[g]=a[f];return b},osc.readString=function(a,b){for(var c=[],d=b.idx;d<a.byteLength;d++){var e=a.getUint8(d);if(0===e){d++;break}c.push(e)}return d=d+3&-4,b.idx=d,String.fromCharCode.apply(null,c)},osc.writeString=function(a){for(var b=a+"\x00",c=b.length,d=c+3&-4,e=new Uint8Array(d),f=0;f<b.length;f++){var g=b.charCodeAt(f);e[f]=g}return e},osc.readPrimitive=function(a,b,c,d){var e=a[b](d.idx,!1);return d.idx+=c,e},osc.writePrimitive=function(a,b,c,d,e){e=void 0===e?0:e;var f;return b?f=new Uint8Array(b.buffer):(f=new Uint8Array(d),b=new DataView(f.buffer)),b[c](e,a,!1),f},osc.readInt32=function(a,b){return osc.readPrimitive(a,"getInt32",4,b)},osc.writeInt32=function(a,b,c){return osc.writePrimitive(a,b,"setInt32",4,c)},osc.readInt64=function(a,c){var d=osc.readPrimitive(a,"getInt32",4,c),e=osc.readPrimitive(a,"getInt32",4,c);return b?new b(e,d):{high:d,low:e,unsigned:!1}},osc.writeInt64=function(a,b,c){var d=new Uint8Array(8);return d.set(osc.writePrimitive(a.high,b,"setInt32",4,c),0),d.set(osc.writePrimitive(a.low,b,"setInt32",4,c+4),4),d},osc.readFloat32=function(a,b){return osc.readPrimitive(a,"getFloat32",4,b)},osc.writeFloat32=function(a,b,c){return osc.writePrimitive(a,b,"setFloat32",4,c)},osc.readFloat64=function(a,b){return osc.readPrimitive(a,"getFloat64",8,b)},osc.writeFloat64=function(a,b,c){return osc.writePrimitive(a,b,"setFloat64",8,c)},osc.readChar32=function(a,b){var c=osc.readPrimitive(a,"getUint32",4,b);return String.fromCharCode(c)},osc.writeChar32=function(a,b,c){var d=a.charCodeAt(0);return void 0===d||-1>d?void 0:osc.writePrimitive(d,b,"setUint32",4,c)},osc.readBlob=function(a,b){var c=osc.readInt32(a,b),d=c+3&-4,e=new Uint8Array(a.buffer,b.idx,c);return b.idx+=d,e},osc.writeBlob=function(a){a=osc.byteArray(a);var b=a.byteLength,c=b+3&-4,d=4,e=c+d,f=new Uint8Array(e),g=new DataView(f.buffer);return osc.writeInt32(b,g),f.set(a,d),f},osc.readMIDIBytes=function(a,b){var c=new Uint8Array(a.buffer,b.idx,4);return b.idx+=4,c},osc.writeMIDIBytes=function(a){a=osc.byteArray(a);var b=new Uint8Array(4);return b.set(a),b},osc.readColor=function(a,b){var c=new Uint8Array(a.buffer,b.idx,4),d=c[3]/255;return b.idx+=4,{r:c[0],g:c[1],b:c[2],a:d}},osc.writeColor=function(a){var b=Math.round(255*a.a),c=new Uint8Array([a.r,a.g,a.b,b]);return c},osc.readTrue=function(){return!0},osc.readFalse=function(){return!1},osc.readNull=function(){return null},osc.readImpulse=function(){return 1},osc.readTimeTag=function(a,b){var c=osc.readPrimitive(a,"getUint32",4,b),d=osc.readPrimitive(a,"getUint32",4,b),e=0===c&&1===d?Date.now():osc.ntpToJSTime(c,d);return{raw:[c,d],"native":e}},osc.writeTimeTag=function(a){var b=a.raw?a.raw:osc.jsToNTPTime(a["native"]),c=new Uint8Array(8),d=new DataView(c.buffer);return osc.writeInt32(b[0],d,0),osc.writeInt32(b[1],d,4),c},osc.timeTag=function(a){a=a||0;var b=Date.now()/1e3,c=Math.floor(b),d=b-c,e=Math.floor(a),f=a-e,g=d+f;if(g>1){var h=Math.floor(g),i=g-h;e+=h,g=i}var j=c+e+osc.SECS_70YRS,k=Math.round(osc.TWO_32*g);return{raw:[j,k]}},osc.ntpToJSTime=function(a,b){var c=a-osc.SECS_70YRS,d=b/osc.TWO_32,e=1e3*(c+d);return e},osc.jsToNTPTime=function(a){var b=a/1e3,c=Math.floor(b),d=b-c,e=c+osc.SECS_70YRS,f=Math.round(osc.TWO_32*d);return[e,f]},osc.readArguments=function(a,b,c){var d=osc.readString(a,c);if(0!==d.indexOf(","))throw new Error("A malformed type tag string was found while reading the arguments of an OSC message. String was: "+d," at offset: "+c.idx);var e=d.substring(1).split(""),f=[];return osc.readArgumentsIntoArray(f,e,d,a,b,c),f},osc.readArgument=function(a,b,c,d,e){var f=osc.argumentTypes[a];if(!f)throw new Error("'"+a+"' is not a valid OSC type tag. Type tag string was: "+b);var g=f.reader,h=osc[g](c,e);return d.metadata&&(h={type:a,value:h}),h},osc.readArgumentsIntoArray=function(a,b,c,d,e,f){for(var g=0;g<b.length;){var h,i=b[g];if("["===i){var j=b.slice(g+1),k=j.indexOf("]");if(0>k)throw new Error("Invalid argument type tag: an open array type tag ('[') was found without a matching close array tag ('[]'). Type tag was: "+c);var l=j.slice(0,k);h=osc.readArgumentsIntoArray([],l,c,d,e,f),g+=k+2}else h=osc.readArgument(i,c,d,e,f),g++;a.push(h)}return a},osc.writeArguments=function(a,b){var c=osc.collectArguments(a,b);return osc.joinParts(c)},osc.joinParts=function(a){for(var b=osc.makeByteArray(a.byteLength),c=a.parts,d=0,e=0;e<c.length;e++){var f=c[e];osc.copyByteArray(f,b,d),d+=f.length}return b},osc.addDataPart=function(a,b){b.parts.push(a),b.byteLength+=a.length},osc.writeArrayArguments=function(a,b){for(var c="[",d=0;d<a.length;d++){var e=a[d];c+=osc.writeArgument(e,b)}return c+="]"},osc.writeArgument=function(a,b){if(osc.isArray(a))return osc.writeArrayArguments(a,b);var c=a.type,d=osc.argumentTypes[c].writer;if(d){var e=osc[d](a.value);osc.addDataPart(e,b)}return a.type},osc.collectArguments=function(a,b,c){osc.isArray(a)||(a=[a]),c=c||{byteLength:0,parts:[]},b.metadata||(a=osc.annotateArguments(a));for(var d=",",e=c.parts.length,f=0;f<a.length;f++){var g=a[f];d+=osc.writeArgument(g,c)}var h=osc.writeString(d);return c.byteLength+=h.byteLength,c.parts.splice(e,0,h),c},osc.readMessage=function(a,b,c){b=b||osc.defaults;var d=osc.dataView(a);c=c||{idx:0};var e=osc.readString(d,c);return osc.readMessageContents(e,d,b,c)},osc.readMessageContents=function(a,b,c,d){if(0!==a.indexOf("/"))throw new Error("A malformed OSC address was found while reading an OSC message. String was: "+a);var e=osc.readArguments(b,c,d);return{address:a,args:1===e.length&&c.unpackSingleArgs?e[0]:e}},osc.collectMessageParts=function(a,b,c){return c=c||{byteLength:0,parts:[]},osc.addDataPart(osc.writeString(a.address),c),osc.collectArguments(a.args,b,c)},osc.writeMessage=function(a,b){b=b||osc.defaults;var c=osc.collectMessageParts(a,b);return osc.joinParts(c)},osc.readBundle=function(a,b,c){return osc.readPacket(a,b,c)},osc.collectBundlePackets=function(a,b,c){c=c||{byteLength:0,parts:[]},osc.addDataPart(osc.writeString("#bundle"),c),osc.addDataPart(osc.writeTimeTag(a.timeTag),c);for(var d=0;d<a.packets.length;d++){var e=a.packets[d],f=e.address?osc.collectMessageParts:osc.collectBundlePackets,g=f(e,b);c.byteLength+=g.byteLength,osc.addDataPart(osc.writeInt32(g.byteLength),c),c.parts=c.parts.concat(g.parts)}return c},osc.writeBundle=function(a,b){if(a.timeTag&&a.packets){b=b||osc.defaults;var c=osc.collectBundlePackets(a,b);return osc.joinParts(c)}},osc.readBundleContents=function(a,b,c,d){for(var e=osc.readTimeTag(a,c),f=[];c.idx<d;){var g=osc.readInt32(a,c),h=c.idx+g,i=osc.readPacket(a,b,c,h);f.push(i)}return{timeTag:e,packets:f}},osc.readPacket=function(a,b,c,d){var e=osc.dataView(a);d=void 0===d?e.byteLength:d,c=c||{idx:0};var f=osc.readString(e,c),g=f[0];if("#"===g)return osc.readBundleContents(e,b,c,d);if("/"===g)return osc.readMessageContents(f,e,b,c);throw new Error("The header of an OSC packet didn't contain an OSC address or a #bundle string. Header was: "+f)},osc.writePacket=function(a,b){var c=a.address?osc.writeMessage:osc.writeBundle;return c(a,b)},osc.argumentTypes={i:{reader:"readInt32",writer:"writeInt32"},h:{reader:"readInt64",writer:"writeInt64"},f:{reader:"readFloat32",writer:"writeFloat32"},s:{reader:"readString",writer:"writeString"},S:{reader:"readString",writer:"writeString"},b:{reader:"readBlob",writer:"writeBlob"},t:{reader:"readTimeTag",writer:"writeTimeTag"},T:{reader:"readTrue"},F:{reader:"readFalse"},N:{reader:"readNull"},I:{reader:"readImpulse"},d:{reader:"readFloat64",writer:"writeFloat64"},c:{reader:"readChar32",writer:"writeChar32"},r:{reader:"readColor",writer:"writeColor"},m:{reader:"readMIDIBytes",writer:"writeMIDIBytes"}},osc.inferTypeForArgument=function(a){var b=typeof a;switch(b){case"boolean":return a?"T":"F";case"string":return"s";case"number":return"f";case"undefined":return"N";case"object":if(null===a)return"N";if(a instanceof Uint8Array||a instanceof ArrayBuffer||osc.isBufferEnv&&a instanceof Buffer)return"b";if(a.high instanceof Number&&a.low instanceof Number)return"h"}throw new Error("Can't infer OSC argument type for value: "+JSON.stringify(a,null,2))},osc.annotateArguments=function(a){osc.isArray(a)||(a=[a]);for(var b=[],c=0;c<a.length;c++){var d,e=a[c];if("object"==typeof e&&e.type&&void 0!==e.value)d=e;else{var f=osc.inferTypeForArgument(e);d={type:f,value:e}}b.push(d)}return b},osc.isCommonJS&&(module.exports=osc)}(),function(a){"use strict";var b=function(a,b,c){this.low=0|a,this.high=0|b,this.unsigned=!!c};b.isLong=function(a){return(a&&a instanceof b)===!0};var c={},d={};b.fromInt=function(a,e){var f,g;return e?(a>>>=0,a>=0&&256>a&&(g=d[a])?g:(f=new b(a,0>(0|a)?-1:0,!0),a>=0&&256>a&&(d[a]=f),f)):(a=0|a,a>=-128&&128>a&&(g=c[a])?g:(f=new b(a,0>a?-1:0,!1),a>=-128&&128>a&&(c[a]=f),f))},b.fromNumber=function(a,c){return c=!!c,isNaN(a)||!isFinite(a)?b.ZERO:!c&&-i>=a?b.MIN_VALUE:!c&&a+1>=i?b.MAX_VALUE:c&&a>=h?b.MAX_UNSIGNED_VALUE:0>a?b.fromNumber(-a,c).negate():new b(a%g|0,a/g|0,c)},b.fromBits=function(a,c,d){return new b(a,c,d)},b.fromString=function(a,c,d){if(0===a.length)throw Error("number format error: empty string");if("NaN"===a||"Infinity"===a||"+Infinity"===a||"-Infinity"===a)return b.ZERO;if("number"==typeof c&&(d=c,c=!1),d=d||10,2>d||d>36)throw Error("radix out of range: "+d);var e;if((e=a.indexOf("-"))>0)throw Error('number format error: interior "-" character: '+a);if(0===e)return b.fromString(a.substring(1),c,d).negate();for(var f=b.fromNumber(Math.pow(d,8)),g=b.ZERO,h=0;h<a.length;h+=8){var i=Math.min(8,a.length-h),j=parseInt(a.substring(h,h+i),d);if(8>i){var k=b.fromNumber(Math.pow(d,i));g=g.multiply(k).add(b.fromNumber(j))}else g=g.multiply(f),g=g.add(b.fromNumber(j))}return g.unsigned=c,g},b.fromValue=function(a){return"number"==typeof a?b.fromNumber(a):"string"==typeof a?b.fromString(a):b.isLong(a)?a:new b(a.low,a.high,a.unsigned)};var e=65536,f=1<<24,g=e*e,h=g*g,i=h/2,j=b.fromInt(f);b.ZERO=b.fromInt(0),b.UZERO=b.fromInt(0,!0),b.ONE=b.fromInt(1),b.UONE=b.fromInt(1,!0),b.NEG_ONE=b.fromInt(-1),b.MAX_VALUE=b.fromBits(-1,2147483647,!1),b.MAX_UNSIGNED_VALUE=b.fromBits(-1,-1,!0),b.MIN_VALUE=b.fromBits(0,-2147483648,!1),b.prototype.toInt=function(){return this.unsigned?this.low>>>0:this.low},b.prototype.toNumber=function(){return this.unsigned?(this.high>>>0)*g+(this.low>>>0):this.high*g+(this.low>>>0)},b.prototype.toString=function(a){if(a=a||10,2>a||a>36)throw RangeError("radix out of range: "+a);if(this.isZero())return"0";var c;if(this.isNegative()){if(this.equals(b.MIN_VALUE)){var d=b.fromNumber(a),e=this.div(d);return c=e.multiply(d).subtract(this),e.toString(a)+c.toInt().toString(a)}return"-"+this.negate().toString(a)}var f=b.fromNumber(Math.pow(a,6),this.unsigned);c=this;for(var g="";;){var h=c.div(f),i=c.subtract(h.multiply(f)).toInt()>>>0,j=i.toString(a);if(c=h,c.isZero())return j+g;for(;j.length<6;)j="0"+j;g=""+j+g}},b.prototype.getHighBits=function(){return this.high},b.prototype.getHighBitsUnsigned=function(){return this.high>>>0},b.prototype.getLowBits=function(){return this.low},b.prototype.getLowBitsUnsigned=function(){return this.low>>>0},b.prototype.getNumBitsAbs=function(){if(this.isNegative())return this.equals(b.MIN_VALUE)?64:this.negate().getNumBitsAbs();for(var a=0!=this.high?this.high:this.low,c=31;c>0&&0==(a&1<<c);c--);return 0!=this.high?c+33:c+1},b.prototype.isZero=function(){return 0===this.high&&0===this.low},b.prototype.isNegative=function(){return!this.unsigned&&this.high<0},b.prototype.isPositive=function(){return this.unsigned||this.high>=0},b.prototype.isOdd=function(){return 1===(1&this.low)},b.prototype.isEven=function(){return 0===(1&this.low)},b.prototype.equals=function(a){return b.isLong(a)||(a=b.fromValue(a)),this.unsigned!==a.unsigned&&this.high>>>31===1&&a.high>>>31===1?!1:this.high===a.high&&this.low===a.low},b.prototype.notEquals=function(a){return b.isLong(a)||(a=b.fromValue(a)),!this.equals(a)},b.prototype.lessThan=function(a){return b.isLong(a)||(a=b.fromValue(a)),this.compare(a)<0},b.prototype.lessThanOrEqual=function(a){return b.isLong(a)||(a=b.fromValue(a)),this.compare(a)<=0},b.prototype.greaterThan=function(a){return b.isLong(a)||(a=b.fromValue(a)),this.compare(a)>0},b.prototype.greaterThanOrEqual=function(a){return b.isLong(a)||(a=b.fromValue(a)),this.compare(a)>=0},b.prototype.compare=function(a){if(this.equals(a))return 0;var b=this.isNegative(),c=a.isNegative();return b&&!c?-1:!b&&c?1:this.unsigned?a.high>>>0>this.high>>>0||a.high===this.high&&a.low>>>0>this.low>>>0?-1:1:this.subtract(a).isNegative()?-1:1},b.prototype.negate=function(){return!this.unsigned&&this.equals(b.MIN_VALUE)?b.MIN_VALUE:this.not().add(b.ONE)},b.prototype.add=function(a){b.isLong(a)||(a=b.fromValue(a));var c=this.high>>>16,d=65535&this.high,e=this.low>>>16,f=65535&this.low,g=a.high>>>16,h=65535&a.high,i=a.low>>>16,j=65535&a.low,k=0,l=0,m=0,n=0;return n+=f+j,m+=n>>>16,n&=65535,m+=e+i,l+=m>>>16,m&=65535,l+=d+h,k+=l>>>16,l&=65535,k+=c+g,k&=65535,b.fromBits(m<<16|n,k<<16|l,this.unsigned)},b.prototype.subtract=function(a){return b.isLong(a)||(a=b.fromValue(a)),this.add(a.negate())},b.prototype.multiply=function(a){if(this.isZero())return b.ZERO;if(b.isLong(a)||(a=b.fromValue(a)),a.isZero())return b.ZERO;if(this.equals(b.MIN_VALUE))return a.isOdd()?b.MIN_VALUE:b.ZERO;if(a.equals(b.MIN_VALUE))return this.isOdd()?b.MIN_VALUE:b.ZERO;if(this.isNegative())return a.isNegative()?this.negate().multiply(a.negate()):this.negate().multiply(a).negate();if(a.isNegative())return this.multiply(a.negate()).negate();if(this.lessThan(j)&&a.lessThan(j))return b.fromNumber(this.toNumber()*a.toNumber(),this.unsigned);var c=this.high>>>16,d=65535&this.high,e=this.low>>>16,f=65535&this.low,g=a.high>>>16,h=65535&a.high,i=a.low>>>16,k=65535&a.low,l=0,m=0,n=0,o=0;return o+=f*k,n+=o>>>16,o&=65535,n+=e*k,m+=n>>>16,n&=65535,n+=f*i,m+=n>>>16,n&=65535,m+=d*k,l+=m>>>16,m&=65535,m+=e*i,l+=m>>>16,m&=65535,m+=f*h,l+=m>>>16,m&=65535,l+=c*k+d*i+e*h+f*g,l&=65535,b.fromBits(n<<16|o,l<<16|m,this.unsigned)},b.prototype.div=function(a){if(b.isLong(a)||(a=b.fromValue(a)),a.isZero())throw new Error("division by zero");if(this.isZero())return this.unsigned?b.UZERO:b.ZERO;var c,d,e;if(this.equals(b.MIN_VALUE)){if(a.equals(b.ONE)||a.equals(b.NEG_ONE))return b.MIN_VALUE;if(a.equals(b.MIN_VALUE))return b.ONE;var f=this.shiftRight(1);return c=f.div(a).shiftLeft(1),c.equals(b.ZERO)?a.isNegative()?b.ONE:b.NEG_ONE:(d=this.subtract(a.multiply(c)),e=c.add(d.div(a)))}if(a.equals(b.MIN_VALUE))return this.unsigned?b.UZERO:b.ZERO;if(this.isNegative())return a.isNegative()?this.negate().div(a.negate()):this.negate().div(a).negate();if(a.isNegative())return this.div(a.negate()).negate();for(e=b.ZERO,d=this;d.greaterThanOrEqual(a);){c=Math.max(1,Math.floor(d.toNumber()/a.toNumber()));for(var g=Math.ceil(Math.log(c)/Math.LN2),h=48>=g?1:Math.pow(2,g-48),i=b.fromNumber(c),j=i.multiply(a);j.isNegative()||j.greaterThan(d);)c-=h,i=b.fromNumber(c,this.unsigned),j=i.multiply(a);i.isZero()&&(i=b.ONE),e=e.add(i),d=d.subtract(j)}return e},b.prototype.modulo=function(a){return b.isLong(a)||(a=b.fromValue(a)),this.subtract(this.div(a).multiply(a))},b.prototype.not=function(){return b.fromBits(~this.low,~this.high,this.unsigned)},b.prototype.and=function(a){return b.isLong(a)||(a=b.fromValue(a)),b.fromBits(this.low&a.low,this.high&a.high,this.unsigned)},b.prototype.or=function(a){return b.isLong(a)||(a=b.fromValue(a)),b.fromBits(this.low|a.low,this.high|a.high,this.unsigned)},b.prototype.xor=function(a){return b.isLong(a)||(a=b.fromValue(a)),b.fromBits(this.low^a.low,this.high^a.high,this.unsigned)},b.prototype.shiftLeft=function(a){return b.isLong(a)&&(a=a.toInt()),0===(a&=63)?this:32>a?b.fromBits(this.low<<a,this.high<<a|this.low>>>32-a,this.unsigned):b.fromBits(0,this.low<<a-32,this.unsigned)},b.prototype.shiftRight=function(a){return b.isLong(a)&&(a=a.toInt()),0===(a&=63)?this:32>a?b.fromBits(this.low>>>a|this.high<<32-a,this.high>>a,this.unsigned):b.fromBits(this.high>>a-32,this.high>=0?0:-1,this.unsigned)},b.prototype.shiftRightUnsigned=function(a){if(b.isLong(a)&&(a=a.toInt()),a&=63,0===a)return this;var c=this.high;if(32>a){var d=this.low;return b.fromBits(d>>>a|c<<32-a,c>>>a,this.unsigned)}return 32===a?b.fromBits(c,0,this.unsigned):b.fromBits(c>>>a-32,0,this.unsigned)},b.prototype.toSigned=function(){return this.unsigned?new b(this.low,this.high,!1):this},b.prototype.toUnsigned=function(){return this.unsigned?this:new b(this.low,this.high,!0)},"function"==typeof require&&"object"==typeof module&&module&&"object"==typeof exports&&exports?module.exports=b:"function"==typeof define&&define.amd?define(function(){return b}):(a.dcodeIO=a.dcodeIO||{}).Long=b}(this),function(a,b){"use strict";"object"==typeof exports?(a.slip=exports,b(exports)):"function"==typeof define&&define.amd?define(["exports"],function(c){return a.slip=c,a.slip,b(c)}):(a.slip={},b(a.slip))}(this,function(a){"use strict";var b=a;b.END=192,b.ESC=219,b.ESC_END=220,b.ESC_ESC=221,b.byteArray=function(a,b,c){return a instanceof ArrayBuffer?new Uint8Array(a,b,c):a},b.expandByteArray=function(a){var b=new Uint8Array(2*a.length);return b.set(a),b},b.sliceByteArray=function(a,b,c){var d=a.buffer.slice?a.buffer.slice(b,c):a.subarray(b,c);return new Uint8Array(d)},b.encode=function(a,c){c=c||{},c.bufferPadding=c.bufferPadding||4,a=b.byteArray(a,c.offset,c.byteLength);var d=a.length+c.bufferPadding+3&-4,e=new Uint8Array(d),f=1;e[0]=b.END;for(var g=0;g<a.length;g++){f>e.length-3&&(e=b.expandByteArray(e));var h=a[g];h===b.END?(e[f++]=b.ESC,h=b.ESC_END):h===b.ESC&&(e[f++]=b.ESC,h=b.ESC_ESC),e[f++]=h}return e[f]=b.END,b.sliceByteArray(e,0,f+1)},b.Decoder=function(a){a="function"!=typeof a?a||{}:{onMessage:a},this.maxMessageSize=a.maxMessageSize||10485760,this.bufferSize=a.bufferSize||1024,this.msgBuffer=new Uint8Array(this.bufferSize),this.msgBufferIdx=0,this.onMessage=a.onMessage,this.onError=a.onError,this.escape=!1};var c=b.Decoder.prototype;return c.decode=function(a){a=b.byteArray(a);for(var c,d=0;d<a.length;d++){var e=a[d];if(this.escape)e===b.ESC_ESC?e=b.ESC:e===b.ESC_END&&(e=b.END);else{if(e===b.ESC){this.escape=!0;continue}if(e===b.END){c=this.handleEnd();continue}}var f=this.addByte(e);f||this.handleMessageMaxError()}return c},c.handleMessageMaxError=function(){this.onError&&this.onError(this.msgBuffer.subarray(0),"The message is too large; the maximum message size is "+this.maxMessageSize/1024+"KB. Use a larger maxMessageSize if necessary."),this.msgBufferIdx=0,this.escape=!1},c.addByte=function(a){return this.msgBufferIdx>this.msgBuffer.length-1&&(this.msgBuffer=b.expandByteArray(this.msgBuffer)),this.msgBuffer[this.msgBufferIdx++]=a,this.escape=!1,this.msgBuffer.length<this.maxMessageSize},c.handleEnd=function(){if(0!==this.msgBufferIdx){var a=b.sliceByteArray(this.msgBuffer,0,this.msgBufferIdx);return this.onMessage&&this.onMessage(a),this.msgBufferIdx=0,a}},b}),function(){"use strict";function a(){}function b(a,b){for(var c=a.length;c--;)if(a[c].listener===b)return c;return-1}function c(a){return function(){return this[a].apply(this,arguments)}}var d=a.prototype,e=this,f=e.EventEmitter;d.getListeners=function(a){var b,c,d=this._getEvents();if(a instanceof RegExp){b={};for(c in d)d.hasOwnProperty(c)&&a.test(c)&&(b[c]=d[c])}else b=d[a]||(d[a]=[]);return b},d.flattenListeners=function(a){var b,c=[];for(b=0;b<a.length;b+=1)c.push(a[b].listener);return c},d.getListenersAsObject=function(a){var b,c=this.getListeners(a);return c instanceof Array&&(b={},b[a]=c),b||c},d.addListener=function(a,c){var d,e=this.getListenersAsObject(a),f="object"==typeof c;for(d in e)e.hasOwnProperty(d)&&-1===b(e[d],c)&&e[d].push(f?c:{listener:c,once:!1});return this},d.on=c("addListener"),d.addOnceListener=function(a,b){return this.addListener(a,{listener:b,once:!0})},d.once=c("addOnceListener"),d.defineEvent=function(a){return this.getListeners(a),this},d.defineEvents=function(a){for(var b=0;b<a.length;b+=1)this.defineEvent(a[b]);return this},d.removeListener=function(a,c){var d,e,f=this.getListenersAsObject(a);for(e in f)f.hasOwnProperty(e)&&(d=b(f[e],c),-1!==d&&f[e].splice(d,1));return this},d.off=c("removeListener"),d.addListeners=function(a,b){return this.manipulateListeners(!1,a,b)},d.removeListeners=function(a,b){return this.manipulateListeners(!0,a,b)},d.manipulateListeners=function(a,b,c){var d,e,f=a?this.removeListener:this.addListener,g=a?this.removeListeners:this.addListeners;if("object"!=typeof b||b instanceof RegExp)for(d=c.length;d--;)f.call(this,b,c[d]);else for(d in b)b.hasOwnProperty(d)&&(e=b[d])&&("function"==typeof e?f.call(this,d,e):g.call(this,d,e));return this},d.removeEvent=function(a){var b,c=typeof a,d=this._getEvents();if("string"===c)delete d[a];else if(a instanceof RegExp)for(b in d)d.hasOwnProperty(b)&&a.test(b)&&delete d[b];else delete this._events;return this},d.removeAllListeners=c("removeEvent"),d.emitEvent=function(a,b){var c,d,e,f,g=this.getListenersAsObject(a);for(e in g)if(g.hasOwnProperty(e))for(d=g[e].length;d--;)c=g[e][d],c.once===!0&&this.removeListener(a,c.listener),f=c.listener.apply(this,b||[]),f===this._getOnceReturnValue()&&this.removeListener(a,c.listener);return this},d.trigger=c("emitEvent"),d.emit=function(a){var b=Array.prototype.slice.call(arguments,1);return this.emitEvent(a,b)},d.setOnceReturnValue=function(a){return this._onceReturnValue=a,this},d._getOnceReturnValue=function(){return this.hasOwnProperty("_onceReturnValue")?this._onceReturnValue:!0},d._getEvents=function(){return this._events||(this._events={})},a.noConflict=function(){return e.EventEmitter=f,a},"function"==typeof define&&define.amd?define(function(){return a}):"object"==typeof module&&module.exports?module.exports=a:e.EventEmitter=a}.call(this);var osc=osc||require("./osc.js"),slip=slip||require("slip"),EventEmitter=EventEmitter||require("events").EventEmitter;!function(){"use strict";osc.firePacketEvents=function(a,b,c){b.address?a.emit("message",b,c):osc.fireBundleEvents(a,b,c)},osc.fireBundleEvents=function(a,b,c){a.emit("bundle",b,c);for(var d=0;d<b.packets.length;d++){var e=b.packets[d];osc.firePacketEvents(a,e,b.timeTag)}},osc.Port=function(a){this.options=a||{},this.on("data",this.decodeOSC.bind(this))};var a=osc.Port.prototype=Object.create(EventEmitter.prototype);a.constructor=osc.Port,a.send=function(a){var b=Array.prototype.slice.call(arguments),c=this.encodeOSC(a);b[0]=c,this.sendRaw.apply(this,b)},a.encodeOSC=function(a){a=a.buffer?a.buffer:a;var b=osc.writePacket(a,this.options);return b},a.decodeOSC=function(a){this.emit("raw",a);var b=osc.readPacket(a,this.options);this.emit("osc",b),osc.firePacketEvents(this,b)},osc.SLIPPort=function(a){var b=this,c=this.options=a||{};c.useSLIP=void 0===c.useSLIP?!0:c.useSLIP,this.decoder=new slip.Decoder({onMessage:this.decodeOSC.bind(this),onError:function(a){b.emit("error",a)}});var d=c.useSLIP?this.decodeSLIPData:this.decodeOSC;this.on("data",d.bind(this))},a=osc.SLIPPort.prototype=Object.create(osc.Port.prototype),a.constructor=osc.SLIPPort,a.encodeOSC=function(a){a=a.buffer?a.buffer:a;var b=osc.writePacket(a,this.options);return slip.encode(b)},a.decodeSLIPData=function(a){this.decoder.decode(a)},osc.relay=function(a,b,c,d,e,f){c=c||"message",d=d||"send",e=e||function(){},f=f?[null].concat(f):[];var g=function(a){f[0]=a,a=e(a),b[d].apply(b,f)};return a.on(c,g),{eventName:c,listener:g}},osc.relayPorts=function(a,b,c){var d=c.raw?"raw":"osc",e=c.raw?"sendRaw":"send";return osc.relay(a,b,d,e,c.transform)},osc.stopRelaying=function(a,b){a.removeListener(b.eventName,b.listener)},osc.Relay=function(a,b,c){var d=this.options=c||{};d.raw=!1,this.port1=a,this.port2=b,this.listen()},a=osc.Relay.prototype=Object.create(EventEmitter.prototype),a.constructor=osc.Relay,a.open=function(){this.port1.open(),this.port2.open()},a.listen=function(){this.port1Spec&&this.port2Spec&&this.close(),this.port1Spec=osc.relayPorts(this.port1,this.port2,this.options),this.port2Spec=osc.relayPorts(this.port2,this.port1,this.options);var a=this.close.bind(this);this.port1.on("close",a),this.port2.on("close",a)},a.close=function(){osc.stopRelaying(this.port1,this.port1Spec),osc.stopRelaying(this.port2,this.port2Spec),this.emit("close",this.port1,this.port2)},"undefined"!=typeof module&&module.exports&&(module.exports=osc)}();var osc=osc;!function(){"use strict";osc.WebSocketPort=function(a){osc.Port.call(this,a),this.on("open",this.listen.bind(this))};var a=osc.WebSocketPort.prototype=Object.create(osc.Port.prototype);a.constructor=osc.WebSocketPort,a.open=function(){this.socket=new WebSocket(this.options.url),this.socket.binaryType="arraybuffer";var a=this;this.socket.onopen=function(){a.emit("open",a.socket)}},a.listen=function(){var a=this;this.socket.onmessage=function(b){a.emit("data",b.data)},this.socket.onerror=function(b){a.emit("error",b)},this.socket.onclose=function(b){a.emit("close",b)},a.emit("ready")},a.sendRaw=function(a){this.socket&&this.socket.send(a.buffer)},a.close=function(a,b){this.socket.close(a,b)}}();

@@ -1,3 +0,3 @@

/*! osc.js 1.2.0, Copyright 2015 Colin Clark | github.com/colinbdclark/osc.js */
/*! osc.js 1.2.1, Copyright 2015 Colin Clark | github.com/colinbdclark/osc.js */
var osc=osc||{};!function(){"use strict";osc.SECS_70YRS=2208988800,osc.TWO_32=4294967296,osc.defaults={metadata:!1,unpackSingleArgs:!0},osc.isBufferEnv="undefined"!=typeof Buffer,osc.isCommonJS="undefined"!=typeof module&&module.exports,osc.isNode=osc.isCommonJS&&"undefined"==typeof window,osc.isArray=function(a){return a&&"[object Array]"===Object.prototype.toString.call(a)},osc.isTypedArrayView=function(a){return a.buffer&&a.buffer instanceof ArrayBuffer},osc.isBuffer=function(a){return osc.isBufferEnv&&a instanceof Buffer};var a=osc.isNode?require("buffer-dataview"):void 0,b="undefined"!=typeof dcodeIO?dcodeIO.Long:"undefined"!=typeof b?b:osc.isNode?require("long"):void 0;osc.dataView=function(b){return b instanceof DataView?b:"undefined"!=typeof a&&b instanceof a?b:osc.isBufferEnv&&b instanceof Buffer?new a(b):b.buffer?new DataView(b.buffer):b instanceof ArrayBuffer?new DataView(b):new DataView(new Uint8Array(b))},osc.byteArray=function(a){if(a instanceof Uint8Array)return a;var b=a.buffer?a.buffer:a;if("undefined"==typeof a.length||"string"==typeof a)throw new Error("Can't wrap a non-array-like object as Uint8Array. Object was: "+JSON.stringify(a,null,2));return new Uint8Array(b)},osc.makeByteArray=function(a){return osc.isBufferEnv?new Buffer(a):new Uint8Array(a)},osc.copyByteArray=function(a,b,c){if(osc.isTypedArrayView(a)&&osc.isTypedArrayView(b))b.set(a,c);else if(osc.isBuffer(a)&&osc.isBuffer(b))a.copy(b,c);else for(var d=void 0===c?0:c,e=Math.min(b.length-c,a.length),f=0,g=d;e>f;f++,g++)b[g]=a[f];return b},osc.readString=function(a,b){for(var c=[],d=b.idx;d<a.byteLength;d++){var e=a.getUint8(d);if(0===e){d++;break}c.push(e)}return d=d+3&-4,b.idx=d,String.fromCharCode.apply(null,c)},osc.writeString=function(a){for(var b=a+"\x00",c=b.length,d=c+3&-4,e=new Uint8Array(d),f=0;f<b.length;f++){var g=b.charCodeAt(f);e[f]=g}return e},osc.readPrimitive=function(a,b,c,d){var e=a[b](d.idx,!1);return d.idx+=c,e},osc.writePrimitive=function(a,b,c,d,e){e=void 0===e?0:e;var f;return b?f=new Uint8Array(b.buffer):(f=new Uint8Array(d),b=new DataView(f.buffer)),b[c](e,a,!1),f},osc.readInt32=function(a,b){return osc.readPrimitive(a,"getInt32",4,b)},osc.writeInt32=function(a,b,c){return osc.writePrimitive(a,b,"setInt32",4,c)},osc.readInt64=function(a,c){var d=osc.readPrimitive(a,"getInt32",4,c),e=osc.readPrimitive(a,"getInt32",4,c);return b?new b(e,d):{high:d,low:e,unsigned:!1}},osc.writeInt64=function(a,b,c){var d=new Uint8Array(8);return d.set(osc.writePrimitive(a.high,b,"setInt32",4,c),0),d.set(osc.writePrimitive(a.low,b,"setInt32",4,c+4),4),d},osc.readFloat32=function(a,b){return osc.readPrimitive(a,"getFloat32",4,b)},osc.writeFloat32=function(a,b,c){return osc.writePrimitive(a,b,"setFloat32",4,c)},osc.readFloat64=function(a,b){return osc.readPrimitive(a,"getFloat64",8,b)},osc.writeFloat64=function(a,b,c){return osc.writePrimitive(a,b,"setFloat64",8,c)},osc.readChar32=function(a,b){var c=osc.readPrimitive(a,"getUint32",4,b);return String.fromCharCode(c)},osc.writeChar32=function(a,b,c){var d=a.charCodeAt(0);return void 0===d||-1>d?void 0:osc.writePrimitive(d,b,"setUint32",4,c)},osc.readBlob=function(a,b){var c=osc.readInt32(a,b),d=c+3&-4,e=new Uint8Array(a.buffer,b.idx,c);return b.idx+=d,e},osc.writeBlob=function(a){a=osc.byteArray(a);var b=a.byteLength,c=b+3&-4,d=4,e=c+d,f=new Uint8Array(e),g=new DataView(f.buffer);return osc.writeInt32(b,g),f.set(a,d),f},osc.readMIDIBytes=function(a,b){var c=new Uint8Array(a.buffer,b.idx,4);return b.idx+=4,c},osc.writeMIDIBytes=function(a){a=osc.byteArray(a);var b=new Uint8Array(4);return b.set(a),b},osc.readColor=function(a,b){var c=new Uint8Array(a.buffer,b.idx,4),d=c[3]/255;return b.idx+=4,{r:c[0],g:c[1],b:c[2],a:d}},osc.writeColor=function(a){var b=Math.round(255*a.a),c=new Uint8Array([a.r,a.g,a.b,b]);return c},osc.readTrue=function(){return!0},osc.readFalse=function(){return!1},osc.readNull=function(){return null},osc.readImpulse=function(){return 1},osc.readTimeTag=function(a,b){var c=osc.readPrimitive(a,"getUint32",4,b),d=osc.readPrimitive(a,"getUint32",4,b),e=0===c&&1===d?Date.now():osc.ntpToJSTime(c,d);return{raw:[c,d],"native":e}},osc.writeTimeTag=function(a){var b=a.raw?a.raw:osc.jsToNTPTime(a["native"]),c=new Uint8Array(8),d=new DataView(c.buffer);return osc.writeInt32(b[0],d,0),osc.writeInt32(b[1],d,4),c},osc.timeTag=function(a){a=a||0;var b=Date.now()/1e3,c=Math.floor(b),d=b-c,e=Math.floor(a),f=a-e,g=d+f;if(g>1){var h=Math.floor(g),i=g-h;e+=h,g=i}var j=c+e+osc.SECS_70YRS,k=Math.round(osc.TWO_32*g);return{raw:[j,k]}},osc.ntpToJSTime=function(a,b){var c=a-osc.SECS_70YRS,d=b/osc.TWO_32,e=1e3*(c+d);return e},osc.jsToNTPTime=function(a){var b=a/1e3,c=Math.floor(b),d=b-c,e=c+osc.SECS_70YRS,f=Math.round(osc.TWO_32*d);return[e,f]},osc.readArguments=function(a,b,c){var d=osc.readString(a,c);if(0!==d.indexOf(","))throw new Error("A malformed type tag string was found while reading the arguments of an OSC message. String was: "+d," at offset: "+c.idx);var e=d.substring(1).split(""),f=[];return osc.readArgumentsIntoArray(f,e,d,a,b,c),f},osc.readArgument=function(a,b,c,d,e){var f=osc.argumentTypes[a];if(!f)throw new Error("'"+a+"' is not a valid OSC type tag. Type tag string was: "+b);var g=f.reader,h=osc[g](c,e);return d.metadata&&(h={type:a,value:h}),h},osc.readArgumentsIntoArray=function(a,b,c,d,e,f){for(var g=0;g<b.length;){var h,i=b[g];if("["===i){var j=b.slice(g+1),k=j.indexOf("]");if(0>k)throw new Error("Invalid argument type tag: an open array type tag ('[') was found without a matching close array tag ('[]'). Type tag was: "+c);var l=j.slice(0,k);h=osc.readArgumentsIntoArray([],l,c,d,e,f),g+=k+2}else h=osc.readArgument(i,c,d,e,f),g++;a.push(h)}return a},osc.writeArguments=function(a,b){var c=osc.collectArguments(a,b);return osc.joinParts(c)},osc.joinParts=function(a){for(var b=osc.makeByteArray(a.byteLength),c=a.parts,d=0,e=0;e<c.length;e++){var f=c[e];osc.copyByteArray(f,b,d),d+=f.length}return b},osc.addDataPart=function(a,b){b.parts.push(a),b.byteLength+=a.length},osc.writeArrayArguments=function(a,b){for(var c="[",d=0;d<a.length;d++){var e=a[d];c+=osc.writeArgument(e,b)}return c+="]"},osc.writeArgument=function(a,b){if(osc.isArray(a))return osc.writeArrayArguments(a,b);var c=a.type,d=osc.argumentTypes[c].writer;if(d){var e=osc[d](a.value);osc.addDataPart(e,b)}return a.type},osc.collectArguments=function(a,b,c){osc.isArray(a)||(a=[a]),c=c||{byteLength:0,parts:[]},b.metadata||(a=osc.annotateArguments(a));for(var d=",",e=c.parts.length,f=0;f<a.length;f++){var g=a[f];d+=osc.writeArgument(g,c)}var h=osc.writeString(d);return c.byteLength+=h.byteLength,c.parts.splice(e,0,h),c},osc.readMessage=function(a,b,c){b=b||osc.defaults;var d=osc.dataView(a);c=c||{idx:0};var e=osc.readString(d,c);return osc.readMessageContents(e,d,b,c)},osc.readMessageContents=function(a,b,c,d){if(0!==a.indexOf("/"))throw new Error("A malformed OSC address was found while reading an OSC message. String was: "+a);var e=osc.readArguments(b,c,d);return{address:a,args:1===e.length&&c.unpackSingleArgs?e[0]:e}},osc.collectMessageParts=function(a,b,c){return c=c||{byteLength:0,parts:[]},osc.addDataPart(osc.writeString(a.address),c),osc.collectArguments(a.args,b,c)},osc.writeMessage=function(a,b){b=b||osc.defaults;var c=osc.collectMessageParts(a,b);return osc.joinParts(c)},osc.readBundle=function(a,b,c){return osc.readPacket(a,b,c)},osc.collectBundlePackets=function(a,b,c){c=c||{byteLength:0,parts:[]},osc.addDataPart(osc.writeString("#bundle"),c),osc.addDataPart(osc.writeTimeTag(a.timeTag),c);for(var d=0;d<a.packets.length;d++){var e=a.packets[d],f=e.address?osc.collectMessageParts:osc.collectBundlePackets,g=f(e,b);c.byteLength+=g.byteLength,osc.addDataPart(osc.writeInt32(g.byteLength),c),c.parts=c.parts.concat(g.parts)}return c},osc.writeBundle=function(a,b){if(a.timeTag&&a.packets){b=b||osc.defaults;var c=osc.collectBundlePackets(a,b);return osc.joinParts(c)}},osc.readBundleContents=function(a,b,c,d){for(var e=osc.readTimeTag(a,c),f=[];c.idx<d;){var g=osc.readInt32(a,c),h=c.idx+g,i=osc.readPacket(a,b,c,h);f.push(i)}return{timeTag:e,packets:f}},osc.readPacket=function(a,b,c,d){var e=osc.dataView(a);d=void 0===d?e.byteLength:d,c=c||{idx:0};var f=osc.readString(e,c),g=f[0];if("#"===g)return osc.readBundleContents(e,b,c,d);if("/"===g)return osc.readMessageContents(f,e,b,c);throw new Error("The header of an OSC packet didn't contain an OSC address or a #bundle string. Header was: "+f)},osc.writePacket=function(a,b){var c=a.address?osc.writeMessage:osc.writeBundle;return c(a,b)},osc.argumentTypes={i:{reader:"readInt32",writer:"writeInt32"},h:{reader:"readInt64",writer:"writeInt64"},f:{reader:"readFloat32",writer:"writeFloat32"},s:{reader:"readString",writer:"writeString"},S:{reader:"readString",writer:"writeString"},b:{reader:"readBlob",writer:"writeBlob"},t:{reader:"readTimeTag",writer:"writeTimeTag"},T:{reader:"readTrue"},F:{reader:"readFalse"},N:{reader:"readNull"},I:{reader:"readImpulse"},d:{reader:"readFloat64",writer:"writeFloat64"},c:{reader:"readChar32",writer:"writeChar32"},r:{reader:"readColor",writer:"writeColor"},m:{reader:"readMIDIBytes",writer:"writeMIDIBytes"}},osc.inferTypeForArgument=function(a){var b=typeof a;switch(b){case"boolean":return a?"T":"F";case"string":return"s";case"number":return"f";case"undefined":return"N";case"object":if(null===a)return"N";if(a instanceof Uint8Array||a instanceof ArrayBuffer||osc.isBufferEnv&&a instanceof Buffer)return"b";if(a.high instanceof Number&&a.low instanceof Number)return"h"}throw new Error("Can't infer OSC argument type for value: "+JSON.stringify(a,null,2))},osc.annotateArguments=function(a){osc.isArray(a)||(a=[a]);for(var b=[],c=0;c<a.length;c++){var d,e=a[c];if("object"==typeof e&&e.type&&void 0!==e.value)d=e;else{var f=osc.inferTypeForArgument(e);d={type:f,value:e}}b.push(d)}return b},osc.isCommonJS&&(module.exports=osc)}(),function(a){"use strict";var b=function(a,b,c){this.low=0|a,this.high=0|b,this.unsigned=!!c};b.isLong=function(a){return(a&&a instanceof b)===!0};var c={},d={};b.fromInt=function(a,e){var f,g;return e?(a>>>=0,a>=0&&256>a&&(g=d[a])?g:(f=new b(a,0>(0|a)?-1:0,!0),a>=0&&256>a&&(d[a]=f),f)):(a=0|a,a>=-128&&128>a&&(g=c[a])?g:(f=new b(a,0>a?-1:0,!1),a>=-128&&128>a&&(c[a]=f),f))},b.fromNumber=function(a,c){return c=!!c,isNaN(a)||!isFinite(a)?b.ZERO:!c&&-i>=a?b.MIN_VALUE:!c&&a+1>=i?b.MAX_VALUE:c&&a>=h?b.MAX_UNSIGNED_VALUE:0>a?b.fromNumber(-a,c).negate():new b(a%g|0,a/g|0,c)},b.fromBits=function(a,c,d){return new b(a,c,d)},b.fromString=function(a,c,d){if(0===a.length)throw Error("number format error: empty string");if("NaN"===a||"Infinity"===a||"+Infinity"===a||"-Infinity"===a)return b.ZERO;if("number"==typeof c&&(d=c,c=!1),d=d||10,2>d||d>36)throw Error("radix out of range: "+d);var e;if((e=a.indexOf("-"))>0)throw Error('number format error: interior "-" character: '+a);if(0===e)return b.fromString(a.substring(1),c,d).negate();for(var f=b.fromNumber(Math.pow(d,8)),g=b.ZERO,h=0;h<a.length;h+=8){var i=Math.min(8,a.length-h),j=parseInt(a.substring(h,h+i),d);if(8>i){var k=b.fromNumber(Math.pow(d,i));g=g.multiply(k).add(b.fromNumber(j))}else g=g.multiply(f),g=g.add(b.fromNumber(j))}return g.unsigned=c,g},b.fromValue=function(a){return"number"==typeof a?b.fromNumber(a):"string"==typeof a?b.fromString(a):b.isLong(a)?a:new b(a.low,a.high,a.unsigned)};var e=65536,f=1<<24,g=e*e,h=g*g,i=h/2,j=b.fromInt(f);b.ZERO=b.fromInt(0),b.UZERO=b.fromInt(0,!0),b.ONE=b.fromInt(1),b.UONE=b.fromInt(1,!0),b.NEG_ONE=b.fromInt(-1),b.MAX_VALUE=b.fromBits(-1,2147483647,!1),b.MAX_UNSIGNED_VALUE=b.fromBits(-1,-1,!0),b.MIN_VALUE=b.fromBits(0,-2147483648,!1),b.prototype.toInt=function(){return this.unsigned?this.low>>>0:this.low},b.prototype.toNumber=function(){return this.unsigned?(this.high>>>0)*g+(this.low>>>0):this.high*g+(this.low>>>0)},b.prototype.toString=function(a){if(a=a||10,2>a||a>36)throw RangeError("radix out of range: "+a);if(this.isZero())return"0";var c;if(this.isNegative()){if(this.equals(b.MIN_VALUE)){var d=b.fromNumber(a),e=this.div(d);return c=e.multiply(d).subtract(this),e.toString(a)+c.toInt().toString(a)}return"-"+this.negate().toString(a)}var f=b.fromNumber(Math.pow(a,6),this.unsigned);c=this;for(var g="";;){var h=c.div(f),i=c.subtract(h.multiply(f)).toInt()>>>0,j=i.toString(a);if(c=h,c.isZero())return j+g;for(;j.length<6;)j="0"+j;g=""+j+g}},b.prototype.getHighBits=function(){return this.high},b.prototype.getHighBitsUnsigned=function(){return this.high>>>0},b.prototype.getLowBits=function(){return this.low},b.prototype.getLowBitsUnsigned=function(){return this.low>>>0},b.prototype.getNumBitsAbs=function(){if(this.isNegative())return this.equals(b.MIN_VALUE)?64:this.negate().getNumBitsAbs();for(var a=0!=this.high?this.high:this.low,c=31;c>0&&0==(a&1<<c);c--);return 0!=this.high?c+33:c+1},b.prototype.isZero=function(){return 0===this.high&&0===this.low},b.prototype.isNegative=function(){return!this.unsigned&&this.high<0},b.prototype.isPositive=function(){return this.unsigned||this.high>=0},b.prototype.isOdd=function(){return 1===(1&this.low)},b.prototype.isEven=function(){return 0===(1&this.low)},b.prototype.equals=function(a){return b.isLong(a)||(a=b.fromValue(a)),this.unsigned!==a.unsigned&&this.high>>>31===1&&a.high>>>31===1?!1:this.high===a.high&&this.low===a.low},b.prototype.notEquals=function(a){return b.isLong(a)||(a=b.fromValue(a)),!this.equals(a)},b.prototype.lessThan=function(a){return b.isLong(a)||(a=b.fromValue(a)),this.compare(a)<0},b.prototype.lessThanOrEqual=function(a){return b.isLong(a)||(a=b.fromValue(a)),this.compare(a)<=0},b.prototype.greaterThan=function(a){return b.isLong(a)||(a=b.fromValue(a)),this.compare(a)>0},b.prototype.greaterThanOrEqual=function(a){return b.isLong(a)||(a=b.fromValue(a)),this.compare(a)>=0},b.prototype.compare=function(a){if(this.equals(a))return 0;var b=this.isNegative(),c=a.isNegative();return b&&!c?-1:!b&&c?1:this.unsigned?a.high>>>0>this.high>>>0||a.high===this.high&&a.low>>>0>this.low>>>0?-1:1:this.subtract(a).isNegative()?-1:1},b.prototype.negate=function(){return!this.unsigned&&this.equals(b.MIN_VALUE)?b.MIN_VALUE:this.not().add(b.ONE)},b.prototype.add=function(a){b.isLong(a)||(a=b.fromValue(a));var c=this.high>>>16,d=65535&this.high,e=this.low>>>16,f=65535&this.low,g=a.high>>>16,h=65535&a.high,i=a.low>>>16,j=65535&a.low,k=0,l=0,m=0,n=0;return n+=f+j,m+=n>>>16,n&=65535,m+=e+i,l+=m>>>16,m&=65535,l+=d+h,k+=l>>>16,l&=65535,k+=c+g,k&=65535,b.fromBits(m<<16|n,k<<16|l,this.unsigned)},b.prototype.subtract=function(a){return b.isLong(a)||(a=b.fromValue(a)),this.add(a.negate())},b.prototype.multiply=function(a){if(this.isZero())return b.ZERO;if(b.isLong(a)||(a=b.fromValue(a)),a.isZero())return b.ZERO;if(this.equals(b.MIN_VALUE))return a.isOdd()?b.MIN_VALUE:b.ZERO;if(a.equals(b.MIN_VALUE))return this.isOdd()?b.MIN_VALUE:b.ZERO;if(this.isNegative())return a.isNegative()?this.negate().multiply(a.negate()):this.negate().multiply(a).negate();if(a.isNegative())return this.multiply(a.negate()).negate();if(this.lessThan(j)&&a.lessThan(j))return b.fromNumber(this.toNumber()*a.toNumber(),this.unsigned);var c=this.high>>>16,d=65535&this.high,e=this.low>>>16,f=65535&this.low,g=a.high>>>16,h=65535&a.high,i=a.low>>>16,k=65535&a.low,l=0,m=0,n=0,o=0;return o+=f*k,n+=o>>>16,o&=65535,n+=e*k,m+=n>>>16,n&=65535,n+=f*i,m+=n>>>16,n&=65535,m+=d*k,l+=m>>>16,m&=65535,m+=e*i,l+=m>>>16,m&=65535,m+=f*h,l+=m>>>16,m&=65535,l+=c*k+d*i+e*h+f*g,l&=65535,b.fromBits(n<<16|o,l<<16|m,this.unsigned)},b.prototype.div=function(a){if(b.isLong(a)||(a=b.fromValue(a)),a.isZero())throw new Error("division by zero");if(this.isZero())return this.unsigned?b.UZERO:b.ZERO;var c,d,e;if(this.equals(b.MIN_VALUE)){if(a.equals(b.ONE)||a.equals(b.NEG_ONE))return b.MIN_VALUE;if(a.equals(b.MIN_VALUE))return b.ONE;var f=this.shiftRight(1);return c=f.div(a).shiftLeft(1),c.equals(b.ZERO)?a.isNegative()?b.ONE:b.NEG_ONE:(d=this.subtract(a.multiply(c)),e=c.add(d.div(a)))}if(a.equals(b.MIN_VALUE))return this.unsigned?b.UZERO:b.ZERO;if(this.isNegative())return a.isNegative()?this.negate().div(a.negate()):this.negate().div(a).negate();if(a.isNegative())return this.div(a.negate()).negate();for(e=b.ZERO,d=this;d.greaterThanOrEqual(a);){c=Math.max(1,Math.floor(d.toNumber()/a.toNumber()));for(var g=Math.ceil(Math.log(c)/Math.LN2),h=48>=g?1:Math.pow(2,g-48),i=b.fromNumber(c),j=i.multiply(a);j.isNegative()||j.greaterThan(d);)c-=h,i=b.fromNumber(c,this.unsigned),j=i.multiply(a);i.isZero()&&(i=b.ONE),e=e.add(i),d=d.subtract(j)}return e},b.prototype.modulo=function(a){return b.isLong(a)||(a=b.fromValue(a)),this.subtract(this.div(a).multiply(a))},b.prototype.not=function(){return b.fromBits(~this.low,~this.high,this.unsigned)},b.prototype.and=function(a){return b.isLong(a)||(a=b.fromValue(a)),b.fromBits(this.low&a.low,this.high&a.high,this.unsigned)},b.prototype.or=function(a){return b.isLong(a)||(a=b.fromValue(a)),b.fromBits(this.low|a.low,this.high|a.high,this.unsigned)},b.prototype.xor=function(a){return b.isLong(a)||(a=b.fromValue(a)),b.fromBits(this.low^a.low,this.high^a.high,this.unsigned)},b.prototype.shiftLeft=function(a){return b.isLong(a)&&(a=a.toInt()),0===(a&=63)?this:32>a?b.fromBits(this.low<<a,this.high<<a|this.low>>>32-a,this.unsigned):b.fromBits(0,this.low<<a-32,this.unsigned)},b.prototype.shiftRight=function(a){return b.isLong(a)&&(a=a.toInt()),0===(a&=63)?this:32>a?b.fromBits(this.low>>>a|this.high<<32-a,this.high>>a,this.unsigned):b.fromBits(this.high>>a-32,this.high>=0?0:-1,this.unsigned)},b.prototype.shiftRightUnsigned=function(a){if(b.isLong(a)&&(a=a.toInt()),a&=63,0===a)return this;var c=this.high;if(32>a){var d=this.low;return b.fromBits(d>>>a|c<<32-a,c>>>a,this.unsigned)}return 32===a?b.fromBits(c,0,this.unsigned):b.fromBits(c>>>a-32,0,this.unsigned)},b.prototype.toSigned=function(){return this.unsigned?new b(this.low,this.high,!1):this},b.prototype.toUnsigned=function(){return this.unsigned?this:new b(this.low,this.high,!0)},"function"==typeof require&&"object"==typeof module&&module&&"object"==typeof exports&&exports?module.exports=b:"function"==typeof define&&define.amd?define(function(){return b}):(a.dcodeIO=a.dcodeIO||{}).Long=b}(this),function(a,b){"use strict";"object"==typeof exports?(a.slip=exports,b(exports)):"function"==typeof define&&define.amd?define(["exports"],function(c){return a.slip=c,a.slip,b(c)}):(a.slip={},b(a.slip))}(this,function(a){"use strict";var b=a;b.END=192,b.ESC=219,b.ESC_END=220,b.ESC_ESC=221,b.byteArray=function(a,b,c){return a instanceof ArrayBuffer?new Uint8Array(a,b,c):a},b.expandByteArray=function(a){var b=new Uint8Array(2*a.length);return b.set(a),b},b.sliceByteArray=function(a,b,c){var d=a.buffer.slice?a.buffer.slice(b,c):a.subarray(b,c);return new Uint8Array(d)},b.encode=function(a,c){c=c||{},c.bufferPadding=c.bufferPadding||4,a=b.byteArray(a,c.offset,c.byteLength);var d=a.length+c.bufferPadding+3&-4,e=new Uint8Array(d),f=1;e[0]=b.END;for(var g=0;g<a.length;g++){f>e.length-3&&(e=b.expandByteArray(e));var h=a[g];h===b.END?(e[f++]=b.ESC,h=b.ESC_END):h===b.ESC&&(e[f++]=b.ESC,h=b.ESC_ESC),e[f++]=h}return e[f]=b.END,b.sliceByteArray(e,0,f+1)},b.Decoder=function(a){a="function"!=typeof a?a||{}:{onMessage:a},this.maxMessageSize=a.maxMessageSize||10485760,this.bufferSize=a.bufferSize||1024,this.msgBuffer=new Uint8Array(this.bufferSize),this.msgBufferIdx=0,this.onMessage=a.onMessage,this.onError=a.onError,this.escape=!1};var c=b.Decoder.prototype;return c.decode=function(a){a=b.byteArray(a);for(var c,d=0;d<a.length;d++){var e=a[d];if(this.escape)e===b.ESC_ESC?e=b.ESC:e===b.ESC_END&&(e=b.END);else{if(e===b.ESC){this.escape=!0;continue}if(e===b.END){c=this.handleEnd();continue}}var f=this.addByte(e);f||this.handleMessageMaxError()}return c},c.handleMessageMaxError=function(){this.onError&&this.onError(this.msgBuffer.subarray(0),"The message is too large; the maximum message size is "+this.maxMessageSize/1024+"KB. Use a larger maxMessageSize if necessary."),this.msgBufferIdx=0,this.escape=!1},c.addByte=function(a){return this.msgBufferIdx>this.msgBuffer.length-1&&(this.msgBuffer=b.expandByteArray(this.msgBuffer)),this.msgBuffer[this.msgBufferIdx++]=a,this.escape=!1,this.msgBuffer.length<this.maxMessageSize},c.handleEnd=function(){if(0!==this.msgBufferIdx){var a=b.sliceByteArray(this.msgBuffer,0,this.msgBufferIdx);return this.onMessage&&this.onMessage(a),this.msgBufferIdx=0,a}},b}),function(){"use strict";function a(){}function b(a,b){for(var c=a.length;c--;)if(a[c].listener===b)return c;return-1}function c(a){return function(){return this[a].apply(this,arguments)}}var d=a.prototype,e=this,f=e.EventEmitter;d.getListeners=function(a){var b,c,d=this._getEvents();if(a instanceof RegExp){b={};for(c in d)d.hasOwnProperty(c)&&a.test(c)&&(b[c]=d[c])}else b=d[a]||(d[a]=[]);return b},d.flattenListeners=function(a){var b,c=[];for(b=0;b<a.length;b+=1)c.push(a[b].listener);return c},d.getListenersAsObject=function(a){var b,c=this.getListeners(a);return c instanceof Array&&(b={},b[a]=c),b||c},d.addListener=function(a,c){var d,e=this.getListenersAsObject(a),f="object"==typeof c;for(d in e)e.hasOwnProperty(d)&&-1===b(e[d],c)&&e[d].push(f?c:{listener:c,once:!1});return this},d.on=c("addListener"),d.addOnceListener=function(a,b){return this.addListener(a,{listener:b,once:!0})},d.once=c("addOnceListener"),d.defineEvent=function(a){return this.getListeners(a),this},d.defineEvents=function(a){for(var b=0;b<a.length;b+=1)this.defineEvent(a[b]);return this},d.removeListener=function(a,c){var d,e,f=this.getListenersAsObject(a);for(e in f)f.hasOwnProperty(e)&&(d=b(f[e],c),-1!==d&&f[e].splice(d,1));return this},d.off=c("removeListener"),d.addListeners=function(a,b){return this.manipulateListeners(!1,a,b)},d.removeListeners=function(a,b){return this.manipulateListeners(!0,a,b)},d.manipulateListeners=function(a,b,c){var d,e,f=a?this.removeListener:this.addListener,g=a?this.removeListeners:this.addListeners;if("object"!=typeof b||b instanceof RegExp)for(d=c.length;d--;)f.call(this,b,c[d]);else for(d in b)b.hasOwnProperty(d)&&(e=b[d])&&("function"==typeof e?f.call(this,d,e):g.call(this,d,e));return this},d.removeEvent=function(a){var b,c=typeof a,d=this._getEvents();if("string"===c)delete d[a];else if(a instanceof RegExp)for(b in d)d.hasOwnProperty(b)&&a.test(b)&&delete d[b];else delete this._events;return this},d.removeAllListeners=c("removeEvent"),d.emitEvent=function(a,b){var c,d,e,f,g=this.getListenersAsObject(a);for(e in g)if(g.hasOwnProperty(e))for(d=g[e].length;d--;)c=g[e][d],c.once===!0&&this.removeListener(a,c.listener),f=c.listener.apply(this,b||[]),f===this._getOnceReturnValue()&&this.removeListener(a,c.listener);return this},d.trigger=c("emitEvent"),d.emit=function(a){var b=Array.prototype.slice.call(arguments,1);return this.emitEvent(a,b)},d.setOnceReturnValue=function(a){return this._onceReturnValue=a,this},d._getOnceReturnValue=function(){return this.hasOwnProperty("_onceReturnValue")?this._onceReturnValue:!0},d._getEvents=function(){return this._events||(this._events={})},a.noConflict=function(){return e.EventEmitter=f,a},"function"==typeof define&&define.amd?define(function(){return a}):"object"==typeof module&&module.exports?module.exports=a:e.EventEmitter=a}.call(this);var osc=osc||require("./osc.js"),slip=slip||require("slip"),EventEmitter=EventEmitter||require("events").EventEmitter;!function(){"use strict";osc.firePacketEvents=function(a,b,c){b.address?a.emit("message",b,c):osc.fireBundleEvents(a,b,c)},osc.fireBundleEvents=function(a,b,c){a.emit("bundle",b,c);for(var d=0;d<b.packets.length;d++){var e=b.packets[d];osc.firePacketEvents(a,e,b.timeTag)}},osc.Port=function(a){this.options=a||{},this.on("data",this.decodeOSC.bind(this))};var a=osc.Port.prototype=Object.create(EventEmitter.prototype);a.constructor=osc.Port,a.send=function(a){var b=Array.prototype.slice.call(arguments),c=this.encodeOSC(a);b[0]=c,this.sendRaw.apply(this,b)},a.encodeOSC=function(a){a=a.buffer?a.buffer:a;var b=osc.writePacket(a,this.options);return b},a.decodeOSC=function(a){this.emit("raw",a);var b=osc.readPacket(a,this.options);this.emit("osc",b),osc.firePacketEvents(this,b)},osc.SLIPPort=function(a){var b=this,c=this.options=a||{};c.useSLIP=void 0===c.useSLIP?!0:c.useSLIP,this.decoder=new slip.Decoder({onMessage:this.decodeOSC.bind(this),onError:function(a){b.emit("error",a)}});var d=c.useSLIP?this.decodeSLIPData:this.decodeOSC;this.on("data",d.bind(this))},a=osc.SLIPPort.prototype=Object.create(osc.Port.prototype),a.constructor=osc.SLIPPort,a.encodeOSC=function(a){a=a.buffer?a.buffer:a;var b=osc.writePacket(a,this.options);return slip.encode(b)},a.decodeSLIPData=function(a){this.decoder.decode(a)},osc.relay=function(a,b,c,d,e,f){c=c||"message",d=d||"send",e=e||function(){},f=f?[null].concat(f):[];var g=function(a){f[0]=a,a=e(a),b[d].apply(b,f)};return a.on(c,g),{eventName:c,listener:g}},osc.relayPorts=function(a,b,c){var d=c.raw?"raw":"osc",e=c.raw?"sendRaw":"send";return osc.relay(a,b,d,e,c.transform)},osc.stopRelaying=function(a,b){a.removeListener(b.eventName,b.listener)},osc.Relay=function(a,b,c){var d=this.options=c||{};d.raw=!1,this.port1=a,this.port2=b,this.listen()},a=osc.Relay.prototype=Object.create(EventEmitter.prototype),a.constructor=osc.Relay,a.open=function(){this.port1.open(),this.port2.open()},a.listen=function(){this.port1Spec&&this.port2Spec&&this.close(),this.port1Spec=osc.relayPorts(this.port1,this.port2,this.options),this.port2Spec=osc.relayPorts(this.port2,this.port1,this.options);var a=this.close.bind(this);this.port1.on("close",a),this.port2.on("close",a)},a.close=function(){osc.stopRelaying(this.port1,this.port1Spec),osc.stopRelaying(this.port2,this.port2Spec),this.emit("close",this.port1,this.port2)},"undefined"!=typeof module&&module.exports&&(module.exports=osc)}();var osc=osc;!function(){"use strict";osc.WebSocketPort=function(a){osc.Port.call(this,a),this.on("open",this.listen.bind(this))};var a=osc.WebSocketPort.prototype=Object.create(osc.Port.prototype);a.constructor=osc.WebSocketPort,a.open=function(){this.socket=new WebSocket(this.options.url),this.socket.binaryType="arraybuffer";var a=this;this.socket.onopen=function(){a.emit("open",a.socket)}},a.listen=function(){var a=this;this.socket.onmessage=function(b){a.emit("data",b.data)},this.socket.onerror=function(b){a.emit("error",b)},this.socket.onclose=function(b){a.emit("close",b)},a.emit("ready")},a.sendRaw=function(a){this.socket&&this.socket.send(a.buffer)},a.close=function(a,b){this.socket.close(a,b)}}();var osc=osc||{};!function(){"use strict";osc.listenToTransport=function(a,b,c){b.onReceive.addListener(function(b){b[c]===a[c]&&a.emit("data",b.data)}),b.onReceiveError.addListener(function(b){a.emit("error",b)}),a.emit("ready")},osc.emitNetworkError=function(a,b){a.emit("error","There was an error while opening the UDP socket connection. Result code: "+b)},osc.SerialPort=function(a){this.on("open",this.listen.bind(this)),osc.SLIPPort.call(this,a)};var a=osc.SerialPort.prototype=Object.create(osc.SLIPPort.prototype);a.constructor=osc.SerialPort,a.open=function(){var a=this,b={bitrate:a.options.bitrate};chrome.serial.connect(this.options.devicePath,b,function(b){a.connectionId=b.connectionId,a.emit("open",b)})},a.listen=function(){osc.listenToTransport(this,chrome.serial,"connectionId")},a.sendRaw=function(a){if(this.connectionId){var b=this;chrome.serial.send(this.connectionId,a.buffer,function(a,c){c&&b.emit("error",c+". Total bytes sent: "+a)})}},a.close=function(){if(this.connectionId){var a=this;chrome.serial.disconnect(this.connectionId,function(b){b&&a.emit("close")})}},osc.UDPPort=function(a){osc.Port.call(this,a);var b=this.options;b.localAddress=b.localAddress||"127.0.0.1",b.localPort=void 0!==b.localPort?b.localPort:57121,this.on("open",this.listen.bind(this))},a=osc.UDPPort.prototype=Object.create(osc.Port.prototype),a.constructor=osc.UDPPort,a.open=function(){var a=this.options,b={persistent:a.persistent,name:a.name,bufferSize:a.bufferSize},c=this;chrome.sockets.udp.create(b,function(a){c.socketId=a.socketId,c.bindSocket()})},a.bindSocket=function(){var a=this,b=this.options;chrome.sockets.udp.bind(this.socketId,b.localAddress,b.localPort,function(b){return b>0?void osc.emitNetworkError(a,b):void a.emit("open",b)})},a.listen=function(){osc.listenToTransport(this,chrome.sockets.udp,"socketId")},a.sendRaw=function(a,b,c){if(this.socketId){var d=this.options,e=this;b=b||d.remoteAddress,c=void 0!==c?c:d.remotePort,chrome.sockets.udp.send(this.socketId,a.buffer,b,c,function(a){a||e.emit("error","There was an unknown error while trying to send a UDP message. Have you declared the appropriate udp send permissions in your application's manifest file?"),a.resultCode>0&&osc.emitNetworkError(e,a.resultCode)})}},a.close=function(){if(this.socketId){var a=this;chrome.sockets.udp.close(this.socketId,function(){a.emit("close")})}}}();

@@ -1,2 +0,2 @@

/*! osc.js 1.2.0, Copyright 2015 Colin Clark | github.com/colinbdclark/osc.js */
/*! osc.js 1.2.1, Copyright 2015 Colin Clark | github.com/colinbdclark/osc.js */

@@ -3,0 +3,0 @@ (function (root, factory) {

@@ -1,3 +0,3 @@

/*! osc.js 1.2.0, Copyright 2015 Colin Clark | github.com/colinbdclark/osc.js */
/*! osc.js 1.2.1, Copyright 2015 Colin Clark | github.com/colinbdclark/osc.js */
!function(a,b){"object"==typeof exports?(a.osc=exports,b(exports,require("slip"),require("EventEmitter"),require("long"))):"function"==typeof define&&define.amd?define(["exports","slip","EventEmitter","long"],function(c,d,e,f){return a.osc=c,a.osc,b(c,d,e,f)}):(a.osc={},b(a.osc,slip,EventEmitter))}(this,function(a,b,c,d){var e=e||{};!function(){"use strict";e.SECS_70YRS=2208988800,e.TWO_32=4294967296,e.defaults={metadata:!1,unpackSingleArgs:!0},e.isBufferEnv="undefined"!=typeof Buffer,e.isCommonJS="undefined"!=typeof module&&module.exports,e.isNode=e.isCommonJS&&"undefined"==typeof window,e.isArray=function(a){return a&&"[object Array]"===Object.prototype.toString.call(a)},e.isTypedArrayView=function(a){return a.buffer&&a.buffer instanceof ArrayBuffer},e.isBuffer=function(a){return e.isBufferEnv&&a instanceof Buffer};var a=e.isNode?require("buffer-dataview"):void 0,b="undefined"!=typeof dcodeIO?dcodeIO.Long:"undefined"!=typeof b?b:e.isNode?require("long"):void 0;e.dataView=function(b){return b instanceof DataView?b:"undefined"!=typeof a&&b instanceof a?b:e.isBufferEnv&&b instanceof Buffer?new a(b):b.buffer?new DataView(b.buffer):b instanceof ArrayBuffer?new DataView(b):new DataView(new Uint8Array(b))},e.byteArray=function(a){if(a instanceof Uint8Array)return a;var b=a.buffer?a.buffer:a;if("undefined"==typeof a.length||"string"==typeof a)throw new Error("Can't wrap a non-array-like object as Uint8Array. Object was: "+JSON.stringify(a,null,2));return new Uint8Array(b)},e.makeByteArray=function(a){return e.isBufferEnv?new Buffer(a):new Uint8Array(a)},e.copyByteArray=function(a,b,c){if(e.isTypedArrayView(a)&&e.isTypedArrayView(b))b.set(a,c);else if(e.isBuffer(a)&&e.isBuffer(b))a.copy(b,c);else for(var d=void 0===c?0:c,f=Math.min(b.length-c,a.length),g=0,h=d;f>g;g++,h++)b[h]=a[g];return b},e.readString=function(a,b){for(var c=[],d=b.idx;d<a.byteLength;d++){var e=a.getUint8(d);if(0===e){d++;break}c.push(e)}return d=d+3&-4,b.idx=d,String.fromCharCode.apply(null,c)},e.writeString=function(a){for(var b=a+"\x00",c=b.length,d=c+3&-4,e=new Uint8Array(d),f=0;f<b.length;f++){var g=b.charCodeAt(f);e[f]=g}return e},e.readPrimitive=function(a,b,c,d){var e=a[b](d.idx,!1);return d.idx+=c,e},e.writePrimitive=function(a,b,c,d,e){e=void 0===e?0:e;var f;return b?f=new Uint8Array(b.buffer):(f=new Uint8Array(d),b=new DataView(f.buffer)),b[c](e,a,!1),f},e.readInt32=function(a,b){return e.readPrimitive(a,"getInt32",4,b)},e.writeInt32=function(a,b,c){return e.writePrimitive(a,b,"setInt32",4,c)},e.readInt64=function(a,c){var d=e.readPrimitive(a,"getInt32",4,c),f=e.readPrimitive(a,"getInt32",4,c);return b?new b(f,d):{high:d,low:f,unsigned:!1}},e.writeInt64=function(a,b,c){var d=new Uint8Array(8);return d.set(e.writePrimitive(a.high,b,"setInt32",4,c),0),d.set(e.writePrimitive(a.low,b,"setInt32",4,c+4),4),d},e.readFloat32=function(a,b){return e.readPrimitive(a,"getFloat32",4,b)},e.writeFloat32=function(a,b,c){return e.writePrimitive(a,b,"setFloat32",4,c)},e.readFloat64=function(a,b){return e.readPrimitive(a,"getFloat64",8,b)},e.writeFloat64=function(a,b,c){return e.writePrimitive(a,b,"setFloat64",8,c)},e.readChar32=function(a,b){var c=e.readPrimitive(a,"getUint32",4,b);return String.fromCharCode(c)},e.writeChar32=function(a,b,c){var d=a.charCodeAt(0);return void 0===d||-1>d?void 0:e.writePrimitive(d,b,"setUint32",4,c)},e.readBlob=function(a,b){var c=e.readInt32(a,b),d=c+3&-4,f=new Uint8Array(a.buffer,b.idx,c);return b.idx+=d,f},e.writeBlob=function(a){a=e.byteArray(a);var b=a.byteLength,c=b+3&-4,d=4,f=c+d,g=new Uint8Array(f),h=new DataView(g.buffer);return e.writeInt32(b,h),g.set(a,d),g},e.readMIDIBytes=function(a,b){var c=new Uint8Array(a.buffer,b.idx,4);return b.idx+=4,c},e.writeMIDIBytes=function(a){a=e.byteArray(a);var b=new Uint8Array(4);return b.set(a),b},e.readColor=function(a,b){var c=new Uint8Array(a.buffer,b.idx,4),d=c[3]/255;return b.idx+=4,{r:c[0],g:c[1],b:c[2],a:d}},e.writeColor=function(a){var b=Math.round(255*a.a),c=new Uint8Array([a.r,a.g,a.b,b]);return c},e.readTrue=function(){return!0},e.readFalse=function(){return!1},e.readNull=function(){return null},e.readImpulse=function(){return 1},e.readTimeTag=function(a,b){var c=e.readPrimitive(a,"getUint32",4,b),d=e.readPrimitive(a,"getUint32",4,b),f=0===c&&1===d?Date.now():e.ntpToJSTime(c,d);return{raw:[c,d],"native":f}},e.writeTimeTag=function(a){var b=a.raw?a.raw:e.jsToNTPTime(a["native"]),c=new Uint8Array(8),d=new DataView(c.buffer);return e.writeInt32(b[0],d,0),e.writeInt32(b[1],d,4),c},e.timeTag=function(a){a=a||0;var b=Date.now()/1e3,c=Math.floor(b),d=b-c,f=Math.floor(a),g=a-f,h=d+g;if(h>1){var i=Math.floor(h),j=h-i;f+=i,h=j}var k=c+f+e.SECS_70YRS,l=Math.round(e.TWO_32*h);return{raw:[k,l]}},e.ntpToJSTime=function(a,b){var c=a-e.SECS_70YRS,d=b/e.TWO_32,f=1e3*(c+d);return f},e.jsToNTPTime=function(a){var b=a/1e3,c=Math.floor(b),d=b-c,f=c+e.SECS_70YRS,g=Math.round(e.TWO_32*d);return[f,g]},e.readArguments=function(a,b,c){var d=e.readString(a,c);if(0!==d.indexOf(","))throw new Error("A malformed type tag string was found while reading the arguments of an OSC message. String was: "+d," at offset: "+c.idx);var f=d.substring(1).split(""),g=[];return e.readArgumentsIntoArray(g,f,d,a,b,c),g},e.readArgument=function(a,b,c,d,f){var g=e.argumentTypes[a];if(!g)throw new Error("'"+a+"' is not a valid OSC type tag. Type tag string was: "+b);var h=g.reader,i=e[h](c,f);return d.metadata&&(i={type:a,value:i}),i},e.readArgumentsIntoArray=function(a,b,c,d,f,g){for(var h=0;h<b.length;){var i,j=b[h];if("["===j){var k=b.slice(h+1),l=k.indexOf("]");if(0>l)throw new Error("Invalid argument type tag: an open array type tag ('[') was found without a matching close array tag ('[]'). Type tag was: "+c);var m=k.slice(0,l);i=e.readArgumentsIntoArray([],m,c,d,f,g),h+=l+2}else i=e.readArgument(j,c,d,f,g),h++;a.push(i)}return a},e.writeArguments=function(a,b){var c=e.collectArguments(a,b);return e.joinParts(c)},e.joinParts=function(a){for(var b=e.makeByteArray(a.byteLength),c=a.parts,d=0,f=0;f<c.length;f++){var g=c[f];e.copyByteArray(g,b,d),d+=g.length}return b},e.addDataPart=function(a,b){b.parts.push(a),b.byteLength+=a.length},e.writeArrayArguments=function(a,b){for(var c="[",d=0;d<a.length;d++){var f=a[d];c+=e.writeArgument(f,b)}return c+="]"},e.writeArgument=function(a,b){if(e.isArray(a))return e.writeArrayArguments(a,b);var c=a.type,d=e.argumentTypes[c].writer;if(d){var f=e[d](a.value);e.addDataPart(f,b)}return a.type},e.collectArguments=function(a,b,c){e.isArray(a)||(a=[a]),c=c||{byteLength:0,parts:[]},b.metadata||(a=e.annotateArguments(a));for(var d=",",f=c.parts.length,g=0;g<a.length;g++){var h=a[g];d+=e.writeArgument(h,c)}var i=e.writeString(d);return c.byteLength+=i.byteLength,c.parts.splice(f,0,i),c},e.readMessage=function(a,b,c){b=b||e.defaults;var d=e.dataView(a);c=c||{idx:0};var f=e.readString(d,c);return e.readMessageContents(f,d,b,c)},e.readMessageContents=function(a,b,c,d){if(0!==a.indexOf("/"))throw new Error("A malformed OSC address was found while reading an OSC message. String was: "+a);var f=e.readArguments(b,c,d);return{address:a,args:1===f.length&&c.unpackSingleArgs?f[0]:f}},e.collectMessageParts=function(a,b,c){return c=c||{byteLength:0,parts:[]},e.addDataPart(e.writeString(a.address),c),e.collectArguments(a.args,b,c)},e.writeMessage=function(a,b){b=b||e.defaults;var c=e.collectMessageParts(a,b);return e.joinParts(c)},e.readBundle=function(a,b,c){return e.readPacket(a,b,c)},e.collectBundlePackets=function(a,b,c){c=c||{byteLength:0,parts:[]},e.addDataPart(e.writeString("#bundle"),c),e.addDataPart(e.writeTimeTag(a.timeTag),c);for(var d=0;d<a.packets.length;d++){var f=a.packets[d],g=f.address?e.collectMessageParts:e.collectBundlePackets,h=g(f,b);c.byteLength+=h.byteLength,e.addDataPart(e.writeInt32(h.byteLength),c),c.parts=c.parts.concat(h.parts)}return c},e.writeBundle=function(a,b){if(a.timeTag&&a.packets){b=b||e.defaults;var c=e.collectBundlePackets(a,b);return e.joinParts(c)}},e.readBundleContents=function(a,b,c,d){for(var f=e.readTimeTag(a,c),g=[];c.idx<d;){var h=e.readInt32(a,c),i=c.idx+h,j=e.readPacket(a,b,c,i);g.push(j)}return{timeTag:f,packets:g}},e.readPacket=function(a,b,c,d){var f=e.dataView(a);d=void 0===d?f.byteLength:d,c=c||{idx:0};var g=e.readString(f,c),h=g[0];if("#"===h)return e.readBundleContents(f,b,c,d);if("/"===h)return e.readMessageContents(g,f,b,c);throw new Error("The header of an OSC packet didn't contain an OSC address or a #bundle string. Header was: "+g)},e.writePacket=function(a,b){var c=a.address?e.writeMessage:e.writeBundle;return c(a,b)},e.argumentTypes={i:{reader:"readInt32",writer:"writeInt32"},h:{reader:"readInt64",writer:"writeInt64"},f:{reader:"readFloat32",writer:"writeFloat32"},s:{reader:"readString",writer:"writeString"},S:{reader:"readString",writer:"writeString"},b:{reader:"readBlob",writer:"writeBlob"},t:{reader:"readTimeTag",writer:"writeTimeTag"},T:{reader:"readTrue"},F:{reader:"readFalse"},N:{reader:"readNull"},I:{reader:"readImpulse"},d:{reader:"readFloat64",writer:"writeFloat64"},c:{reader:"readChar32",writer:"writeChar32"},r:{reader:"readColor",writer:"writeColor"},m:{reader:"readMIDIBytes",writer:"writeMIDIBytes"}},e.inferTypeForArgument=function(a){var b=typeof a;switch(b){case"boolean":return a?"T":"F";case"string":return"s";case"number":return"f";case"undefined":return"N";case"object":if(null===a)return"N";if(a instanceof Uint8Array||a instanceof ArrayBuffer||e.isBufferEnv&&a instanceof Buffer)return"b";if(a.high instanceof Number&&a.low instanceof Number)return"h"}throw new Error("Can't infer OSC argument type for value: "+JSON.stringify(a,null,2))},e.annotateArguments=function(a){e.isArray(a)||(a=[a]);for(var b=[],c=0;c<a.length;c++){var d,f=a[c];if("object"==typeof f&&f.type&&void 0!==f.value)d=f;else{var g=e.inferTypeForArgument(f);d={type:g,value:f}}b.push(d)}return b},e.isCommonJS&&(module.exports=e)}();var e=e||require("./osc.js"),b=b||require("slip"),c=c||require("events").EventEmitter;!function(){"use strict";e.firePacketEvents=function(a,b,c){b.address?a.emit("message",b,c):e.fireBundleEvents(a,b,c)},e.fireBundleEvents=function(a,b,c){a.emit("bundle",b,c);for(var d=0;d<b.packets.length;d++){var f=b.packets[d];e.firePacketEvents(a,f,b.timeTag)}},e.Port=function(a){this.options=a||{},this.on("data",this.decodeOSC.bind(this))};var a=e.Port.prototype=Object.create(c.prototype);a.constructor=e.Port,a.send=function(a){var b=Array.prototype.slice.call(arguments),c=this.encodeOSC(a);b[0]=c,this.sendRaw.apply(this,b)},a.encodeOSC=function(a){a=a.buffer?a.buffer:a;var b=e.writePacket(a,this.options);return b},a.decodeOSC=function(a){this.emit("raw",a);var b=e.readPacket(a,this.options);this.emit("osc",b),e.firePacketEvents(this,b)},e.SLIPPort=function(a){var c=this,d=this.options=a||{};d.useSLIP=void 0===d.useSLIP?!0:d.useSLIP,this.decoder=new b.Decoder({onMessage:this.decodeOSC.bind(this),onError:function(a){c.emit("error",a)}});var e=d.useSLIP?this.decodeSLIPData:this.decodeOSC;this.on("data",e.bind(this))},a=e.SLIPPort.prototype=Object.create(e.Port.prototype),a.constructor=e.SLIPPort,a.encodeOSC=function(a){a=a.buffer?a.buffer:a;var c=e.writePacket(a,this.options);return b.encode(c)},a.decodeSLIPData=function(a){this.decoder.decode(a)},e.relay=function(a,b,c,d,e,f){c=c||"message",d=d||"send",e=e||function(){},f=f?[null].concat(f):[];var g=function(a){f[0]=a,a=e(a),b[d].apply(b,f)};return a.on(c,g),{eventName:c,listener:g}},e.relayPorts=function(a,b,c){var d=c.raw?"raw":"osc",f=c.raw?"sendRaw":"send";return e.relay(a,b,d,f,c.transform)},e.stopRelaying=function(a,b){a.removeListener(b.eventName,b.listener)},e.Relay=function(a,b,c){var d=this.options=c||{};d.raw=!1,this.port1=a,this.port2=b,this.listen()},a=e.Relay.prototype=Object.create(c.prototype),a.constructor=e.Relay,a.open=function(){this.port1.open(),this.port2.open()},a.listen=function(){this.port1Spec&&this.port2Spec&&this.close(),this.port1Spec=e.relayPorts(this.port1,this.port2,this.options),this.port2Spec=e.relayPorts(this.port2,this.port1,this.options);var a=this.close.bind(this);this.port1.on("close",a),this.port2.on("close",a)},a.close=function(){e.stopRelaying(this.port1,this.port1Spec),e.stopRelaying(this.port2,this.port2Spec),this.emit("close",this.port1,this.port2)},"undefined"!=typeof module&&module.exports&&(module.exports=e)}();var e=e;return function(){"use strict";e.WebSocketPort=function(a){e.Port.call(this,a),this.on("open",this.listen.bind(this))};var a=e.WebSocketPort.prototype=Object.create(e.Port.prototype);a.constructor=e.WebSocketPort,a.open=function(){this.socket=new WebSocket(this.options.url),this.socket.binaryType="arraybuffer";var a=this;this.socket.onopen=function(){a.emit("open",a.socket)}},a.listen=function(){var a=this;this.socket.onmessage=function(b){a.emit("data",b.data)},this.socket.onerror=function(b){a.emit("error",b)},this.socket.onclose=function(b){a.emit("close",b)},a.emit("ready")},a.sendRaw=function(a){this.socket&&this.socket.send(a.buffer)},a.close=function(a,b){this.socket.close(a,b)}}(),e});

@@ -1,2 +0,2 @@

/*! osc.js 1.2.0, Copyright 2015 Colin Clark | github.com/colinbdclark/osc.js */
/*! osc.js 1.2.1, Copyright 2015 Colin Clark | github.com/colinbdclark/osc.js */

@@ -3,0 +3,0 @@ /*

@@ -1,3 +0,3 @@

/*! osc.js 1.2.0, Copyright 2015 Colin Clark | github.com/colinbdclark/osc.js */
/*! osc.js 1.2.1, Copyright 2015 Colin Clark | github.com/colinbdclark/osc.js */
var osc=osc||{};!function(){"use strict";osc.SECS_70YRS=2208988800,osc.TWO_32=4294967296,osc.defaults={metadata:!1,unpackSingleArgs:!0},osc.isBufferEnv="undefined"!=typeof Buffer,osc.isCommonJS="undefined"!=typeof module&&module.exports,osc.isNode=osc.isCommonJS&&"undefined"==typeof window,osc.isArray=function(a){return a&&"[object Array]"===Object.prototype.toString.call(a)},osc.isTypedArrayView=function(a){return a.buffer&&a.buffer instanceof ArrayBuffer},osc.isBuffer=function(a){return osc.isBufferEnv&&a instanceof Buffer};var a=osc.isNode?require("buffer-dataview"):void 0,b="undefined"!=typeof dcodeIO?dcodeIO.Long:"undefined"!=typeof b?b:osc.isNode?require("long"):void 0;osc.dataView=function(b){return b instanceof DataView?b:"undefined"!=typeof a&&b instanceof a?b:osc.isBufferEnv&&b instanceof Buffer?new a(b):b.buffer?new DataView(b.buffer):b instanceof ArrayBuffer?new DataView(b):new DataView(new Uint8Array(b))},osc.byteArray=function(a){if(a instanceof Uint8Array)return a;var b=a.buffer?a.buffer:a;if("undefined"==typeof a.length||"string"==typeof a)throw new Error("Can't wrap a non-array-like object as Uint8Array. Object was: "+JSON.stringify(a,null,2));return new Uint8Array(b)},osc.makeByteArray=function(a){return osc.isBufferEnv?new Buffer(a):new Uint8Array(a)},osc.copyByteArray=function(a,b,c){if(osc.isTypedArrayView(a)&&osc.isTypedArrayView(b))b.set(a,c);else if(osc.isBuffer(a)&&osc.isBuffer(b))a.copy(b,c);else for(var d=void 0===c?0:c,e=Math.min(b.length-c,a.length),f=0,g=d;e>f;f++,g++)b[g]=a[f];return b},osc.readString=function(a,b){for(var c=[],d=b.idx;d<a.byteLength;d++){var e=a.getUint8(d);if(0===e){d++;break}c.push(e)}return d=d+3&-4,b.idx=d,String.fromCharCode.apply(null,c)},osc.writeString=function(a){for(var b=a+"\x00",c=b.length,d=c+3&-4,e=new Uint8Array(d),f=0;f<b.length;f++){var g=b.charCodeAt(f);e[f]=g}return e},osc.readPrimitive=function(a,b,c,d){var e=a[b](d.idx,!1);return d.idx+=c,e},osc.writePrimitive=function(a,b,c,d,e){e=void 0===e?0:e;var f;return b?f=new Uint8Array(b.buffer):(f=new Uint8Array(d),b=new DataView(f.buffer)),b[c](e,a,!1),f},osc.readInt32=function(a,b){return osc.readPrimitive(a,"getInt32",4,b)},osc.writeInt32=function(a,b,c){return osc.writePrimitive(a,b,"setInt32",4,c)},osc.readInt64=function(a,c){var d=osc.readPrimitive(a,"getInt32",4,c),e=osc.readPrimitive(a,"getInt32",4,c);return b?new b(e,d):{high:d,low:e,unsigned:!1}},osc.writeInt64=function(a,b,c){var d=new Uint8Array(8);return d.set(osc.writePrimitive(a.high,b,"setInt32",4,c),0),d.set(osc.writePrimitive(a.low,b,"setInt32",4,c+4),4),d},osc.readFloat32=function(a,b){return osc.readPrimitive(a,"getFloat32",4,b)},osc.writeFloat32=function(a,b,c){return osc.writePrimitive(a,b,"setFloat32",4,c)},osc.readFloat64=function(a,b){return osc.readPrimitive(a,"getFloat64",8,b)},osc.writeFloat64=function(a,b,c){return osc.writePrimitive(a,b,"setFloat64",8,c)},osc.readChar32=function(a,b){var c=osc.readPrimitive(a,"getUint32",4,b);return String.fromCharCode(c)},osc.writeChar32=function(a,b,c){var d=a.charCodeAt(0);return void 0===d||-1>d?void 0:osc.writePrimitive(d,b,"setUint32",4,c)},osc.readBlob=function(a,b){var c=osc.readInt32(a,b),d=c+3&-4,e=new Uint8Array(a.buffer,b.idx,c);return b.idx+=d,e},osc.writeBlob=function(a){a=osc.byteArray(a);var b=a.byteLength,c=b+3&-4,d=4,e=c+d,f=new Uint8Array(e),g=new DataView(f.buffer);return osc.writeInt32(b,g),f.set(a,d),f},osc.readMIDIBytes=function(a,b){var c=new Uint8Array(a.buffer,b.idx,4);return b.idx+=4,c},osc.writeMIDIBytes=function(a){a=osc.byteArray(a);var b=new Uint8Array(4);return b.set(a),b},osc.readColor=function(a,b){var c=new Uint8Array(a.buffer,b.idx,4),d=c[3]/255;return b.idx+=4,{r:c[0],g:c[1],b:c[2],a:d}},osc.writeColor=function(a){var b=Math.round(255*a.a),c=new Uint8Array([a.r,a.g,a.b,b]);return c},osc.readTrue=function(){return!0},osc.readFalse=function(){return!1},osc.readNull=function(){return null},osc.readImpulse=function(){return 1},osc.readTimeTag=function(a,b){var c=osc.readPrimitive(a,"getUint32",4,b),d=osc.readPrimitive(a,"getUint32",4,b),e=0===c&&1===d?Date.now():osc.ntpToJSTime(c,d);return{raw:[c,d],"native":e}},osc.writeTimeTag=function(a){var b=a.raw?a.raw:osc.jsToNTPTime(a["native"]),c=new Uint8Array(8),d=new DataView(c.buffer);return osc.writeInt32(b[0],d,0),osc.writeInt32(b[1],d,4),c},osc.timeTag=function(a){a=a||0;var b=Date.now()/1e3,c=Math.floor(b),d=b-c,e=Math.floor(a),f=a-e,g=d+f;if(g>1){var h=Math.floor(g),i=g-h;e+=h,g=i}var j=c+e+osc.SECS_70YRS,k=Math.round(osc.TWO_32*g);return{raw:[j,k]}},osc.ntpToJSTime=function(a,b){var c=a-osc.SECS_70YRS,d=b/osc.TWO_32,e=1e3*(c+d);return e},osc.jsToNTPTime=function(a){var b=a/1e3,c=Math.floor(b),d=b-c,e=c+osc.SECS_70YRS,f=Math.round(osc.TWO_32*d);return[e,f]},osc.readArguments=function(a,b,c){var d=osc.readString(a,c);if(0!==d.indexOf(","))throw new Error("A malformed type tag string was found while reading the arguments of an OSC message. String was: "+d," at offset: "+c.idx);var e=d.substring(1).split(""),f=[];return osc.readArgumentsIntoArray(f,e,d,a,b,c),f},osc.readArgument=function(a,b,c,d,e){var f=osc.argumentTypes[a];if(!f)throw new Error("'"+a+"' is not a valid OSC type tag. Type tag string was: "+b);var g=f.reader,h=osc[g](c,e);return d.metadata&&(h={type:a,value:h}),h},osc.readArgumentsIntoArray=function(a,b,c,d,e,f){for(var g=0;g<b.length;){var h,i=b[g];if("["===i){var j=b.slice(g+1),k=j.indexOf("]");if(0>k)throw new Error("Invalid argument type tag: an open array type tag ('[') was found without a matching close array tag ('[]'). Type tag was: "+c);var l=j.slice(0,k);h=osc.readArgumentsIntoArray([],l,c,d,e,f),g+=k+2}else h=osc.readArgument(i,c,d,e,f),g++;a.push(h)}return a},osc.writeArguments=function(a,b){var c=osc.collectArguments(a,b);return osc.joinParts(c)},osc.joinParts=function(a){for(var b=osc.makeByteArray(a.byteLength),c=a.parts,d=0,e=0;e<c.length;e++){var f=c[e];osc.copyByteArray(f,b,d),d+=f.length}return b},osc.addDataPart=function(a,b){b.parts.push(a),b.byteLength+=a.length},osc.writeArrayArguments=function(a,b){for(var c="[",d=0;d<a.length;d++){var e=a[d];c+=osc.writeArgument(e,b)}return c+="]"},osc.writeArgument=function(a,b){if(osc.isArray(a))return osc.writeArrayArguments(a,b);var c=a.type,d=osc.argumentTypes[c].writer;if(d){var e=osc[d](a.value);osc.addDataPart(e,b)}return a.type},osc.collectArguments=function(a,b,c){osc.isArray(a)||(a=[a]),c=c||{byteLength:0,parts:[]},b.metadata||(a=osc.annotateArguments(a));for(var d=",",e=c.parts.length,f=0;f<a.length;f++){var g=a[f];d+=osc.writeArgument(g,c)}var h=osc.writeString(d);return c.byteLength+=h.byteLength,c.parts.splice(e,0,h),c},osc.readMessage=function(a,b,c){b=b||osc.defaults;var d=osc.dataView(a);c=c||{idx:0};var e=osc.readString(d,c);return osc.readMessageContents(e,d,b,c)},osc.readMessageContents=function(a,b,c,d){if(0!==a.indexOf("/"))throw new Error("A malformed OSC address was found while reading an OSC message. String was: "+a);var e=osc.readArguments(b,c,d);return{address:a,args:1===e.length&&c.unpackSingleArgs?e[0]:e}},osc.collectMessageParts=function(a,b,c){return c=c||{byteLength:0,parts:[]},osc.addDataPart(osc.writeString(a.address),c),osc.collectArguments(a.args,b,c)},osc.writeMessage=function(a,b){b=b||osc.defaults;var c=osc.collectMessageParts(a,b);return osc.joinParts(c)},osc.readBundle=function(a,b,c){return osc.readPacket(a,b,c)},osc.collectBundlePackets=function(a,b,c){c=c||{byteLength:0,parts:[]},osc.addDataPart(osc.writeString("#bundle"),c),osc.addDataPart(osc.writeTimeTag(a.timeTag),c);for(var d=0;d<a.packets.length;d++){var e=a.packets[d],f=e.address?osc.collectMessageParts:osc.collectBundlePackets,g=f(e,b);c.byteLength+=g.byteLength,osc.addDataPart(osc.writeInt32(g.byteLength),c),c.parts=c.parts.concat(g.parts)}return c},osc.writeBundle=function(a,b){if(a.timeTag&&a.packets){b=b||osc.defaults;var c=osc.collectBundlePackets(a,b);return osc.joinParts(c)}},osc.readBundleContents=function(a,b,c,d){for(var e=osc.readTimeTag(a,c),f=[];c.idx<d;){var g=osc.readInt32(a,c),h=c.idx+g,i=osc.readPacket(a,b,c,h);f.push(i)}return{timeTag:e,packets:f}},osc.readPacket=function(a,b,c,d){var e=osc.dataView(a);d=void 0===d?e.byteLength:d,c=c||{idx:0};var f=osc.readString(e,c),g=f[0];if("#"===g)return osc.readBundleContents(e,b,c,d);if("/"===g)return osc.readMessageContents(f,e,b,c);throw new Error("The header of an OSC packet didn't contain an OSC address or a #bundle string. Header was: "+f)},osc.writePacket=function(a,b){var c=a.address?osc.writeMessage:osc.writeBundle;return c(a,b)},osc.argumentTypes={i:{reader:"readInt32",writer:"writeInt32"},h:{reader:"readInt64",writer:"writeInt64"},f:{reader:"readFloat32",writer:"writeFloat32"},s:{reader:"readString",writer:"writeString"},S:{reader:"readString",writer:"writeString"},b:{reader:"readBlob",writer:"writeBlob"},t:{reader:"readTimeTag",writer:"writeTimeTag"},T:{reader:"readTrue"},F:{reader:"readFalse"},N:{reader:"readNull"},I:{reader:"readImpulse"},d:{reader:"readFloat64",writer:"writeFloat64"},c:{reader:"readChar32",writer:"writeChar32"},r:{reader:"readColor",writer:"writeColor"},m:{reader:"readMIDIBytes",writer:"writeMIDIBytes"}},osc.inferTypeForArgument=function(a){var b=typeof a;switch(b){case"boolean":return a?"T":"F";case"string":return"s";case"number":return"f";case"undefined":return"N";case"object":if(null===a)return"N";if(a instanceof Uint8Array||a instanceof ArrayBuffer||osc.isBufferEnv&&a instanceof Buffer)return"b";if(a.high instanceof Number&&a.low instanceof Number)return"h"}throw new Error("Can't infer OSC argument type for value: "+JSON.stringify(a,null,2))},osc.annotateArguments=function(a){osc.isArray(a)||(a=[a]);for(var b=[],c=0;c<a.length;c++){var d,e=a[c];if("object"==typeof e&&e.type&&void 0!==e.value)d=e;else{var f=osc.inferTypeForArgument(e);d={type:f,value:e}}b.push(d)}return b},osc.isCommonJS&&(module.exports=osc)}();
{
"name": "osc",
"main": "src/platforms/osc-node.js",
"version": "1.2.0",
"version": "1.2.1",
"description": "A JavaScript Open Sound Control (OSC) library that works in Node.js and the browser.",

@@ -27,3 +27,3 @@ "author": "Colin Clark",

"devDependencies": {
"infusion": "git://github.com/fluid-project/infusion.git",
"infusion": "fluid-project/infusion#1.9.x",
"jqUnit": "git://github.com/fluid-project/node-jqUnit.git",

@@ -30,0 +30,0 @@ "grunt-gpii": "git://github.com/GPII/grunt-gpii.git",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc