Main(function(){functiont(t){returnvoid0===t}functione(t){return"function"==typeoft}vari,s,n,o;if(t(window.AudioContext)&&(window.AudioContext=window.webkitAudioContext),t(window.OfflineAudioContext)&&(window.OfflineAudioContext=window.webkitOfflineAudioContext),t(AudioContext))thrownewError("Web Audio is not supported in this browser");returni=newAudioContext,e(AudioContext.prototype.createGain)||(AudioContext.prototype.createGain=AudioContext.prototype.createGainNode),e(AudioContext.prototype.createDelay)||(AudioContext.prototype.createDelay=AudioContext.prototype.createDelayNode),e(AudioContext.prototype.createPeriodicWave)||(AudioContext.prototype.createPeriodicWave=AudioContext.prototype.createWaveTable),e(AudioBufferSourceNode.prototype.start)||(AudioBufferSourceNode.prototype.start=AudioBufferSourceNode.prototype.noteGrainOn),e(AudioBufferSourceNode.prototype.stop)||(AudioBufferSourceNode.prototype.stop=AudioBufferSourceNode.prototype.noteOff),e(OscillatorNode.prototype.start)||(OscillatorNode.prototype.start=OscillatorNode.prototype.noteOn),e(OscillatorNode.prototype.stop)||(OscillatorNode.prototype.stop=OscillatorNode.prototype.noteOff),e(OscillatorNode.prototype.setPeriodicWave)||(OscillatorNode.prototype.setPeriodicWave=OscillatorNode.prototype.setWaveTable),AudioNode.prototype._nativeConnect=AudioNode.prototype.connect,AudioNode.prototype.connect=function(e,i,s){if(e.input)Array.isArray(e.input)?(t(s)&&(s=0),this.connect(e.input[s])):this.connect(e.input,i,s);elsetry{einstanceofAudioNode?this._nativeConnect(e,i,s):this._nativeConnect(e,i)}catch(n){thrownewError("error connecting to node: "+e)}},s=function(e,i){t(e)||1===e?this.input=this.context.createGain():e>1&&(this.input=newArray(e)),t(i)||1===i?this.output=this.context.createGain():i>1&&(this.output=newArray(e))},s.prototype.set=function(e,i,n){varo,r,a,l,h,u;this.isObject(e)?n=i:this.isString(e)&&(o={},o[e]=i,e=o);for(rine){if(i=e[r],a=this,-1!==r.indexOf(".")){for(l=r.split("."),h=0;h<l.length-1;h++)a=a[l[h]];r=l[l.length-1]}u=a[r],t(u)||(s.Signal&&uinstanceofs.Signal||s.Param&&uinstanceofs.Param?u.value!==i&&(t(n)?u.value=i:u.rampTo(i,n)):uinstanceofAudioParam?u.value!==i&&(u.value=i):uinstanceofs?u.set(i):u!==i&&(a[r]=i))}returnthis},s.prototype.get=function(i){varn,o,r,a,l,h,u,c,p;for(t(i)?i=this._collectDefaults(this.constructor):this.isString(i)&&(i=[i]),n={},o=0;o<i.length;o++){if(r=i[o],a=this,l=n,-1!==r.indexOf(".")){for(h=r.split("."),u=0;u<h.length-1;u++)c=h[u],l[c]=l[c]||{},l=l[c],a=a[c];r=h[h.length-1]}p=a[r],this.isObject(i[r])?l[r]=p.get():s.Signal&&pinstanceofs.Signal?l[r]=p.value:s.Param&&pinstanceofs.Param?l[r]=p.value:pinstanceofAudioParam?l[r]=p.value:pinstanceofs?l[r]=p.get():e(p)||t(p)||(l[r]=p)}returnn},s.prototype._collectDefaults=function(e){vari,s,n=[];if(t(e.defaults)||(n=Object.keys(e.defaults)),!t(e._super))for(i=this._collectDefaults(e._super),s=0;s<i.length;s++)-1===n.indexOf(i[s])&&n.push(i[s]);returnn},s.prototype.toString=function(){vart,i,n;for(tins)if(i=t[0].match(/^[A-Z]$/),n=s[t]===this.constructor,e(s[t])&&i&&n)returnt;return"Tone"},s.context=i,s.prototype.context=s.context,s.prototype.bufferSize=2048,s.prototype.blockTime=128/s.context.sampleRate,s.prototype.dispose=function(){returnthis.isUndef(this.input)||(this.inputinstanceofAudioNode&&this.input.disconnect(),this.input=null),this.isUndef(this.output)||(this.outputinstanceofAudioNode&&this.output.disconnect(),this.output=null),this},n=null,s.prototype.noGC=function(){returnthis.output.connect(n),this},AudioNode.prototype.noGC=function(){returnthis.connect(n),this},s.prototype.connect=function(t,e,i){returnArray.isArray(this.output)?(e=this.defaultArg(e,0),this.output[e].connect(t,0,i)):this.output.connect(t,e,i),this},s.prototype.disconnect=function(t){returnArray.isArray(this.output)?(t=this.defaultArg(t,0),this.output[t].disconnect()):this.output.disconnect(),this},s.prototype.connectSeries=function(){vart,e,i;if(arguments.length>1)for(t=arguments[0],e=1;e<arguments.length;e++)i=arguments[e],t.connect(i
a=this._nextTick,this._nextTick+=1/this.frequency.getValueAtTime(this._nextTick),this.callback(a),this.ticks++;elser===t.State.Stopped&&(this._nextTick=-1,this.ticks=0)},t.Clock.prototype.getStateAtTime=function(t){returnthis._state.getStateAtTime(t)},t.Clock.prototype.dispose=function(){cancelAnimationFrame(this._loopID),t.TimelineState.prototype.dispose.call(this),this._writable("frequency"),this.frequency.dispose(),this.frequency=null,this._boundLoop=t.noOp,this._nextTick=1/0,this.callback=null,this._state.dispose(),this._state=null},t.Clock}),Module(function(t){returnt.Emitter=function(){this._events={}},t.extend(t.Emitter),t.Emitter.prototype.on=function(t,e){vari,s,n=t.split(/\W+/);for(i=0;i<n.length;i++)s=n[i],this._events.hasOwnProperty(s)||(this._events[s]=[]),this._events[s].push(e);returnthis},t.Emitter.prototype.off=function(e,i){vars,n,o,r=e.split(/\W+/);for(s=0;s<r.length;s++)if(e=r[s],this._events.hasOwnProperty(e))if(t.prototype.isUndef(i))this._events[e]=[];elsefor(n=this._events[e],o=0;o<n.length;o++)n[o]===i&&n.splice(o,1);returnthis},t.Emitter.prototype.trigger=function(t){vare,i,s,n;if(this._events&&(e=Array.prototype.slice.call(arguments,1),this._events.hasOwnProperty(t)))for(i=this._events[t],s=0,n=i.length;n>s;s++)i[s].apply(this,e);returnthis},t.Emitter.mixin=function(e){vari,s,n,o=["on","off","trigger"];for(e._events={},i=0;i<o.length;i++)s=o[i],n=t.Emitter.prototype[s],e[s]=n},t.Emitter.prototype.dispose=function(){returnt.prototype.dispose.call(this),this._events=null,this},t.Emitter}),Module(function(t){t.IntervalTimeline=function(){this._root=null,this._length=0},t.extend(t.IntervalTimeline),t.IntervalTimeline.prototype.addEvent=function(t){if(this.isUndef(t.time)||this.isUndef(t.duration))thrownewError("events must have time and duration parameters");vari=newe(t.time,t.time+t.duration,t);for(null===this._root?this._root=i:this._root.insert(i),this._length++;null!==i;)i.updateHeight(),i.updateMax(),this._rebalance(i),i=i.parent;returnthis},t.IntervalTimeline.prototype.removeEvent=function(t){vare,i,s;if(null!==this._root)for(e=[],this._root.search(t.time,e),i=0;i<e.length;i++)if(s=e[i],s.event===t){this._removeNode(s),this._length--;break}returnthis},Object.defineProperty(t.IntervalTimeline.prototype,"length",{get:function(){returnthis._length}}),t.IntervalTimeline.prototype.cancel=function(t){returnt=this.toSeconds(t),this.forEachAfter(t,function(t){this.removeEvent(t)}.bind(this)),this},t.IntervalTimeline.prototype._setRoot=function(t){this._root=t,null!==this._root&&(this._root.parent=null)},t.IntervalTimeline.prototype._replaceNodeInParent=function(t,e){null!==t.parent?(t.isLeftChild()?t.parent.left=e:t.parent.right=e,this._rebalance(t.parent)):this._setRoot(e)},t.IntervalTimeline.prototype._removeNode=function(t){vare,i,s;if(null===t.left&&null===t.right)this._replaceNodeInParent(t,null);elseif(null===t.right)this._replaceNodeInParent(t,t.left);elseif(null===t.left)this._replaceNodeInParent(t,t.right);else{if(e=t.getBalance(),e>0)if(null===t.left.right)i=t.left,i.right=t.right,s=i;else{for(i=t.left.right;null!==i.right;)i=i.right;i.parent.right=i.left,s=i.parent,i.left=t.left,i.right=t.right}elseif(null===t.right.left)i=t.right,i.left=t.left,s=i;else{for(i=t.right.left;null!==i.left;)i=i.left;i.parent=i.parent,i.parent.left=i.right,s=i.parent,i.left=t.left,i.right=t.right}null!==t.parent?t.isLeftChild()?t.parent.left=i:t.parent.right=i:this._setRoot(i),this._rebalance(s)}t.dispose()},t.IntervalTimeline.prototype._rotateLeft=function(t){vare=t.parent,i=t.isLeftChild(),s=t.right;t.right=s.left,s.left=t,null!==e?i?e.left=s:e.right=s:this._setRoot(s)},t.IntervalTimeline.prototype._rotateRight=function(t){vare=t.parent,i=t.isLeftChild(),s=t.left;t.left=s.right,s.right=t,null!==e?i?e.left=s:e.right=s:this._setRoot(s)},t.IntervalTimeline.prototype._rebalance=function(t){vare=t.getBalance();e>1?t.left.getBalance()<0?this._rotateLeft(t.left):this._rotateRight(t):-1>e&&(t.right.getBalance()>0?this._rotateRight(t.right):this._rotateLeft(t))},t.IntervalTimeline.prototyp