text: !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Tone=e():t.Tone=e()}("undefined"!=typeof self?self:this,function(){return function(i){var n={};function o(t){if(n[t])return n[t].exports;var e=n[t]={i:t,l:!1,exports:{}};return i[t].call(e.exports,e,e.exports,o),e.l=!0,e.exports}return o.m=i,o.c=n,o.d=function(t,e,i){o.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:i})},o.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=154)}([function(n,o,s){(function(e){var t,i;t=[s(152)],void 0===(i=function(t){"use strict";var u=function(){if(!(this instanceof u))throw new Error("constructor needs to be called with the 'new' keyword")};return u.prototype.toString=function(){for(var t in u){var e=t[0].match(/^[A-Z]$/),i=u[t]===this.constructor;if(u.isFunction(u[t])&&e&&i)return t}return"Tone"},u.prototype.dispose=function(){return this},u.prototype.set=function(t,e,i){if(u.isObject(t))i=e;else if(u.isString(t)){var n={};n[t]=e,t=n}t:for(var o in t){e=t[o];var s=this;if(-1!==o.indexOf(".")){for(var r=o.split("."),a=0;a<r.length-1;a++)if((s=s[r[a]])instanceof u){r.splice(0,a+1);var l=r.join(".");s.set(l,e);continue t}o=r[r.length-1]}var h=s[o];u.isUndef(h)||(u.Signal&&h instanceof u.Signal||u.Param&&h instanceof u.Param?h.value!==e&&(u.isUndef(i)?h.value=e:h.rampTo(e,i)):h instanceof AudioParam?h.value!==e&&(h.value=e):u.TimeBase&&h instanceof u.TimeBase?s[o]=e:h instanceof u?h.set(e):h!==e&&(s[o]=e))}return this},u.prototype.get=function(t){u.isUndef(t)?t=this._collectDefaults(this.constructor):u.isString(t)&&(t=[t]);for(var e={},i=0;i<t.length;i++){var n=t[i],o=this,s=e;if(-1!==n.indexOf(".")){for(var r=n.split("."),a=0;a<r.length-1;a++){var l=r[a];s[l]=s[l]||{},s=s[l],o=o[l]}n=r[r.length-1]}var h=o[n];u.isObject(t[n])?s[n]=h.get():u.Signal&&h instanceof u.Signal?s[n]=h.value:u.Param&&h instanceof u.Param?s[n]=h.value:h instanceof AudioParam?s[n]=h.value:h instanceof u?s[n]=h.get():!u.isFunction(h)&&u.isDefined(h)&&(s[n]=h)}return e},u.prototype._collectDefaults=function(t){var e=[];if(u.isDefined(t.defaults)&&(e=Object.keys(t.defaults)),u.isDefined(t._super))for(var i=this._collectDefaults(t._super),n=0;n<i.length;n++)-1===e.indexOf(i[n])&&e.push(i[n]);return e},u.defaults=function(t,e,i){var n={};if(1===t.length&&u.isObject(t[0]))n=t[0];else for(var o=0;o<e.length;o++)n[e[o]]=t[o];return u.isDefined(i.defaults)?u.defaultArg(n,i.defaults):u.isObject(i)?u.defaultArg(n,i):n},u.defaultArg=function(t,e){if(u.isObject(t)&&u.isObject(e)){var i={};for(var n in t)i[n]=u.defaultArg(e[n],t[n]);for(var o in e)i[o]=u.defaultArg(t[o],e[o]);return i}return u.isUndef(t)?e:t},u.prototype.log=function(){if(this.debug||this.toString()===u.global.TONE_DEBUG_CLASS){var t=Array.from(arguments);t.unshift(this.toString()+":"),console.log.apply(void 0,t)}},u.prototype.assert=function(t,e){if(!t)throw new Error(e)},u.connectSeries=function(){for(var t=arguments[0],e=1;e<arguments.length;e++){var i=arguments[e];t.connect(i),t=i}return u},u.isUndef=function(t){return void 0===t},u.isDefined=function(t){return!u.isUndef(t)},u.isFunction=function(t){return"function"==typeof t},u.isNumber=function(t){return"number"==typeof t},u.isObject=function(t){return"[object Object]"===Object.prototype.toString.call(t)&&t.constructor===Object},u.isBoolean=function(t){return"boolean"==typeof t},u.isArray=function(t){return Array.isArray(t)},u.isString=function(t){return"string"==typeof t},u.isNote=function(t){return u.isString(t)&&/^([a-g]{1}(?:b|#|x|bb)?)(-?[0-9]+)/i.test(t)},u.noOp=function(){},u.prototype._readOnly=function(t){if(Array.isArray(t))for(var e=0;e<t.length;e++)this._readOnly(t[e]);else Object.defineProperty(this,t,{writable:!1,enumerable:!0})},u.prototype._writable=function(t){if(Array.isArray(t))for(var e=0;e<t.length;e++)this._writable(t[e]);else Object.defineProperty(this,t,{writable:!0})},u.State={Started:"started",Stopped:"stopped",Paused:"paused"},u.global=u.isUndef(e)?window:e,u.equalPowerScale=function(t){var e=.5*Math.PI;return Math.sin(t*e)},u.dbToGain=function(t){return Math.pow(10,t/20)},u.gainToDb=function(t){return Math.log(t)/Math.LN10*20},u.intervalToFrequencyRatio=function(t){return Math.pow(2,t/12)},u.prototype.now=function(){return u.context.now()},u.now=function(){return u.context.now()},u.prototype.immediate=function(){return u.context.currentTime},u.immediate=function(){return u.context.currentTime},u.extend=function(t,e){function i(){}u.isUndef(e)&&(e=u),i.prototype=e.prototype,t.prototype=new i,(t.prototype.constructor=t)._super=e},u._audioContext=null,Object.defineProperty(u,"context",{get:function(){return u._audioContext},set:function(t){t.isContext?u._audioContext=t:u._audioContext=new u.Context(t),u.Context.emit("init",u._audioContext)}}),Object.defineProperty(u.prototype,"context",{get:function(){return u.context}}),u.setContext=function(t){u.context=t},Object.defineProperty(u.prototype,"blockTime",{get:function(){return 128/this.context.sampleRate}}),Object.defineProperty(u.prototype,"sampleTime",{get:function(){return 1/this.context.sampleRate}}),Object.defineProperty(u,"supported",{get:function(){var t=u.global.hasOwnProperty("AudioContext")||u.global.hasOwnProperty("webkitAudioContext"),e=u.global.hasOwnProperty("Promise");return t&&e}}),Object.defineProperty(u,"initialized",{get:function(){return Boolean(u.context)}}),u.getContext=function(t){if(u.initialized)t(u.context);else{var e=function(){t(u.context),u.Context.off("init",e)};u.Context.on("init",e)}return u},u.version=t,u}.apply(o,t))||(n.exports=i)}).call(this,s(153))},function(t,e,i){var n,o;n=[i(0),i(7),i(4),i(14),i(95),i(3)],void 0===(o=function(e){"use strict";return e.Signal=function(){var t=e.defaults(arguments,["value","units"],e.Signal);e.Param.call(this,t),this._constantSource=this.context.createConstantSource(),this._constantSource.start(0),this._param=this._constantSource.offset,this.value=t.value,this.output=this._constantSource,this.input=this._param=this.output.offset},e.extend(e.Signal,e.Param),e.Signal.defaults={value:0,units:e.Type.Default,convert:!0},e.Signal.prototype.connect=e.SignalBase.prototype.connect,e.Signal.prototype.disconnect=e.SignalBase.prototype.disconnect,e.Signal.prototype.getValueAtTime=function(t){return this._param.getValueAtTime?this._param.getValueAtTime(t):e.Param.prototype.getValueAtTime.call(this,t)},e.Signal.prototype.dispose=function(){return e.Param.prototype.dispose.call(this),this._constantSource.disconnect(),this._constantSource=null,this},e.Signal}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(20)],void 0===(o=function(n){return n.AudioNode=function(){n.call(this);var t=n.defaults(arguments,["context"],{context:n.context});this._context=t.context},n.extend(n.AudioNode),Object.defineProperty(n.AudioNode.prototype,"context",{get:function(){return this._context}}),n.AudioNode.prototype.createInsOuts=function(t,e){1===t?this.input=this.context.createGain():1<t&&(this.input=new Array(t)),1===e?this.output=this.context.createGain():1<e&&(this.output=new Array(e))},Object.defineProperty(n.AudioNode.prototype,"channelCount",{get:function(){return this.output.channelCount},set:function(t){return this.output.channelCount=t}}),Object.defineProperty(n.AudioNode.prototype,"channelCountMode",{get:function(){return this.output.channelCountMode},set:function(t){return this.output.channelCountMode=t}}),Object.defineProperty(n.AudioNode.prototype,"channelInterpretation",{get:function(){return this.output.channelInterpretation},set:function(t){return this.output.channelInterpretation=t}}),Object.defineProperty(n.AudioNode.prototype,"numberOfInputs",{get:function(){return this.input?n.isArray(this.input)?this.input.length:1:0}}),Object.defineProperty(n.AudioNode.prototype,"numberOfOutputs",{get:function(){return this.output?n.isArray(this.output)?this.output.length:1:0}}),n.AudioNode.prototype.connect=function(t,e,i){return n.isArray(this.output)?(e=n.defaultArg(e,0),this.output[e].connect(t,0,i)):this.output.connect(t,e,i),this},n.AudioNode.prototype.disconnect=function(t,e,i){n.isArray(this.output)?n.isNumber(t)?this.output[t].disconnect():(e=n.defaultArg(e,0),this.output[e].disconnect(t,0,i)):this.output.disconnect.apply(this.output,arguments)},n.AudioNode.prototype.chain=function(){for(var t=this,e=0;e<arguments.length;e++){var i=arguments[e];t.connect(i),t=i}return this},n.AudioNode.prototype.fan=function(){for(var t=0;t<arguments.length;t++)this.connect(arguments[t]);return this},n.global.AudioNode&&(AudioNode.prototype.chain=n.AudioNode.prototype.chain,AudioNode.prototype.fan=n.AudioNode.prototype.fan),n.AudioNode.prototype.dispose=function(){return n.isDefined(this.input)&&(this.input instanceof AudioNode&&this.input.disconnect(),this.input=null),n.isDefined(this.output)&&(this.output instanceof AudioNode&&this.output.disconnect(),this.output=null),this._context=null,this},n.AudioNode}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(14),i(4),i(2)],void 0===(o=function(e){"use strict";return e.Gain=function(){var t=e.defaults(arguments,["gain","units"],e.Gain);e.AudioNode.call(this,t),this.input=this.output=this._gainNode=this.context.createGain(),this.gain=new e.Param({param:this._gainNode.gain,units:t.units,value:t.gain,convert:t.convert}),this._readOnly("gain")},e.extend(e.Gain,e.AudioNode),e.Gain.defaults={gain:1,convert:!0},e.Gain.prototype.dispose=function(){e.AudioNode.prototype.dispose.call(this),this._gainNode.disconnect(),this._gainNode=null,this._writable("gain"),this.gain.dispose(),this.gain=null},e.Gain}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(65),i(46),i(45),i(20)],void 0===(o=function(e){return e.Type={Default:"number",Time:"time",Frequency:"frequency",TransportTime:"transportTime",Ticks:"ticks",NormalRange:"normalRange",AudioRange:"audioRange",Decibels:"db",Interval:"interval",BPM:"bpm",Positive:"positive",Gain:"gain",Cents:"cents",Degrees:"degrees",MIDI:"midi",BarsBeatsSixteenths:"barsBeatsSixteenths",Samples:"samples",Hertz:"hertz",Note:"note",Milliseconds:"milliseconds",Seconds:"seconds",Notation:"notation"},e.prototype.toSeconds=function(t){return e.isNumber(t)?t:e.isUndef(t)?this.now():e.isString(t)||e.isObject(t)?new e.Time(t).toSeconds():t instanceof e.TimeBase?t.toSeconds():void 0},e.prototype.toFrequency=function(t){return e.isNumber(t)?t:e.isString(t)||e.isUndef(t)||e.isObject(t)?new e.Frequency(t).valueOf():t instanceof e.TimeBase?t.toFrequency():void 0},e.prototype.toTicks=function(t){return e.isNumber(t)||e.isString(t)||e.isObject(t)?new e.TransportTime(t).toTicks():e.isUndef(t)?e.Transport.ticks:t instanceof e.TimeBase?t.toTicks():void 0},e}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(14),i(3),i(36)],void 0===(o=function(e){"use strict";return e.Multiply=function(t){e.Signal.call(this),this.createInsOuts(2,0),this._mult=this.input[0]=this.output=new e.Gain,this._param=this.input[1]=this.output.gain,this.value=e.defaultArg(t,0),this.proxy=!1},e.extend(e.Multiply,e.Signal),e.Multiply.prototype.dispose=function(){return e.Signal.prototype.dispose.call(this),this._mult.dispose(),this._mult=null,this._param=null,this},e.Multiply}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(17),i(27),i(40),i(4),i(33),i(1),i(2)],void 0===(o=function(s){"use strict";return s.Source=function(t){t=s.defaultArg(t,s.Source.defaults),s.AudioNode.call(this),this._volume=this.output=new s.Volume(t.volume),this.volume=this._volume.volume,this._readOnly("volume"),this._state=new s.TimelineState(s.State.Stopped),this._state.memory=100,this._synced=!1,this._scheduled=[],this._volume.output.output.channelCount=2,this._volume.output.output.channelCountMode="explicit",this.mute=t.mute},s.extend(s.Source,s.AudioNode),s.Source.defaults={volume:0,mute:!1},Object.defineProperty(s.Source.prototype,"state",{get:function(){return this._synced?s.Transport.state===s.State.Started?this._state.getValueAtTime(s.Transport.seconds):s.State.Stopped:this._state.getValueAtTime(this.now())}}),Object.defineProperty(s.Source.prototype,"mute",{get:function(){return this._volume.mute},set:function(t){this._volume.mute=t}}),s.Source.prototype._start=s.noOp,s.Source.prototype.restart=s.noOp,s.Source.prototype._stop=s.noOp,s.Source.prototype.start=function(t,e,i){if(t=s.isUndef(t)&&this._synced?s.Transport.seconds:this.toSeconds(t),this._state.getValueAtTime(t)===s.State.Started)this._state.cancel(t),this._state.setStateAtTime(s.State.Started,t),this.restart(t,e,i);else if(this._state.setStateAtTime(s.State.Started,t),this._synced){var n=this._state.get(t);n.offset=s.defaultArg(e,0),n.duration=i;var o=s.Transport.schedule(function(t){this._start(t,e,i)}.bind(this),t);this._scheduled.push(o),s.Transport.state===s.State.Started&&this._syncedStart(this.now(),s.Transport.seconds)}else this._start.apply(this,arguments);return this},s.Source.prototype.stop=function(t){if(t=s.isUndef(t)&&this._synced?s.Transport.seconds:this.toSeconds(t),this._synced){var e=s.Transport.schedule(this._stop.bind(this),t);this._scheduled.push(e)}else this._stop.apply(this,arguments);return this._state.cancel(t),this._state.setStateAtTime(s.State.Stopped,t),this},s.Source.prototype.sync=function(){return this._synced=!0,this._syncedStart=function(t,e){if(0<e){var i=this._state.get(e);if(i&&i.state===s.State.Started&&i.time!==e){var n,o=e-this.toSeconds(i.time);i.duration&&(n=this.toSeconds(i.duration)-o),this._start(t,this.toSeconds(i.offset)+o,n)}}}.bind(this),this._syncedStop=function(t){var e=s.Transport.getSecondsAtTime(Math.max(t-this.sampleTime,0));this._state.getValueAtTime(e)===s.State.Started&&this._stop(t)}.bind(this),s.Transport.on("start loopStart",this._syncedStart),s.Transport.on("stop pause loopEnd",this._syncedStop),this},s.Source.prototype.unsync=function(){this._synced&&(s.Transport.off("stop pause loopEnd",this._syncedStop),s.Transport.off("start loopStart",this._syncedStart)),this._synced=!1;for(var t=0;t<this._scheduled.length;t++){var e=this._scheduled[t];s.Transport.clear(e)}return this._scheduled=[],this._state.cancel(0),this},s.Source.prototype.dispose=function(){s.AudioNode.prototype.dispose.call(this),this.unsync(),this._scheduled=null,this._writable("volume"),this._volume.dispose(),this._volume=null,this.volume=null,this._state.dispose(),this._state=null},s.Source}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(36),i(96)],void 0===(o=function(i){"use strict";return i.WaveShaper=function(t,e){i.SignalBase.call(this),this._shaper=this.input=this.output=this.context.createWaveShaper(),this._curve=null,Array.isArray(t)?this.curve=t:isFinite(t)||i.isUndef(t)?this._curve=new Float32Array(i.defaultArg(t,1024)):i.isFunction(t)&&(this._curve=new Float32Array(i.defaultArg(e,1024)),this.setMap(t))},i.extend(i.WaveShaper,i.SignalBase),i.WaveShaper.prototype.setMap=function(t){for(var e=new Array(this._curve.length),i=0,n=this._curve.length;i<n;i++){var o=i/(n-1)*2-1;e[i]=t(o,i)}return this.curve=e,this},Object.defineProperty(i.WaveShaper.prototype,"curve",{get:function(){return this._shaper.curve},set:function(t){this._curve=new Float32Array(t),this._shaper.curve=this._curve}}),Object.defineProperty(i.WaveShaper.prototype,"oversample",{get:function(){return this._shaper.oversample},set:function(t){if(!["none","2x","4x"].includes(t))throw new RangeError("Tone.WaveShaper: oversampling must be either 'none', '2x', or '4x'");this._shaper.oversample=t}}),i.WaveShaper.prototype.dispose=function(){return i.SignalBase.prototype.dispose.call(this),this._shaper.disconnect(),this._shaper=null,this._curve=null,this},i.WaveShaper}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(23),i(2)],void 0===(o=function(e){"use strict";return e.Effect=function(){var t=e.defaults(arguments,["wet"],e.Effect);e.AudioNode.call(this),this.createInsOuts(1,1),this._dryWet=new e.CrossFade(t.wet),this.wet=this._dryWet.fade,this.effectSend=new e.Gain,this.effectReturn=new e.Gain,this.input.connect(this._dryWet.a),this.input.connect(this.effectSend),this.effectReturn.connect(this._dryWet.b),this._dryWet.connect(this.output),this._readOnly(["wet"])},e.extend(e.Effect,e.AudioNode),e.Effect.defaults={wet:1},e.Effect.prototype.connectEffect=function(t){return this.effectSend.chain(t,this.effectReturn),this},e.Effect.prototype.dispose=function(){return e.AudioNode.prototype.dispose.call(this),this._dryWet.dispose(),this._dryWet=null,this.effectSend.dispose(),this.effectSend=null,this.effectReturn.dispose(),this.effectReturn=null,this._writable(["wet"]),this.wet=null,this},e.Effect}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(2)],void 0===(o=function(t){"use strict";return t.Merge=function(){t.AudioNode.call(this),this.createInsOuts(2,0),this.left=this.input[0]=new t.Gain,this.right=this.input[1]=new t.Gain,this._merger=this.output=this.context.createChannelMerger(2),this.left.connect(this._merger,0,0),this.right.connect(this._merger,0,1),this.left.channelCount=1,this.right.channelCount=1,this.left.channelCountMode="explicit",this.right.channelCountMode="explicit"},t.extend(t.Merge,t.AudioNode),t.Merge.prototype.dispose=function(){return t.AudioNode.prototype.dispose.call(this),this.left.dispose(),this.left=null,this.right.dispose(),this.right=null,this._merger.disconnect(),this._merger=null,this},t.Merge}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(1),i(2)],void 0===(o=function(r){"use strict";return r.Filter=function(){var t=r.defaults(arguments,["frequency","type","rolloff"],r.Filter);r.AudioNode.call(this),this.createInsOuts(1,1),this._filters=[],this.frequency=new r.Signal(t.frequency,r.Type.Frequency),this.detune=new r.Signal(0,r.Type.Cents),this.gain=new r.Signal({value:t.gain,convert:!0,type:r.Type.Decibels}),this.Q=new r.Signal(t.Q),this._type=t.type,this._rolloff=t.rolloff,this.rolloff=t.rolloff,this._readOnly(["detune","frequency","gain","Q"])},r.extend(r.Filter,r.AudioNode),r.Filter.defaults={type:"lowpass",frequency:350,rolloff:-12,Q:1,gain:0},Object.defineProperty(r.Filter.prototype,"type",{get:function(){return this._type},set:function(t){if(-1===["lowpass","highpass","bandpass","lowshelf","highshelf","notch","allpass","peaking"].indexOf(t))throw new TypeError("Tone.Filter: invalid type "+t);this._type=t;for(var e=0;e<this._filters.length;e++)this._filters[e].type=t}}),Object.defineProperty(r.Filter.prototype,"rolloff",{get:function(){return this._rolloff},set:function(t){t=parseInt(t,10);var e=[-12,-24,-48,-96].indexOf(t);if(-1===e)throw new RangeError("Tone.Filter: rolloff can only be -12, -24, -48 or -96");e+=1,this._rolloff=t,this.input.disconnect();for(var i=0;i<this._filters.length;i++)this._filters[i].disconnect(),this._filters[i]=null;this._filters=new Array(e);for(var n=0;n<e;n++){var o=this.context.createBiquadFilter();o.type=this._type,this.frequency.connect(o.frequency),this.detune.connect(o.detune),this.Q.connect(o.Q),this.gain.connect(o.gain),this._filters[n]=o}var s=[this.input].concat(this._filters).concat([this.output]);r.connectSeries.apply(r,s)}}),r.Filter.prototype.dispose=function(){r.AudioNode.prototype.dispose.call(this);for(var t=0;t<this._filters.length;t++)this._filters[t].disconnect(),this._filters[t]=null;return this._filters=null,this._writable(["detune","frequency","gain","Q"]),this.frequency.dispose(),this.Q.dispose(),this.frequency=null,this.Q=null,this.detune.dispose(),this.detune=null,this.gain.dispose(),this.gain=null,this},r.Filter}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(35),i(4),i(82)],void 0===(o=function(u){"use strict";return u.Buffer=function(){var t=u.defaults(arguments,["url","onload","onerror"],u.Buffer);u.call(this),this._buffer=null,this._reversed=t.reverse,this._xhr=null,this.onload=u.noOp,t.url instanceof AudioBuffer||t.url instanceof u.Buffer?(this.set(t.url),this.loaded||(this.onload=t.onload)):u.isString(t.url)&&this.load(t.url).then(t.onload).catch(t.onerror)},u.extend(u.Buffer),u.Buffer.defaults={url:void 0,reverse:!1,onload:u.noOp,onerror:u.noOp},u.Buffer.prototype.set=function(t){return t instanceof u.Buffer?t.loaded?this._buffer=t.get():t.onload=function(){this.set(t),this.onload(this)}.bind(this):this._buffer=t,this},u.Buffer.prototype.get=function(){return this._buffer},u.Buffer.prototype.load=function(t,n,o){return new Promise(function(e,i){this._xhr=u.Buffer.load(t,function(t){this._xhr=null,this.set(t),e(this),this.onload(this),n&&n(this)}.bind(this),function(t){this._xhr=null,i(t),o&&o(t)}.bind(this))}.bind(this))},u.Buffer.prototype.dispose=function(){return u.prototype.dispose.call(this),this._buffer=null,this._xhr&&(u.Buffer._removeFromDownloadQueue(this._xhr),this._xhr.abort(),this._xhr=null),this},Object.defineProperty(u.Buffer.prototype,"loaded",{get:function(){return 0<this.length}}),Object.defineProperty(u.Buffer.prototype,"duration",{get:function(){return this._buffer?this._buffer.duration:0}}),Object.defineProperty(u.Buffer.prototype,"length",{get:function(){return this._buffer?this._buffer.length:0}}),Object.defineProperty(u.Buffer.prototype,"numberOfChannels",{get:function(){return this._buffer?this._buffer.numberOfChannels:0}}),u.Buffer.prototype.fromArray=function(t){var e=0<t[0].length,i=e?t.length:1,n=e?t[0].length:t.length,o=this.context.createBuffer(i,n,this.context.sampleRate);e||1!==i||(t=[t]);for(var s=0;s<i;s++)o.copyToChannel(t[s],s);return this._buffer=o,this},u.Buffer.prototype.toMono=function(t){if(u.isNumber(t))this.fromArray(this.toArray(t));else{for(var e=new Float32Array(this.length),i=this.numberOfChannels,n=0;n<i;n++)for(var o=this.toArray(n),s=0;s<o.length;s++)e[s]+=o[s];e=e.map(function(t){return t/i}),this.fromArray(e)}return this},u.Buffer.prototype.toArray=function(t){if(u.isNumber(t))return this.getChannelData(t);if(1===this.numberOfChannels)return this.toArray(0);for(var e=[],i=0;i<this.numberOfChannels;i++)e[i]=this.getChannelData(i);return e},u.Buffer.prototype.getChannelData=function(t){return this._buffer.getChannelData(t)},u.Buffer.prototype.slice=function(t,e){e=u.defaultArg(e,this.duration);for(var i=Math.floor(this.context.sampleRate*this.toSeconds(t)),n=Math.floor(this.context.sampleRate*this.toSeconds(e)),o=[],s=0;s<this.numberOfChannels;s++)o[s]=this.toArray(s).slice(i,n);return(new u.Buffer).fromArray(o)},u.Buffer.prototype._reverse=function(){if(this.loaded)for(var t=0;t<this.numberOfChannels;t++)Array.prototype.reverse.call(this.getChannelData(t));return this},Object.defineProperty(u.Buffer.prototype,"reverse",{get:function(){return this._reversed},set:function(t){this._reversed!==t&&(this._reversed=t,this._reverse())}}),u.Emitter.mixin(u.Buffer),u.Buffer._downloadQueue=[],u.Buffer.baseUrl="",u.Buffer.fromArray=function(t){return(new u.Buffer).fromArray(t)},u.Buffer.fromUrl=function(t){var e=new u.Buffer;return e.load(t).then(function(){return e})},u.Buffer._removeFromDownloadQueue=function(t){var e=u.Buffer._downloadQueue.indexOf(t);-1!==e&&u.Buffer._downloadQueue.splice(e,1)},u.Buffer.load=function(t,e,i){e=u.defaultArg(e,u.noOp);var n=t.match(/\[(.+\|?)+\]$/);if(n){for(var o=n[1].split("|"),s=o[0],r=0;r<o.length;r++)if(u.Buffer.supportsType(o[r])){s=o[r];break}t=t.replace(n[0],s)}function a(t){if(u.Buffer._removeFromDownloadQueue(h),u.Buffer.emit("error",t),!i)throw t;i(t)}function l(){for(var t=0,e=0;e<u.Buffer._downloadQueue.length;e++)t+=u.Buffer._downloadQueue[e].progress;u.Buffer.emit("progress",t/u.Buffer._downloadQueue.length)}var h=new XMLHttpRequest;return h.open("GET",u.Buffer.baseUrl+t,!0),h.responseType="arraybuffer",h.progress=0,u.Buffer._downloadQueue.push(h),h.addEventListener("load",function(){200===h.status?u.context.decodeAudioData(h.response).then(function(t){h.progress=1,l(),e(t),u.Buffer._removeFromDownloadQueue(h),0===u.Buffer._downloadQueue.length&&u.Buffer.emit("load")}).catch(function(){u.Buffer._removeFromDownloadQueue(h),a("Tone.Buffer: could not decode audio data: "+t)}):a("Tone.Buffer: could not locate file: "+t)}),h.addEventListener("error",a),h.addEventListener("progress",function(t){t.lengthComputable&&(h.progress=t.loaded/t.total*.95,l())}),h.send(),h},u.Buffer.cancelDownloads=function(){return u.Buffer._downloadQueue.slice().forEach(function(t){u.Buffer._removeFromDownloadQueue(t),t.abort()}),u.Buffer},u.Buffer.supportsType=function(t){var e=t.split(".");return e=e[e.length-1],""!==document.createElement("audio").canPlayType("audio/"+e)},u.loaded=function(){var i,n;function e(){u.Buffer.off("load",i),u.Buffer.off("error",n)}return new Promise(function(t,e){i=function(){t()},n=function(){e()},u.Buffer.on("load",i),u.Buffer.on("error",n)}).then(e).catch(function(t){throw e(),new Error(t)})},u.Buffer}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(18),i(28),i(2),i(1),i(22),i(4),i(26)],void 0===(o=function(e){"use strict";return e.LFO=function(){var t=e.defaults(arguments,["frequency","min","max"],e.LFO);e.AudioNode.call(this),this._oscillator=new e.Oscillator({frequency:t.frequency,type:t.type}),this.frequency=this._oscillator.frequency,this.amplitude=this._oscillator.volume,this.amplitude.units=e.Type.NormalRange,this.amplitude.value=t.amplitude,this._stoppedSignal=new e.Signal(0,e.Type.AudioRange),this._zeros=new e.Zero,this._stoppedValue=0,this._a2g=new e.AudioToGain,this._scaler=this.output=new e.Scale(t.min,t.max),this._units=e.Type.Default,this.units=t.units,this._oscillator.chain(this._a2g,this._scaler),this._zeros.connect(this._a2g),this._stoppedSignal.connect(this._a2g),this._readOnly(["amplitude","frequency"]),this.phase=t.phase},e.extend(e.LFO,e.AudioNode),e.LFO.defaults={type:"sine",min:0,max:1,phase:0,frequency:"4n",amplitude:1,units:e.Type.Default},e.LFO.prototype.start=function(t){return t=this.toSeconds(t),this._stoppedSignal.setValueAtTime(0,t),this._oscillator.start(t),this},e.LFO.prototype.stop=function(t){return t=this.toSeconds(t),this._stoppedSignal.setValueAtTime(this._stoppedValue,t),this._oscillator.stop(t),this},e.LFO.prototype.sync=function(){return this._oscillator.sync(),this._oscillator.syncFrequency(),this},e.LFO.prototype.unsync=function(){return this._oscillator.unsync(),this._oscillator.unsyncFrequency(),this},Object.defineProperty(e.LFO.prototype,"min",{get:function(){return this._toUnits(this._scaler.min)},set:function(t){t=this._fromUnits(t),this._scaler.min=t}}),Object.defineProperty(e.LFO.prototype,"max",{get:function(){return this._toUnits(this._scaler.max)},set:function(t){t=this._fromUnits(t),this._scaler.max=t}}),Object.defineProperty(e.LFO.prototype,"type",{get:function(){return this._oscillator.type},set:function(t){this._oscillator.type=t,this._stoppedValue=this._oscillator._getInitialValue(),this._stoppedSignal.value=this._stoppedValue}}),Object.defineProperty(e.LFO.prototype,"phase",{get:function(){return this._oscillator.phase},set:function(t){this._oscillator.phase=t,this._stoppedValue=this._oscillator._getInitialValue(),this._stoppedSignal.value=this._stoppedValue}}),Object.defineProperty(e.LFO.prototype,"units",{get:function(){return this._units},set:function(t){var e=this.min,i=this.max;this._units=t,this.min=e,this.max=i}}),Object.defineProperty(e.LFO.prototype,"mute",{get:function(){return this._oscillator.mute},set:function(t){this._oscillator.mute=t}}),Object.defineProperty(e.LFO.prototype,"state",{get:function(){return this._oscillator.state}}),e.LFO.prototype.connect=function(t){return t.constructor!==e.Signal&&t.constructor!==e.Param||(this.convert=t.convert,this.units=t.units),e.SignalBase.prototype.connect.apply(this,arguments),this},e.LFO.prototype._fromUnits=e.Param.prototype._fromUnits,e.LFO.prototype._toUnits=e.Param.prototype._toUnits,e.LFO.prototype.dispose=function(){return e.AudioNode.prototype.dispose.call(this),this._writable(["amplitude","frequency"]),this._oscillator.dispose(),this._oscillator=null,this._stoppedSignal.dispose(),this._stoppedSignal=null,this._zeros.dispose(),this._zeros=null,this._scaler.dispose(),this._scaler=null,this._a2g.dispose(),this._a2g=null,this.frequency=null,this.amplitude=null,this},e.LFO}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(29),i(93),i(1),i(3)],void 0===(o=function(e){"use strict";return e.Subtract=function(t){e.Signal.call(this),this.createInsOuts(2,0),this._sum=this.input[0]=this.output=new e.Gain,this._neg=new e.Negate,this._param=this.input[1]=new e.Signal(t),this._param.chain(this._neg,this._sum),this.proxy=!1},e.extend(e.Subtract,e.Signal),e.Subtract.prototype.dispose=function(){return e.Signal.prototype.dispose.call(this),this._neg.dispose(),this._neg=null,this._sum.disconnect(),this._sum=null,this},e.Subtract}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(4),i(2),i(24)],void 0===(o=function(a){"use strict";return a.Param=function(){var t=a.defaults(arguments,["param","units","convert"],a.Param);a.AudioNode.call(this,t),this._param=this.input=t.param,this.units=t.units,this.convert=t.convert,this.overridden=!1,this._events=new a.Timeline(1e3),a.isDefined(t.value)&&this._param&&this.setValueAtTime(t.value,0)},a.extend(a.Param,a.AudioNode),a.Param.defaults={units:a.Type.Default,convert:!0,param:void 0},Object.defineProperty(a.Param.prototype,"value",{get:function(){var t=this.now();return this._toUnits(this.getValueAtTime(t))},set:function(t){this._initialValue=this._fromUnits(t),this.cancelScheduledValues(this.now()),this.setValueAtTime(t,this.now())}}),Object.defineProperty(a.Param.prototype,"minValue",{get:function(){return this.units===a.Type.Time||this.units===a.Type.Frequency||this.units===a.Type.NormalRange||this.units===a.Type.Positive||this.units===a.Type.BPM?0:this.units===a.Type.AudioRange?-1:this.units===a.Type.Decibels?-1/0:this._param.minValue}}),Object.defineProperty(a.Param.prototype,"maxValue",{get:function(){return this.units===a.Type.NormalRange||this.units===a.Type.AudioRange?1:this._param.maxValue}}),a.Param.prototype._fromUnits=function(t){if(!this.convert&&!a.isUndef(this.convert)||this.overridden)return t;switch(this.units){case a.Type.Time:return this.toSeconds(t);case a.Type.Frequency:return this.toFrequency(t);case a.Type.Decibels:return a.dbToGain(t);case a.Type.NormalRange:return Math.min(Math.max(t,0),1);case a.Type.AudioRange:return Math.min(Math.max(t,-1),1);case a.Type.Positive:return Math.max(t,0);default:return t}},a.Param.prototype._toUnits=function(t){if(!this.convert&&!a.isUndef(this.convert))return t;switch(this.units){case a.Type.Decibels:return a.gainToDb(t);default:return t}},a.Param.prototype._minOutput=1e-5,a.Param.AutomationType={Linear:"linearRampToValueAtTime",Exponential:"exponentialRampToValueAtTime",Target:"setTargetAtTime",SetValue:"setValueAtTime",Cancel:"cancelScheduledValues"},a.Param.prototype.setValueAtTime=function(t,e){return e=this.toSeconds(e),t=this._fromUnits(t),this._events.add({type:a.Param.AutomationType.SetValue,value:t,time:e}),this.log(a.Param.AutomationType.SetValue,t,e),this._param.setValueAtTime(t,e),this},a.Param.prototype.getValueAtTime=function(t){t=this.toSeconds(t);var e=this._events.getAfter(t),i=this._events.get(t),n=a.defaultArg(this._initialValue,this._param.defaultValue),o=n;if(null===i)o=n;else if(i.type===a.Param.AutomationType.Target){var s,r=this._events.getBefore(i.time);s=null===r?n:r.value,o=this._exponentialApproach(i.time,s,i.value,i.constant,t)}else o=null===e?i.value:e.type===a.Param.AutomationType.Linear?this._linearInterpolate(i.time,i.value,e.time,e.value,t):e.type===a.Param.AutomationType.Exponential?this._exponentialInterpolate(i.time,i.value,e.time,e.value,t):i.value;return o},a.Param.prototype.setRampPoint=function(t){t=this.toSeconds(t);var e=this.getValueAtTime(t);return this.cancelAndHoldAtTime(t),0===e&&(e=this._minOutput),this.setValueAtTime(this._toUnits(e),t),this},a.Param.prototype.linearRampToValueAtTime=function(t,e){return t=this._fromUnits(t),e=this.toSeconds(e),this._events.add({type:a.Param.AutomationType.Linear,value:t,time:e}),this.log(a.Param.AutomationType.Linear,t,e),this._param.linearRampToValueAtTime(t,e),this},a.Param.prototype.exponentialRampToValueAtTime=function(t,e){return t=this._fromUnits(t),t=Math.max(this._minOutput,t),e=this.toSeconds(e),this._events.add({type:a.Param.AutomationType.Exponential,time:e,value:t}),this.log(a.Param.AutomationType.Exponential,t,e),this._param.exponentialRampToValueAtTime(t,e),this},a.Param.prototype.exponentialRampTo=function(t,e,i){return i=this.toSeconds(i),this.setRampPoint(i),this.exponentialRampToValueAtTime(t,i+this.toSeconds(e)),this},a.Param.prototype.linearRampTo=function(t,e,i){return i=this.toSeconds(i),this.setRampPoint(i),this.linearRampToValueAtTime(t,i+this.toSeconds(e)),this},a.Param.prototype.targetRampTo=function(t,e,i){return i=this.toSeconds(i),this.setRampPoint(i),this.exponentialApproachValueAtTime(t,i,e),this},a.Param.prototype.exponentialApproachValueAtTime=function(t,e,i){var n=Math.log(this.toSeconds(i)+1)/Math.log(200);return e=this.toSeconds(e),this.setTargetAtTime(t,e,n)},a.Param.prototype.setTargetAtTime=function(t,e,i){if(t=this._fromUnits(t),i<=0)throw new Error("timeConstant must be greater than 0");return e=this.toSeconds(e),this._events.add({type:a.Param.AutomationType.Target,value:t,time:e,constant:i}),this.log(a.Param.AutomationType.Target,t,e,i),this._param.setTargetAtTime(t,e,i),this},a.Param.prototype.setValueCurveAtTime=function(t,e,i,n){n=a.defaultArg(n,1),i=this.toSeconds(i),e=this.toSeconds(e),this.setValueAtTime(t[0]*n,e);for(var o=i/(t.length-1),s=1;s<t.length;s++)this.linearRampToValueAtTime(t[s]*n,e+s*o);return this},a.Param.prototype.cancelScheduledValues=function(t){return t=this.toSeconds(t),this._events.cancel(t),this._param.cancelScheduledValues(t),this.log(a.Param.AutomationType.Cancel,t),this},a.Param.prototype.cancelAndHoldAtTime=function(t){var e=this.getValueAtTime(t);this.log("cancelAndHoldAtTime",t,"value="+e),this._param.cancelScheduledValues(t);var i=this._events.get(t),n=this._events.getAfter(t);return i&&i.time===t?n?this._events.cancel(n.time):this._events.cancel(t+1e-6):n&&(this._events.cancel(n.time),n.type===a.Param.AutomationType.Linear?this.linearRampToValueAtTime(e,t):n.type===a.Param.AutomationType.Exponential&&this.exponentialRampToValueAtTime(e,t)),this._events.add({type:a.Param.AutomationType.SetValue,value:e,time:t}),this._param.setValueAtTime(e,t),this},a.Param.prototype.rampTo=function(t,e,i){return e=a.defaultArg(e,.1),this.units===a.Type.Frequency||this.units===a.Type.BPM||this.units===a.Type.Decibels?this.exponentialRampTo(t,e,i):this.linearRampTo(t,e,i),this},a.Param.prototype._exponentialApproach=function(t,e,i,n,o){return i+(e-i)*Math.exp(-(o-t)/n)},a.Param.prototype._linearInterpolate=function(t,e,i,n,o){return e+(o-t)/(i-t)*(n-e)},a.Param.prototype._exponentialInterpolate=function(t,e,i,n,o){return e*Math.pow(n/e,(o-t)/(i-t))},a.Param.prototype.dispose=function(){return a.AudioNode.prototype.dispose.call(this),this._param=null,this._events=null,this},a.Param}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(8),i(16),i(9),i(23)],void 0===(o=function(e){"use strict";return e.StereoEffect=function(){e.AudioNode.call(this);var t=e.defaults(arguments,["wet"],e.Effect);this.createInsOuts(1,1),this._dryWet=new e.CrossFade(t.wet),this.wet=this._dryWet.fade,this._split=new e.Split,this.effectSendL=this._split.left,this.effectSendR=this._split.right,this._merge=new e.Merge,this.effectReturnL=this._merge.left,this.effectReturnR=this._merge.right,this.input.connect(this._split),this.input.connect(this._dryWet,0,0),this._merge.connect(this._dryWet,0,1),this._dryWet.connect(this.output),this._readOnly(["wet"])},e.extend(e.StereoEffect,e.Effect),e.StereoEffect.prototype.dispose=function(){return e.AudioNode.prototype.dispose.call(this),this._dryWet.dispose(),this._dryWet=null,this._split.dispose(),this._split=null,this._merge.dispose(),this._merge=null,this.effectSendL=null,this.effectSendR=null,this.effectReturnL=null,this.effectReturnR=null,this._writable(["wet"]),this.wet=null,this},e.StereoEffect}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(3),i(2)],void 0===(o=function(t){"use strict";return t.Split=function(){t.AudioNode.call(this),this.createInsOuts(0,2),this._splitter=this.input=this.context.createChannelSplitter(2),this.left=this.output[0]=new t.Gain,this.right=this.output[1]=new t.Gain,this._splitter.connect(this.left,0,0),this._splitter.connect(this.right,1,0)},t.extend(t.Split,t.AudioNode),t.Split.prototype.dispose=function(){return t.AudioNode.prototype.dispose.call(this),this._splitter.disconnect(),this.left.dispose(),this.left=null,this.right.dispose(),this.right=null,this._splitter=null,this},t.Split}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(87),i(4),i(24),i(35),i(3),i(85),i(84),i(56)],void 0===(o=function(s){"use strict";s.Transport=function(){s.Emitter.call(this),s.getContext(function(){this.loop=!1,this._loopStart=0,this._loopEnd=0,this._ppq=e.defaults.PPQ,this._clock=new s.Clock({callback:this._processTick.bind(this),frequency:0}),this._bindClockEvents(),this.bpm=this._clock.frequency,this.bpm._toUnits=this._toUnits.bind(this),this.bpm._fromUnits=this._fromUnits.bind(this),this.bpm.units=s.Type.BPM,this.bpm.value=e.defaults.bpm,this._readOnly("bpm"),this._timeSignature=e.defaults.timeSignature,this._scheduledEvents={},this._timeline=new s.Timeline,this._repeatedEvents=new s.IntervalTimeline,this._syncedSignals=[],this._swingTicks=e.defaults.PPQ/2,this._swingAmount=0,this.context.transport=this}.bind(this))},s.extend(s.Transport,s.Emitter),s.Transport.defaults={bpm:120,swing:0,swingSubdivision:"8n",timeSignature:4,loopStart:0,loopEnd:"4m",PPQ:192},s.Transport.prototype.isTransport=!0,s.Transport.prototype._processTick=function(e,t){if(0<this._swingAmount&&t%this._ppq!=0&&t%(2*this._swingTicks)!=0){var i=t%(2*this._swingTicks)/(2*this._swingTicks),n=Math.sin(i*Math.PI)*this._swingAmount;e+=s.Ticks(2*this._swingTicks/3).toSeconds()*n}this.loop&&t>=this._loopEnd&&(this.emit("loopEnd",e),this._clock.setTicksAtTime(this._loopStart,e),t=this._loopStart,this.emit("loopStart",e,this._clock.getSecondsAtTime(e)),this.emit("loop",e)),this._timeline.forEachAtTime(t,function(t){t.invoke(e)})},s.Transport.prototype.schedule=function(t,e){var i=new s.TransportEvent(this,{time:s.TransportTime(e),callback:t});return this._addEvent(i,this._timeline)},s.Transport.prototype.scheduleRepeat=function(t,e,i,n){var o=new s.TransportRepeatEvent(this,{callback:t,interval:s.Time(e),time:s.TransportTime(i),duration:s.Time(s.defaultArg(n,1/0))});return this._addEvent(o,this._repeatedEvents)},s.Transport.prototype.scheduleOnce=function(t,e){var i=new s.TransportEvent(this,{time:s.TransportTime(e),callback:t,once:!0});return this._addEvent(i,this._timeline)},s.Transport.prototype.clear=function(t){if(this._scheduledEvents.hasOwnProperty(t)){var e=this._scheduledEvents[t.toString()];e.timeline.remove(e.event),e.event.dispose(),delete this._scheduledEvents[t.toString()]}return this},s.Transport.prototype._addEvent=function(t,e){return this._scheduledEvents[t.id.toString()]={event:t,timeline:e},e.add(t),t.id},s.Transport.prototype.cancel=function(t){return t=s.defaultArg(t,0),t=this.toTicks(t),this._timeline.forEachFrom(t,function(t){this.clear(t.id)}.bind(this)),this._repeatedEvents.forEachFrom(t,function(t){this.clear(t.id)}.bind(this)),this},s.Transport.prototype._bindClockEvents=function(){this._clock.on("start",function(t,e){e=s.Ticks(e).toSeconds(),this.emit("start",t,e)}.bind(this)),this._clock.on("stop",function(t){this.emit("stop",t)}.bind(this)),this._clock.on("pause",function(t){this.emit("pause",t)}.bind(this))},Object.defineProperty(s.Transport.prototype,"state",{get:function(){return this._clock.getStateAtTime(this.now())}}),s.Transport.prototype.start=function(t,e){return s.isDefined(e)&&(e=this.toTicks(e)),this._clock.start(t,e),this},s.Transport.prototype.stop=function(t){return this._clock.stop(t),this},s.Transport.prototype.pause=function(t){return this._clock.pause(t),this},s.Transport.prototype.toggle=function(t){return t=this.toSeconds(t),this._clock.getStateAtTime(t)!==s.State.Started?this.start(t):this.stop(t),this},Object.defineProperty(s.Transport.prototype,"timeSignature",{get:function(){return this._timeSignature},set:function(t){s.isArray(t)&&(t=t[0]/t[1]*4),this._timeSignature=t}}),Object.defineProperty(s.Transport.prototype,"loopStart",{get:function(){return s.Ticks(this._loopStart).toSeconds()},set:function(t){this._loopStart=this.toTicks(t)}}),Object.defineProperty(s.Transport.prototype,"loopEnd",{get:function(){return s.Ticks(this._loopEnd).toSeconds()},set:function(t){this._loopEnd=this.toTicks(t)}}),s.Transport.prototype.setLoopPoints=function(t,e){return this.loopStart=t,this.loopEnd=e,this},Object.defineProperty(s.Transport.prototype,"swing",{get:function(){return this._swingAmount},set:function(t){this._swingAmount=t}}),Object.defineProperty(s.Transport.prototype,"swingSubdivision",{get:function(){return s.Ticks(this._swingTicks).toNotation()},set:function(t){this._swingTicks=this.toTicks(t)}}),Object.defineProperty(s.Transport.prototype,"position",{get:function(){var t=this.now(),e=this._clock.getTicksAtTime(t);return s.Ticks(e).toBarsBeatsSixteenths()},set:function(t){var e=this.toTicks(t);this.ticks=e}}),Object.defineProperty(s.Transport.prototype,"seconds",{get:function(){return this._clock.seconds},set:function(t){var e=this.now(),i=this.bpm.timeToTicks(t,e);this.ticks=i}}),Object.defineProperty(s.Transport.prototype,"progress",{get:function(){if(this.loop){var t=this.now();return(this._clock.getTicksAtTime(t)-this._loopStart)/(this._loopEnd-this._loopStart)}return 0}}),Object.defineProperty(s.Transport.prototype,"ticks",{get:function(){return this._clock.ticks},set:function(t){if(this._clock.ticks!==t){var e=this.now();this.state===s.State.Started?(this.emit("stop",e),this._clock.setTicksAtTime(t,e),this.emit("start",e,this.seconds)):this._clock.setTicksAtTime(t,e)}}}),s.Transport.prototype.getTicksAtTime=function(t){return Math.round(this._clock.getTicksAtTime(t))},s.Transport.prototype.getSecondsAtTime=function(t){return this._clock.getSecondsAtTime(t)},Object.defineProperty(s.Transport.prototype,"PPQ",{get:function(){return this._ppq},set:function(t){var e=this.bpm.value;this._ppq=t,this.bpm.value=e}}),s.Transport.prototype._fromUnits=function(t){return 1/(60/t/this.PPQ)},s.Transport.prototype._toUnits=function(t){return t/this.PPQ*60},s.Transport.prototype.nextSubdivision=function(t){if(t=this.toTicks(t),this.state!==s.State.Started)return 0;var e=this.now(),i=t-this.getTicksAtTime(e)%t;return this._clock.nextTickTime(i,e)},s.Transport.prototype.syncSignal=function(t,e){if(!e){var i=this.now();e=0!==t.getValueAtTime(i)?t.getValueAtTime(i)/this.bpm.getValueAtTime(i):0}var n=new s.Gain(e);return this.bpm.chain(n,t._param),this._syncedSignals.push({ratio:n,signal:t,initial:t.value}),t.value=0,this},s.Transport.prototype.unsyncSignal=function(t){for(var e=this._syncedSignals.length-1;0<=e;e--){var i=this._syncedSignals[e];i.signal===t&&(i.ratio.dispose(),i.signal.value=i.initial,this._syncedSignals.splice(e,1))}return this},s.Transport.prototype.dispose=function(){return s.Emitter.prototype.dispose.call(this),this._clock.dispose(),this._clock=null,this._writable("bpm"),this.bpm=null,this._timeline.dispose(),this._timeline=null,this._repeatedEvents.dispose(),this._repeatedEvents=null,this};var e=s.Transport;return s.Transport=new e,s.Context.on("init",function(t){t.transport&&t.transport.isTransport?s.Transport=t.transport:s.Transport=new e}),s.Context.on("close",function(t){t.transport&&t.transport.isTransport&&t.transport.dispose()}),s.Transport}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(1),i(6),i(17),i(83)],void 0===(o=function(u){"use strict";return u.Oscillator=function(){var t=u.defaults(arguments,["frequency","type"],u.Oscillator);u.Source.call(this,t),this._oscillator=null,this.frequency=new u.Signal(t.frequency,u.Type.Frequency),this.detune=new u.Signal(t.detune,u.Type.Cents),this._wave=null,this._partials=u.defaultArg(t.partials,[1]),this._phase=t.phase,this._type=null,this.type=t.type,this.phase=this._phase,this._readOnly(["frequency","detune"])},u.extend(u.Oscillator,u.Source),u.Oscillator.defaults={type:"sine",frequency:440,detune:0,phase:0,partials:[]},u.Oscillator.Type={Sine:"sine",Triangle:"triangle",Sawtooth:"sawtooth",Square:"square",Custom:"custom"},u.Oscillator.prototype._start=function(t){this.log("start",t),this._oscillator=new u.OscillatorNode,this._wave?this._oscillator.setPeriodicWave(this._wave):this._oscillator.type=this._type,this._oscillator.connect(this.output),this.frequency.connect(this._oscillator.frequency),this.detune.connect(this._oscillator.detune),t=this.toSeconds(t),this._oscillator.start(t)},u.Oscillator.prototype._stop=function(t){return this.log("stop",t),this._oscillator&&(t=this.toSeconds(t),this._oscillator.stop(t)),this},u.Oscillator.prototype.restart=function(t){return this._oscillator.cancelStop(),this._state.cancel(this.toSeconds(t)),this},u.Oscillator.prototype.syncFrequency=function(){return u.Transport.syncSignal(this.frequency),this},u.Oscillator.prototype.unsyncFrequency=function(){return u.Transport.unsyncSignal(this.frequency),this},Object.defineProperty(u.Oscillator.prototype,"type",{get:function(){return this._type},set:function(t){var e=[u.Oscillator.Type.Sine,u.Oscillator.Type.Square,u.Oscillator.Type.Triangle,u.Oscillator.Type.Sawtooth].includes(t);if(0===this._phase&&e)(this._wave=null)!==this._oscillator&&(this._oscillator.type=t);else{var i=this._getRealImaginary(t,this._phase),n=this.context.createPeriodicWave(i[0],i[1]);this._wave=n,null!==this._oscillator&&this._oscillator.setPeriodicWave(this._wave)}this._type=t}}),u.Oscillator.prototype._getRealImaginary=function(t,e){var i=2048,n=new Float32Array(i),o=new Float32Array(i),s=1;if(t===u.Oscillator.Type.Custom)i=s=this._partials.length+1;else{var r=/^(sine|triangle|square|sawtooth)(\d+)$/.exec(t);r&&(s=parseInt(r[2])+1,t=r[1],i=s=Math.max(s,2))}for(var a=1;a<i;++a){var l,h=2/(a*Math.PI);switch(t){case u.Oscillator.Type.Sine:l=a<=s?1:0;break;case u.Oscillator.Type.Square:l=1&a?2*h:0;break;case u.Oscillator.Type.Sawtooth:l=h*(1&a?1:-1);break;case u.Oscillator.Type.Triangle:l=1&a?h*h*2*(a-1>>1&1?-1:1):0;break;case u.Oscillator.Type.Custom:l=this._partials[a-1];break;default:throw new TypeError("Tone.Oscillator: invalid type: "+t)}0!==l?(n[a]=-l*Math.sin(e*a),o[a]=l*Math.cos(e*a)):(n[a]=0,o[a]=0)}return[n,o]},u.Oscillator.prototype._inverseFFT=function(t,e,i){for(var n=0,o=t.length,s=0;s<o;s++)n+=t[s]*Math.cos(s*i)+e[s]*Math.sin(s*i);return n},u.Oscillator.prototype._getInitialValue=function(){for(var t=this._getRealImaginary(this._type,0),e=t[0],i=t[1],n=0,o=2*Math.PI,s=0;s<8;s++)n=Math.max(this._inverseFFT(e,i,s/8*o),n);return-this._inverseFFT(e,i,this._phase)/n},Object.defineProperty(u.Oscillator.prototype,"partials",{get:function(){return this._type!==u.Oscillator.Type.Custom?[]:this._partials},set:function(t){this._partials=t,this.type=u.Oscillator.Type.Custom}}),Object.defineProperty(u.Oscillator.prototype,"phase",{get:function(){return this._phase*(180/Math.PI)},set:function(t){this._phase=t*Math.PI/180,this.type=this._type}}),u.Oscillator.prototype.dispose=function(){return u.Source.prototype.dispose.call(this),null!==this._oscillator&&(this._oscillator.dispose(),this._oscillator=null),this._wave=null,this._writable(["frequency","detune"]),this.frequency.dispose(),this.frequency=null,this.detune.dispose(),this.detune=null,this._partials=null,this},u.Oscillator}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(14),i(2)],void 0===(o=function(e){"use strict";return e.Delay=function(){var t=e.defaults(arguments,["delayTime","maxDelay"],e.Delay);e.AudioNode.call(this,t),this._maxDelay=Math.max(this.toSeconds(t.maxDelay),this.toSeconds(t.delayTime)),this._delayNode=this.input=this.output=this.context.createDelay(this._maxDelay),this.delayTime=new e.Param({param:this._delayNode.delayTime,units:e.Type.Time,value:t.delayTime}),this._readOnly("delayTime")},e.extend(e.Delay,e.AudioNode),e.Delay.defaults={maxDelay:1,delayTime:0},Object.defineProperty(e.Delay.prototype,"maxDelay",{get:function(){return this._maxDelay}}),e.Delay.prototype.dispose=function(){return e.AudioNode.prototype.dispose.call(this),this._delayNode.disconnect(),this._delayNode=null,this._writable("delayTime"),this.delayTime=null,this},e.Delay}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(35),i(24),i(34)],void 0===(o=function(s){s.Context=function(){s.Emitter.call(this);var t=s.defaults(arguments,["context"],s.Context);if(!t.context&&(t.context=new s.global.AudioContext,!t.context))throw new Error("could not create AudioContext. Possibly too many AudioContexts running already.");for(this._context=t.context;this._context.rawContext;)this._context=this._context.rawContext;for(var e in this._context)this._defineProperty(this._context,e);this._latencyHint=t.latencyHint,this._constants={},this.lookAhead=t.lookAhead,this._computedUpdateInterval=0,this._ticker=new i(this.emit.bind(this,"tick"),t.clockSource,t.updateInterval),this._timeouts=new s.Timeline,this._timeoutIds=0,this.on("tick",this._timeoutLoop.bind(this)),this._context.onstatechange=function(t){this.emit("statechange",t)}.bind(this)},s.extend(s.Context,s.Emitter),s.Emitter.mixin(s.Context),s.Context.defaults={clockSource:"worker",latencyHint:"interactive",lookAhead:.1,updateInterval:.03},s.Context.prototype.isContext=!0,s.Context.prototype._defineProperty=function(e,i){s.isUndef(this[i])&&Object.defineProperty(this,i,{get:function(){return"function"==typeof e[i]?e[i].bind(e):e[i]},set:function(t){e[i]=t}})},s.Context.prototype.now=function(){return this._context.currentTime+this.lookAhead},Object.defineProperty(s.Context.prototype,"destination",{get:function(){return this.master?this.master:this._context.destination}}),s.Context.prototype.resume=function(){return"suspended"===this._context.state&&this._context instanceof AudioContext?this._context.resume():Promise.resolve()},s.Context.prototype.close=function(){var t=Promise.resolve();return this!==s.global.TONE_AUDIO_CONTEXT&&(t=this.rawContext.close()),t.then(function(){s.Context.emit("close",this)}.bind(this))},s.Context.prototype.getConstant=function(t){if(this._constants[t])return this._constants[t];for(var e=this._context.createBuffer(1,128,this._context.sampleRate),i=e.getChannelData(0),n=0;n<i.length;n++)i[n]=t;var o=this._context.createBufferSource();return o.channelCount=1,o.channelCountMode="explicit",o.buffer=e,o.loop=!0,o.start(0),this._constants[t]=o},s.Context.prototype._timeoutLoop=function(){for(var t=this.now();this._timeouts&&this._timeouts.length&&this._timeouts.peek().time<=t;)this._timeouts.shift().callback()},s.Context.prototype.setTimeout=function(t,e){this._timeoutIds++;var i=this.now();return this._timeouts.add({callback:t,time:i+e,id:this._timeoutIds}),this._timeoutIds},s.Context.prototype.clearTimeout=function(e){return this._timeouts.forEach(function(t){t.id===e&&this.remove(t)}),this},Object.defineProperty(s.Context.prototype,"updateInterval",{get:function(){return this._ticker.updateInterval},set:function(t){this._ticker.updateInterval=t}}),Object.defineProperty(s.Context.prototype,"rawContext",{get:function(){return this._context}}),Object.defineProperty(s.Context.prototype,"clockSource",{get:function(){return this._ticker.type},set:function(t){this._ticker.type=t}}),Object.defineProperty(s.Context.prototype,"latencyHint",{get:function(){return this._latencyHint},set:function(t){var e=t;if(this._latencyHint=t,s.isString(t))switch(t){case"interactive":e=.1,this._context.latencyHint=t;break;case"playback":e=.8,this._context.latencyHint=t;break;case"balanced":e=.25,this._context.latencyHint=t;break;case"fastest":this._context.latencyHint="interactive",e=.01}this.lookAhead=e,this.updateInterval=e/3}}),s.Context.prototype.dispose=function(){return this.close().then(function(){for(var t in s.Emitter.prototype.dispose.call(this),this._ticker.dispose(),this._ticker=null,this._timeouts.dispose(),this._timeouts=null,this._constants)this._constants[t].disconnect();this._constants=null}.bind(this))};var i=function(t,e,i){this._type=e,this._updateInterval=i,this._callback=s.defaultArg(t,s.noOp),this._createClock()};if(i.Type={Worker:"worker",Timeout:"timeout",Offline:"offline"},i.prototype._createWorker=function(){s.global.URL=s.global.URL||s.global.webkitURL;var t=new Blob(["var timeoutTime = "+(1e3*this._updateInterval).toFixed(1)+";self.onmessage = function(msg){\ttimeoutTime = parseInt(msg.data);};function tick(){\tsetTimeout(tick, timeoutTime);\tself.postMessage('tick');}tick();"]),e=URL.createObjectURL(t),i=new Worker(e);i.onmessage=this._callback.bind(this),this._worker=i},i.prototype._createTimeout=function(){this._timeout=setTimeout(function(){this._createTimeout(),this._callback()}.bind(this),1e3*this._updateInterval)},i.prototype._createClock=function(){if(this._type===i.Type.Worker)try{this._createWorker()}catch(t){this._type=i.Type.Timeout,this._createClock()}else this._type===i.Type.Timeout&&this._createTimeout()},Object.defineProperty(i.prototype,"updateInterval",{get:function(){return this._updateInterval},set:function(t){this._updateInterval=Math.max(t,128/44100),this._type===i.Type.Worker&&this._worker.postMessage(Math.max(1e3*t,1))}}),Object.defineProperty(i.prototype,"type",{get:function(){return this._type},set:function(t){this._disposeClock(),this._type=t,this._createClock()}}),i.prototype._disposeClock=function(){this._timeout&&(clearTimeout(this._timeout),this._timeout=null),this._worker&&(this._worker.terminate(),this._worker.onmessage=null,this._worker=null)},i.prototype.dispose=function(){this._disposeClock(),this._callback=null},s.getContext(function(){var n=AudioNode.prototype.connect,o=AudioNode.prototype.disconnect;function t(e,t,i){if(e.input)return i=s.defaultArg(i,0),s.isArray(e.input)?this.connect(e.input[i]):this.connect(e.input,t,i);try{return e instanceof AudioNode?n.call(this,e,t,i):n.call(this,e,t),e}catch(t){throw new Error("error connecting to node: "+e+"\n"+t)}}AudioNode.prototype.connect!==t&&(AudioNode.prototype.connect=t,AudioNode.prototype.disconnect=function(e,t,i){if(e&&e.input&&s.isArray(e.input))i=s.defaultArg(i,0),this.disconnect(e.input[i],t,0);else if(e&&e.input)this.disconnect(e.input,t,i);else try{e instanceof AudioParam?o.call(this,e,t):o.apply(this,arguments)}catch(t){throw new Error("error disconnecting node: "+e+"\n"+t)}})}),s.supported&&!s.initialized){if(s.global.TONE_AUDIO_CONTEXT||(s.global.TONE_AUDIO_CONTEXT=new s.Context),s.context=s.global.TONE_AUDIO_CONTEXT,!s.global.TONE_SILENCE_VERSION_LOGGING){var t="v";"dev"===s.version&&(t="");var e=" * Tone.js "+t+s.version+" * ";console.log("%c"+e,"background: #000; color: #fff")}}else s.supported||console.warn("This browser does not support Tone.js");return s.Context}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(4),i(40)],void 0===(o=function(s){"use strict";return s.Instrument=function(t){t=s.defaultArg(t,s.Instrument.defaults),s.AudioNode.call(this),this._volume=this.output=new s.Volume(t.volume),this.volume=this._volume.volume,this._readOnly("volume"),this._scheduledEvents=[]},s.extend(s.Instrument,s.AudioNode),s.Instrument.defaults={volume:0},s.Instrument.prototype.triggerAttack=s.noOp,s.Instrument.prototype.triggerRelease=s.noOp,s.Instrument.prototype.sync=function(){return this._syncMethod("triggerAttack",1),this._syncMethod("triggerRelease",0),this},s.Instrument.prototype._syncMethod=function(t,n){var o=this["_original_"+t]=this[t];this[t]=function(){var e=Array.prototype.slice.call(arguments),t=e[n],i=s.Transport.schedule(function(t){e[n]=t,o.apply(this,e)}.bind(this),t);this._scheduledEvents.push(i)}.bind(this)},s.Instrument.prototype.unsync=function(){return this._scheduledEvents.forEach(function(t){s.Transport.clear(t)}),this._scheduledEvents=[],this._original_triggerAttack&&(this.triggerAttack=this._original_triggerAttack,this.triggerRelease=this._original_triggerRelease),this},s.Instrument.prototype.triggerAttackRelease=function(t,e,i,n){return i=this.toSeconds(i),e=this.toSeconds(e),this.triggerAttack(t,i,n),this.triggerRelease(i+e),this},s.Instrument.prototype.dispose=function(){return s.AudioNode.prototype.dispose.call(this),this._volume.dispose(),this._volume=null,this._writable(["volume"]),this.volume=null,this.unsync(),this._scheduledEvents=null,this},s.Instrument}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(7),i(1)],void 0===(o=function(t){"use strict";return t.AudioToGain=function(){t.SignalBase.call(this),this._norm=this.input=this.output=new t.WaveShaper(function(t){return(t+1)/2})},t.extend(t.AudioToGain,t.SignalBase),t.AudioToGain.prototype.dispose=function(){return t.SignalBase.prototype.dispose.call(this),this._norm.dispose(),this._norm=null,this},t.AudioToGain}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(1),i(13),i(92),i(3),i(2)],void 0===(o=function(e){"use strict";return e.CrossFade=function(t){e.AudioNode.call(this),this.createInsOuts(2,1),this.a=this.input[0]=new e.Gain,this.b=this.input[1]=new e.Gain,this.fade=new e.Signal(e.defaultArg(t,.5),e.Type.NormalRange),this._equalPowerA=new e.EqualPowerGain,this._equalPowerB=new e.EqualPowerGain,this._one=this.context.getConstant(1),this._invert=new e.Subtract,this.a.connect(this.output),this.b.connect(this.output),this.fade.chain(this._equalPowerB,this.b.gain),this._one.connect(this._invert,0,0),this.fade.connect(this._invert,0,1),this._invert.chain(this._equalPowerA,this.a.gain),this._readOnly("fade")},e.extend(e.CrossFade,e.AudioNode),e.CrossFade.prototype.dispose=function(){return e.AudioNode.prototype.dispose.call(this),this._writable("fade"),this._equalPowerA.dispose(),this._equalPowerA=null,this._equalPowerB.dispose(),this._equalPowerB=null,this.fade.dispose(),this.fade=null,this._invert.dispose(),this._invert=null,this._one=null,this.a.dispose(),this.a=null,this.b.dispose(),this.b=null,this},e.CrossFade}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0)],void 0===(o=function(h){"use strict";return h.Timeline=function(){var t=h.defaults(arguments,["memory"],h.Timeline);h.call(this),this._timeline=[],this.memory=t.memory},h.extend(h.Timeline),h.Timeline.defaults={memory:1/0},Object.defineProperty(h.Timeline.prototype,"length",{get:function(){return this._timeline.length}}),h.Timeline.prototype.add=function(t){if(h.isUndef(t.time))throw new Error("Tone.Timeline: events must have a time attribute");t.time=t.time.valueOf();var e=this._search(t.time);if(this._timeline.splice(e+1,0,t),this.length>this.memory){var i=this.length-this.memory;this._timeline.splice(0,i)}return this},h.Timeline.prototype.remove=function(t){var e=this._timeline.indexOf(t);return-1!==e&&this._timeline.splice(e,1),this},h.Timeline.prototype.get=function(t,e){e=h.defaultArg(e,"time");var i=this._search(t,e);return-1!==i?this._timeline[i]:null},h.Timeline.prototype.peek=function(){return this._timeline[0]},h.Timeline.prototype.shift=function(){return this._timeline.shift()},h.Timeline.prototype.getAfter=function(t,e){e=h.defaultArg(e,"time");var i=this._search(t,e);return i+1<this._timeline.length?this._timeline[i+1]:null},h.Timeline.prototype.getBefore=function(t,e){e=h.defaultArg(e,"time");var i=this._timeline.length;if(0<i&&this._timeline[i-1][e]<t)return this._timeline[i-1];var n=this._search(t,e);return 0<=n-1?this._timeline[n-1]:null},h.Timeline.prototype.cancel=function(t){if(1<this._timeline.length){var e=this._search(t);if(0<=e)if(this._timeline[e].time===t){for(var i=e;0<=i&&this._timeline[i].time===t;i--)e=i;this._timeline=this._timeline.slice(0,e)}else this._timeline=this._timeline.slice(0,e+1);else this._timeline=[]}else 1===this._timeline.length&&this._timeline[0].time>=t&&(this._timeline=[]);return this},h.Timeline.prototype.cancelBefore=function(t){var e=this._search(t);return 0<=e&&(this._timeline=this._timeline.slice(e+1)),this},h.Timeline.prototype.previousEvent=function(t){var e=this._timeline.indexOf(t);return 0<e?this._timeline[e-1]:null},h.Timeline.prototype._search=function(t,e){if(0===this._timeline.length)return-1;e=h.defaultArg(e,"time");var i=0,n=this._timeline.length,o=n;if(0<n&&this._timeline[n-1][e]<=t)return n-1;for(;i<o;){var s=Math.floor(i+(o-i)/2),r=this._timeline[s],a=this._timeline[s+1];if(r[e]===t){for(var l=s;l<this._timeline.length;l++)this._timeline[l][e]===t&&(s=l);return s}if(r[e]<t&&a[e]>t)return s;r[e]>t?o=s:i=s+1}return-1},h.Timeline.prototype._iterate=function(e,t,i){t=h.defaultArg(t,0),i=h.defaultArg(i,this._timeline.length-1),this._timeline.slice(t,i+1).forEach(function(t){e.call(this,t)}.bind(this))},h.Timeline.prototype.forEach=function(t){return this._iterate(t),this},h.Timeline.prototype.forEachBefore=function(t,e){var i=this._search(t);return-1!==i&&this._iterate(e,0,i),this},h.Timeline.prototype.forEachAfter=function(t,e){var i=this._search(t);return this._iterate(e,i+1),this},h.Timeline.prototype.forEachBetween=function(t,e,i){var n=this._search(t),o=this._search(e);return-1!==n&&-1!==o?(this._timeline[n].time!==t&&(n+=1),this._timeline[o].time===e&&(o-=1),this._iterate(i,n,o)):-1===n&&this._iterate(i,0,o),this},h.Timeline.prototype.forEachFrom=function(t,e){for(var i=this._search(t);0<=i&&this._timeline[i].time>=t;)i--;return this._iterate(e,i+1),this},h.Timeline.prototype.forEachAtTime=function(e,i){var t=this._search(e);return-1!==t&&this._iterate(function(t){t.time===e&&i.call(this,t)},0,t),this},h.Timeline.prototype.dispose=function(){return h.prototype.dispose.call(this),this._timeline=null,this},h.Timeline}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(21),i(1)],void 0===(o=function(e){"use strict";return e.Monophonic=function(t){t=e.defaultArg(t,e.Monophonic.defaults),e.Instrument.call(this,t),this.portamento=t.portamento},e.extend(e.Monophonic,e.Instrument),e.Monophonic.defaults={portamento:0},e.Monophonic.prototype.triggerAttack=function(t,e,i){return this.log("triggerAttack",t,e,i),e=this.toSeconds(e),this._triggerEnvelopeAttack(e,i),this.setNote(t,e),this},e.Monophonic.prototype.triggerRelease=function(t){return this.log("triggerRelease",t),t=this.toSeconds(t),this._triggerEnvelopeRelease(t),this},e.Monophonic.prototype._triggerEnvelopeAttack=function(){},e.Monophonic.prototype._triggerEnvelopeRelease=function(){},e.Monophonic.prototype.getLevelAtTime=function(t){return t=this.toSeconds(t),this.envelope.getValueAtTime(t)},e.Monophonic.prototype.setNote=function(t,e){if(e=this.toSeconds(e),0<this.portamento&&.05<this.getLevelAtTime(e)){var i=this.toSeconds(this.portamento);this.frequency.exponentialRampTo(t,i,e)}else this.frequency.setValueAtTime(t,e);return this},e.Monophonic}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(3),i(36)],void 0===(o=function(t){return t.Zero=function(){t.SignalBase.call(this),this._gain=this.input=this.output=new t.Gain,this.context.getConstant(0).connect(this._gain)},t.extend(t.Zero,t.SignalBase),t.Zero.prototype.dispose=function(){return t.SignalBase.prototype.dispose.call(this),this._gain.dispose(),this._gain=null,this},t.Zero}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(1),i(3),i(2)],void 0===(o=function(e){"use strict";return e.Volume=function(){var t=e.defaults(arguments,["volume"],e.Volume);e.AudioNode.call(this,t),this.output=this.input=new e.Gain(t.volume,e.Type.Decibels),this._unmutedVolume=t.volume,this.volume=this.output.gain,this._readOnly("volume"),this.mute=t.mute},e.extend(e.Volume,e.AudioNode),e.Volume.defaults={volume:0,mute:!1},Object.defineProperty(e.Volume.prototype,"mute",{get:function(){return this.volume.value===-1/0},set:function(t){!this.mute&&t?(this._unmutedVolume=this.volume.value,this.volume.value=-1/0):this.mute&&!t&&(this.volume.value=this._unmutedVolume)}}),e.Volume.prototype.dispose=function(){return this.input.dispose(),e.AudioNode.prototype.dispose.call(this),this._writable("volume"),this.volume.dispose(),this.volume=null,this},e.Volume}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(29),i(5),i(1)],void 0===(o=function(i){"use strict";return i.Scale=function(t,e){i.SignalBase.call(this),this._outputMin=i.defaultArg(t,0),this._outputMax=i.defaultArg(e,1),this._scale=this.input=new i.Multiply(1),this._add=this.output=new i.Add(0),this._scale.connect(this._add),this._setRange()},i.extend(i.Scale,i.SignalBase),Object.defineProperty(i.Scale.prototype,"min",{get:function(){return this._outputMin},set:function(t){this._outputMin=t,this._setRange()}}),Object.defineProperty(i.Scale.prototype,"max",{get:function(){return this._outputMax},set:function(t){this._outputMax=t,this._setRange()}}),i.Scale.prototype._setRange=function(){this._add.value=this._outputMin,this._scale.value=this._outputMax-this._outputMin},i.Scale.prototype.dispose=function(){return i.SignalBase.prototype.dispose.call(this),this._add.dispose(),this._add=null,this._scale.dispose(),this._scale=null,this},i.Scale}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(1),i(3)],void 0===(o=function(e){"use strict";return e.Add=function(t){e.Signal.call(this),this.createInsOuts(2,0),this._sum=this.input[0]=this.input[1]=this.output=new e.Gain,this._param=this.input[1]=new e.Signal(t),this._param.connect(this._sum),this.proxy=!1},e.extend(e.Add,e.Signal),e.Add.prototype.dispose=function(){return e.Signal.prototype.dispose.call(this),this._sum.dispose(),this._sum=null,this},e.Add}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(47),i(3)],void 0===(o=function(t){"use strict";return t.AmplitudeEnvelope=function(){t.Envelope.apply(this,arguments),this.input=this.output=new t.Gain,this._sig.connect(this.output.gain)},t.extend(t.AmplitudeEnvelope,t.Envelope),t.AmplitudeEnvelope.prototype.dispose=function(){return t.Envelope.prototype.dispose.call(this),this},t.AmplitudeEnvelope}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(11),i(6),i(3),i(2),i(63)],void 0===(o=function(l){return l.BufferSource=function(){var t=l.defaults(arguments,["buffer","onload"],l.BufferSource);l.AudioNode.call(this,t),this.onended=t.onended,this._startTime=-1,this._sourceStarted=!1,this._sourceStopped=!1,this._stopTime=-1,this._gainNode=this.output=new l.Gain(0),this._source=this.context.createBufferSource(),this._source.connect(this._gainNode),this._source.onended=this._onended.bind(this),this._buffer=new l.Buffer(t.buffer,t.onload),this.playbackRate=new l.Param({param:this._source.playbackRate,units:l.Type.Positive,value:t.playbackRate}),this.fadeIn=t.fadeIn,this.fadeOut=t.fadeOut,this.curve=t.curve,this._onendedTimeout=-1,this.loop=t.loop,this.loopStart=t.loopStart,this.loopEnd=t.loopEnd},l.extend(l.BufferSource,l.AudioNode),l.BufferSource.defaults={onended:l.noOp,onload:l.noOp,loop:!1,loopStart:0,loopEnd:0,fadeIn:0,fadeOut:0,curve:"linear",playbackRate:1},Object.defineProperty(l.BufferSource.prototype,"state",{get:function(){return this.getStateAtTime(this.now())}}),l.BufferSource.prototype.getStateAtTime=function(t){return t=this.toSeconds(t),-1!==this._startTime&&this._startTime<=t&&(-1===this._stopTime||t<this._stopTime)&&!this._sourceStopped?l.State.Started:l.State.Stopped},l.BufferSource.prototype.start=function(t,e,i,n){this.log("start",t,e,i,n),this.assert(-1===this._startTime,"can only be started once"),this.assert(this.buffer.loaded,"buffer is either not set or not loaded"),this.assert(!this._sourceStopped,"source is already stopped"),t=this.toSeconds(t),e=this.loop?l.defaultArg(e,this.loopStart):l.defaultArg(e,0),e=this.toSeconds(e),e=Math.max(e,0),n=l.defaultArg(n,1);var o=this.toSeconds(this.fadeIn);if(0<o?(this._gainNode.gain.setValueAtTime(0,t),"linear"===this.curve?this._gainNode.gain.linearRampToValueAtTime(n,t+o):this._gainNode.gain.exponentialApproachValueAtTime(n,t,o)):this._gainNode.gain.setValueAtTime(n,t),this._startTime=t,l.isDefined(i)){var s=this.toSeconds(i);s=Math.max(s,0),this.loop||(s=Math.min(s,this.buffer.duration-e%this.buffer.duration)),this.stop(t+s)}if(this.loop){var r=this.loopEnd||this.buffer.duration,a=this.loopStart;r<=e&&(e=(e-a)%(r-a)+a)}return this._source.buffer=this.buffer.get(),this._source.loopEnd=this.loopEnd||this.buffer.duration,e<this.buffer.duration&&(this._sourceStarted=!0,this._source.start(t,e)),this},l.BufferSource.prototype.stop=function(t){this.log("stop",t),this.assert(this.buffer.loaded,"buffer is either not set or not loaded"),this.assert(!this._sourceStopped,"source is already stopped"),t=this.toSeconds(t),-1!==this._stopTime&&this.cancelStop();var e=this.toSeconds(this.fadeOut);return this._stopTime=t+e,0<e?"linear"===this.curve?this._gainNode.gain.linearRampTo(0,e,t):this._gainNode.gain.targetRampTo(0,e,t):(this._gainNode.gain.cancelAndHoldAtTime(t),this._gainNode.gain.setValueAtTime(0,t)),l.context.clearTimeout(this._onendedTimeout),this._onendedTimeout=l.context.setTimeout(this._onended.bind(this),this._stopTime-this.now()),this},l.BufferSource.prototype.cancelStop=function(){if(-1!==this._startTime&&!this._sourceStopped){var t=this.toSeconds(this.fadeIn);this._gainNode.gain.cancelScheduledValues(this._startTime+t+this.sampleTime),this.context.clearTimeout(this._onendedTimeout),this._stopTime=-1}return this},l.BufferSource.prototype._onended=function(){if(!this._sourceStopped){this._sourceStopped=!0;var t="exponential"===this.curve?2*this.fadeOut:0;this._sourceStarted&&-1!==this._stopTime&&this._source.stop(this._stopTime+t),this.onended(this)}},Object.defineProperty(l.BufferSource.prototype,"loopStart",{get:function(){return this._source.loopStart},set:function(t){this._source.loopStart=this.toSeconds(t)}}),Object.defineProperty(l.BufferSource.prototype,"loopEnd",{get:function(){return this._source.loopEnd},set:function(t){this._source.loopEnd=this.toSeconds(t)}}),Object.defineProperty(l.BufferSource.prototype,"buffer",{get:function(){return this._buffer},set:function(t){this._buffer.set(t)}}),Object.defineProperty(l.BufferSource.prototype,"loop",{get:function(){return this._source.loop},set:function(t){this._source.loop=t,this.cancelStop()}}),l.BufferSource.prototype.dispose=function(){return l.AudioNode.prototype.dispose.call(this),this.onended=null,this._source.onended=null,this._source.disconnect(),this._source=null,this._gainNode.dispose(),this._gainNode=null,this._buffer.dispose(),this._buffer=null,this._startTime=-1,this.playbackRate=null,l.context.clearTimeout(this._onendedTimeout),this},l.BufferSource}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(8),i(1),i(5),i(3)],void 0===(o=function(e){"use strict";return e.FeedbackEffect=function(){var t=e.defaults(arguments,["feedback"],e.FeedbackEffect);e.Effect.call(this,t),this._feedbackGain=new e.Gain(t.feedback,e.Type.NormalRange),this.feedback=this._feedbackGain.gain,this.effectReturn.chain(this._feedbackGain,this.effectSend),this._readOnly(["feedback"])},e.extend(e.FeedbackEffect,e.Effect),e.FeedbackEffect.defaults={feedback:.125},e.FeedbackEffect.prototype.dispose=function(){return e.Effect.prototype.dispose.call(this),this._writable(["feedback"]),this._feedbackGain.dispose(),this._feedbackGain=null,this.feedback=null,this},e.FeedbackEffect}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(24),i(4)],void 0===(o=function(e){"use strict";return e.TimelineState=function(t){e.Timeline.call(this),this._initial=t},e.extend(e.TimelineState,e.Timeline),e.TimelineState.prototype.getValueAtTime=function(t){var e=this.get(t);return null!==e?e.state:this._initial},e.TimelineState.prototype.setStateAtTime=function(t,e){return this.add({state:t,time:e}),this},e.TimelineState.prototype.getLastState=function(t,e){e=this.toSeconds(e);for(var i=this._search(e);0<=i;i--){var n=this._timeline[i];if(n.state===t)return n}},e.TimelineState.prototype.getNextState=function(t,e){e=this.toSeconds(e);var i=this._search(e);if(-1!==i)for(var n=i;n<this._timeline.length;n++){var o=this._timeline[n];if(o.state===t)return o}},e.TimelineState}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(66)],void 0===(o=function(t){if(t.supported){!t.global.hasOwnProperty("AudioContext")&&t.global.hasOwnProperty("webkitAudioContext")&&(t.global.AudioContext=t.global.webkitAudioContext),AudioContext.prototype.close||(AudioContext.prototype.close=function(){return t.isFunction(this.suspend)&&this.suspend(),Promise.resolve()}),AudioContext.prototype.resume||(AudioContext.prototype.resume=function(){var t=this.createBuffer(1,1,this.sampleRate),e=this.createBufferSource();return e.buffer=t,e.connect(this.destination),e.start(0),Promise.resolve()}),!AudioContext.prototype.createGain&&AudioContext.prototype.createGainNode&&(AudioContext.prototype.createGain=AudioContext.prototype.createGainNode),!AudioContext.prototype.createDelay&&AudioContext.prototype.createDelayNode&&(AudioContext.prototype.createDelay=AudioContext.prototype.createDelayNode);var e=!1,i=new OfflineAudioContext(1,1,44100),n=new Uint32Array([1179011410,48,1163280727,544501094,16,131073,44100,176400,1048580,1635017060,8,0,0,0,0]).buffer;try{var o=i.decodeAudioData(n);o&&t.isFunction(o.then)&&(e=!0)}catch(t){e=!1}e||(AudioContext.prototype._native_decodeAudioData=AudioContext.prototype.decodeAudioData,AudioContext.prototype.decodeAudioData=function(i){return new Promise(function(t,e){this._native_decodeAudioData(i,t,e)}.bind(this))})}}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0)],void 0===(o=function(r){"use strict";return r.Emitter=function(){r.call(this),this._events={}},r.extend(r.Emitter),r.Emitter.prototype.on=function(t,e){for(var i=t.split(/\W+/),n=0;n<i.length;n++){var o=i[n];this._events.hasOwnProperty(o)||(this._events[o]=[]),this._events[o].push(e)}return this},r.Emitter.prototype.once=function(t,e){var i=function(){e.apply(this,arguments),this.off(t,i)}.bind(this);return this.on(t,i),this},r.Emitter.prototype.off=function(t,e){for(var i=t.split(/\W+/),n=0;n<i.length;n++)if(t=i[n],this._events.hasOwnProperty(t))if(r.isUndef(e))this._events[t]=[];else for(var o=this._events[t],s=0;s<o.length;s++)o[s]===e&&o.splice(s,1);return this},r.Emitter.prototype.emit=function(t){if(this._events){var e=Array.apply(null,arguments).slice(1);if(this._events.hasOwnProperty(t))for(var i=this._events[t].slice(0),n=0,o=i.length;n<o;n++)i[n].apply(this,e)}return this},r.Emitter.mixin=function(t){var e=["on","once","off","emit"];t._events={};for(var i=0;i<e.length;i++){var n=e[i],o=r.Emitter.prototype[n];t[n]=o}return r.Emitter},r.Emitter.prototype.dispose=function(){return r.prototype.dispose.call(this),this._events=null,this},r.Emitter}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(2)],void 0===(o=function(n){"use strict";return n.SignalBase=function(){n.AudioNode.call(this)},n.extend(n.SignalBase,n.AudioNode),n.SignalBase.prototype.connect=function(t,e,i){return n.Signal&&n.Signal===t.constructor||n.Param&&n.Param===t.constructor?(t._param.cancelScheduledValues(0),t._param.setValueAtTime(0,0),t.overridden=!0):t instanceof AudioParam&&(t.cancelScheduledValues(0),t.setValueAtTime(0,0)),n.AudioNode.prototype.connect.call(this,t,e,i),this},n.SignalBase}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(6),i(18),i(49),i(71),i(48),i(70),i(69)],void 0===(o=function(o){"use strict";o.OmniOscillator=function(){var t=o.defaults(arguments,["frequency","type"],o.OmniOscillator);o.Source.call(this,t),this.frequency=new o.Signal(t.frequency,o.Type.Frequency),this.detune=new o.Signal(t.detune,o.Type.Cents),this._sourceType=void 0,this._oscillator=null,this.type=t.type,this._readOnly(["frequency","detune"]),this.set(t)},o.extend(o.OmniOscillator,o.Source),o.OmniOscillator.defaults={frequency:440,detune:0,type:"sine",phase:0};var e="PulseOscillator",i="PWMOscillator",n="FMOscillator",s="AMOscillator",r="FatOscillator";return o.OmniOscillator.prototype._start=function(t){this._oscillator.start(t)},o.OmniOscillator.prototype._stop=function(t){this._oscillator.stop(t)},o.OmniOscillator.prototype.restart=function(t){this._oscillator.restart(t)},Object.defineProperty(o.OmniOscillator.prototype,"type",{get:function(){var t="";return this._sourceType===n?t="fm":this._sourceType===s?t="am":this._sourceType===r&&(t="fat"),t+this._oscillator.type},set:function(t){"fm"===t.substr(0,2)?(this._createNewOscillator(n),this._oscillator.type=t.substr(2)):"am"===t.substr(0,2)?(this._createNewOscillator(s),this._oscillator.type=t.substr(2)):"fat"===t.substr(0,3)?(this._createNewOscillator(r),this._oscillator.type=t.substr(3)):"pwm"===t?this._createNewOscillator(i):"pulse"===t?this._createNewOscillator(e):(this._createNewOscillator("Oscillator"),this._oscillator.type=t)}}),Object.defineProperty(o.OmniOscillator.prototype,"partials",{get:function(){return this._oscillator.partials},set:function(t){this._oscillator.partials=t}}),o.OmniOscillator.prototype.set=function(t,e){return"type"===t?this.type=e:o.isObject(t)&&t.hasOwnProperty("type")&&(this.type=t.type),o.prototype.set.apply(this,arguments),this},o.OmniOscillator.prototype._createNewOscillator=function(t){if(t!==this._sourceType){this._sourceType=t;var e=o[t],i=this.now();if(null!==this._oscillator){var n=this._oscillator;n.stop(i),this.context.setTimeout(function(){n.dispose(),n=null},this.blockTime)}this._oscillator=new e,this.frequency.connect(this._oscillator.frequency),this.detune.connect(this._oscillator.detune),this._oscillator.connect(this.output),this.state===o.State.Started&&this._oscillator.start(i)}},Object.defineProperty(o.OmniOscillator.prototype,"phase",{get:function(){return this._oscillator.phase},set:function(t){this._oscillator.phase=t}}),Object.defineProperty(o.OmniOscillator.prototype,"width",{get:function(){if(this._sourceType===e)return this._oscillator.width}}),Object.defineProperty(o.OmniOscillator.prototype,"count",{get:function(){if(this._sourceType===r)return this._oscillator.count},set:function(t){this._sourceType===r&&(this._oscillator.count=t)}}),Object.defineProperty(o.OmniOscillator.prototype,"spread",{get:function(){if(this._sourceType===r)return this._oscillator.spread},set:function(t){this._sourceType===r&&(this._oscillator.spread=t)}}),Object.defineProperty(o.OmniOscillator.prototype,"modulationType",{get:function(){if(this._sourceType===n||this._sourceType===s)return this._oscillator.modulationType},set:function(t){this._sourceType!==n&&this._sourceType!==s||(this._oscillator.modulationType=t)}}),Object.defineProperty(o.OmniOscillator.prototype,"modulationIndex",{get:function(){if(this._sourceType===n)return this._oscillator.modulationIndex}}),Object.defineProperty(o.OmniOscillator.prototype,"harmonicity",{get:function(){if(this._sourceType===n||this._sourceType===s)return this._oscillator.harmonicity}}),Object.defineProperty(o.OmniOscillator.prototype,"modulationFrequency",{get:function(){if(this._sourceType===i)return this._oscillator.modulationFrequency}}),o.OmniOscillator.prototype.dispose=function(){return o.Source.prototype.dispose.call(this),this._writable(["frequency","detune"]),this.detune.dispose(),this.detune=null,this.frequency.dispose(),this.frequency=null,this._oscillator.dispose(),this._oscillator=null,this._sourceType=null,this},o.OmniOscillator}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(30),i(37),i(1),i(25)],void 0===(o=function(e){"use strict";return e.Synth=function(t){t=e.defaultArg(t,e.Synth.defaults),e.Monophonic.call(this,t),this.oscillator=new e.OmniOscillator(t.oscillator),this.frequency=this.oscillator.frequency,this.detune=this.oscillator.detune,this.envelope=new e.AmplitudeEnvelope(t.envelope),this.oscillator.chain(this.envelope,this.output),this._readOnly(["oscillator","frequency","detune","envelope"])},e.extend(e.Synth,e.Monophonic),e.Synth.defaults={oscillator:{type:"triangle"},envelope:{attack:.005,decay:.1,sustain:.3,release:1}},e.Synth.prototype._triggerEnvelopeAttack=function(t,e){return this.envelope.triggerAttack(t,e),this.oscillator.start(t),0===this.envelope.sustain&&this.oscillator.stop(t+this.envelope.attack+this.envelope.decay),this},e.Synth.prototype._triggerEnvelopeRelease=function(t){return t=this.toSeconds(t),this.envelope.triggerRelease(t),this.oscillator.stop(t+this.envelope.release),this},e.Synth.prototype.dispose=function(){return e.Monophonic.prototype.dispose.call(this),this._writable(["oscillator","frequency","detune","envelope"]),this.oscillator.dispose(),this.oscillator=null,this.envelope.dispose(),this.envelope=null,this.frequency=null,this.detune=null,this},e.Synth}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(6),i(11),i(31)],void 0===(o=function(p){"use strict";p.Noise=function(){var t=p.defaults(arguments,["type"],p.Noise);p.Source.call(this,t),this._source=null,this._type=t.type,this._playbackRate=t.playbackRate},p.extend(p.Noise,p.Source),p.Noise.defaults={type:"white",playbackRate:1},Object.defineProperty(p.Noise.prototype,"type",{get:function(){return this._type},set:function(t){if(this._type!==t){if(!(t in i))throw new TypeError("Tone.Noise: invalid type: "+t);if(this._type=t,this.state===p.State.Started){var e=this.now();this._stop(e),this._start(e)}}}}),Object.defineProperty(p.Noise.prototype,"playbackRate",{get:function(){return this._playbackRate},set:function(t){this._playbackRate=t,this._source&&(this._source.playbackRate.value=t)}}),p.Noise.prototype._start=function(t){var e=i[this._type];this._source=new p.BufferSource(e).connect(this.output),this._source.loop=!0,this._source.playbackRate.value=this._playbackRate,this._source.start(this.toSeconds(t),Math.random()*(e.duration-.001))},p.Noise.prototype._stop=function(t){this._source&&(this._source.stop(this.toSeconds(t)),this._source=null)},p.Noise.prototype.restart=function(t){return this._stop(t),this._start(t),this},p.Noise.prototype.dispose=function(){return p.Source.prototype.dispose.call(this),null!==this._source&&(this._source.disconnect(),this._source=null),this._buffer=null,this};var i={},f={};return Object.defineProperty(i,"pink",{get:function(){if(!f.pink){for(var t=[],e=0;e<2;e++){var i,n,o,s,r,a,l,h=new Float32Array(220500);t[e]=h,i=n=o=s=r=a=l=0;for(var u=0;u<220500;u++){var c=2*Math.random()-1;i=.99886*i+.0555179*c,n=.99332*n+.0750759*c,o=.969*o+.153852*c,s=.8665*s+.3104856*c,r=.55*r+.5329522*c,a=-.7616*a-.016898*c,h[u]=i+n+o+s+r+a+l+.5362*c,h[u]*=.11,l=.115926*c}}f.pink=(new p.Buffer).fromArray(t)}return f.pink}}),Object.defineProperty(i,"brown",{get:function(){if(!f.brown){for(var t=[],e=0;e<2;e++){var i=new Float32Array(220500);t[e]=i;for(var n=0,o=0;o<220500;o++){var s=2*Math.random()-1;i[o]=(n+.02*s)/1.02,n=i[o],i[o]*=3.5}}f.brown=(new p.Buffer).fromArray(t)}return f.brown}}),Object.defineProperty(i,"white",{get:function(){if(!f.white){for(var t=[],e=0;e<2;e++){var i=new Float32Array(220500);t[e]=i;for(var n=0;n<220500;n++)i[n]=2*Math.random()-1}f.white=(new p.Buffer).fromArray(t)}return f.white}}),p.Noise}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(27),i(20),i(2)],void 0===(o=function(e){"use strict";e.Master=function(){e.AudioNode.call(this),e.getContext(function(){this.createInsOuts(1,0),this._volume=this.output=new e.Volume,this.volume=this._volume.volume,this._readOnly("volume"),this.input.chain(this.output,this.context.destination),this.context.master=this}.bind(this))},e.extend(e.Master,e.AudioNode),e.Master.defaults={volume:0,mute:!1},e.Master.prototype.isMaster=!0,Object.defineProperty(e.Master.prototype,"mute",{get:function(){return this._volume.mute},set:function(t){this._volume.mute=t}}),e.Master.prototype.chain=function(){this.input.disconnect(),this.input.chain.apply(this.input,arguments),arguments[arguments.length-1].connect(this.output)},e.Master.prototype.dispose=function(){e.AudioNode.prototype.dispose.call(this),this._writable("volume"),this._volume.dispose(),this._volume=null,this.volume=null},e.AudioNode.prototype.toMaster=function(){return this.connect(this.context.master),this};var i=e.Master;return e.Master=new i,e.Context.on("init",function(t){t.master&&t.master.isMaster?e.Master=t.master:e.Master=new i}),e.Context.on("close",function(t){t.master&&t.master.isMaster&&t.master.dispose()}),e.Master}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(90),i(47)],void 0===(o=function(e){"use strict";return e.FrequencyEnvelope=function(){var t=e.defaults(arguments,["attack","decay","sustain","release"],e.Envelope);t=e.defaultArg(t,e.FrequencyEnvelope.defaults),e.ScaledEnvelope.call(this,t),this._octaves=t.octaves,this.baseFrequency=t.baseFrequency,this.octaves=t.octaves,this.exponent=t.exponent},e.extend(e.FrequencyEnvelope,e.Envelope),e.FrequencyEnvelope.defaults={baseFrequency:200,octaves:4,exponent:1},Object.defineProperty(e.FrequencyEnvelope.prototype,"baseFrequency",{get:function(){return this._scale.min},set:function(t){this._scale.min=this.toFrequency(t),this.octaves=this._octaves}}),Object.defineProperty(e.FrequencyEnvelope.prototype,"octaves",{get:function(){return this._octaves},set:function(t){this._octaves=t,this._scale.max=this.baseFrequency*Math.pow(2,t)}}),Object.defineProperty(e.FrequencyEnvelope.prototype,"exponent",{get:function(){return this._exp.value},set:function(t){this._exp.value=t}}),e.FrequencyEnvelope.prototype.dispose=function(){return e.ScaledEnvelope.prototype.dispose.call(this),this},e.FrequencyEnvelope}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(28),i(61)],void 0===(o=function(n){return n.ScaleExp=function(t,e,i){n.SignalBase.call(this),this._scale=this.output=new n.Scale(t,e),this._exp=this.input=new n.Pow(n.defaultArg(i,2)),this._exp.connect(this._scale)},n.extend(n.ScaleExp,n.SignalBase),Object.defineProperty(n.ScaleExp.prototype,"exponent",{get:function(){return this._exp.value},set:function(t){this._exp.value=t}}),Object.defineProperty(n.ScaleExp.prototype,"min",{get:function(){return this._scale.min},set:function(t){this._scale.min=t}}),Object.defineProperty(n.ScaleExp.prototype,"max",{get:function(){return this._scale.max},set:function(t){this._scale.max=t}}),n.ScaleExp.prototype.dispose=function(){return n.SignalBase.prototype.dispose.call(this),this._scale.dispose(),this._scale=null,this._exp.dispose(),this._exp=null,this},n.ScaleExp}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(14),i(2)],void 0===(o=function(e){"use strict";return e.Compressor=function(){var t=e.defaults(arguments,["threshold","ratio"],e.Compressor);e.AudioNode.call(this),this._compressor=this.input=this.output=this.context.createDynamicsCompressor(),this.threshold=new e.Param({param:this._compressor.threshold,units:e.Type.Decibels,convert:!1}),this.attack=new e.Param(this._compressor.attack,e.Type.Time),this.release=new e.Param(this._compressor.release,e.Type.Time),this.knee=new e.Param({param:this._compressor.knee,units:e.Type.Decibels,convert:!1}),this.ratio=new e.Param({param:this._compressor.ratio,convert:!1}),this._readOnly(["knee","release","attack","ratio","threshold"]),this.set(t)},e.extend(e.Compressor,e.AudioNode),e.Compressor.defaults={ratio:12,threshold:-24,release:.25,attack:.003,knee:30},e.Compressor.prototype.dispose=function(){return e.AudioNode.prototype.dispose.call(this),this._writable(["knee","release","attack","ratio","threshold"]),this._compressor.disconnect(),this._compressor=null,this.attack.dispose(),this.attack=null,this.release.dispose(),this.release=null,this.threshold.dispose(),this.threshold=null,this.ratio.dispose(),this.ratio=null,this.knee.dispose(),this.knee=null,this},e.Compressor}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(2),i(94)],void 0===(o=function(e){"use strict";return e.Analyser=function(){var t=e.defaults(arguments,["type","size"],e.Analyser);e.AudioNode.call(this),this._analyser=this.input=this.output=this.context.createAnalyser(),this._type=t.type,this._buffer=null,this.size=t.size,this.type=t.type},e.extend(e.Analyser,e.AudioNode),e.Analyser.defaults={size:1024,type:"fft",smoothing:.8},e.Analyser.Type={Waveform:"waveform",FFT:"fft"},e.Analyser.prototype.getValue=function(){return this._type===e.Analyser.Type.FFT?this._analyser.getFloatFrequencyData(this._buffer):this._type===e.Analyser.Type.Waveform&&this._analyser.getFloatTimeDomainData(this._buffer),this._buffer},Object.defineProperty(e.Analyser.prototype,"size",{get:function(){return this._analyser.frequencyBinCount},set:function(t){this._analyser.fftSize=2*t,this._buffer=new Float32Array(t)}}),Object.defineProperty(e.Analyser.prototype,"type",{get:function(){return this._type},set:function(t){if(t!==e.Analyser.Type.Waveform&&t!==e.Analyser.Type.FFT)throw new TypeError("Tone.Analyser: invalid type: "+t);this._type=t}}),Object.defineProperty(e.Analyser.prototype,"smoothing",{get:function(){return this._analyser.smoothingTimeConstant},set:function(t){this._analyser.smoothingTimeConstant=t}}),e.Analyser.prototype.dispose=function(){e.AudioNode.prototype.dispose.call(this),this._analyser.disconnect(),this._analyser=null,this._buffer=null},e.Analyser}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(65)],void 0===(o=function(i){return i.TransportTime=function(t,e){if(!(this instanceof i.TransportTime))return new i.TransportTime(t,e);i.Time.call(this,t,e)},i.extend(i.TransportTime,i.Time),i.TransportTime.prototype._now=function(){return i.Transport.seconds},i.TransportTime}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(64)],void 0===(o=function(o){o.Frequency=function(t,e){if(!(this instanceof o.Frequency))return new o.Frequency(t,e);o.TimeBase.call(this,t,e)},o.extend(o.Frequency,o.TimeBase),o.Frequency.prototype._expressions=Object.assign({},o.TimeBase.prototype._expressions,{midi:{regexp:/^(\d+(?:\.\d+)?midi)/,method:function(t){return"midi"===this._defaultUnits?t:o.Frequency.mtof(t)}},note:{regexp:/^([a-g]{1}(?:b|#|x|bb)?)(-?[0-9]+)/i,method:function(t,e){var i=n[t.toLowerCase()]+12*(parseInt(e)+1);return"midi"===this._defaultUnits?i:o.Frequency.mtof(i)}},tr:{regexp:/^(\d+(?:\.\d+)?):(\d+(?:\.\d+)?):?(\d+(?:\.\d+)?)?/,method:function(t,e,i){var n=1;return t&&"0"!==t&&(n*=this._beatsToUnits(this._getTimeSignature()*parseFloat(t))),e&&"0"!==e&&(n*=this._beatsToUnits(parseFloat(e))),i&&"0"!==i&&(n*=this._beatsToUnits(parseFloat(i)/4)),n}}}),o.Frequency.prototype.transpose=function(t){return new this.constructor(this.valueOf()*o.intervalToFrequencyRatio(t))},o.Frequency.prototype.harmonize=function(t){return t.map(function(t){return this.transpose(t)}.bind(this))},o.Frequency.prototype.toMidi=function(){return o.Frequency.ftom(this.valueOf())},o.Frequency.prototype.toNote=function(){var t=this.toFrequency(),e=Math.log2(t/o.Frequency.A4),i=Math.round(12*e)+57,n=Math.floor(i/12);return n<0&&(i+=-12*n),s[i%12]+n.toString()},o.Frequency.prototype.toSeconds=function(){return 1/o.TimeBase.prototype.toSeconds.call(this)},o.Frequency.prototype.toFrequency=function(){return o.TimeBase.prototype.toFrequency.call(this)},o.Frequency.prototype.toTicks=function(){var t=this._beatsToUnits(1),e=this.valueOf()/t;return Math.floor(e*o.Transport.PPQ)},o.Frequency.prototype._noArg=function(){return 0},o.Frequency.prototype._frequencyToUnits=function(t){return t},o.Frequency.prototype._ticksToUnits=function(t){return 1/(60*t/(o.Transport.bpm.value*o.Transport.PPQ))},o.Frequency.prototype._beatsToUnits=function(t){return 1/o.TimeBase.prototype._beatsToUnits.call(this,t)},o.Frequency.prototype._secondsToUnits=function(t){return 1/t},o.Frequency.prototype._defaultUnits="hz";var n={cbb:-2,cb:-1,c:0,"c#":1,cx:2,dbb:0,db:1,d:2,"d#":3,dx:4,ebb:2,eb:3,e:4,"e#":5,ex:6,fbb:3,fb:4,f:5,"f#":6,fx:7,gbb:5,gb:6,g:7,"g#":8,gx:9,abb:7,ab:8,a:9,"a#":10,ax:11,bbb:9,bb:10,b:11,"b#":12,bx:13},s=["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"];return o.Frequency.A4=440,o.Frequency.mtof=function(t){return o.Frequency.A4*Math.pow(2,(t-69)/12)},o.Frequency.ftom=function(t){return 69+Math.round(12*Math.log2(t/o.Frequency.A4))},o.Frequency}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(1),i(61),i(4),i(2)],void 0===(o=function(p){"use strict";return p.Envelope=function(){var t=p.defaults(arguments,["attack","decay","sustain","release"],p.Envelope);p.AudioNode.call(this),this.attack=t.attack,this.decay=t.decay,this.sustain=t.sustain,this.release=t.release,this._attackCurve="linear",this._releaseCurve="exponential",this._sig=this.output=new p.Signal(0),this.attackCurve=t.attackCurve,this.releaseCurve=t.releaseCurve,this.decayCurve=t.decayCurve},p.extend(p.Envelope,p.AudioNode),p.Envelope.defaults={attack:.01,decay:.1,sustain:.5,release:1,attackCurve:"linear",decayCurve:"exponential",releaseCurve:"exponential"},Object.defineProperty(p.Envelope.prototype,"value",{get:function(){return this.getValueAtTime(this.now())}}),p.Envelope.prototype._getCurve=function(t,e){if(p.isString(t))return t;if(p.isArray(t)){for(var i in p.Envelope.Type)if(p.Envelope.Type[i][e]===t)return i;return t}},p.Envelope.prototype._setCurve=function(t,e,i){if(p.Envelope.Type.hasOwnProperty(i)){var n=p.Envelope.Type[i];p.isObject(n)?this[t]=n[e]:this[t]=n}else{if(!p.isArray(i))throw new Error("Tone.Envelope: invalid curve: "+i);this[t]=i}},Object.defineProperty(p.Envelope.prototype,"attackCurve",{get:function(){return this._getCurve(this._attackCurve,"In")},set:function(t){this._setCurve("_attackCurve","In",t)}}),Object.defineProperty(p.Envelope.prototype,"releaseCurve",{get:function(){return this._getCurve(this._releaseCurve,"Out")},set:function(t){this._setCurve("_releaseCurve","Out",t)}}),Object.defineProperty(p.Envelope.prototype,"decayCurve",{get:function(){return this._decayCurve},set:function(t){if(!["linear","exponential"].includes(t))throw new Error("Tone.Envelope: invalid curve: "+t);this._decayCurve=t}}),p.Envelope.prototype.triggerAttack=function(t,e){this.log("triggerAttack",t,e),t=this.toSeconds(t);var i=this.toSeconds(this.attack),n=this.toSeconds(this.decay);e=p.defaultArg(e,1);var o=this.getValueAtTime(t);if(0<o&&(i=(1-o)/(1/i)),"linear"===this._attackCurve)this._sig.linearRampTo(e,i,t);else if("exponential"===this._attackCurve)this._sig.targetRampTo(e,i,t);else if(0<i){this._sig.cancelAndHoldAtTime(t);for(var s=this._attackCurve,r=1;r<s.length;r++)if(s[r-1]<=o&&o<=s[r]){(s=this._attackCurve.slice(r))[0]=o;break}this._sig.setValueCurveAtTime(s,t,i,e)}if(n){var a=e*this.sustain,l=t+i;this.log("decay",l),"linear"===this._decayCurve?this._sig.linearRampTo(a,n,l):"exponential"===this._decayCurve&&this._sig.exponentialApproachValueAtTime(a,l,n)}return this},p.Envelope.prototype.triggerRelease=function(t){this.log("triggerRelease",t),t=this.toSeconds(t);var e=this.getValueAtTime(t);if(0<e){var i=this.toSeconds(this.release);if("linear"===this._releaseCurve)this._sig.linearRampTo(0,i,t);else if("exponential"===this._releaseCurve)this._sig.targetRampTo(0,i,t);else{var n=this._releaseCurve;p.isArray(n)&&(this._sig.cancelAndHoldAtTime(t),this._sig.setValueCurveAtTime(n,t,i,e))}}return this},p.Envelope.prototype.getValueAtTime=function(t){return this._sig.getValueAtTime(t)},p.Envelope.prototype.triggerAttackRelease=function(t,e,i){return e=this.toSeconds(e),this.triggerAttack(e,i),this.triggerRelease(e+this.toSeconds(t)),this},p.Envelope.prototype.cancel=function(t){return this._sig.cancelScheduledValues(t),this},p.Envelope.prototype.connect=p.SignalBase.prototype.connect,function(){var t,e,i=[];for(t=0;t<128;t++)i[t]=Math.sin(t/127*(Math.PI/2));var n=[];for(t=0;t<127;t++){e=t/127;var o=Math.sin(e*(2*Math.PI)*6.4-Math.PI/2)+1;n[t]=o/10+.83*e}n[127]=1;var s=[];for(t=0;t<128;t++)s[t]=Math.ceil(t/127*5)/5;var r=[];for(t=0;t<128;t++)e=t/127,r[t]=.5*(1-Math.cos(Math.PI*e));var a,l=[];for(t=0;t<128;t++){e=t/127;var h=4*Math.pow(e,3)+.2,u=Math.cos(h*Math.PI*2*e);l[t]=Math.abs(u*(1-e))}function c(t){for(var e=new Array(t.length),i=0;i<t.length;i++)e[i]=1-t[i];return e}p.Envelope.Type={linear:"linear",exponential:"exponential",bounce:{In:c(l),Out:l},cosine:{In:i,Out:(a=i,a.slice(0).reverse())},step:{In:s,Out:c(s)},ripple:{In:n,Out:c(n)},sine:{In:r,Out:c(r)}}}(),p.Envelope.prototype.dispose=function(){return p.AudioNode.prototype.dispose.call(this),this._sig.dispose(),this._sig=null,this._attackCurve=null,this._releaseCurve=null,this},p.Envelope}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(6),i(18),i(5),i(3)],void 0===(o=function(e){"use strict";return e.FMOscillator=function(){var t=e.defaults(arguments,["frequency","type","modulationType"],e.FMOscillator);e.Source.call(this,t),this._carrier=new e.Oscillator(t.frequency,t.type),this.frequency=new e.Signal(t.frequency,e.Type.Frequency),this.detune=this._carrier.detune,this.detune.value=t.detune,this.modulationIndex=new e.Multiply(t.modulationIndex),this.modulationIndex.units=e.Type.Positive,this._modulator=new e.Oscillator(t.frequency,t.modulationType),this.harmonicity=new e.Multiply(t.harmonicity),this.harmonicity.units=e.Type.Positive,this._modulationNode=new e.Gain(0),this.frequency.connect(this._carrier.frequency),this.frequency.chain(this.harmonicity,this._modulator.frequency),this.frequency.chain(this.modulationIndex,this._modulationNode),this._modulator.connect(this._modulationNode.gain),this._modulationNode.connect(this._carrier.frequency),this._carrier.connect(this.output),this.detune.connect(this._modulator.detune),this.phase=t.phase,this._readOnly(["modulationIndex","frequency","detune","harmonicity"])},e.extend(e.FMOscillator,e.Source),e.FMOscillator.defaults={frequency:440,detune:0,phase:0,modulationIndex:2,modulationType:"square",harmonicity:1},e.FMOscillator.prototype._start=function(t){this._modulator.start(t),this._carrier.start(t)},e.FMOscillator.prototype._stop=function(t){this._modulator.stop(t),this._carrier.stop(t)},e.FMOscillator.prototype.restart=function(t){this._modulator.restart(t),this._carrier.restart(t)},Object.defineProperty(e.FMOscillator.prototype,"type",{get:function(){return this._carrier.type},set:function(t){this._carrier.type=t}}),Object.defineProperty(e.FMOscillator.prototype,"modulationType",{get:function(){return this._modulator.type},set:function(t){this._modulator.type=t}}),Object.defineProperty(e.FMOscillator.prototype,"phase",{get:function(){return this._carrier.phase},set:function(t){this._carrier.phase=t,this._modulator.phase=t}}),Object.defineProperty(e.FMOscillator.prototype,"partials",{get:function(){return this._carrier.partials},set:function(t){this._carrier.partials=t}}),e.FMOscillator.prototype.dispose=function(){return e.Source.prototype.dispose.call(this),this._writable(["modulationIndex","frequency","detune","harmonicity"]),this.frequency.dispose(),this.frequency=null,this.detune=null,this.harmonicity.dispose(),this.harmonicity=null,this._carrier.dispose(),this._carrier=null,this._modulator.dispose(),this._modulator=null,this._modulationNode.dispose(),this._modulationNode=null,this.modulationIndex.dispose(),this.modulationIndex=null,this},e.FMOscillator}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(6),i(18),i(1),i(7),i(3)],void 0===(o=function(e){"use strict";return e.PulseOscillator=function(){var t=e.defaults(arguments,["frequency","width"],e.Oscillator);e.Source.call(this,t),this.width=new e.Signal(t.width,e.Type.NormalRange),this._widthGate=new e.Gain,this._sawtooth=new e.Oscillator({frequency:t.frequency,detune:t.detune,type:"sawtooth",phase:t.phase}),this.frequency=this._sawtooth.frequency,this.detune=this._sawtooth.detune,this._thresh=new e.WaveShaper(function(t){return t<0?-1:1}),this._sawtooth.chain(this._thresh,this.output),this.width.chain(this._widthGate,this._thresh),this._readOnly(["width","frequency","detune"])},e.extend(e.PulseOscillator,e.Source),e.PulseOscillator.defaults={frequency:440,detune:0,phase:0,width:.2},e.PulseOscillator.prototype._start=function(t){t=this.toSeconds(t),this._sawtooth.start(t),this._widthGate.gain.setValueAtTime(1,t)},e.PulseOscillator.prototype._stop=function(t){t=this.toSeconds(t),this._sawtooth.stop(t),this._widthGate.gain.setValueAtTime(0,t)},e.PulseOscillator.prototype.restart=function(t){this._sawtooth.restart(t),this._widthGate.gain.cancelScheduledValues(t),this._widthGate.gain.setValueAtTime(1,t)},Object.defineProperty(e.PulseOscillator.prototype,"phase",{get:function(){return this._sawtooth.phase},set:function(t){this._sawtooth.phase=t}}),Object.defineProperty(e.PulseOscillator.prototype,"type",{get:function(){return"pulse"}}),Object.defineProperty(e.PulseOscillator.prototype,"partials",{get:function(){return[]}}),e.PulseOscillator.prototype.dispose=function(){return e.Source.prototype.dispose.call(this),this._sawtooth.dispose(),this._sawtooth=null,this._writable(["width","frequency","detune"]),this.width.dispose(),this.width=null,this._widthGate.dispose(),this._widthGate=null,this._thresh.dispose(),this._thresh=null,this.frequency=null,this.detune=null,this},e.PulseOscillator}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(17),i(4),i(33)],void 0===(o=function(s){"use strict";return s.Event=function(){var t=s.defaults(arguments,["callback","value"],s.Event);s.call(this),this._loop=t.loop,this.callback=t.callback,this.value=t.value,this._loopStart=this.toTicks(t.loopStart),this._loopEnd=this.toTicks(t.loopEnd),this._state=new s.TimelineState(s.State.Stopped),this._playbackRate=1,this._startOffset=0,this._probability=t.probability,this._humanize=t.humanize,this.mute=t.mute,this.playbackRate=t.playbackRate},s.extend(s.Event),s.Event.defaults={callback:s.noOp,loop:!1,loopEnd:"1m",loopStart:0,playbackRate:1,value:null,probability:1,mute:!1,humanize:!1},s.Event.prototype._rescheduleEvents=function(t){return t=s.defaultArg(t,-1),this._state.forEachFrom(t,function(t){var e;if(t.state===s.State.Started){s.isDefined(t.id)&&s.Transport.clear(t.id);var i=t.time+Math.round(this.startOffset/this._playbackRate);if(this._loop){e=1/0,s.isNumber(this._loop)&&(e=this._loop*this._getLoopDuration());var n=this._state.getAfter(i);null!==n&&(e=Math.min(e,n.time-i)),e!==1/0&&(this._state.setStateAtTime(s.State.Stopped,i+e+1),e=s.Ticks(e));var o=s.Ticks(this._getLoopDuration());t.id=s.Transport.scheduleRepeat(this._tick.bind(this),o,s.Ticks(i),e)}else t.id=s.Transport.schedule(this._tick.bind(this),s.Ticks(i))}}.bind(this)),this},Object.defineProperty(s.Event.prototype,"state",{get:function(){return this._state.getValueAtTime(s.Transport.ticks)}}),Object.defineProperty(s.Event.prototype,"startOffset",{get:function(){return this._startOffset},set:function(t){this._startOffset=t}}),Object.defineProperty(s.Event.prototype,"probability",{get:function(){return this._probability},set:function(t){this._probability=t}}),Object.defineProperty(s.Event.prototype,"humanize",{get:function(){return this._humanize},set:function(t){this._humanize=t}}),s.Event.prototype.start=function(t){return t=this.toTicks(t),this._state.getValueAtTime(t)===s.State.Stopped&&(this._state.add({state:s.State.Started,time:t,id:void 0}),this._rescheduleEvents(t)),this},s.Event.prototype.stop=function(t){if(this.cancel(t),t=this.toTicks(t),this._state.getValueAtTime(t)===s.State.Started){this._state.setStateAtTime(s.State.Stopped,t);var e=this._state.getBefore(t),i=t;null!==e&&(i=e.time),this._rescheduleEvents(i)}return this},s.Event.prototype.cancel=function(t){return t=s.defaultArg(t,-1/0),t=this.toTicks(t),this._state.forEachFrom(t,function(t){s.Transport.clear(t.id)}),this._state.cancel(t),this},s.Event.prototype._tick=function(t){var e=s.Transport.getTicksAtTime(t);if(!this.mute&&this._state.getValueAtTime(e)===s.State.Started){if(this.probability<1&&Math.random()>this.probability)return;if(this.humanize){var i=.02;s.isBoolean(this.humanize)||(i=this.toSeconds(this.humanize)),t+=(2*Math.random()-1)*i}this.callback(t,this.value)}},s.Event.prototype._getLoopDuration=function(){return Math.round((this._loopEnd-this._loopStart)/this._playbackRate)},Object.defineProperty(s.Event.prototype,"loop",{get:function(){return this._loop},set:function(t){this._loop=t,this._rescheduleEvents()}}),Object.defineProperty(s.Event.prototype,"playbackRate",{get:function(){return this._playbackRate},set:function(t){this._playbackRate=t,this._rescheduleEvents()}}),Object.defineProperty(s.Event.prototype,"loopEnd",{get:function(){return s.Ticks(this._loopEnd).toSeconds()},set:function(t){this._loopEnd=this.toTicks(t),this._loop&&this._rescheduleEvents()}}),Object.defineProperty(s.Event.prototype,"loopStart",{get:function(){return s.Ticks(this._loopStart).toSeconds()},set:function(t){this._loopStart=this.toTicks(t),this._loop&&this._rescheduleEvents()}}),Object.defineProperty(s.Event.prototype,"progress",{get:function(){if(this._loop){var t=s.Transport.ticks,e=this._state.get(t);if(null!==e&&e.state===s.State.Started){var i=this._getLoopDuration();return(t-e.time)%i/i}return 0}return 0}}),s.Event.prototype.dispose=function(){this.cancel(),this._state.dispose(),this._state=null,this.callback=null,this.value=null},s.Event}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(23),i(9),i(16),i(81),i(1),i(22),i(26),i(2)],void 0===(o=function(e){"use strict";return e.Panner=function(t){e.AudioNode.call(this),this._panner=this.input=this.output=this.context.createStereoPanner(),this.pan=this._panner.pan,this.pan.value=e.defaultArg(t,0),this._readOnly("pan")},e.extend(e.Panner,e.AudioNode),e.Panner.prototype.dispose=function(){return e.AudioNode.prototype.dispose.call(this),this._writable("pan"),this._panner.disconnect(),this._panner=null,this.pan=null,this},e.Panner}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(1),i(13),i(29),i(9),i(3),i(2)],void 0===(o=function(t){"use strict";return t.MidSideMerge=function(){t.AudioNode.call(this),this.createInsOuts(2,0),this.mid=this.input[0]=new t.Gain,this._left=new t.Add,this._timesTwoLeft=new t.Multiply(Math.SQRT1_2),this.side=this.input[1]=new t.Gain,this._right=new t.Subtract,this._timesTwoRight=new t.Multiply(Math.SQRT1_2),this._merge=this.output=new t.Merge,this.mid.connect(this._left,0,0),this.side.connect(this._left,0,1),this.mid.connect(this._right,0,0),this.side.connect(this._right,0,1),this._left.connect(this._timesTwoLeft),this._right.connect(this._timesTwoRight),this._timesTwoLeft.connect(this._merge,0,0),this._timesTwoRight.connect(this._merge,0,1)},t.extend(t.MidSideMerge,t.AudioNode),t.MidSideMerge.prototype.dispose=function(){return t.AudioNode.prototype.dispose.call(this),this.mid.dispose(),this.mid=null,this.side.dispose(),this.side=null,this._left.dispose(),this._left=null,this._timesTwoLeft.dispose(),this._timesTwoLeft=null,this._right.dispose(),this._right=null,this._timesTwoRight.dispose(),this._timesTwoRight=null,this._merge.dispose(),this._merge=null,this},t.MidSideMerge}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(29),i(13),i(1),i(16),i(2)],void 0===(o=function(t){"use strict";return t.MidSideSplit=function(){t.AudioNode.call(this),this.createInsOuts(0,2),this._split=this.input=new t.Split,this._midAdd=new t.Add,this.mid=this.output[0]=new t.Multiply(Math.SQRT1_2),this._sideSubtract=new t.Subtract,this.side=this.output[1]=new t.Multiply(Math.SQRT1_2),this._split.connect(this._midAdd,0,0),this._split.connect(this._midAdd,1,1),this._split.connect(this._sideSubtract,0,0),this._split.connect(this._sideSubtract,1,1),this._midAdd.connect(this.mid),this._sideSubtract.connect(this.side)},t.extend(t.MidSideSplit,t.AudioNode),t.MidSideSplit.prototype.dispose=function(){return t.AudioNode.prototype.dispose.call(this),this.mid.dispose(),this.mid=null,this.side.dispose(),this.side=null,this._midAdd.dispose(),this._midAdd=null,this._sideSubtract.dispose(),this._sideSubtract=null,this._split.dispose(),this._split=null,this},t.MidSideSplit}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(1),i(10),i(2),i(59)],void 0===(o=function(e){"use strict";return e.LowpassCombFilter=function(){var t=e.defaults(arguments,["delayTime","resonance","dampening"],e.LowpassCombFilter);e.AudioNode.call(this),this._combFilter=this.output=new e.FeedbackCombFilter(t.delayTime,t.resonance),this.delayTime=this._combFilter.delayTime,this._lowpass=this.input=new e.Filter({frequency:t.dampening,type:"lowpass",Q:0,rolloff:-12}),this.dampening=this._lowpass.frequency,this.resonance=this._combFilter.resonance,this._lowpass.connect(this._combFilter),this._readOnly(["dampening","resonance","delayTime"])},e.extend(e.LowpassCombFilter,e.AudioNode),e.LowpassCombFilter.defaults={delayTime:.1,resonance:.5,dampening:3e3},e.LowpassCombFilter.prototype.dispose=function(){return e.AudioNode.prototype.dispose.call(this),this._writable(["dampening","resonance","delayTime"]),this._combFilter.dispose(),this._combFilter=null,this.resonance=null,this.delayTime=null,this._lowpass.dispose(),this._lowpass=null,this.dampening=null,this},e.LowpassCombFilter}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(45)],void 0===(o=function(i){return i.Ticks=function(t,e){if(!(this instanceof i.Ticks))return new i.Ticks(t,e);i.TransportTime.call(this,t,e)},i.extend(i.Ticks,i.TransportTime),i.Ticks.prototype._defaultUnits="i",i.Ticks.prototype._now=function(){return i.Transport.ticks},i.Ticks.prototype._beatsToUnits=function(t){return this._getPPQ()*t},i.Ticks.prototype._secondsToUnits=function(t){return Math.floor(t/(60/this._getBpm())*this._getPPQ())},i.Ticks.prototype._ticksToUnits=function(t){return t},i.Ticks.prototype.toTicks=function(){return this.valueOf()},i.Ticks.prototype.toSeconds=function(){return this.valueOf()/this._getPPQ()*(60/this._getBpm())},i.Ticks}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(55)],void 0===(o=function(i){return i.TransportEvent=function(t,e){e=i.defaultArg(e,i.TransportEvent.defaults),i.call(this),this.Transport=t,this.id=i.TransportEvent._eventId++,this.time=i.Ticks(e.time),this.callback=e.callback,this._once=e.once},i.extend(i.TransportEvent),i.TransportEvent.defaults={once:!1,callback:i.noOp},i.TransportEvent._eventId=0,i.TransportEvent.prototype.invoke=function(t){this.callback&&(this.callback(t),this._once&&this.Transport&&this.Transport.clear(this.id))},i.TransportEvent.prototype.dispose=function(){return i.prototype.dispose.call(this),this.Transport=null,this.callback=null,this.time=null,this},i.TransportEvent}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(86),i(33),i(24),i(14)],void 0===(o=function(l){"use strict";return l.TickSource=function(){var t=l.defaults(arguments,["frequency"],l.TickSource);this.frequency=new l.TickSignal(t.frequency),this._readOnly("frequency"),this._state=new l.TimelineState(l.State.Stopped),this._state.setStateAtTime(l.State.Stopped,0),this._tickOffset=new l.Timeline,this.setTicksAtTime(0,0)},l.extend(l.TickSource),l.TickSource.defaults={frequency:1},Object.defineProperty(l.TickSource.prototype,"state",{get:function(){return this._state.getValueAtTime(this.now())}}),l.TickSource.prototype.start=function(t,e){return t=this.toSeconds(t),this._state.getValueAtTime(t)!==l.State.Started&&(this._state.setStateAtTime(l.State.Started,t),l.isDefined(e)&&this.setTicksAtTime(e,t)),this},l.TickSource.prototype.stop=function(t){if(t=this.toSeconds(t),this._state.getValueAtTime(t)===l.State.Stopped){var e=this._state.get(t);0<e.time&&(this._tickOffset.cancel(e.time),this._state.cancel(e.time))}return this._state.cancel(t),this._state.setStateAtTime(l.State.Stopped,t),this.setTicksAtTime(0,t),this},l.TickSource.prototype.pause=function(t){return t=this.toSeconds(t),this._state.getValueAtTime(t)===l.State.Started&&this._state.setStateAtTime(l.State.Paused,t),this},l.TickSource.prototype.cancel=function(t){return t=this.toSeconds(t),this._state.cancel(t),this._tickOffset.cancel(t),this},l.TickSource.prototype.getTicksAtTime=function(t){t=this.toSeconds(t);var e=this._state.getLastState(l.State.Stopped,t),i={state:l.State.Paused,time:t};this._state.add(i);var n=e,o=0;return this._state.forEachBetween(e.time,t+this.sampleTime,function(t){var e=n.time,i=this._tickOffset.get(t.time);i.time>=n.time&&(o=i.ticks,e=i.time),n.state===l.State.Started&&t.state!==l.State.Started&&(o+=this.frequency.getTicksAtTime(t.time)-this.frequency.getTicksAtTime(e)),n=t}.bind(this)),this._state.remove(i),o},Object.defineProperty(l.TickSource.prototype,"ticks",{get:function(){return this.getTicksAtTime(this.now())},set:function(t){this.setTicksAtTime(t,this.now())}}),Object.defineProperty(l.TickSource.prototype,"seconds",{get:function(){return this.getSecondsAtTime(this.now())},set:function(t){var e=this.now(),i=this.frequency.timeToTicks(t,e);this.setTicksAtTime(i,e)}}),l.TickSource.prototype.getSecondsAtTime=function(t){t=this.toSeconds(t);var e=this._state.getLastState(l.State.Stopped,t),i={state:l.State.Paused,time:t};this._state.add(i);var n=e,o=0;return this._state.forEachBetween(e.time,t+this.sampleTime,function(t){var e=n.time,i=this._tickOffset.get(t.time);i.time>=n.time&&(o=i.seconds,e=i.time),n.state===l.State.Started&&t.state!==l.State.Started&&(o+=t.time-e),n=t}.bind(this)),this._state.remove(i),o},l.TickSource.prototype.setTicksAtTime=function(t,e){return e=this.toSeconds(e),this._tickOffset.cancel(e),this._tickOffset.add({time:e,ticks:t,seconds:this.frequency.getDurationOfTicks(t,e)}),this},l.TickSource.prototype.getStateAtTime=function(t){return t=this.toSeconds(t),this._state.getValueAtTime(t)},l.TickSource.prototype.getTimeOfTick=function(t,e){e=l.defaultArg(e,this.now());var i=this._tickOffset.get(e),n=this._state.get(e),o=Math.max(i.time,n.time),s=this.frequency.getTicksAtTime(o)+t-i.ticks;return this.frequency.getTimeOfTick(s)},l.TickSource.prototype.forEachTickBetween=function(e,t,i){var n=this._state.get(e);if(this._state.forEachBetween(e,t,function(t){n.state===l.State.Started&&t.state!==l.State.Started&&this.forEachTickBetween(Math.max(n.time,e),t.time-this.sampleTime,i),n=t}.bind(this)),e=Math.max(n.time,e),n.state===l.State.Started&&this._state){var o=this.frequency.getTicksAtTime(e),s=(o-this.frequency.getTicksAtTime(n.time))%1;0!==s&&(s=1-s);for(var r=this.frequency.getTimeOfTick(o+s),a=null;r<t&&this._state;){try{i(r,Math.round(this.getTicksAtTime(r)))}catch(t){a=t;break}this._state&&(r+=this.frequency.getDurationOfTicks(1,r))}}if(a)throw a;return this},l.TickSource.prototype.dispose=function(){return l.Param.prototype.dispose.call(this),this._state.dispose(),this._state=null,this._tickOffset.dispose(),this._tickOffset=null,this._writable("frequency"),this.frequency.dispose(),this.frequency=null,this},l.TickSource}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(91),i(13),i(1),i(4),i(19),i(2)],void 0===(o=function(e){"use strict";return e.Follower=function(){var t=e.defaults(arguments,["smoothing"],e.Follower);e.AudioNode.call(this),this.createInsOuts(1,1),this._abs=new e.Abs,this._filter=this.context.createBiquadFilter(),this._filter.type="lowpass",this._filter.frequency.value=0,this._filter.Q.value=0,this._sub=new e.Subtract,this._delay=new e.Delay(this.blockTime),this._smoothing=t.smoothing,this.input.connect(this._delay,this._sub),this.input.connect(this._sub,0,1),this._sub.chain(this._abs,this._filter,this.output),this.smoothing=t.smoothing},e.extend(e.Follower,e.AudioNode),e.Follower.defaults={smoothing:.05},Object.defineProperty(e.Follower.prototype,"smoothing",{get:function(){return this._smoothing},set:function(t){this._smoothing=t,this._filter.frequency.value=.5*e.Time(t).toFrequency()}}),e.Follower.prototype.connect=e.SignalBase.prototype.connect,e.Follower.prototype.dispose=function(){return e.AudioNode.prototype.dispose.call(this),this._filter.disconnect(),this._filter=null,this._delay.dispose(),this._delay=null,this._sub.disconnect(),this._sub=null,this._abs.dispose(),this._abs=null,this},e.Follower}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(42),i(1),i(14),i(19),i(3),i(2)],void 0===(o=function(e){"use strict";return e.FeedbackCombFilter=function(){var t=e.defaults(arguments,["delayTime","resonance"],e.FeedbackCombFilter);e.AudioNode.call(this),this._delay=this.input=this.output=new e.Delay(t.delayTime),this.delayTime=this._delay.delayTime,this._feedback=new e.Gain(t.resonance,e.Type.NormalRange),this.resonance=this._feedback.gain,this._delay.chain(this._feedback,this._delay),this._readOnly(["resonance","delayTime"])},e.extend(e.FeedbackCombFilter,e.AudioNode),e.FeedbackCombFilter.defaults={delayTime:.1,resonance:.5},e.FeedbackCombFilter.prototype.dispose=function(){return e.AudioNode.prototype.dispose.call(this),this._writable(["resonance","delayTime"]),this._delay.dispose(),this._delay=null,this.delayTime=null,this._feedback.dispose(),this._feedback=null,this.resonance=null,this},e.FeedbackCombFilter}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(10),i(1),i(3),i(2)],void 0===(o=function(e){"use strict";return e.MultibandSplit=function(){var t=e.defaults(arguments,["lowFrequency","highFrequency"],e.MultibandSplit);e.AudioNode.call(this),this.input=new e.Gain,this.output=new Array(3),this.low=this.output[0]=new e.Filter(0,"lowpass"),this._lowMidFilter=new e.Filter(0,"highpass"),this.mid=this.output[1]=new e.Filter(0,"lowpass"),this.high=this.output[2]=new e.Filter(0,"highpass"),this.lowFrequency=new e.Signal(t.lowFrequency,e.Type.Frequency),this.highFrequency=new e.Signal(t.highFrequency,e.Type.Frequency),this.Q=new e.Signal(t.Q),this.input.fan(this.low,this.high),this.input.chain(this._lowMidFilter,this.mid),this.lowFrequency.connect(this.low.frequency),this.lowFrequency.connect(this._lowMidFilter.frequency),this.highFrequency.connect(this.mid.frequency),this.highFrequency.connect(this.high.frequency),this.Q.connect(this.low.Q),this.Q.connect(this._lowMidFilter.Q),this.Q.connect(this.mid.Q),this.Q.connect(this.high.Q),this._readOnly(["high","mid","low","highFrequency","lowFrequency"])},e.extend(e.MultibandSplit,e.AudioNode),e.MultibandSplit.defaults={lowFrequency:400,highFrequency:2500,Q:1},e.MultibandSplit.prototype.dispose=function(){return e.AudioNode.prototype.dispose.call(this),this._writable(["high","mid","low","highFrequency","lowFrequency"]),this.low.dispose(),this.low=null,this._lowMidFilter.dispose(),this._lowMidFilter=null,this.mid.dispose(),this.mid=null,this.high.dispose(),this.high=null,this.lowFrequency.dispose(),this.lowFrequency=null,this.highFrequency.dispose(),this.highFrequency=null,this.Q.dispose(),this.Q=null,this},e.MultibandSplit}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(7)],void 0===(o=function(e){"use strict";return e.Pow=function(t){e.SignalBase.call(this),this._exp=e.defaultArg(t,1),this._expScaler=this.input=this.output=new e.WaveShaper(this._expFunc(this._exp),8192)},e.extend(e.Pow,e.SignalBase),Object.defineProperty(e.Pow.prototype,"value",{get:function(){return this._exp},set:function(t){this._exp=t,this._expScaler.setMap(this._expFunc(this._exp))}}),e.Pow.prototype._expFunc=function(e){return function(t){return Math.pow(Math.abs(t),e)}},e.Pow.prototype.dispose=function(){return e.SignalBase.prototype.dispose.call(this),this._expScaler.dispose(),this._expScaler=null,this},e.Pow}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(20),i(66)],void 0===(o=function(o){return o.OfflineContext=function(t,e,i){var n=new OfflineAudioContext(t,e*i,i);o.Context.call(this,{context:n,clockSource:"offline",lookAhead:0,updateInterval:128/i}),this._duration=e,this._currentTime=0},o.extend(o.OfflineContext,o.Context),o.OfflineContext.prototype.now=function(){return this._currentTime},o.OfflineContext.prototype.resume=function(){return Promise.resolve()},o.OfflineContext.prototype.render=function(){for(;0<=this._duration-this._currentTime;)this.emit("tick"),this._currentTime+=this.blockTime;return this._context.startRendering()},o.OfflineContext.prototype.close=function(){return this._context=null,Promise.resolve()},o.OfflineContext}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(62)],void 0===(o=function(t){if(t.supported){var e=navigator.userAgent.toLowerCase();e.includes("safari")&&!e.includes("chrome")&&e.includes("mobile")&&(t.OfflineContext.prototype.createBufferSource=function(){var e=this._context.createBufferSource(),i=e.start;return e.start=function(t){this.setTimeout(function(){i.call(e,t)}.bind(this),0)}.bind(this),e})}}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0)],void 0===(o=function(r){return r.TimeBase=function(t,e){if(!(this instanceof r.TimeBase))return new r.TimeBase(t,e);if(this._val=t,this._units=e,r.isUndef(this._units)&&r.isString(this._val)&&parseFloat(this._val)==this._val&&"+"!==this._val.charAt(0))this._val=parseFloat(this._val),this._units=this._defaultUnits;else if(t&&t.constructor===this.constructor)this._val=t._val,this._units=t._units;else if(t instanceof r.TimeBase)switch(this._defaultUnits){case"s":this._val=t.toSeconds();break;case"i":this._val=t.toTicks();break;case"hz":this._val=t.toFrequency();break;case"midi":this._val=t.toMidi();break;default:throw new Error("Unrecognized default units "+this._defaultUnits)}},r.extend(r.TimeBase),r.TimeBase.prototype._expressions={n:{regexp:/^(\d+)n(\.?)$/i,method:function(t,e){var i="."===e?1.5:1;return 1===(t=parseInt(t))?this._beatsToUnits(this._getTimeSignature())*i:this._beatsToUnits(4/t)*i}},t:{regexp:/^(\d+)t$/i,method:function(t){return t=parseInt(t),this._beatsToUnits(8/(3*parseInt(t)))}},m:{regexp:/^(\d+)m$/i,method:function(t){return this._beatsToUnits(parseInt(t)*this._getTimeSignature())}},i:{regexp:/^(\d+)i$/i,method:function(t){return this._ticksToUnits(parseInt(t))}},hz:{regexp:/^(\d+(?:\.\d+)?)hz$/i,method:function(t){return this._frequencyToUnits(parseFloat(t))}},tr:{regexp:/^(\d+(?:\.\d+)?):(\d+(?:\.\d+)?):?(\d+(?:\.\d+)?)?$/,method:function(t,e,i){var n=0;return t&&"0"!==t&&(n+=this._beatsToUnits(this._getTimeSignature()*parseFloat(t))),e&&"0"!==e&&(n+=this._beatsToUnits(parseFloat(e))),i&&"0"!==i&&(n+=this._beatsToUnits(parseFloat(i)/4)),n}},s:{regexp:/^(\d+(?:\.\d+)?)s$/,method:function(t){return this._secondsToUnits(parseFloat(t))}},samples:{regexp:/^(\d+)samples$/,method:function(t){return parseInt(t)/this.context.sampleRate}},default:{regexp:/^(\d+(?:\.\d+)?)$/,method:function(t){return this._expressions[this._defaultUnits].method.call(this,t)}}},r.TimeBase.prototype._defaultUnits="s",r.TimeBase.prototype._getBpm=function(){return r.Transport?r.Transport.bpm.value:120},r.TimeBase.prototype._getTimeSignature=function(){return r.Transport?r.Transport.timeSignature:4},r.TimeBase.prototype._getPPQ=function(){return r.Transport?r.Transport.PPQ:192},r.TimeBase.prototype._now=function(){return this.now()},r.TimeBase.prototype._frequencyToUnits=function(t){return 1/t},r.TimeBase.prototype._beatsToUnits=function(t){return 60/this._getBpm()*t},r.TimeBase.prototype._secondsToUnits=function(t){return t},r.TimeBase.prototype._ticksToUnits=function(t){return t*(this._beatsToUnits(1)/this._getPPQ())},r.TimeBase.prototype._noArg=function(){return this._now()},r.TimeBase.prototype.valueOf=function(){if(r.isUndef(this._val))return this._noArg();if(r.isString(this._val)&&r.isUndef(this._units)){for(var t in this._expressions)if(this._expressions[t].regexp.test(this._val.trim())){this._units=t;break}}else if(r.isObject(this._val)){var e=0;for(var i in this._val){var n=this._val[i];e+=new this.constructor(i).valueOf()*n}return e}if(r.isDefined(this._units)){var o=this._expressions[this._units],s=this._val.toString().trim().match(o.regexp);return s?o.method.apply(this,s.slice(1)):o.method.call(this,parseFloat(this._val))}return this._val},r.TimeBase.prototype.toSeconds=function(){return this.valueOf()},r.TimeBase.prototype.toFrequency=function(){return 1/this.toSeconds()},r.TimeBase.prototype.toSamples=function(){return this.toSeconds()*this.context.sampleRate},r.TimeBase.prototype.toMilliseconds=function(){return 1e3*this.toSeconds()},r.TimeBase.prototype.dispose=function(){this._val=null,this._units=null},r.TimeBase}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(64),i(46)],void 0===(o=function(r){return r.Time=function(t,e){if(!(this instanceof r.Time))return new r.Time(t,e);r.TimeBase.call(this,t,e)},r.extend(r.Time,r.TimeBase),r.Time.prototype._expressions=Object.assign({},r.TimeBase.prototype._expressions,{quantize:{regexp:/^@(.+)/,method:function(t){if(r.Transport){var e=new this.constructor(t);return this._secondsToUnits(r.Transport.nextSubdivision(e))}return 0}},now:{regexp:/^\+(.+)/,method:function(t){return this._now()+new this.constructor(t)}}}),r.Time.prototype.quantize=function(t,e){e=r.defaultArg(e,1);var i=new this.constructor(t),n=this.valueOf();return n+(Math.round(n/i)*i-n)*e},r.Time.prototype.toNotation=function(){for(var i=this.toSeconds(),t=["1m"],e=1;e<8;e++){var n=Math.pow(2,e);t.push(n+"n."),t.push(n+"n"),t.push(n+"t")}t.push("0");var o=t[0],s=r.Time(t[0]).toSeconds();return t.forEach(function(t){var e=r.Time(t).toSeconds();Math.abs(e-i)<Math.abs(s-i)&&(o=t,s=e)}),o},r.Time.prototype.toBarsBeatsSixteenths=function(){var t=this._beatsToUnits(1),e=this.valueOf()/t;e=parseFloat(e.toFixed(4));var i=Math.floor(e/this._getTimeSignature()),n=e%1*4;return e=Math.floor(e)%this._getTimeSignature(),3<(n=n.toString()).length&&(n=parseFloat(parseFloat(n).toFixed(3))),[i,e,n].join(":")},r.Time.prototype.toTicks=function(){var t=this._beatsToUnits(1),e=this.valueOf()/t;return Math.round(e*this._getPPQ())},r.Time.prototype.toSeconds=function(){return this.valueOf()},r.Time.prototype.toMidi=function(){return r.Frequency.ftom(this.toFrequency())},r.Time}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0)],void 0===(o=function(t){if(t.supported){!t.global.hasOwnProperty("OfflineAudioContext")&&t.global.hasOwnProperty("webkitOfflineAudioContext")&&(t.global.OfflineAudioContext=t.global.webkitOfflineAudioContext);var e=new OfflineAudioContext(1,1,44100).startRendering();e&&t.isFunction(e.then)||(OfflineAudioContext.prototype._native_startRendering=OfflineAudioContext.prototype.startRendering,OfflineAudioContext.prototype.startRendering=function(){return new Promise(function(e){this.oncomplete=function(t){e(t.renderedBuffer)},this._native_startRendering()}.bind(this))})}}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(11),i(6),i(57),i(31)],void 0===(o=function(s){"use strict";return s.Player=function(t){var e;t instanceof s.Buffer&&t.loaded?(t=t.get(),e=s.Player.defaults):e=s.defaults(arguments,["url","onload"],s.Player),s.Source.call(this,e),this.autostart=e.autostart,this._buffer=new s.Buffer({url:e.url,onload:this._onload.bind(this,e.onload),reverse:e.reverse}),t instanceof AudioBuffer&&this._buffer.set(t),this._loop=e.loop,this._loopStart=e.loopStart,this._loopEnd=e.loopEnd,this._playbackRate=e.playbackRate,this._activeSources=[],this._elapsedTime=new s.TickSource(e.playbackRate),this.fadeIn=e.fadeIn,this.fadeOut=e.fadeOut},s.extend(s.Player,s.Source),s.Player.defaults={onload:s.noOp,playbackRate:1,loop:!1,autostart:!1,loopStart:0,loopEnd:0,retrigger:!1,reverse:!1,fadeIn:0,fadeOut:0},s.Player.prototype.load=function(t,e){return this._buffer.load(t,this._onload.bind(this,e))},s.Player.prototype._onload=function(t){(t=s.defaultArg(t,s.noOp))(this),this.autostart&&this.start()},s.Player.prototype._onSourceEnd=function(t){var e=this._activeSources.indexOf(t);this._activeSources.splice(e,1)},s.Player.prototype._start=function(t,e,i){e=this._loop?s.defaultArg(e,this._loopStart):s.defaultArg(e,0),e=this.toSeconds(e);var n=s.defaultArg(i,Math.max(this._buffer.duration-e,0));n=this.toSeconds(n),n/=this._playbackRate,t=this.toSeconds(t),this._elapsedTime.start(t,e);var o=new s.BufferSource({buffer:this._buffer,loop:this._loop,loopStart:this._loopStart,loopEnd:this._loopEnd,onended:this._onSourceEnd.bind(this),playbackRate:this._playbackRate,fadeIn:this.fadeIn,fadeOut:this.fadeOut}).connect(this.output);return this._loop||this._synced||this._state.setStateAtTime(s.State.Stopped,t+n),this._activeSources.push(o),this._loop&&s.isUndef(i)?o.start(t,e):o.start(t,e,n-this.toSeconds(this.fadeOut)),this},s.Player.prototype._stop=function(e){return e=this.toSeconds(e),this._elapsedTime.stop(e),this._activeSources.forEach(function(t){t.stop(e)}),this},s.Player.prototype.restart=function(t,e,i){return this._stop(t),this._start(t,e,i),this},s.Player.prototype.seek=function(t,e){return e=this.toSeconds(e),this._state.getValueAtTime(e)===s.State.Started&&(t=this.toSeconds(t),this._stop(e),this._start(e,t)),this},s.Player.prototype.setLoopPoints=function(t,e){return this.loopStart=t,this.loopEnd=e,this},Object.defineProperty(s.Player.prototype,"loopStart",{get:function(){return this._loopStart},set:function(e){this._loopStart=e,this._activeSources.forEach(function(t){t.loopStart=e})}}),Object.defineProperty(s.Player.prototype,"loopEnd",{get:function(){return this._loopEnd},set:function(e){this._loopEnd=e,this._activeSources.forEach(function(t){t.loopEnd=e})}}),Object.defineProperty(s.Player.prototype,"buffer",{get:function(){return this._buffer},set:function(t){this._buffer.set(t)}}),Object.defineProperty(s.Player.prototype,"loop",{get:function(){return this._loop},set:function(e){if(this._loop!==e){this._loop=e;var t=this.now();if(e){var i=this._state.getNextState(s.State.Stopped,t);i&&(this._activeSources.forEach(function(t){t.loop=e}),this._state.cancel(i.time),this._elapsedTime.cancel(i.time))}else this._stopAtNextIteration(t)}}}),s.Player.prototype._stopAtNextIteration=function(t){if(this._state.getValueAtTime(t)===s.State.Started){var e=this._state.getNextState(s.State.Stopped,t),i=this._elapsedTime.getTicksAtTime(t),n=Math.max(Math.ceil(i/this.buffer.duration),1),o=this._elapsedTime.getTimeOfTick(n*this.buffer.duration,e?e.time-this.sampleTime:1/0);this.stop(o)}},Object.defineProperty(s.Player.prototype,"playbackRate",{get:function(){return this._playbackRate},set:function(e){this._playbackRate=e;var i=this.now();this._elapsedTime.frequency.setValueAtTime(e,i),this._loop||this._stopAtNextIteration(i),this._activeSources.forEach(function(t){t.playbackRate.setValueAtTime(e,i)})}}),Object.defineProperty(s.Player.prototype,"position",{get:function(){var t=this.now();if(this._state.getValueAtTime(t)===s.State.Started&&this.loaded){var e=this.buffer.duration;return this._elapsedTime.getTicksAtTime(t)%e}return 0}}),Object.defineProperty(s.Player.prototype,"reverse",{get:function(){return this._buffer.reverse},set:function(t){this._buffer.reverse=t}}),Object.defineProperty(s.Player.prototype,"loaded",{get:function(){return this._buffer.loaded}}),s.Player.prototype.dispose=function(){return this._activeSources.forEach(function(t){t.dispose()}),this._activeSources=null,s.Source.prototype.dispose.call(this),this._buffer.dispose(),this._buffer=null,this._elapsedTime.dispose(),this._elapsedTime=null,this},s.Player}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(30),i(41),i(37),i(1),i(10),i(25)],void 0===(o=function(e){"use strict";return e.MonoSynth=function(t){t=e.defaultArg(t,e.MonoSynth.defaults),e.Monophonic.call(this,t),this.oscillator=new e.OmniOscillator(t.oscillator),this.frequency=this.oscillator.frequency,this.detune=this.oscillator.detune,this.filter=new e.Filter(t.filter),this.filterEnvelope=new e.FrequencyEnvelope(t.filterEnvelope),this.envelope=new e.AmplitudeEnvelope(t.envelope),this.oscillator.chain(this.filter,this.envelope,this.output),this.filterEnvelope.connect(this.filter.frequency),this._readOnly(["oscillator","frequency","detune","filter","filterEnvelope","envelope"])},e.extend(e.MonoSynth,e.Monophonic),e.MonoSynth.defaults={frequency:"C4",detune:0,oscillator:{type:"square"},filter:{Q:6,type:"lowpass",rolloff:-24},envelope:{attack:.005,decay:.1,sustain:.9,release:1},filterEnvelope:{attack:.06,decay:.2,sustain:.5,release:2,baseFrequency:200,octaves:7,exponent:2}},e.MonoSynth.prototype._triggerEnvelopeAttack=function(t,e){return t=this.toSeconds(t),this.envelope.triggerAttack(t,e),this.filterEnvelope.triggerAttack(t),this.oscillator.start(t),0===this.envelope.sustain&&this.oscillator.stop(t+this.envelope.attack+this.envelope.decay),this},e.MonoSynth.prototype._triggerEnvelopeRelease=function(t){return this.envelope.triggerRelease(t),this.filterEnvelope.triggerRelease(t),this.oscillator.stop(t+this.envelope.release),this},e.MonoSynth.prototype.dispose=function(){return e.Monophonic.prototype.dispose.call(this),this._writable(["oscillator","frequency","detune","filter","filterEnvelope","envelope"]),this.oscillator.dispose(),this.oscillator=null,this.envelope.dispose(),this.envelope=null,this.filterEnvelope.dispose(),this.filterEnvelope=null,this.filter.dispose(),this.filter=null,this.frequency=null,this.detune=null,this},e.MonoSynth}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(6),i(18),i(5),i(3)],void 0===(o=function(n){"use strict";return n.FatOscillator=function(){var t=n.defaults(arguments,["frequency","type","spread"],n.FatOscillator);n.Source.call(this,t),this.frequency=new n.Signal(t.frequency,n.Type.Frequency),this.detune=new n.Signal(t.detune,n.Type.Cents),this._oscillators=[],this._spread=t.spread,this._type=t.type,this._phase=t.phase,this._partials=n.defaultArg(t.partials,[]),this.count=t.count,this._readOnly(["frequency","detune"])},n.extend(n.FatOscillator,n.Source),n.FatOscillator.defaults={frequency:440,detune:0,phase:0,spread:20,count:3,type:"sawtooth"},n.FatOscillator.prototype._start=function(e){e=this.toSeconds(e),this._forEach(function(t){t.start(e)})},n.FatOscillator.prototype._stop=function(e){e=this.toSeconds(e),this._forEach(function(t){t.stop(e)})},n.FatOscillator.prototype.restart=function(e){e=this.toSeconds(e),this._forEach(function(t){t.restart(e)})},n.FatOscillator.prototype._forEach=function(t){for(var e=0;e<this._oscillators.length;e++)t.call(this,this._oscillators[e],e)},Object.defineProperty(n.FatOscillator.prototype,"type",{get:function(){return this._type},set:function(e){this._type=e,this._forEach(function(t){t.type=e})}}),Object.defineProperty(n.FatOscillator.prototype,"spread",{get:function(){return this._spread},set:function(t){if(this._spread=t,1<this._oscillators.length){var i=-t/2,n=t/(this._oscillators.length-1);this._forEach(function(t,e){t.detune.value=i+n*e})}}}),Object.defineProperty(n.FatOscillator.prototype,"count",{get:function(){return this._oscillators.length},set:function(t){if(t=Math.max(t,1),this._oscillators.length!==t){this._forEach(function(t){t.dispose()}),this._oscillators=[];for(var e=0;e<t;e++){var i=new n.Oscillator;this.type===n.Oscillator.Type.Custom?i.partials=this._partials:i.type=this._type,i.phase=this._phase+e/t*360,i.volume.value=-6-1.1*t,this.frequency.connect(i.frequency),this.detune.connect(i.detune),i.connect(this.output),this._oscillators[e]=i}this.spread=this._spread,this.state===n.State.Started&&this._forEach(function(t){t.start()})}}}),Object.defineProperty(n.FatOscillator.prototype,"phase",{get:function(){return this._phase},set:function(e){this._phase=e,this._forEach(function(t){t.phase=e})}}),Object.defineProperty(n.FatOscillator.prototype,"partials",{get:function(){return this._partials},set:function(e){this._partials=e,this._type=n.Oscillator.Type.Custom,this._forEach(function(t){t.partials=e})}}),n.FatOscillator.prototype.dispose=function(){return n.Source.prototype.dispose.call(this),this._writable(["frequency","detune"]),this.frequency.dispose(),this.frequency=null,this.detune.dispose(),this.detune=null,this._forEach(function(t){t.dispose()}),this._oscillators=null,this._partials=null,this},n.FatOscillator}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(6),i(18),i(5),i(3),i(22)],void 0===(o=function(e){"use strict";return e.AMOscillator=function(){var t=e.defaults(arguments,["frequency","type","modulationType"],e.AMOscillator);e.Source.call(this,t),this._carrier=new e.Oscillator(t.frequency,t.type),this.frequency=this._carrier.frequency,this.detune=this._carrier.detune,this.detune.value=t.detune,this._modulator=new e.Oscillator(t.frequency,t.modulationType),this._modulationScale=new e.AudioToGain,this.harmonicity=new e.Multiply(t.harmonicity),this.harmonicity.units=e.Type.Positive,this._modulationNode=new e.Gain(0),this.frequency.chain(this.harmonicity,this._modulator.frequency),this.detune.connect(this._modulator.detune),this._modulator.chain(this._modulationScale,this._modulationNode.gain),this._carrier.chain(this._modulationNode,this.output),this.phase=t.phase,this._readOnly(["frequency","detune","harmonicity"])},e.extend(e.AMOscillator,e.Oscillator),e.AMOscillator.defaults={frequency:440,detune:0,phase:0,modulationType:"square",harmonicity:1},e.AMOscillator.prototype._start=function(t){this._modulator.start(t),this._carrier.start(t)},e.AMOscillator.prototype._stop=function(t){this._modulator.stop(t),this._carrier.stop(t)},e.AMOscillator.prototype.restart=function(t){this._modulator.restart(t),this._carrier.restart(t)},Object.defineProperty(e.AMOscillator.prototype,"type",{get:function(){return this._carrier.type},set:function(t){this._carrier.type=t}}),Object.defineProperty(e.AMOscillator.prototype,"modulationType",{get:function(){return this._modulator.type},set:function(t){this._modulator.type=t}}),Object.defineProperty(e.AMOscillator.prototype,"phase",{get:function(){return this._carrier.phase},set:function(t){this._carrier.phase=t,this._modulator.phase=t}}),Object.defineProperty(e.AMOscillator.prototype,"partials",{get:function(){return this._carrier.partials},set:function(t){this._carrier.partials=t}}),e.AMOscillator.prototype.dispose=function(){return e.Source.prototype.dispose.call(this),this._writable(["frequency","detune","harmonicity"]),this.frequency=null,this.detune=null,this.harmonicity.dispose(),this.harmonicity=null,this._carrier.dispose(),this._carrier=null,this._modulator.dispose(),this._modulator=null,this._modulationNode.dispose(),this._modulationNode=null,this._modulationScale.dispose(),this._modulationScale=null,this},e.AMOscillator}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(6),i(49),i(18),i(5)],void 0===(o=function(e){"use strict";return e.PWMOscillator=function(){var t=e.defaults(arguments,["frequency","modulationFrequency"],e.PWMOscillator);e.Source.call(this,t),this._pulse=new e.PulseOscillator(t.modulationFrequency),this._pulse._sawtooth.type="sine",this._modulator=new e.Oscillator({frequency:t.frequency,detune:t.detune,phase:t.phase}),this._scale=new e.Multiply(2),this.frequency=this._modulator.frequency,this.detune=this._modulator.detune,this.modulationFrequency=this._pulse.frequency,this._modulator.chain(this._scale,this._pulse.width),this._pulse.connect(this.output),this._readOnly(["modulationFrequency","frequency","detune"])},e.extend(e.PWMOscillator,e.Source),e.PWMOscillator.defaults={frequency:440,detune:0,phase:0,modulationFrequency:.4},e.PWMOscillator.prototype._start=function(t){t=this.toSeconds(t),this._modulator.start(t),this._pulse.start(t)},e.PWMOscillator.prototype._stop=function(t){t=this.toSeconds(t),this._modulator.stop(t),this._pulse.stop(t)},e.PWMOscillator.prototype.restart=function(t){this._modulator.restart(t),this._pulse.restart(t)},Object.defineProperty(e.PWMOscillator.prototype,"type",{get:function(){return"pwm"}}),Object.defineProperty(e.PWMOscillator.prototype,"partials",{get:function(){return[]}}),Object.defineProperty(e.PWMOscillator.prototype,"phase",{get:function(){return this._modulator.phase},set:function(t){this._modulator.phase=t}}),e.PWMOscillator.prototype.dispose=function(){return e.Source.prototype.dispose.call(this),this._pulse.dispose(),this._pulse=null,this._scale.dispose(),this._scale=null,this._modulator.dispose(),this._modulator=null,this._writable(["modulationFrequency","frequency","detune"]),this.frequency=null,this.detune=null,this.modulationFrequency=null,this},e.PWMOscillator}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(50),i(4),i(17)],void 0===(o=function(s){"use strict";return s.Part=function(){var t=s.defaults(arguments,["callback","events"],s.Part);s.Event.call(this,t),this._events=[];for(var e=0;e<t.events.length;e++)Array.isArray(t.events[e])?this.add(t.events[e][0],t.events[e][1]):this.add(t.events[e])},s.extend(s.Part,s.Event),s.Part.defaults={callback:s.noOp,loop:!1,loopEnd:"1m",loopStart:0,playbackRate:1,probability:1,humanize:!1,mute:!1,events:[]},s.Part.prototype.start=function(t,e){var i=this.toTicks(t);return this._state.getValueAtTime(i)!==s.State.Started&&(e=this._loop?s.defaultArg(e,this._loopStart):s.defaultArg(e,0),e=this.toTicks(e),this._state.add({state:s.State.Started,time:i,offset:e}),this._forEach(function(t){this._startNote(t,i,e)})),this},s.Part.prototype._startNote=function(t,e,i){e-=i,this._loop?t.startOffset>=this._loopStart&&t.startOffset<this._loopEnd?(t.startOffset<i&&(e+=this._getLoopDuration()),t.start(s.Ticks(e))):t.startOffset<this._loopStart&&t.startOffset>=i&&(t.loop=!1,t.start(s.Ticks(e))):t.startOffset>=i&&t.start(s.Ticks(e))},Object.defineProperty(s.Part.prototype,"startOffset",{get:function(){return this._startOffset},set:function(t){this._startOffset=t,this._forEach(function(t){t.startOffset+=this._startOffset})}}),s.Part.prototype.stop=function(e){var t=this.toTicks(e);return this._state.cancel(t),this._state.setStateAtTime(s.State.Stopped,t),this._forEach(function(t){t.stop(e)}),this},s.Part.prototype.at=function(t,e){t=s.TransportTime(t);for(var i=s.Ticks(1).toSeconds(),n=0;n<this._events.length;n++){var o=this._events[n];if(Math.abs(t.toTicks()-o.startOffset)<i)return s.isDefined(e)&&(o.value=e),o}return s.isDefined(e)?(this.add(t,e),this._events[this._events.length-1]):null},s.Part.prototype.add=function(t,e){var i;return t.hasOwnProperty("time")&&(t=(e=t).time),t=this.toTicks(t),e instanceof s.Event?(i=e).callback=this._tick.bind(this):i=new s.Event({callback:this._tick.bind(this),value:e}),i.startOffset=t,i.set({loopEnd:this.loopEnd,loopStart:this.loopStart,loop:this.loop,humanize:this.humanize,playbackRate:this.playbackRate,probability:this.probability}),this._events.push(i),this._restartEvent(i),this},s.Part.prototype._restartEvent=function(e){this._state.forEach(function(t){t.state===s.State.Started?this._startNote(e,t.time,t.offset):e.stop(s.Ticks(t.time))}.bind(this))},s.Part.prototype.remove=function(t,e){t.hasOwnProperty("time")&&(t=(e=t).time),t=this.toTicks(t);for(var i=this._events.length-1;0<=i;i--){var n=this._events[i];n instanceof s.Part?n.remove(t,e):n.startOffset===t&&(s.isUndef(e)||s.isDefined(e)&&n.value===e)&&(this._events.splice(i,1),n.dispose())}return this},s.Part.prototype.removeAll=function(){return this._forEach(function(t){t.dispose()}),this._events=[],this},s.Part.prototype.cancel=function(e){return this._forEach(function(t){t.cancel(e)}),this._state.cancel(this.toTicks(e)),this},s.Part.prototype._forEach=function(t,e){if(this._events){e=s.defaultArg(e,this);for(var i=this._events.length-1;0<=i;i--){var n=this._events[i];n instanceof s.Part?n._forEach(t,e):t.call(e,n)}}return this},s.Part.prototype._setAll=function(e,i){this._forEach(function(t){t[e]=i})},s.Part.prototype._tick=function(t,e){this.mute||this.callback(t,e)},s.Part.prototype._testLoopBoundries=function(t){t.startOffset<this._loopStart||t.startOffset>=this._loopEnd?t.cancel(0):t.state===s.State.Stopped&&this._restartEvent(t)},Object.defineProperty(s.Part.prototype,"probability",{get:function(){return this._probability},set:function(t){this._probability=t,this._setAll("probability",t)}}),Object.defineProperty(s.Part.prototype,"humanize",{get:function(){return this._humanize},set:function(t){this._humanize=t,this._setAll("humanize",t)}}),Object.defineProperty(s.Part.prototype,"loop",{get:function(){return this._loop},set:function(e){this._loop=e,this._forEach(function(t){t._loopStart=this._loopStart,t._loopEnd=this._loopEnd,t.loop=e,this._testLoopBoundries(t)})}}),Object.defineProperty(s.Part.prototype,"loopEnd",{get:function(){return s.Ticks(this._loopEnd).toSeconds()},set:function(e){this._loopEnd=this.toTicks(e),this._loop&&this._forEach(function(t){t.loopEnd=e,this._testLoopBoundries(t)})}}),Object.defineProperty(s.Part.prototype,"loopStart",{get:function(){return s.Ticks(this._loopStart).toSeconds()},set:function(t){this._loopStart=this.toTicks(t),this._loop&&this._forEach(function(t){t.loopStart=this.loopStart,this._testLoopBoundries(t)})}}),Object.defineProperty(s.Part.prototype,"playbackRate",{get:function(){return this._playbackRate},set:function(t){this._playbackRate=t,this._setAll("playbackRate",t)}}),Object.defineProperty(s.Part.prototype,"length",{get:function(){return this._events.length}}),s.Part.prototype.dispose=function(){return s.Event.prototype.dispose.call(this),this.removeAll(),this.callback=null,this._events=null,this},s.Part}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(50)],void 0===(o=function(e){return e.Loop=function(){var t=e.defaults(arguments,["callback","interval"],e.Loop);e.call(this),this._event=new e.Event({callback:this._tick.bind(this),loop:!0,loopEnd:t.interval,playbackRate:t.playbackRate,probability:t.probability}),this.callback=t.callback,this.iterations=t.iterations},e.extend(e.Loop),e.Loop.defaults={interval:"4n",callback:e.noOp,playbackRate:1,iterations:1/0,probability:!0,mute:!1},e.Loop.prototype.start=function(t){return this._event.start(t),this},e.Loop.prototype.stop=function(t){return this._event.stop(t),this},e.Loop.prototype.cancel=function(t){return this._event.cancel(t),this},e.Loop.prototype._tick=function(t){this.callback(t)},Object.defineProperty(e.Loop.prototype,"state",{get:function(){return this._event.state}}),Object.defineProperty(e.Loop.prototype,"progress",{get:function(){return this._event.progress}}),Object.defineProperty(e.Loop.prototype,"interval",{get:function(){return this._event.loopEnd},set:function(t){this._event.loopEnd=t}}),Object.defineProperty(e.Loop.prototype,"playbackRate",{get:function(){return this._event.playbackRate},set:function(t){this._event.playbackRate=t}}),Object.defineProperty(e.Loop.prototype,"humanize",{get:function(){return this._event.humanize},set:function(t){this._event.humanize=t}}),Object.defineProperty(e.Loop.prototype,"probability",{get:function(){return this._event.probability},set:function(t){this._event.probability=t}}),Object.defineProperty(e.Loop.prototype,"mute",{get:function(){return this._event.mute},set:function(t){this._event.mute=t}}),Object.defineProperty(e.Loop.prototype,"iterations",{get:function(){return!0===this._event.loop?1/0:this._event.loop},set:function(t){this._event.loop=t===1/0||t}}),e.Loop.prototype.dispose=function(){this._event.dispose(),this._event=null,this.callback=null},e.Loop}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(15),i(32)],void 0===(o=function(e){"use strict";return e.StereoXFeedbackEffect=function(){var t=e.defaults(arguments,["feedback"],e.FeedbackEffect);e.StereoEffect.call(this,t),this.feedback=new e.Signal(t.feedback,e.Type.NormalRange),this._feedbackLR=new e.Gain,this._feedbackRL=new e.Gain,this.effectReturnL.chain(this._feedbackLR,this.effectSendR),this.effectReturnR.chain(this._feedbackRL,this.effectSendL),this.feedback.fan(this._feedbackLR.gain,this._feedbackRL.gain),this._readOnly(["feedback"])},e.extend(e.StereoXFeedbackEffect,e.StereoEffect),e.StereoXFeedbackEffect.prototype.dispose=function(){return e.StereoEffect.prototype.dispose.call(this),this._writable(["feedback"]),this.feedback.dispose(),this.feedback=null,this._feedbackLR.dispose(),this._feedbackLR=null,this._feedbackRL.dispose(),this._feedbackRL=null,this},e.StereoXFeedbackEffect}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(8),i(53),i(52)],void 0===(o=function(t){"use strict";return t.MidSideEffect=function(){t.Effect.apply(this,arguments),this._midSideSplit=new t.MidSideSplit,this._midSideMerge=new t.MidSideMerge,this.midSend=this._midSideSplit.mid,this.sideSend=this._midSideSplit.side,this.midReturn=this._midSideMerge.mid,this.sideReturn=this._midSideMerge.side,this.effectSend.connect(this._midSideSplit),this._midSideMerge.connect(this.effectReturn)},t.extend(t.MidSideEffect,t.Effect),t.MidSideEffect.prototype.dispose=function(){return t.Effect.prototype.dispose.call(this),this._midSideSplit.dispose(),this._midSideSplit=null,this._midSideMerge.dispose(),this._midSideMerge=null,this.midSend=null,this.sideSend=null,this.midReturn=null,this.sideReturn=null,this},t.MidSideEffect}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(11),i(8)],void 0===(o=function(t){"use strict";return t.Convolver=function(){var e=t.defaults(arguments,["url","onload"],t.Convolver);t.Effect.call(this,e),this._convolver=this.context.createConvolver(),this._buffer=new t.Buffer(e.url,function(t){this.buffer=t.get(),e.onload()}.bind(this)),this._buffer.loaded&&(this.buffer=this._buffer),this.normalize=e.normalize,this.connectEffect(this._convolver)},t.extend(t.Convolver,t.Effect),t.Convolver.defaults={onload:t.noOp,normalize:!0},Object.defineProperty(t.Convolver.prototype,"buffer",{get:function(){return this._buffer.length?this._buffer:null},set:function(t){this._buffer.set(t),this._convolver.buffer&&(this.effectSend.disconnect(),this._convolver.disconnect(),this._convolver=this.context.createConvolver(),this.connectEffect(this._convolver)),this._convolver.buffer=this._buffer.get()}}),Object.defineProperty(t.Convolver.prototype,"normalize",{get:function(){return this._convolver.normalize},set:function(t){this._convolver.normalize=t}}),t.Convolver.prototype.load=function(t,e){return this._buffer.load(t,function(t){this.buffer=t,e&&e()}.bind(this))},t.Convolver.prototype.dispose=function(){return t.Effect.prototype.dispose.call(this),this._buffer.dispose(),this._buffer=null,this._convolver.disconnect(),this._convolver=null,this},t.Convolver}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(7),i(5),i(13)],void 0===(o=function(e){"use strict";return e.Modulo=function(t){e.SignalBase.call(this),this.createInsOuts(1,0),this._shaper=new e.WaveShaper(Math.pow(2,16)),this._multiply=new e.Multiply,this._subtract=this.output=new e.Subtract,this._modSignal=new e.Signal(t),this.input.fan(this._shaper,this._subtract),this._modSignal.connect(this._multiply,0,0),this._shaper.connect(this._multiply,0,1),this._multiply.connect(this._subtract,0,1),this._setWaveShaper(t)},e.extend(e.Modulo,e.SignalBase),e.Modulo.prototype._setWaveShaper=function(e){this._shaper.setMap(function(t){return Math.floor((t+1e-4)/e)})},Object.defineProperty(e.Modulo.prototype,"value",{get:function(){return this._modSignal.value},set:function(t){this._modSignal.value=t,this._setWaveShaper(t)}}),e.Modulo.prototype.dispose=function(){return e.SignalBase.prototype.dispose.call(this),this._shaper.dispose(),this._shaper=null,this._multiply.dispose(),this._multiply=null,this._subtract.dispose(),this._subtract=null,this._modSignal.dispose(),this._modSignal=null,this},e.Modulo}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(17),i(11),i(62),i(40)],void 0===(o=function(l){return l.Offline=function(t,e){var i,n=l.context.sampleRate,o=l.context,s=function t(e,i,n,o){o=l.defaultArg(o,0);var s=new l.OfflineContext(2,i,n);l.context=s;var r=e(l.Transport);return 0<s.currentTime&&o<1e3?t(e,i,n,++o):{response:r,context:s}}(t,e,n),r=s.response,a=s.context;return i=r&&l.isFunction(r.then)?r.then(function(){return a.render()}):a.render(),l.context=o,i.then(function(t){return new l.Buffer(t)})},l.Offline}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(11)],void 0===(o=function(o){return o.Buffers=function(t){var e=Array.prototype.slice.call(arguments);e.shift();var i=o.defaults(e,["onload","baseUrl"],o.Buffers);for(var n in o.call(this),this._buffers={},this.baseUrl=i.baseUrl,this._loadingCount=0,t)this._loadingCount++,this.add(n,t[n],this._bufferLoaded.bind(this,i.onload))},o.extend(o.Buffers),o.Buffers.defaults={onload:o.noOp,baseUrl:""},o.Buffers.prototype.has=function(t){return this._buffers.hasOwnProperty(t)},o.Buffers.prototype.get=function(t){if(this.has(t))return this._buffers[t];throw new Error("Tone.Buffers: no buffer named "+t)},o.Buffers.prototype._bufferLoaded=function(t){this._loadingCount--,0===this._loadingCount&&t&&t(this)},Object.defineProperty(o.Buffers.prototype,"loaded",{get:function(){var t=!0;for(var e in this._buffers){var i=this.get(e);t=t&&i.loaded}return t}}),o.Buffers.prototype.add=function(t,e,i){return i=o.defaultArg(i,o.noOp),e instanceof o.Buffer?(this._buffers[t]=e,i(this)):e instanceof AudioBuffer?(this._buffers[t]=new o.Buffer(e),i(this)):o.isString(e)&&(this._buffers[t]=new o.Buffer(this.baseUrl+e,i)),this},o.Buffers.prototype.dispose=function(){for(var t in o.prototype.dispose.call(this),this._buffers)this._buffers[t].dispose();return this._buffers=null,this},o.Buffers}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0)],void 0===(o=function(e){"use strict";return e.CtrlPattern=function(){var t=e.defaults(arguments,["values","type"],e.CtrlPattern);e.call(this),this.values=t.values,this.index=0,this._type=null,this._shuffled=null,this._direction=null,this.type=t.type},e.extend(e.CtrlPattern),e.CtrlPattern.Type={Up:"up",Down:"down",UpDown:"upDown",DownUp:"downUp",AlternateUp:"alternateUp",AlternateDown:"alternateDown",Random:"random",RandomWalk:"randomWalk",RandomOnce:"randomOnce"},e.CtrlPattern.defaults={type:e.CtrlPattern.Type.Up,values:[]},Object.defineProperty(e.CtrlPattern.prototype,"value",{get:function(){if(0!==this.values.length){if(1===this.values.length)return this.values[0];this.index=Math.min(this.index,this.values.length-1);var t=this.values[this.index];return this.type===e.CtrlPattern.Type.RandomOnce&&(this.values.length!==this._shuffled.length&&this._shuffleValues(),t=this.values[this._shuffled[this.index]]),t}}}),Object.defineProperty(e.CtrlPattern.prototype,"type",{get:function(){return this._type},set:function(t){this._type=t,this._shuffled=null,this._type===e.CtrlPattern.Type.Up||this._type===e.CtrlPattern.Type.UpDown||this._type===e.CtrlPattern.Type.RandomOnce||this._type===e.CtrlPattern.Type.AlternateUp?this.index=0:this._type!==e.CtrlPattern.Type.Down&&this._type!==e.CtrlPattern.Type.DownUp&&this._type!==e.CtrlPattern.Type.AlternateDown||(this.index=this.values.length-1),this._type===e.CtrlPattern.Type.UpDown||this._type===e.CtrlPattern.Type.AlternateUp?this._direction=e.CtrlPattern.Type.Up:this._type!==e.CtrlPattern.Type.DownUp&&this._type!==e.CtrlPattern.Type.AlternateDown||(this._direction=e.CtrlPattern.Type.Down),this._type===e.CtrlPattern.Type.RandomOnce?this._shuffleValues():this._type===e.CtrlPattern.Random&&(this.index=Math.floor(Math.random()*this.values.length))}}),e.CtrlPattern.prototype.next=function(){var t=this.type;return t===e.CtrlPattern.Type.Up?(this.index++,this.index>=this.values.length&&(this.index=0)):t===e.CtrlPattern.Type.Down?(this.index--,this.index<0&&(this.index=this.values.length-1)):t===e.CtrlPattern.Type.UpDown||t===e.CtrlPattern.Type.DownUp?(this._direction===e.CtrlPattern.Type.Up?this.index++:this.index--,this.index<0?(this.index=1,this._direction=e.CtrlPattern.Type.Up):this.index>=this.values.length&&(this.index=this.values.length-2,this._direction=e.CtrlPattern.Type.Down)):t===e.CtrlPattern.Type.Random?this.index=Math.floor(Math.random()*this.values.length):t===e.CtrlPattern.Type.RandomWalk?Math.random()<.5?(this.index--,this.index=Math.max(this.index,0)):(this.index++,this.index=Math.min(this.index,this.values.length-1)):t===e.CtrlPattern.Type.RandomOnce?(this.index++,this.index>=this.values.length&&(this.index=0,this._shuffleValues())):t===e.CtrlPattern.Type.AlternateUp?(this._direction===e.CtrlPattern.Type.Up?(this.index+=2,this._direction=e.CtrlPattern.Type.Down):(this.index-=1,this._direction=e.CtrlPattern.Type.Up),this.index>=this.values.length&&(this.index=0,this._direction=e.CtrlPattern.Type.Up)):t===e.CtrlPattern.Type.AlternateDown&&(this._direction===e.CtrlPattern.Type.Up?(this.index+=1,this._direction=e.CtrlPattern.Type.Down):(this.index-=2,this._direction=e.CtrlPattern.Type.Up),this.index<0&&(this.index=this.values.length-1,this._direction=e.CtrlPattern.Type.Down)),this.value},e.CtrlPattern.prototype._shuffleValues=function(){var t=[];this._shuffled=[];for(var e=0;e<this.values.length;e++)t[e]=e;for(;0<t.length;){var i=t.splice(Math.floor(t.length*Math.random()),1);this._shuffled.push(i[0])}},e.CtrlPattern.prototype.dispose=function(){this._shuffled=null,this.values=null},e.CtrlPattern}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(7),i(9),i(26),i(16),i(3),i(1),i(20)],void 0===(o=function(a){if(a.supported&&!a.global.AudioContext.prototype.createStereoPanner){var t=function(t){this.context=t,this.pan=new a.Signal(0,a.Type.AudioRange);var e=new a.WaveShaper(function(t){return a.equalPowerScale((t+1)/2)},4096),i=new a.WaveShaper(function(t){return a.equalPowerScale(1-(t+1)/2)},4096),n=new a.Gain,o=new a.Gain,s=this.input=new a.Split;s._splitter.channelCountMode="explicit",(new a.Zero).fan(e,i);var r=this.output=new a.Merge;s.left.chain(n,r.left),s.right.chain(o,r.right),this.pan.chain(i,n.gain),this.pan.chain(e,o.gain)};t.prototype.disconnect=function(){this.output.disconnect.apply(this.output,arguments)},t.prototype.connect=function(){this.output.connect.apply(this.output,arguments)},AudioContext.prototype.createStereoPanner=function(){return new t(this)},a.Context.prototype.createStereoPanner=function(){return new t(this)}}}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0)],void 0===(o=function(t){t.supported&&(AudioBuffer.prototype.copyToChannel||(AudioBuffer.prototype.copyToChannel=function(t,e,i){var n=this.getChannelData(e);i=i||0;for(var o=0;o<n.length;o++)n[o+i]=t[o]},AudioBuffer.prototype.copyFromChannel=function(t,e,i){var n=this.getChannelData(e);i=i||0;for(var o=0;o<t.length;o++)t[o]=n[o+i]}))}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(11),i(6),i(3),i(2)],void 0===(o=function(e){return e.OscillatorNode=function(){var t=e.defaults(arguments,["frequency","type"],e.OscillatorNode);e.AudioNode.call(this,t),this.onended=t.onended,this._startTime=-1,this._stopTime=-1,this._gainNode=this.output=new e.Gain(0),this._oscillator=this.context.createOscillator(),this._oscillator.connect(this._gainNode),this.type=t.type,this.frequency=new e.Param({param:this._oscillator.frequency,units:e.Type.Frequency,value:t.frequency}),this.detune=new e.Param({param:this._oscillator.detune,units:e.Type.Cents,value:t.detune}),this._gain=1},e.extend(e.OscillatorNode,e.AudioNode),e.OscillatorNode.defaults={frequency:440,detune:0,type:"sine",onended:e.noOp},Object.defineProperty(e.OscillatorNode.prototype,"state",{get:function(){return this.getStateAtTime(this.now())}}),e.OscillatorNode.prototype.getStateAtTime=function(t){return t=this.toSeconds(t),-1!==this._startTime&&t>=this._startTime&&(-1===this._stopTime||t<=this._stopTime)?e.State.Started:e.State.Stopped},e.OscillatorNode.prototype.start=function(t){if(this.log("start",t),-1!==this._startTime)throw new Error("cannot call OscillatorNode.start more than once");return this._startTime=this.toSeconds(t),this._oscillator.start(this._startTime),this._gainNode.gain.setValueAtTime(1,this._startTime),this},e.OscillatorNode.prototype.setPeriodicWave=function(t){return this._oscillator.setPeriodicWave(t),this},e.OscillatorNode.prototype.stop=function(t){return this.log("stop",t),this.assert(-1!==this._startTime,"'start' must be called before 'stop'"),this.cancelStop(),this._stopTime=this.toSeconds(t),this._stopTime>this._startTime?(this._gainNode.gain.setValueAtTime(0,this._stopTime),this.context.clearTimeout(this._timeout),this._timeout=this.context.setTimeout(function(){this._oscillator.stop(this.now()),this.onended()}.bind(this),this._stopTime-this.context.currentTime)):this._gainNode.gain.cancelScheduledValues(this._startTime),this},e.OscillatorNode.prototype.cancelStop=function(){return-1!==this._startTime&&(this._gainNode.gain.cancelScheduledValues(this._startTime+this.sampleTime),this.context.clearTimeout(this._timeout),this._stopTime=-1),this},Object.defineProperty(e.OscillatorNode.prototype,"type",{get:function(){return this._oscillator.type},set:function(t){this._oscillator.type=t}}),e.OscillatorNode.prototype.dispose=function(){return this.context.clearTimeout(this._timeout),e.AudioNode.prototype.dispose.call(this),this.onended=null,this._oscillator.disconnect(),this._oscillator=null,this._gainNode.dispose(),this._gainNode=null,this.frequency.dispose(),this.frequency=null,this.detune.dispose(),this.detune=null,this},e.OscillatorNode}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(56),i(55)],void 0===(o=function(i){return i.TransportRepeatEvent=function(t,e){i.TransportEvent.call(this,t,e),e=i.defaultArg(e,i.TransportRepeatEvent.defaults),this.duration=i.Ticks(e.duration),this._interval=i.Ticks(e.interval),this._currentId=-1,this._nextId=-1,this._nextTick=this.time,this._boundRestart=this._restart.bind(this),this.Transport.on("start loopStart",this._boundRestart),this._restart()},i.extend(i.TransportRepeatEvent,i.TransportEvent),i.TransportRepeatEvent.defaults={duration:1/0,interval:1},i.TransportRepeatEvent.prototype.invoke=function(t){this._createEvents(t),i.TransportEvent.prototype.invoke.call(this,t)},i.TransportRepeatEvent.prototype._createEvents=function(t){var e=this.Transport.getTicksAtTime(t);e>=this.time&&e>=this._nextTick&&this._nextTick+this._interval<this.time+this.duration&&(this._nextTick+=this._interval,this._currentId=this._nextId,this._nextId=this.Transport.scheduleOnce(this.invoke.bind(this),i.Ticks(this._nextTick)))},i.TransportRepeatEvent.prototype._restart=function(t){this.Transport.clear(this._currentId),this.Transport.clear(this._nextId),this._nextTick=this.time;var e=this.Transport.getTicksAtTime(t);e>this.time&&(this._nextTick=this.time+Math.ceil((e-this.time)/this._interval)*this._interval),this._currentId=this.Transport.scheduleOnce(this.invoke.bind(this),i.Ticks(this._nextTick)),this._nextTick+=this._interval,this._nextId=this.Transport.scheduleOnce(this.invoke.bind(this),i.Ticks(this._nextTick))},i.TransportRepeatEvent.prototype.dispose=function(){return this.Transport.clear(this._currentId),this.Transport.clear(this._nextId),this.Transport.off("start loopStart",this._boundRestart),this._boundCreateEvents=null,i.TransportEvent.prototype.dispose.call(this),this.duration=null,this._interval=null,this},i.TransportRepeatEvent}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(4)],void 0===(o=function(i){"use strict";i.IntervalTimeline=function(){i.call(this),this._root=null,this._length=0},i.extend(i.IntervalTimeline),i.IntervalTimeline.prototype.add=function(t){if(i.isUndef(t.time)||i.isUndef(t.duration))throw new Error("Tone.IntervalTimeline: events must have time and duration parameters");t.time=t.time.valueOf();var e=new n(t.time,t.time+t.duration,t);for(null===this._root?this._root=e:this._root.insert(e),this._length++;null!==e;)e.updateHeight(),e.updateMax(),this._rebalance(e),e=e.parent;return this},i.IntervalTimeline.prototype.remove=function(t){if(null!==this._root){var e=[];this._root.search(t.time,e);for(var i=0;i<e.length;i++){var n=e[i];if(n.event===t){this._removeNode(n),this._length--;break}}}return this},Object.defineProperty(i.IntervalTimeline.prototype,"length",{get:function(){return this._length}}),i.IntervalTimeline.prototype.cancel=function(t){return this.forEachFrom(t,function(t){this.remove(t)}.bind(this)),this},i.IntervalTimeline.prototype._setRoot=function(t){this._root=t,null!==this._root&&(this._root.parent=null)},i.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)},i.IntervalTimeline.prototype._removeNode=function(t){if(null===t.left&&null===t.right)this._replaceNodeInParent(t,null);else if(null===t.right)this._replaceNodeInParent(t,t.left);else if(null===t.left)this._replaceNodeInParent(t,t.right);else{var e,i;if(0<t.getBalance())if(null===t.left.right)(e=t.left).right=t.right,i=e;else{for(e=t.left.right;null!==e.right;)e=e.right;e.parent.right=e.left,i=e.parent,e.left=t.left,e.right=t.right}else if(null===t.right.left)(e=t.right).left=t.left,i=e;else{for(e=t.right.left;null!==e.left;)e=e.left;e.parent=e.parent,e.parent.left=e.right,i=e.parent,e.left=t.left,e.right=t.right}null!==t.parent?t.isLeftChild()?t.parent.left=e:t.parent.right=e:this._setRoot(e),this._rebalance(i)}t.dispose()},i.IntervalTimeline.prototype._rotateLeft=function(t){var e=t.parent,i=t.isLeftChild(),n=t.right;t.right=n.left,n.left=t,null!==e?i?e.left=n:e.right=n:this._setRoot(n)},i.IntervalTimeline.prototype._rotateRight=function(t){var e=t.parent,i=t.isLeftChild(),n=t.left;t.left=n.right,n.right=t,null!==e?i?e.left=n:e.right=n:this._setRoot(n)},i.IntervalTimeline.prototype._rebalance=function(t){var e=t.getBalance();1<e?t.left.getBalance()<0?this._rotateLeft(t.left):this._rotateRight(t):e<-1&&(0<t.right.getBalance()?this._rotateRight(t.right):this._rotateLeft(t))},i.IntervalTimeline.prototype.get=function(t){if(null!==this._root){var e=[];if(this._root.search(t,e),0<e.length){for(var i=e[0],n=1;n<e.length;n++)e[n].low>i.low&&(i=e[n]);return i.event}}return null},i.IntervalTimeline.prototype.forEach=function(t){if(null!==this._root){var e=[];this._root.traverse(function(t){e.push(t)});for(var i=0;i<e.length;i++){var n=e[i].event;n&&t(n)}}return this},i.IntervalTimeline.prototype.forEachAtTime=function(t,e){if(null!==this._root){var i=[];this._root.search(t,i);for(var n=i.length-1;0<=n;n--){var o=i[n].event;o&&e(o)}}return this},i.IntervalTimeline.prototype.forEachFrom=function(t,e){if(null!==this._root){var i=[];this._root.searchAfter(t,i);for(var n=i.length-1;0<=n;n--)e(i[n].event)}return this},i.IntervalTimeline.prototype.dispose=function(){var e=[];null!==this._root&&this._root.traverse(function(t){e.push(t)});for(var t=0;t<e.length;t++)e[t].dispose();return e=null,this._root=null,this};var n=function(t,e,i){this.event=i,this.low=t,this.high=e,this.max=this.high,this._left=null,this._right=null,this.parent=null,this.height=0};return n.prototype.insert=function(t){t.low<=this.low?null===this.left?this.left=t:this.left.insert(t):null===this.right?this.right=t:this.right.insert(t)},n.prototype.search=function(t,e){t>this.max||(null!==this.left&&this.left.search(t,e),this.low<=t&&this.high>t&&e.push(this),this.low>t||null!==this.right&&this.right.search(t,e))},n.prototype.searchAfter=function(t,e){this.low>=t&&(e.push(this),null!==this.left&&this.left.searchAfter(t,e)),null!==this.right&&this.right.searchAfter(t,e)},n.prototype.traverse=function(t){t(this),null!==this.left&&this.left.traverse(t),null!==this.right&&this.right.traverse(t)},n.prototype.updateHeight=function(){null!==this.left&&null!==this.right?this.height=Math.max(this.left.height,this.right.height)+1:null!==this.right?this.height=this.right.height+1:null!==this.left?this.height=this.left.height+1:this.height=0},n.prototype.updateMax=function(){this.max=this.high,null!==this.left&&(this.max=Math.max(this.max,this.left.max)),null!==this.right&&(this.max=Math.max(this.max,this.right.max))},n.prototype.getBalance=function(){var t=0;return null!==this.left&&null!==this.right?t=this.left.height-this.right.height:null!==this.left?t=this.left.height+1:null!==this.right&&(t=-(this.right.height+1)),t},n.prototype.isLeftChild=function(){return null!==this.parent&&this.parent.left===this},Object.defineProperty(n.prototype,"left",{get:function(){return this._left},set:function(t){null!==(this._left=t)&&(t.parent=this),this.updateHeight(),this.updateMax()}}),Object.defineProperty(n.prototype,"right",{get:function(){return this._right},set:function(t){null!==(this._right=t)&&(t.parent=this),this.updateHeight(),this.updateMax()}}),n.prototype.dispose=function(){this.parent=null,this._left=null,this._right=null,this.event=null},i.IntervalTimeline}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(1)],void 0===(o=function(a){function t(s){return function(t,e){e=this.toSeconds(e),s.apply(this,arguments);var i=this._events.get(e),n=this._events.previousEvent(i),o=this._getTicksUntilEvent(n,e);return i.ticks=Math.max(o,0),this}}return a.TickSignal=function(t){t=a.defaultArg(t,1),a.Signal.call(this,{units:a.Type.Ticks,value:t}),this._events.memory=1/0,this.cancelScheduledValues(0),this._events.add({type:a.Param.AutomationType.SetValue,time:0,value:t})},a.extend(a.TickSignal,a.Signal),a.TickSignal.prototype.setValueAtTime=t(a.Signal.prototype.setValueAtTime),a.TickSignal.prototype.linearRampToValueAtTime=t(a.Signal.prototype.linearRampToValueAtTime),a.TickSignal.prototype.setTargetAtTime=function(t,e,i){e=this.toSeconds(e),this.setRampPoint(e),t=this._fromUnits(t);for(var n=this._events.get(e),o=Math.round(Math.max(1/i,1)),s=0;s<=o;s++){var r=i*s+e,a=this._exponentialApproach(n.time,n.value,t,i,r);this.linearRampToValueAtTime(this._toUnits(a),r)}return this},a.TickSignal.prototype.exponentialRampToValueAtTime=function(t,e){e=this.toSeconds(e),t=this._fromUnits(t);var i=this._events.get(e);null===i&&(i={value:this._initialValue,time:0});for(var n=Math.round(Math.max(10*(e-i.time),1)),o=(e-i.time)/n,s=0;s<=n;s++){var r=o*s+i.time,a=this._exponentialInterpolate(i.time,i.value,e,t,r);this.linearRampToValueAtTime(this._toUnits(a),r)}return this},a.TickSignal.prototype._getTicksUntilEvent=function(t,e){if(null===t)t={ticks:0,time:0};else if(a.isUndef(t.ticks)){var i=this._events.previousEvent(t);t.ticks=this._getTicksUntilEvent(i,t.time)}var n=this.getValueAtTime(t.time),o=this.getValueAtTime(e);return this._events.get(e).time===e&&this._events.get(e).type===a.Param.AutomationType.SetValue&&(o=this.getValueAtTime(e-this.sampleTime)),.5*(e-t.time)*(n+o)+t.ticks},a.TickSignal.prototype.getTicksAtTime=function(t){t=this.toSeconds(t);var e=this._events.get(t);return Math.max(this._getTicksUntilEvent(e,t),0)},a.TickSignal.prototype.getDurationOfTicks=function(t,e){e=this.toSeconds(e);var i=this.getTicksAtTime(e);return this.getTimeOfTick(i+t)-e},a.TickSignal.prototype.getTimeOfTick=function(t){var e=this._events.get(t,"ticks"),i=this._events.getAfter(t,"ticks");if(e&&e.ticks===t)return e.time;if(e&&i&&i.type===a.Param.AutomationType.Linear&&e.value!==i.value){var n=this.getValueAtTime(e.time),o=(this.getValueAtTime(i.time)-n)/(i.time-e.time),s=Math.sqrt(Math.pow(n,2)-2*o*(e.ticks-t)),r=(-n+s)/o;return(0<r?r:(-n-s)/o)+e.time}return e?0===e.value?1/0:e.time+(t-e.ticks)/e.value:t/this._initialValue},a.TickSignal.prototype.ticksToTime=function(t,e){return e=this.toSeconds(e),new a.Time(this.getDurationOfTicks(t,e))},a.TickSignal.prototype.timeToTicks=function(t,e){e=this.toSeconds(e),t=this.toSeconds(t);var i=this.getTicksAtTime(e),n=this.getTicksAtTime(e+t);return new a.Ticks(n-i)},a.TickSignal}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(57),i(33),i(35),i(20)],void 0===(o=function(i){"use strict";return i.Clock=function(){var t=i.defaults(arguments,["callback","frequency"],i.Clock);i.Emitter.call(this),this.callback=t.callback,this._nextTick=0,this._tickSource=new i.TickSource(t.frequency),this._lastUpdate=0,this.frequency=this._tickSource.frequency,this._readOnly("frequency"),this._state=new i.TimelineState(i.State.Stopped),this._state.setStateAtTime(i.State.Stopped,0),this._boundLoop=this._loop.bind(this),this.context.on("tick",this._boundLoop)},i.extend(i.Clock,i.Emitter),i.Clock.defaults={callback:i.noOp,frequency:1},Object.defineProperty(i.Clock.prototype,"state",{get:function(){return this._state.getValueAtTime(this.now())}}),i.Clock.prototype.start=function(t,e){return this.context.resume(),t=this.toSeconds(t),this._state.getValueAtTime(t)!==i.State.Started&&(this._state.setStateAtTime(i.State.Started,t),this._tickSource.start(t,e),t<this._lastUpdate&&this.emit("start",t,e)),this},i.Clock.prototype.stop=function(t){return t=this.toSeconds(t),this._state.cancel(t),this._state.setStateAtTime(i.State.Stopped,t),this._tickSource.stop(t),t<this._lastUpdate&&this.emit("stop",t),this},i.Clock.prototype.pause=function(t){return t=this.toSeconds(t),this._state.getValueAtTime(t)===i.State.Started&&(this._state.setStateAtTime(i.State.Paused,t),this._tickSource.pause(t),t<this._lastUpdate&&this.emit("pause",t)),this},Object.defineProperty(i.Clock.prototype,"ticks",{get:function(){return Math.ceil(this.getTicksAtTime(this.now()))},set:function(t){this._tickSource.ticks=t}}),Object.defineProperty(i.Clock.prototype,"seconds",{get:function(){return this._tickSource.seconds},set:function(t){this._tickSource.seconds=t}}),i.Clock.prototype.getSecondsAtTime=function(t){return this._tickSource.getSecondsAtTime(t)},i.Clock.prototype.setTicksAtTime=function(t,e){return this._tickSource.setTicksAtTime(t,e),this},i.Clock.prototype.getTicksAtTime=function(t){return this._tickSource.getTicksAtTime(t)},i.Clock.prototype.nextTickTime=function(t,e){e=this.toSeconds(e);var i=this.getTicksAtTime(e);return this._tickSource.getTimeOfTick(i+t,e)},i.Clock.prototype._loop=function(){var t=this._lastUpdate,e=this.now();t!==(this._lastUpdate=e)&&(this._state.forEachBetween(t,e,function(t){switch(t.state){case i.State.Started:var e=this._tickSource.getTicksAtTime(t.time);this.emit("start",t.time,e);break;case i.State.Stopped:0!==t.time&&this.emit("stop",t.time);break;case i.State.Paused:this.emit("pause",t.time)}}.bind(this)),this._tickSource.forEachTickBetween(t,e,function(t,e){this.callback(t,e)}.bind(this)))},i.Clock.prototype.getStateAtTime=function(t){return t=this.toSeconds(t),this._state.getValueAtTime(t)},i.Clock.prototype.dispose=function(){i.Emitter.prototype.dispose.call(this),this.context.off("tick",this._boundLoop),this._writable("frequency"),this._tickSource.dispose(),this._tickSource=null,this.frequency=null,this._boundLoop=null,this._nextTick=1/0,this.callback=null,this._state.dispose(),this._state=null},i.Clock}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(1),i(5),i(7)],void 0===(o=function(t){"use strict";return t.GreaterThanZero=function(){t.SignalBase.call(this),this._thresh=this.output=new t.WaveShaper(function(t){return t<=0?0:1},127),this._scale=this.input=new t.Multiply(1e4),this._scale.connect(this._thresh)},t.extend(t.GreaterThanZero,t.SignalBase),t.GreaterThanZero.prototype.dispose=function(){return t.SignalBase.prototype.dispose.call(this),this._scale.dispose(),this._scale=null,this._thresh.dispose(),this._thresh=null,this},t.GreaterThanZero}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(88),i(13),i(1)],void 0===(o=function(e){"use strict";return e.GreaterThan=function(t){e.Signal.call(this),this.createInsOuts(2,0),this._param=this.input[0]=new e.Subtract(t),this.input[1]=this._param.input[1],this._gtz=this.output=new e.GreaterThanZero,this._param.connect(this._gtz),this.proxy=!1},e.extend(e.GreaterThan,e.Signal),e.GreaterThan.prototype.dispose=function(){return e.Signal.prototype.dispose.call(this),this._gtz.dispose(),this._gtz=null,this},e.GreaterThan}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(47),i(28)],void 0===(o=function(e){"use strict";return e.ScaledEnvelope=function(){var t=e.defaults(arguments,["attack","decay","sustain","release"],e.Envelope);e.Envelope.call(this,t),t=e.defaultArg(t,e.ScaledEnvelope.defaults),this._exp=this.output=new e.Pow(t.exponent),this._scale=this.output=new e.Scale(t.min,t.max),this._sig.chain(this._exp,this._scale)},e.extend(e.ScaledEnvelope,e.Envelope),e.ScaledEnvelope.defaults={min:0,max:1,exponent:1},Object.defineProperty(e.ScaledEnvelope.prototype,"min",{get:function(){return this._scale.min},set:function(t){this._scale.min=t}}),Object.defineProperty(e.ScaledEnvelope.prototype,"max",{get:function(){return this._scale.max},set:function(t){this._scale.max=t}}),Object.defineProperty(e.ScaledEnvelope.prototype,"exponent",{get:function(){return this._exp.value},set:function(t){this._exp.value=t}}),e.ScaledEnvelope.prototype.dispose=function(){return e.Envelope.prototype.dispose.call(this),this._scale.dispose(),this._scale=null,this._exp.dispose(),this._exp=null,this},e.ScaledEnvelope}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(7),i(36)],void 0===(o=function(t){"use strict";return t.Abs=function(){t.SignalBase.call(this),this._abs=this.input=this.output=new t.WaveShaper(function(t){return Math.abs(t)<.001?0:Math.abs(t)},1024)},t.extend(t.Abs,t.SignalBase),t.Abs.prototype.dispose=function(){return t.SignalBase.prototype.dispose.call(this),this._abs.dispose(),this._abs=null,this},t.Abs}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(7)],void 0===(o=function(e){"use strict";return e.EqualPowerGain=function(){e.SignalBase.call(this),this._eqPower=this.input=this.output=new e.WaveShaper(function(t){return Math.abs(t)<.001?0:e.equalPowerScale(t)}.bind(this),4096)},e.extend(e.EqualPowerGain,e.SignalBase),e.EqualPowerGain.prototype.dispose=function(){return e.SignalBase.prototype.dispose.call(this),this._eqPower.dispose(),this._eqPower=null,this},e.EqualPowerGain}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(5),i(1)],void 0===(o=function(t){"use strict";return t.Negate=function(){t.SignalBase.call(this),this._multiply=this.input=this.output=new t.Multiply(-1)},t.extend(t.Negate,t.SignalBase),t.Negate.prototype.dispose=function(){return t.SignalBase.prototype.dispose.call(this),this._multiply.dispose(),this._multiply=null,this},t.Negate}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(34)],void 0===(o=function(t){t.supported&&(AnalyserNode.prototype.getFloatTimeDomainData||(AnalyserNode.prototype.getFloatTimeDomainData=function(t){var e=new Uint8Array(t.length);this.getByteTimeDomainData(e);for(var i=0;i<e.length;i++)t[i]=(e[i]-128)/128}))}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(34),i(63),i(20),i(3)],void 0===(o=function(t){if(t.supported&&!t.global.AudioContext.prototype.createConstantSource){var e=function(t){for(var e=(this.context=t).createBuffer(1,128,t.sampleRate),i=e.getChannelData(0),n=0;n<i.length;n++)i[n]=1;this._bufferSource=t.createBufferSource(),this._bufferSource.channelCount=1,this._bufferSource.channelCountMode="explicit",this._bufferSource.buffer=e,this._bufferSource.loop=!0;var o=this._output=t.createGain();this.offset=o.gain,this._bufferSource.connect(o)};e.prototype.start=function(t){return this._bufferSource.start(t),this},e.prototype.stop=function(t){return this._bufferSource.stop(t),this},e.prototype.connect=function(){return this._output.connect.apply(this._output,arguments),this},e.prototype.disconnect=function(){return this._output.disconnect.apply(this._output,arguments),this},AudioContext.prototype.createConstantSource=function(){return new e(this)},t.Context.prototype.createConstantSource=function(){return new e(this)}}}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(34)],void 0===(o=function(t){if(t.supported&&!t.global.AudioContext.prototype._native_createWaveShaper){var e=navigator.userAgent.toLowerCase();if(e.includes("safari")&&!e.includes("chrome")){var i=function(t){for(var e in this._internalNode=this.input=this.output=t._native_createWaveShaper(),this._curve=null,this._internalNode)this._defineProperty(this._internalNode,e)};Object.defineProperty(i.prototype,"curve",{get:function(){return this._curve},set:function(t){this._curve=t;var e=new Float32Array(t.length+1);e.set(t,1),e[0]=t[0],this._internalNode.curve=e}}),i.prototype._defineProperty=function(e,i){t.isUndef(this[i])&&Object.defineProperty(this,i,{get:function(){return"function"==typeof e[i]?e[i].bind(e):e[i]},set:function(t){e[i]=t}})},t.global.AudioContext.prototype._native_createWaveShaper=t.global.AudioContext.prototype.createWaveShaper,t.global.AudioContext.prototype.createWaveShaper=function(){return new i(this)}}}}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(46)],void 0===(o=function(i){return i.Midi=function(t,e){if(!(this instanceof i.Midi))return new i.Midi(t,e);i.Frequency.call(this,t,e)},i.extend(i.Midi,i.Frequency),i.Midi.prototype._defaultUnits="midi",i.Midi.prototype._frequencyToUnits=function(t){return i.Frequency.ftom(i.Frequency.prototype._frequencyToUnits.call(this,t))},i.Midi.prototype._ticksToUnits=function(t){return i.Frequency.ftom(i.Frequency.prototype._ticksToUnits.call(this,t))},i.Midi.prototype._beatsToUnits=function(t){return i.Frequency.ftom(i.Frequency.prototype._beatsToUnits.call(this,t))},i.Midi.prototype._secondsToUnits=function(t){return i.Frequency.ftom(i.Frequency.prototype._secondsToUnits.call(this,t))},i.Midi.prototype.toMidi=function(){return this.valueOf()},i.Midi.prototype.toFrequency=function(){return i.Frequency.mtof(this.toMidi())},i.Midi.prototype.transpose=function(t){return new this.constructor(this.toMidi()+t)},i.Midi}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(27),i(2)],void 0===(o=function(o){"use strict";return o.UserMedia=function(){var t=o.defaults(arguments,["volume"],o.UserMedia);o.AudioNode.call(this),this._mediaStream=null,this._stream=null,this._device=null,this._volume=this.output=new o.Volume(t.volume),this.volume=this._volume.volume,this._readOnly("volume"),this.mute=t.mute},o.extend(o.UserMedia,o.AudioNode),o.UserMedia.defaults={volume:0,mute:!1},o.UserMedia.prototype.open=function(n){return o.UserMedia.enumerateDevices().then(function(t){var e;if(o.isNumber(n))e=t[n];else if(!(e=t.find(function(t){return t.label===n||t.deviceId===n}))&&0<t.length)e=t[0];else if(!e&&o.isDefined(n))throw new Error("Tone.UserMedia: no matching device: "+n);this._device=e;var i={audio:{echoCancellation:!1,sampleRate:this.context.sampleRate,noiseSuppression:!1,mozNoiseSuppression:!1}};return e&&(i.audio.deviceId=e.deviceId),navigator.mediaDevices.getUserMedia(i).then(function(t){return this._stream||(this._stream=t,this._mediaStream=this.context.createMediaStreamSource(t),this._mediaStream.connect(this.output)),this}.bind(this))}.bind(this))},o.UserMedia.prototype.close=function(){return this._stream&&(this._stream.getAudioTracks().forEach(function(t){t.stop()}),this._stream=null,this._mediaStream.disconnect(),this._mediaStream=null),this._device=null,this},o.UserMedia.enumerateDevices=function(){return navigator.mediaDevices.enumerateDevices().then(function(t){return t.filter(function(t){return"audioinput"===t.kind})})},Object.defineProperty(o.UserMedia.prototype,"state",{get:function(){return this._stream&&this._stream.active?o.State.Started:o.State.Stopped}}),Object.defineProperty(o.UserMedia.prototype,"deviceId",{get:function(){if(this._device)return this._device.deviceId}}),Object.defineProperty(o.UserMedia.prototype,"groupId",{get:function(){if(this._device)return this._device.groupId}}),Object.defineProperty(o.UserMedia.prototype,"label",{get:function(){if(this._device)return this._device.label}}),Object.defineProperty(o.UserMedia.prototype,"mute",{get:function(){return this._volume.mute},set:function(t){this._volume.mute=t}}),o.UserMedia.prototype.dispose=function(){return o.AudioNode.prototype.dispose.call(this),this.close(),this._writable("volume"),this._volume.dispose(),this._volume=null,this.volume=null,this},Object.defineProperty(o.UserMedia,"supported",{get:function(){return o.isDefined(navigator.mediaDevices)&&o.isFunction(navigator.mediaDevices.getUserMedia)}}),o.UserMedia}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(67),i(27),i(2)],void 0===(o=function(o){"use strict";return o.Players=function(t){var e=Array.prototype.slice.call(arguments);e.shift();var i=o.defaults(e,["onload"],o.Players);for(var n in o.AudioNode.call(this,i),this._volume=this.output=new o.Volume(i.volume),this.volume=this._volume.volume,this._readOnly("volume"),this._volume.output.output.channelCount=2,this._volume.output.output.channelCountMode="explicit",this.mute=i.mute,this._players={},this._loadingCount=0,this._fadeIn=i.fadeIn,this._fadeOut=i.fadeOut,t)this._loadingCount++,this.add(n,t[n],this._bufferLoaded.bind(this,i.onload))},o.extend(o.Players,o.AudioNode),o.Players.defaults={volume:0,mute:!1,onload:o.noOp,fadeIn:0,fadeOut:0},o.Players.prototype._bufferLoaded=function(t){this._loadingCount--,0===this._loadingCount&&t&&t(this)},Object.defineProperty(o.Players.prototype,"mute",{get:function(){return this._volume.mute},set:function(t){this._volume.mute=t}}),Object.defineProperty(o.Players.prototype,"fadeIn",{get:function(){return this._fadeIn},set:function(e){this._fadeIn=e,this._forEach(function(t){t.fadeIn=e})}}),Object.defineProperty(o.Players.prototype,"fadeOut",{get:function(){return this._fadeOut},set:function(e){this._fadeOut=e,this._forEach(function(t){t.fadeOut=e})}}),Object.defineProperty(o.Players.prototype,"state",{get:function(){var e=!1;return this._forEach(function(t){e=e||t.state===o.State.Started}),e?o.State.Started:o.State.Stopped}}),o.Players.prototype.has=function(t){return this._players.hasOwnProperty(t)},o.Players.prototype.get=function(t){if(this.has(t))return this._players[t];throw new Error("Tone.Players: no player named "+t)},o.Players.prototype._forEach=function(t){for(var e in this._players)t(this._players[e],e);return this},Object.defineProperty(o.Players.prototype,"loaded",{get:function(){var e=!0;return this._forEach(function(t){e=e&&t.loaded}),e}}),o.Players.prototype.add=function(t,e,i){return this._players[t]=new o.Player(e,i).connect(this.output),this._players[t].fadeIn=this._fadeIn,this._players[t].fadeOut=this._fadeOut,this},o.Players.prototype.stopAll=function(e){this._forEach(function(t){t.stop(e)})},o.Players.prototype.dispose=function(){return o.AudioNode.prototype.dispose.call(this),this._volume.dispose(),this._volume=null,this._writable("volume"),this.volume=null,this.output=null,this._forEach(function(t){t.dispose()}),this._players=null,this},o.Players}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(6),i(11),i(31)],void 0===(o=function(n){return n.GrainPlayer=function(){var t=n.defaults(arguments,["url","onload"],n.GrainPlayer);n.Source.call(this,t),this.buffer=new n.Buffer(t.url,t.onload),this._clock=new n.Clock(this._tick.bind(this),t.grainSize),this._loopStart=0,this._loopEnd=0,this._activeSources=[],this._playbackRate=t.playbackRate,this._grainSize=t.grainSize,this._overlap=t.overlap,this.detune=t.detune,this.overlap=t.overlap,this.loop=t.loop,this.playbackRate=t.playbackRate,this.grainSize=t.grainSize,this.loopStart=t.loopStart,this.loopEnd=t.loopEnd,this.reverse=t.reverse,this._clock.on("stop",this._onstop.bind(this))},n.extend(n.GrainPlayer,n.Source),n.GrainPlayer.defaults={onload:n.noOp,overlap:.1,grainSize:.2,playbackRate:1,detune:0,loop:!1,loopStart:0,loopEnd:0,reverse:!1},n.GrainPlayer.prototype._start=function(t,e,i){e=n.defaultArg(e,0),e=this.toSeconds(e),t=this.toSeconds(t),this._offset=e,this._clock.start(t),i&&this.stop(t+this.toSeconds(i))},n.GrainPlayer.prototype._stop=function(t){this._clock.stop(t)},n.GrainPlayer.prototype._onstop=function(e){this._activeSources.forEach(function(t){t.fadeOut=0,t.stop(e)})},n.GrainPlayer.prototype._tick=function(t){if(!this.loop&&this._offset>this.buffer.duration)this.stop(t);else{var e=this._offset<this._overlap?0:this._overlap,i=new n.BufferSource({buffer:this.buffer,fadeIn:e,fadeOut:this._overlap,loop:this.loop,loopStart:this._loopStart,loopEnd:this._loopEnd,playbackRate:n.intervalToFrequencyRatio(this.detune/100)}).connect(this.output);i.start(t,this._offset),this._offset+=this.grainSize,i.stop(t+this.grainSize/this.playbackRate),this._activeSources.push(i),i.onended=function(){var t=this._activeSources.indexOf(i);-1!==t&&this._activeSources.splice(t,1)}.bind(this)}},Object.defineProperty(n.GrainPlayer.prototype,"playbackRate",{get:function(){return this._playbackRate},set:function(t){this._playbackRate=t,this.grainSize=this._grainSize}}),Object.defineProperty(n.GrainPlayer.prototype,"loopStart",{get:function(){return this._loopStart},set:function(t){this._loopStart=this.toSeconds(t)}}),Object.defineProperty(n.GrainPlayer.prototype,"loopEnd",{get:function(){return this._loopEnd},set:function(t){this._loopEnd=this.toSeconds(t)}}),Object.defineProperty(n.GrainPlayer.prototype,"reverse",{get:function(){return this.buffer.reverse},set:function(t){this.buffer.reverse=t}}),Object.defineProperty(n.GrainPlayer.prototype,"grainSize",{get:function(){return this._grainSize},set:function(t){this._grainSize=this.toSeconds(t),this._clock.frequency.value=this._playbackRate/this._grainSize}}),Object.defineProperty(n.GrainPlayer.prototype,"overlap",{get:function(){return this._overlap},set:function(t){this._overlap=this.toSeconds(t)}}),n.GrainPlayer.prototype.dispose=function(){return n.Source.prototype.dispose.call(this),this.buffer.dispose(),this.buffer=null,this._clock.dispose(),this._clock=null,this._activeSources.forEach(function(t){t.dispose()}),this._activeSources=null,this},n.GrainPlayer}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(17),i(1),i(45)],void 0===(o=function(o){return o.TransportTimelineSignal=function(){o.Signal.apply(this,arguments),this.output=this._outputSig=new o.Signal(this._initialValue),this._lastVal=this.value,this._synced=o.Transport.scheduleRepeat(this._onTick.bind(this),"1i"),this._bindAnchorValue=this._anchorValue.bind(this),o.Transport.on("start stop pause",this._bindAnchorValue),this._events.memory=1/0},o.extend(o.TransportTimelineSignal,o.Signal),o.TransportTimelineSignal.prototype._onTick=function(t){var e=this.getValueAtTime(o.Transport.seconds);this._lastVal!==e&&(this._lastVal=e,this._outputSig.linearRampToValueAtTime(e,t))},o.TransportTimelineSignal.prototype._anchorValue=function(t){var e=this.getValueAtTime(o.Transport.seconds);return this._lastVal=e,this._outputSig.cancelScheduledValues(t),this._outputSig.setValueAtTime(e,t),this},o.TransportTimelineSignal.prototype.getValueAtTime=function(t){return t=o.TransportTime(t),o.Signal.prototype.getValueAtTime.call(this,t)},o.TransportTimelineSignal.prototype.setValueAtTime=function(t,e){return e=o.TransportTime(e),o.Signal.prototype.setValueAtTime.call(this,t,e),this},o.TransportTimelineSignal.prototype.linearRampToValueAtTime=function(t,e){return e=o.TransportTime(e),o.Signal.prototype.linearRampToValueAtTime.call(this,t,e),this},o.TransportTimelineSignal.prototype.exponentialRampToValueAtTime=function(t,e){return e=o.TransportTime(e),o.Signal.prototype.exponentialRampToValueAtTime.call(this,t,e),this},o.TransportTimelineSignal.prototype.setTargetAtTime=function(t,e,i){return e=o.TransportTime(e),o.Signal.prototype.setTargetAtTime.call(this,t,e,i),this},o.TransportTimelineSignal.prototype.cancelScheduledValues=function(t){return t=o.TransportTime(t),o.Signal.prototype.cancelScheduledValues.call(this,t),this},o.TransportTimelineSignal.prototype.setValueCurveAtTime=function(t,e,i,n){return e=o.TransportTime(e),i=o.TransportTime(i),o.Signal.prototype.setValueCurveAtTime.call(this,t,e,i,n),this},o.TransportTimelineSignal.prototype.cancelAndHoldAtTime=function(t){return o.Signal.prototype.cancelAndHoldAtTime.call(this,o.TransportTime(t))},o.TransportTimelineSignal.prototype.dispose=function(){o.Transport.clear(this._synced),o.Transport.off("start stop pause",this._syncedCallback),this._events.cancel(0),o.Signal.prototype.dispose.call(this),this._outputSig.dispose(),this._outputSig=null},o.TransportTimelineSignal}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(29),i(5)],void 0===(o=function(i){"use strict";return i.Normalize=function(t,e){i.SignalBase.call(this),this._inputMin=i.defaultArg(t,0),this._inputMax=i.defaultArg(e,1),this._sub=this.input=new i.Add(0),this._div=this.output=new i.Multiply(1),this._sub.connect(this._div),this._setRange()},i.extend(i.Normalize,i.SignalBase),Object.defineProperty(i.Normalize.prototype,"min",{get:function(){return this._inputMin},set:function(t){this._inputMin=t,this._setRange()}}),Object.defineProperty(i.Normalize.prototype,"max",{get:function(){return this._inputMax},set:function(t){this._inputMax=t,this._setRange()}}),i.Normalize.prototype._setRange=function(){this._sub.value=-this._inputMin,this._div.value=1/(this._inputMax-this._inputMin)},i.Normalize.prototype.dispose=function(){return i.SignalBase.prototype.dispose.call(this),this._sub.dispose(),this._sub=null,this._div.dispose(),this._div=null,this},i.Normalize}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(7),i(1)],void 0===(o=function(t){"use strict";return t.GainToAudio=function(){t.SignalBase.call(this),this._norm=this.input=this.output=new t.WaveShaper(function(t){return 2*Math.abs(t)-1})},t.extend(t.GainToAudio,t.SignalBase),t.GainToAudio.prototype.dispose=function(){return t.SignalBase.prototype.dispose.call(this),this._norm.dispose(),this._norm=null,this},t.GainToAudio}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0)],void 0===(o=function(t){t.supported&&(OscillatorNode.prototype.setPeriodicWave||(OscillatorNode.prototype.setPeriodicWave=OscillatorNode.prototype.setWaveTable),AudioContext.prototype.createPeriodicWave||(AudioContext.prototype.createPeriodicWave=AudioContext.prototype.createWaveTable))}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(21),i(79),i(31)],void 0===(o=function(u){return u.Sampler=function(t){var e=Array.prototype.slice.call(arguments);e.shift();var i=u.defaults(e,["onload","baseUrl"],u.Sampler);u.Instrument.call(this,i);var n={};for(var o in t)if(u.isNote(o))n[u.Frequency(o).toMidi()]=t[o];else{if(isNaN(parseFloat(o)))throw new Error("Tone.Sampler: url keys must be the note's pitch");n[o]=t[o]}this._buffers=new u.Buffers(n,i.onload,i.baseUrl),this._activeSources={},this.attack=i.attack,this.release=i.release,this.curve=i.curve},u.extend(u.Sampler,u.Instrument),u.Sampler.defaults={attack:0,release:.1,onload:u.noOp,baseUrl:"",curve:"exponential"},u.Sampler.prototype._findClosest=function(t){for(var e=0;e<96;){if(this._buffers.has(t+e))return-e;if(this._buffers.has(t-e))return e;e++}return null},u.Sampler.prototype.triggerAttack=function(t,e,i){this.log("triggerAttack",t,e,i),Array.isArray(t)||(t=[t]);for(var n=0;n<t.length;n++){var o=u.Frequency(t[n]).toMidi(),s=this._findClosest(o);if(null!==s){var r=o-s,a=this._buffers.get(r),l=u.intervalToFrequencyRatio(s),h=new u.BufferSource({buffer:a,playbackRate:l,fadeIn:this.attack,fadeOut:this.release,curve:this.curve}).connect(this.output);h.start(e,0,a.duration/l,i),u.isArray(this._activeSources[o])||(this._activeSources[o]=[]),this._activeSources[o].push(h),h.onended=function(){var t=this._activeSources[o].indexOf(h);-1!==t&&this._activeSources[o].splice(t,1)}.bind(this)}}return this},u.Sampler.prototype.triggerRelease=function(t,e){this.log("triggerRelease",t,e),Array.isArray(t)||(t=[t]);for(var i=0;i<t.length;i++){var n=u.Frequency(t[i]).toMidi();if(this._activeSources[n]&&this._activeSources[n].length){var o=this._activeSources[n].shift();e=this.toSeconds(e),o.stop(e)}}return this},u.Sampler.prototype.releaseAll=function(t){for(var e in t=this.toSeconds(t),this._activeSources)for(var i=this._activeSources[e];i.length;)i.shift().stop(t);return this},u.Sampler.prototype.sync=function(){return this._syncMethod("triggerAttack",1),this._syncMethod("triggerRelease",1),this},u.Sampler.prototype.triggerAttackRelease=function(t,e,i,n){if(i=this.toSeconds(i),this.triggerAttack(t,i,n),u.isArray(e)&&u.isArray(t))for(var o=0;o<t.length;o++){var s=e[Math.min(o,e.length-1)];this.triggerRelease(t[o],i+this.toSeconds(s))}else this.triggerRelease(t,i+this.toSeconds(e));return this},u.Sampler.prototype.add=function(t,e,i){if(u.isNote(t)){var n=u.Frequency(t).toMidi();this._buffers.add(n,e,i)}else{if(isNaN(parseFloat(t)))throw new Error("Tone.Sampler: note must be the note's pitch. Instead got "+t);this._buffers.add(t,e,i)}},Object.defineProperty(u.Sampler.prototype,"loaded",{get:function(){return this._buffers.loaded}}),u.Sampler.prototype.dispose=function(){for(var t in u.Instrument.prototype.dispose.call(this),this._buffers.dispose(),this._buffers=null,this._activeSources)this._activeSources[t].forEach(function(t){t.dispose()});return this._activeSources=null,this},u.Sampler}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(38),i(6)],void 0===(o=function(r){"use strict";return r.PolySynth=function(){var t=r.defaults(arguments,["polyphony","voice"],r.PolySynth);r.Instrument.call(this,t),(t=r.defaultArg(t,r.Instrument.defaults)).polyphony=Math.min(r.PolySynth.MAX_POLYPHONY,t.polyphony),this.voices=new Array(t.polyphony),this.assert(0<t.polyphony,"polyphony must be greater than 0"),this.detune=new r.Signal(t.detune,r.Type.Cents),this._readOnly("detune");for(var e=0;e<t.polyphony;e++){var i=new t.voice(arguments[2],arguments[3]);if(!(i instanceof r.Monophonic))throw new Error("Synth constructor must be instance of Tone.Monophonic");(this.voices[e]=i).index=e,i.connect(this.output),i.hasOwnProperty("detune")&&this.detune.connect(i.detune)}},r.extend(r.PolySynth,r.Instrument),r.PolySynth.defaults={polyphony:4,volume:0,detune:0,voice:r.Synth},r.PolySynth.prototype._getClosestVoice=function(e,i){var t=this.voices.find(function(t){if(Math.abs(t.frequency.getValueAtTime(e)-r.Frequency(i))<1e-4&&1e-5<t.getLevelAtTime(e))return t});if(t)return t;var n=this.voices.filter(function(t){return t.getLevelAtTime(e)>=t.getLevelAtTime(e+this.sampleTime)&&t.getLevelAtTime(e)<1e-5}.bind(this));if(n.length)return n[0];var o=this.voices[0];return this.voices.forEach(function(t){t.getLevelAtTime(e)<o.getLevelAtTime(e)&&(o=t)}),o},r.PolySynth.prototype.triggerAttack=function(t,i,n){return Array.isArray(t)||(t=[t]),i=this.toSeconds(i),t.forEach(function(t){var e=this._getClosestVoice(i,t);e.triggerAttack(t,i,n),this.log("triggerAttack",e.index,t)}.bind(this)),this},r.PolySynth.prototype.triggerRelease=function(t,i){return Array.isArray(t)||(t=[t]),i=this.toSeconds(i),t.forEach(function(t){var e=this._getClosestVoice(i,t);this.log("triggerRelease",e.index,t),e.triggerRelease(i)}.bind(this)),this},r.PolySynth.prototype.triggerAttackRelease=function(t,e,i,n){if(i=this.toSeconds(i),this.triggerAttack(t,i,n),r.isArray(e)&&r.isArray(t))for(var o=0;o<t.length;o++){var s=e[Math.min(o,e.length-1)];this.triggerRelease(t[o],i+this.toSeconds(s))}else this.triggerRelease(t,i+this.toSeconds(e));return this},r.PolySynth.prototype.sync=function(){return this._syncMethod("triggerAttack",1),this._syncMethod("triggerRelease",1),this},r.PolySynth.prototype.set=function(t,e,i){for(var n=0;n<this.voices.length;n++)this.voices[n].set(t,e,i);return this},r.PolySynth.prototype.get=function(t){return this.voices[0].get(t)},r.PolySynth.prototype.releaseAll=function(e){return e=this.toSeconds(e),this.voices.forEach(function(t){t.triggerRelease(e)}),this},r.PolySynth.prototype.dispose=function(){return r.Instrument.prototype.dispose.call(this),this.voices.forEach(function(t){t.dispose()}),this._writable("detune"),this.detune.dispose(),this.detune=null,this.voices=null,this},r.PolySynth.MAX_POLYPHONY=20,r.PolySynth}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(21),i(39),i(54)],void 0===(o=function(e){"use strict";return e.PluckSynth=function(t){t=e.defaultArg(t,e.PluckSynth.defaults),e.Instrument.call(this,t),this._noise=new e.Noise("pink"),this.attackNoise=t.attackNoise,this._lfcf=new e.LowpassCombFilter({resonance:t.resonance,dampening:t.dampening}),this.resonance=this._lfcf.resonance,this.dampening=this._lfcf.dampening,this._noise.connect(this._lfcf),this._lfcf.connect(this.output),this._readOnly(["resonance","dampening"])},e.extend(e.PluckSynth,e.Instrument),e.PluckSynth.defaults={attackNoise:1,dampening:4e3,resonance:.7},e.PluckSynth.prototype.triggerAttack=function(t,e){t=this.toFrequency(t),e=this.toSeconds(e);var i=1/t;return this._lfcf.delayTime.setValueAtTime(i,e),this._noise.start(e),this._noise.stop(e+i*this.attackNoise),this},e.PluckSynth.prototype.dispose=function(){return e.Instrument.prototype.dispose.call(this),this._noise.dispose(),this._lfcf.dispose(),this._noise=null,this._lfcf=null,this._writable(["resonance","dampening"]),this.dampening=null,this.resonance=null,this},e.PluckSynth}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(30),i(41),i(39),i(1),i(10),i(21)],void 0===(o=function(e){"use strict";return e.NoiseSynth=function(t){t=e.defaultArg(t,e.NoiseSynth.defaults),e.Instrument.call(this,t),this.noise=new e.Noise(t.noise),this.envelope=new e.AmplitudeEnvelope(t.envelope),this.noise.chain(this.envelope,this.output),this._readOnly(["noise","envelope"])},e.extend(e.NoiseSynth,e.Instrument),e.NoiseSynth.defaults={noise:{type:"white"},envelope:{attack:.005,decay:.1,sustain:0}},e.NoiseSynth.prototype.triggerAttack=function(t,e){return t=this.toSeconds(t),this.envelope.triggerAttack(t,e),this.noise.start(t),0===this.envelope.sustain&&this.noise.stop(t+this.envelope.attack+this.envelope.decay),this},e.NoiseSynth.prototype.triggerRelease=function(t){return this.envelope.triggerRelease(t),this.noise.stop(t+this.envelope.release),this},e.NoiseSynth.prototype.sync=function(){return this._syncMethod("triggerAttack",0),this._syncMethod("triggerRelease",0),this},e.NoiseSynth.prototype.triggerAttackRelease=function(t,e,i){return e=this.toSeconds(e),t=this.toSeconds(t),this.triggerAttack(e,i),this.triggerRelease(e+t),this},e.NoiseSynth.prototype.dispose=function(){return e.Instrument.prototype.dispose.call(this),this._writable(["noise","envelope"]),this.noise.dispose(),this.noise=null,this.envelope.dispose(),this.envelope=null,this},e.NoiseSynth}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(21),i(48),i(10),i(41),i(30),i(3),i(28),i(5)],void 0===(o=function(o){var s=[1,1.483,1.932,2.546,2.63,3.897];return o.MetalSynth=function(t){t=o.defaultArg(t,o.MetalSynth.defaults),o.Instrument.call(this,t),this.frequency=new o.Signal(t.frequency,o.Type.Frequency),this._oscillators=[],this._freqMultipliers=[],this._amplitue=new o.Gain(0).connect(this.output),this._highpass=new o.Filter({type:"highpass",Q:-3.0102999566398125}).connect(this._amplitue),this._octaves=t.octaves,this._filterFreqScaler=new o.Scale(t.resonance,7e3),this.envelope=new o.Envelope({attack:t.envelope.attack,attackCurve:"linear",decay:t.envelope.decay,sustain:0,release:t.envelope.release}).chain(this._filterFreqScaler,this._highpass.frequency),this.envelope.connect(this._amplitue.gain);for(var e=0;e<s.length;e++){var i=new o.FMOscillator({type:"square",modulationType:"square",harmonicity:t.harmonicity,modulationIndex:t.modulationIndex});i.connect(this._highpass),this._oscillators[e]=i;var n=new o.Multiply(s[e]);this._freqMultipliers[e]=n,this.frequency.chain(n,i.frequency)}this.octaves=t.octaves},o.extend(o.MetalSynth,o.Instrument),o.MetalSynth.defaults={frequency:200,envelope:{attack:.001,decay:1.4,release:.2},harmonicity:5.1,modulationIndex:32,resonance:4e3,octaves:1.5},o.MetalSynth.prototype.triggerAttack=function(e,t){return e=this.toSeconds(e),t=o.defaultArg(t,1),this.envelope.triggerAttack(e,t),this._oscillators.forEach(function(t){t.start(e)}),0===this.envelope.sustain&&this._oscillators.forEach(function(t){t.stop(e+this.envelope.attack+this.envelope.decay)}.bind(this)),this},o.MetalSynth.prototype.triggerRelease=function(e){return e=this.toSeconds(e),this.envelope.triggerRelease(e),this._oscillators.forEach(function(t){t.stop(e+this.envelope.release)}.bind(this)),this},o.MetalSynth.prototype.sync=function(){return this._syncMethod("triggerAttack",0),this._syncMethod("triggerRelease",0),this},o.MetalSynth.prototype.triggerAttackRelease=function(t,e,i){return e=this.toSeconds(e),t=this.toSeconds(t),this.triggerAttack(e,i),this.triggerRelease(e+t),this},Object.defineProperty(o.MetalSynth.prototype,"modulationIndex",{get:function(){return this._oscillators[0].modulationIndex.value},set:function(t){for(var e=0;e<this._oscillators.length;e++)this._oscillators[e].modulationIndex.value=t}}),Object.defineProperty(o.MetalSynth.prototype,"harmonicity",{get:function(){return this._oscillators[0].harmonicity.value},set:function(t){for(var e=0;e<this._oscillators.length;e++)this._oscillators[e].harmonicity.value=t}}),Object.defineProperty(o.MetalSynth.prototype,"resonance",{get:function(){return this._filterFreqScaler.min},set:function(t){this._filterFreqScaler.min=t,this.octaves=this._octaves}}),Object.defineProperty(o.MetalSynth.prototype,"octaves",{get:function(){return this._octaves},set:function(t){this._octaves=t,this._filterFreqScaler.max=this._filterFreqScaler.min*Math.pow(2,t)}}),o.MetalSynth.prototype.dispose=function(){o.Instrument.prototype.dispose.call(this);for(var t=0;t<this._oscillators.length;t++)this._oscillators[t].dispose(),this._freqMultipliers[t].dispose();this._oscillators=null,this._freqMultipliers=null,this.frequency.dispose(),this.frequency=null,this._filterFreqScaler.dispose(),this._filterFreqScaler=null,this._amplitue.dispose(),this._amplitue=null,this.envelope.dispose(),this.envelope=null,this._highpass.dispose(),this._highpass=null},o.MetalSynth}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(37),i(21),i(30)],void 0===(o=function(e){"use strict";return e.MembraneSynth=function(t){t=e.defaultArg(t,e.MembraneSynth.defaults),e.Instrument.call(this,t),this.oscillator=new e.OmniOscillator(t.oscillator),this.envelope=new e.AmplitudeEnvelope(t.envelope),this.octaves=t.octaves,this.pitchDecay=t.pitchDecay,this.oscillator.chain(this.envelope,this.output),this._readOnly(["oscillator","envelope"])},e.extend(e.MembraneSynth,e.Instrument),e.MembraneSynth.defaults={pitchDecay:.05,octaves:10,oscillator:{type:"sine"},envelope:{attack:.001,decay:.4,sustain:.01,release:1.4,attackCurve:"exponential"}},e.MembraneSynth.prototype.triggerAttack=function(t,e,i){e=this.toSeconds(e);var n=(t=this.toFrequency(t))*this.octaves;return this.oscillator.frequency.setValueAtTime(n,e),this.oscillator.frequency.exponentialRampToValueAtTime(t,e+this.toSeconds(this.pitchDecay)),this.envelope.triggerAttack(e,i),this.oscillator.start(e),0===this.envelope.sustain&&this.oscillator.stop(e+this.envelope.attack+this.envelope.decay),this},e.MembraneSynth.prototype.triggerRelease=function(t){return t=this.toSeconds(t),this.envelope.triggerRelease(t),this.oscillator.stop(t+this.envelope.release),this},e.MembraneSynth.prototype.dispose=function(){return e.Instrument.prototype.dispose.call(this),this._writable(["oscillator","envelope"]),this.oscillator.dispose(),this.oscillator=null,this.envelope.dispose(),this.envelope=null,this},e.MembraneSynth}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(38),i(1),i(5),i(25)],void 0===(o=function(e){"use strict";return e.FMSynth=function(t){t=e.defaultArg(t,e.FMSynth.defaults),e.Monophonic.call(this,t),this._carrier=new e.Synth(t.carrier),this._carrier.volume.value=-10,this.oscillator=this._carrier.oscillator,this.envelope=this._carrier.envelope.set(t.envelope),this._modulator=new e.Synth(t.modulator),this._modulator.volume.value=-10,this.modulation=this._modulator.oscillator.set(t.modulation),this.modulationEnvelope=this._modulator.envelope.set(t.modulationEnvelope),this.frequency=new e.Signal(440,e.Type.Frequency),this.detune=new e.Signal(t.detune,e.Type.Cents),this.harmonicity=new e.Multiply(t.harmonicity),this.harmonicity.units=e.Type.Positive,this.modulationIndex=new e.Multiply(t.modulationIndex),this.modulationIndex.units=e.Type.Positive,this._modulationNode=new e.Gain(0),this.frequency.connect(this._carrier.frequency),this.frequency.chain(this.harmonicity,this._modulator.frequency),this.frequency.chain(this.modulationIndex,this._modulationNode),this.detune.fan(this._carrier.detune,this._modulator.detune),this._modulator.connect(this._modulationNode.gain),this._modulationNode.connect(this._carrier.frequency),this._carrier.connect(this.output),this._readOnly(["frequency","harmonicity","modulationIndex","oscillator","envelope","modulation","modulationEnvelope","detune"])},e.extend(e.FMSynth,e.Monophonic),e.FMSynth.defaults={harmonicity:3,modulationIndex:10,detune:0,oscillator:{type:"sine"},envelope:{attack:.01,decay:.01,sustain:1,release:.5},modulation:{type:"square"},modulationEnvelope:{attack:.5,decay:0,sustain:1,release:.5}},e.FMSynth.prototype._triggerEnvelopeAttack=function(t,e){return t=this.toSeconds(t),this._carrier._triggerEnvelopeAttack(t,e),this._modulator._triggerEnvelopeAttack(t),this},e.FMSynth.prototype._triggerEnvelopeRelease=function(t){return t=this.toSeconds(t),this._carrier._triggerEnvelopeRelease(t),this._modulator._triggerEnvelopeRelease(t),this},e.FMSynth.prototype.dispose=function(){return e.Monophonic.prototype.dispose.call(this),this._writable(["frequency","harmonicity","modulationIndex","oscillator","envelope","modulation","modulationEnvelope","detune"]),this._carrier.dispose(),this._carrier=null,this._modulator.dispose(),this._modulator=null,this.frequency.dispose(),this.frequency=null,this.detune.dispose(),this.detune=null,this.modulationIndex.dispose(),this.modulationIndex=null,this.harmonicity.dispose(),this.harmonicity=null,this._modulationNode.dispose(),this._modulationNode=null,this.oscillator=null,this.envelope=null,this.modulationEnvelope=null,this.modulation=null,this},e.FMSynth}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(68),i(12),i(1),i(5),i(25),i(14)],void 0===(o=function(e){"use strict";return e.DuoSynth=function(t){t=e.defaultArg(t,e.DuoSynth.defaults),e.Monophonic.call(this,t),this.voice0=new e.MonoSynth(t.voice0),this.voice0.volume.value=-10,this.voice1=new e.MonoSynth(t.voice1),this.voice1.volume.value=-10,this._vibrato=new e.LFO(t.vibratoRate,-50,50),this._vibrato.start(),this.vibratoRate=this._vibrato.frequency,this._vibratoGain=new e.Gain(t.vibratoAmount,e.Type.Positive),this.vibratoAmount=this._vibratoGain.gain,this.frequency=new e.Signal(440,e.Type.Frequency),this.harmonicity=new e.Multiply(t.harmonicity),this.harmonicity.units=e.Type.Positive,this.frequency.connect(this.voice0.frequency),this.frequency.chain(this.harmonicity,this.voice1.frequency),this._vibrato.connect(this._vibratoGain),this._vibratoGain.fan(this.voice0.detune,this.voice1.detune),this.voice0.connect(this.output),this.voice1.connect(this.output),this._readOnly(["voice0","voice1","frequency","vibratoAmount","vibratoRate"])},e.extend(e.DuoSynth,e.Monophonic),e.DuoSynth.defaults={vibratoAmount:.5,vibratoRate:5,harmonicity:1.5,voice0:{volume:-10,portamento:0,oscillator:{type:"sine"},filterEnvelope:{attack:.01,decay:0,sustain:1,release:.5},envelope:{attack:.01,decay:0,sustain:1,release:.5}},voice1:{volume:-10,portamento:0,oscillator:{type:"sine"},filterEnvelope:{attack:.01,decay:0,sustain:1,release:.5},envelope:{attack:.01,decay:0,sustain:1,release:.5}}},e.DuoSynth.prototype._triggerEnvelopeAttack=function(t,e){return t=this.toSeconds(t),this.voice0._triggerEnvelopeAttack(t,e),this.voice1._triggerEnvelopeAttack(t,e),this},e.DuoSynth.prototype._triggerEnvelopeRelease=function(t){return this.voice0._triggerEnvelopeRelease(t),this.voice1._triggerEnvelopeRelease(t),this},e.DuoSynth.prototype.getLevelAtTime=function(t){return(this.voice0.getLevelAtTime(t)+this.voice1.getLevelAtTime(t))/2},e.DuoSynth.prototype.dispose=function(){return e.Monophonic.prototype.dispose.call(this),this._writable(["voice0","voice1","frequency","vibratoAmount","vibratoRate"]),this.voice0.dispose(),this.voice0=null,this.voice1.dispose(),this.voice1=null,this.frequency.dispose(),this.frequency=null,this._vibratoGain.dispose(),this._vibratoGain=null,this._vibrato=null,this.harmonicity.dispose(),this.harmonicity=null,this.vibratoAmount.dispose(),this.vibratoAmount=null,this.vibratoRate=null,this},e.DuoSynth}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(38),i(1),i(5),i(25),i(22),i(3)],void 0===(o=function(e){"use strict";return e.AMSynth=function(t){t=e.defaultArg(t,e.AMSynth.defaults),e.Monophonic.call(this,t),this._carrier=new e.Synth,this._carrier.volume.value=-10,this.oscillator=this._carrier.oscillator,this.envelope=this._carrier.envelope.set(t.envelope),this._modulator=new e.Synth,this._modulator.volume.value=-10,this.modulation=this._modulator.oscillator.set(t.modulation),this.modulationEnvelope=this._modulator.envelope.set(t.modulationEnvelope),this.frequency=new e.Signal(440,e.Type.Frequency),this.detune=new e.Signal(t.detune,e.Type.Cents),this.harmonicity=new e.Multiply(t.harmonicity),this.harmonicity.units=e.Type.Positive,this._modulationScale=new e.AudioToGain,this._modulationNode=new e.Gain,this.frequency.connect(this._carrier.frequency),this.frequency.chain(this.harmonicity,this._modulator.frequency),this.detune.fan(this._carrier.detune,this._modulator.detune),this._modulator.chain(this._modulationScale,this._modulationNode.gain),this._carrier.chain(this._modulationNode,this.output),this._readOnly(["frequency","harmonicity","oscillator","envelope","modulation","modulationEnvelope","detune"])},e.extend(e.AMSynth,e.Monophonic),e.AMSynth.defaults={harmonicity:3,detune:0,oscillator:{type:"sine"},envelope:{attack:.01,decay:.01,sustain:1,release:.5},modulation:{type:"square"},modulationEnvelope:{attack:.5,decay:0,sustain:1,release:.5}},e.AMSynth.prototype._triggerEnvelopeAttack=function(t,e){return t=this.toSeconds(t),this._carrier._triggerEnvelopeAttack(t,e),this._modulator._triggerEnvelopeAttack(t),this},e.AMSynth.prototype._triggerEnvelopeRelease=function(t){return this._carrier._triggerEnvelopeRelease(t),this._modulator._triggerEnvelopeRelease(t),this},e.AMSynth.prototype.dispose=function(){return e.Monophonic.prototype.dispose.call(this),this._writable(["frequency","harmonicity","oscillator","envelope","modulation","modulationEnvelope","detune"]),this._carrier.dispose(),this._carrier=null,this._modulator.dispose(),this._modulator=null,this.frequency.dispose(),this.frequency=null,this.detune.dispose(),this.detune=null,this.harmonicity.dispose(),this.harmonicity=null,this._modulationScale.dispose(),this._modulationScale=null,this._modulationNode.dispose(),this._modulationNode=null,this.oscillator=null,this.envelope=null,this.modulationEnvelope=null,this.modulation=null,this},e.AMSynth}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(72),i(17)],void 0===(o=function(n){"use strict";return n.Sequence=function(){var t=n.defaults(arguments,["callback","events","subdivision"],n.Sequence),e=t.events;if(delete t.events,n.Part.call(this,t),this._subdivision=this.toTicks(t.subdivision),n.isUndef(t.loopEnd)&&n.isDefined(e)&&(this._loopEnd=e.length*this._subdivision),this._loop=!0,n.isDefined(e))for(var i=0;i<e.length;i++)this.add(i,e[i])},n.extend(n.Sequence,n.Part),n.Sequence.defaults={subdivision:"4n"},Object.defineProperty(n.Sequence.prototype,"subdivision",{get:function(){return n.Ticks(this._subdivision).toSeconds()}}),n.Sequence.prototype.at=function(t,e){return n.isArray(e)&&this.remove(t),n.Part.prototype.at.call(this,this._indexTime(t),e)},n.Sequence.prototype.add=function(t,e){if(null===e)return this;if(n.isArray(e)){var i=Math.round(this._subdivision/e.length);e=new n.Sequence(this._tick.bind(this),e,n.Ticks(i))}return n.Part.prototype.add.call(this,this._indexTime(t),e),this},n.Sequence.prototype.remove=function(t,e){return n.Part.prototype.remove.call(this,this._indexTime(t),e),this},n.Sequence.prototype._indexTime=function(t){return t instanceof n.TransportTime?t:n.Ticks(t*this._subdivision+this.startOffset).toSeconds()},n.Sequence.prototype.dispose=function(){return n.Part.prototype.dispose.call(this),this},n.Sequence}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(73),i(80)],void 0===(o=function(e){return e.Pattern=function(){var t=e.defaults(arguments,["callback","values","pattern"],e.Pattern);e.Loop.call(this,t),this._pattern=new e.CtrlPattern({values:t.values,type:t.pattern,index:t.index})},e.extend(e.Pattern,e.Loop),e.Pattern.defaults={pattern:e.CtrlPattern.Type.Up,callback:e.noOp,values:[]},e.Pattern.prototype._tick=function(t){this.callback(t,this._pattern.value),this._pattern.next()},Object.defineProperty(e.Pattern.prototype,"index",{get:function(){return this._pattern.index},set:function(t){this._pattern.index=t}}),Object.defineProperty(e.Pattern.prototype,"values",{get:function(){return this._pattern.values},set:function(t){this._pattern.values=t}}),Object.defineProperty(e.Pattern.prototype,"value",{get:function(){return this._pattern.value}}),Object.defineProperty(e.Pattern.prototype,"pattern",{get:function(){return this._pattern.type},set:function(t){this._pattern.type=t}}),e.Pattern.prototype.dispose=function(){e.Loop.prototype.dispose.call(this),this._pattern.dispose(),this._pattern=null},e.Pattern}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(8),i(19),i(12)],void 0===(o=function(e){"use strict";return e.Vibrato=function(){var t=e.defaults(arguments,["frequency","depth"],e.Vibrato);e.Effect.call(this,t),this._delayNode=new e.Delay(0,t.maxDelay),this._lfo=new e.LFO({type:t.type,min:0,max:t.maxDelay,frequency:t.frequency,phase:-90}).start().connect(this._delayNode.delayTime),this.frequency=this._lfo.frequency,this.depth=this._lfo.amplitude,this.depth.value=t.depth,this._readOnly(["frequency","depth"]),this.effectSend.chain(this._delayNode,this.effectReturn)},e.extend(e.Vibrato,e.Effect),e.Vibrato.defaults={maxDelay:.005,frequency:5,depth:.1,type:"sine"},Object.defineProperty(e.Vibrato.prototype,"type",{get:function(){return this._lfo.type},set:function(t){this._lfo.type=t}}),e.Vibrato.prototype.dispose=function(){e.Effect.prototype.dispose.call(this),this._delayNode.dispose(),this._delayNode=null,this._lfo.dispose(),this._lfo=null,this._writable(["frequency","depth"]),this.frequency=null,this.depth=null},e.Vibrato}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(12),i(15)],void 0===(o=function(e){"use strict";return e.Tremolo=function(){var t=e.defaults(arguments,["frequency","depth"],e.Tremolo);e.StereoEffect.call(this,t),this._lfoL=new e.LFO({phase:t.spread,min:1,max:0}),this._lfoR=new e.LFO({phase:t.spread,min:1,max:0}),this._amplitudeL=new e.Gain,this._amplitudeR=new e.Gain,this.frequency=new e.Signal(t.frequency,e.Type.Frequency),this.depth=new e.Signal(t.depth,e.Type.NormalRange),this._readOnly(["frequency","depth"]),this.effectSendL.chain(this._amplitudeL,this.effectReturnL),this.effectSendR.chain(this._amplitudeR,this.effectReturnR),this._lfoL.connect(this._amplitudeL.gain),this._lfoR.connect(this._amplitudeR.gain),this.frequency.fan(this._lfoL.frequency,this._lfoR.frequency),this.depth.fan(this._lfoR.amplitude,this._lfoL.amplitude),this.type=t.type,this.spread=t.spread},e.extend(e.Tremolo,e.StereoEffect),e.Tremolo.defaults={frequency:10,type:"sine",depth:.5,spread:180},e.Tremolo.prototype.start=function(t){return this._lfoL.start(t),this._lfoR.start(t),this},e.Tremolo.prototype.stop=function(t){return this._lfoL.stop(t),this._lfoR.stop(t),this},e.Tremolo.prototype.sync=function(t){return this._lfoL.sync(t),this._lfoR.sync(t),e.Transport.syncSignal(this.frequency),this},e.Tremolo.prototype.unsync=function(){return this._lfoL.unsync(),this._lfoR.unsync(),e.Transport.unsyncSignal(this.frequency),this},Object.defineProperty(e.Tremolo.prototype,"type",{get:function(){return this._lfoL.type},set:function(t){this._lfoL.type=t,this._lfoR.type=t}}),Object.defineProperty(e.Tremolo.prototype,"spread",{get:function(){return this._lfoR.phase-this._lfoL.phase},set:function(t){this._lfoL.phase=90-t/2,this._lfoR.phase=t/2+90}}),e.Tremolo.prototype.dispose=function(){return e.StereoEffect.prototype.dispose.call(this),this._writable(["frequency","depth"]),this._lfoL.dispose(),this._lfoL=null,this._lfoR.dispose(),this._lfoR=null,this._amplitudeL.dispose(),this._amplitudeL=null,this._amplitudeR.dispose(),this._amplitudeR=null,this.frequency=null,this.depth=null,this},e.Tremolo}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(75),i(1),i(5),i(13)],void 0===(o=function(e){"use strict";return e.StereoWidener=function(){var t=e.defaults(arguments,["width"],e.StereoWidener);e.MidSideEffect.call(this,t),this.width=new e.Signal(t.width,e.Type.NormalRange),this._readOnly(["width"]),this._twoTimesWidthMid=new e.Multiply(2),this._twoTimesWidthSide=new e.Multiply(2),this._midMult=new e.Multiply,this._twoTimesWidthMid.connect(this._midMult,0,1),this.midSend.chain(this._midMult,this.midReturn),this._oneMinusWidth=new e.Subtract,this._oneMinusWidth.connect(this._twoTimesWidthMid),this.context.getConstant(1).connect(this._oneMinusWidth,0,0),this.width.connect(this._oneMinusWidth,0,1),this._sideMult=new e.Multiply,this.width.connect(this._twoTimesWidthSide),this._twoTimesWidthSide.connect(this._sideMult,0,1),this.sideSend.chain(this._sideMult,this.sideReturn)},e.extend(e.StereoWidener,e.MidSideEffect),e.StereoWidener.defaults={width:.5},e.StereoWidener.prototype.dispose=function(){return e.MidSideEffect.prototype.dispose.call(this),this._writable(["width"]),this.width.dispose(),this.width=null,this._midMult.dispose(),this._midMult=null,this._sideMult.dispose(),this._sideMult=null,this._twoTimesWidthMid.dispose(),this._twoTimesWidthMid=null,this._twoTimesWidthSide.dispose(),this._twoTimesWidthSide=null,this._oneMinusWidth.dispose(),this._oneMinusWidth=null,this},e.StereoWidener}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(15),i(32),i(3)],void 0===(o=function(e){"use strict";return e.StereoFeedbackEffect=function(){var t=e.defaults(arguments,["feedback"],e.FeedbackEffect);e.StereoEffect.call(this,t),this.feedback=new e.Signal(t.feedback,e.Type.NormalRange),this._feedbackL=new e.Gain,this._feedbackR=new e.Gain,this.effectReturnL.chain(this._feedbackL,this.effectSendL),this.effectReturnR.chain(this._feedbackR,this.effectSendR),this.feedback.fan(this._feedbackL.gain,this._feedbackR.gain),this._readOnly(["feedback"])},e.extend(e.StereoFeedbackEffect,e.StereoEffect),e.StereoFeedbackEffect.prototype.dispose=function(){return e.StereoEffect.prototype.dispose.call(this),this._writable(["feedback"]),this.feedback.dispose(),this.feedback=null,this._feedbackL.dispose(),this._feedbackL=null,this._feedbackR.dispose(),this._feedbackR=null,this},e.StereoFeedbackEffect}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(78),i(10),i(9),i(39),i(3),i(76)],void 0===(o=function(o){"use strict";return o.Reverb=function(){var t=o.defaults(arguments,["decay"],o.Reverb);o.Effect.call(this,t),this._convolver=this.context.createConvolver(),this.decay=t.decay,this.preDelay=t.preDelay,this.connectEffect(this._convolver)},o.extend(o.Reverb,o.Effect),o.Reverb.defaults={decay:1.5,preDelay:.01},o.Reverb.prototype.generate=function(){return o.Offline(function(){var t=new o.Noise,e=new o.Noise,i=new o.Merge;t.connect(i.left),e.connect(i.right);var n=(new o.Gain).toMaster();i.connect(n),t.start(0),e.start(0),n.gain.setValueAtTime(0,0),n.gain.linearRampToValueAtTime(1,this.preDelay),n.gain.exponentialApproachValueAtTime(0,this.preDelay,this.decay-this.preDelay)}.bind(this),this.decay).then(function(t){return this._convolver.buffer=t.get(),this}.bind(this))},o.Reverb.prototype.dispose=function(){return o.Effect.prototype.dispose.call(this),this._convolver.disconnect(),this._convolver=null,this},o.Reverb}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(12),i(23),i(1),i(32),i(19)],void 0===(o=function(i){"use strict";return i.PitchShift=function(){var t=i.defaults(arguments,["pitch"],i.PitchShift);i.FeedbackEffect.call(this,t),this._frequency=new i.Signal(0),this._delayA=new i.Delay(0,1),this._lfoA=new i.LFO({min:0,max:.1,type:"sawtooth"}).connect(this._delayA.delayTime),this._delayB=new i.Delay(0,1),this._lfoB=new i.LFO({min:0,max:.1,type:"sawtooth",phase:180}).connect(this._delayB.delayTime),this._crossFade=new i.CrossFade,this._crossFadeLFO=new i.LFO({min:0,max:1,type:"triangle",phase:90}).connect(this._crossFade.fade),this._feedbackDelay=new i.Delay(t.delayTime),this.delayTime=this._feedbackDelay.delayTime,this._readOnly("delayTime"),this._pitch=t.pitch,this._windowSize=t.windowSize,this._delayA.connect(this._crossFade.a),this._delayB.connect(this._crossFade.b),this._frequency.fan(this._lfoA.frequency,this._lfoB.frequency,this._crossFadeLFO.frequency),this.effectSend.fan(this._delayA,this._delayB),this._crossFade.chain(this._feedbackDelay,this.effectReturn);var e=this.now();this._lfoA.start(e),this._lfoB.start(e),this._crossFadeLFO.start(e),this.windowSize=this._windowSize},i.extend(i.PitchShift,i.FeedbackEffect),i.PitchShift.defaults={pitch:0,windowSize:.1,delayTime:0,feedback:0},Object.defineProperty(i.PitchShift.prototype,"pitch",{get:function(){return this._pitch},set:function(t){var e=0;(this._pitch=t)<0?(this._lfoA.min=0,this._lfoA.max=this._windowSize,this._lfoB.min=0,this._lfoB.max=this._windowSize,e=i.intervalToFrequencyRatio(t-1)+1):(this._lfoA.min=this._windowSize,this._lfoA.max=0,this._lfoB.min=this._windowSize,this._lfoB.max=0,e=i.intervalToFrequencyRatio(t)-1),this._frequency.value=e*(1.2/this._windowSize)}}),Object.defineProperty(i.PitchShift.prototype,"windowSize",{get:function(){return this._windowSize},set:function(t){this._windowSize=this.toSeconds(t),this.pitch=this._pitch}}),i.PitchShift.prototype.dispose=function(){return i.FeedbackEffect.prototype.dispose.call(this),this._frequency.dispose(),this._frequency=null,this._delayA.disconnect(),this._delayA=null,this._delayB.disconnect(),this._delayB=null,this._lfoA.dispose(),this._lfoA=null,this._lfoB.dispose(),this._lfoB=null,this._crossFade.dispose(),this._crossFade=null,this._crossFadeLFO.dispose(),this._crossFadeLFO=null,this._writable("delayTime"),this._feedbackDelay.dispose(),this._feedbackDelay=null,this.delayTime=null,this},i.PitchShift}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(74),i(1),i(19)],void 0===(o=function(e){"use strict";return e.PingPongDelay=function(){var t=e.defaults(arguments,["delayTime","feedback"],e.PingPongDelay);e.StereoXFeedbackEffect.call(this,t),this._leftDelay=new e.Delay(0,t.maxDelayTime),this._rightDelay=new e.Delay(0,t.maxDelayTime),this._rightPreDelay=new e.Delay(0,t.maxDelayTime),this.delayTime=new e.Signal(t.delayTime,e.Type.Time),this.effectSendL.chain(this._leftDelay,this.effectReturnL),this.effectSendR.chain(this._rightPreDelay,this._rightDelay,this.effectReturnR),this.delayTime.fan(this._leftDelay.delayTime,this._rightDelay.delayTime,this._rightPreDelay.delayTime),this._feedbackLR.disconnect(),this._feedbackLR.connect(this._rightDelay),this._readOnly(["delayTime"])},e.extend(e.PingPongDelay,e.StereoXFeedbackEffect),e.PingPongDelay.defaults={delayTime:.25,maxDelayTime:1},e.PingPongDelay.prototype.dispose=function(){return e.StereoXFeedbackEffect.prototype.dispose.call(this),this._leftDelay.dispose(),this._leftDelay=null,this._rightDelay.dispose(),this._rightDelay=null,this._rightPreDelay.dispose(),this._rightPreDelay=null,this._writable(["delayTime"]),this.delayTime.dispose(),this.delayTime=null,this},e.PingPongDelay}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(12),i(10),i(15)],void 0===(o=function(r){"use strict";return r.Phaser=function(){var t=r.defaults(arguments,["frequency","octaves","baseFrequency"],r.Phaser);r.StereoEffect.call(this,t),this._lfoL=new r.LFO(t.frequency,0,1),this._lfoR=new r.LFO(t.frequency,0,1),this._lfoR.phase=180,this._baseFrequency=t.baseFrequency,this._octaves=t.octaves,this.Q=new r.Signal(t.Q,r.Type.Positive),this._filtersL=this._makeFilters(t.stages,this._lfoL,this.Q),this._filtersR=this._makeFilters(t.stages,this._lfoR,this.Q),this.frequency=this._lfoL.frequency,this.frequency.value=t.frequency,this.effectSendL.connect(this._filtersL[0]),this.effectSendR.connect(this._filtersR[0]),this._filtersL[t.stages-1].connect(this.effectReturnL),this._filtersR[t.stages-1].connect(this.effectReturnR),this._lfoL.frequency.connect(this._lfoR.frequency),this.baseFrequency=t.baseFrequency,this.octaves=t.octaves,this._lfoL.start(),this._lfoR.start(),this._readOnly(["frequency","Q"])},r.extend(r.Phaser,r.StereoEffect),r.Phaser.defaults={frequency:.5,octaves:3,stages:10,Q:10,baseFrequency:350},r.Phaser.prototype._makeFilters=function(t,e,i){for(var n=new Array(t),o=0;o<t;o++){var s=this.context.createBiquadFilter();s.type="allpass",i.connect(s.Q),e.connect(s.frequency),n[o]=s}return r.connectSeries.apply(r,n),n},Object.defineProperty(r.Phaser.prototype,"octaves",{get:function(){return this._octaves},set:function(t){this._octaves=t;var e=this._baseFrequency*Math.pow(2,t);this._lfoL.max=e,this._lfoR.max=e}}),Object.defineProperty(r.Phaser.prototype,"baseFrequency",{get:function(){return this._baseFrequency},set:function(t){this._baseFrequency=t,this._lfoL.min=t,this._lfoR.min=t,this.octaves=this._octaves}}),r.Phaser.prototype.dispose=function(){r.StereoEffect.prototype.dispose.call(this),this._writable(["frequency","Q"]),this.Q.dispose(),this.Q=null,this._lfoL.dispose(),this._lfoL=null,this._lfoR.dispose(),this._lfoR=null;for(var t=0;t<this._filtersL.length;t++)this._filtersL[t].disconnect(),this._filtersL[t]=null;this._filtersL=null;for(var e=0;e<this._filtersR.length;e++)this._filtersR[e].disconnect(),this._filtersR[e]=null;return this._filtersR=null,this.frequency=null,this},r.Phaser}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(59),i(15),i(28)],void 0===(o=function(s){"use strict";var r=[.06748,.06404,.08212,.09004],a=[.773,.802,.753,.733],l=[347,113,37];return s.JCReverb=function(){var t=s.defaults(arguments,["roomSize"],s.JCReverb);s.StereoEffect.call(this,t),this.roomSize=new s.Signal(t.roomSize,s.Type.NormalRange),this._scaleRoomSize=new s.Scale(-.733,.197),this._allpassFilters=[],this._feedbackCombFilters=[];for(var e=0;e<l.length;e++){var i=this.context.createBiquadFilter();i.type="allpass",i.frequency.value=l[e],this._allpassFilters.push(i)}for(var n=0;n<r.length;n++){var o=new s.FeedbackCombFilter(r[n],.1);this._scaleRoomSize.connect(o.resonance),o.resonance.value=a[n],this._allpassFilters[this._allpassFilters.length-1].connect(o),n<r.length/2?o.connect(this.effectReturnL):o.connect(this.effectReturnR),this._feedbackCombFilters.push(o)}this.roomSize.connect(this._scaleRoomSize),s.connectSeries.apply(s,this._allpassFilters),this.effectSendL.connect(this._allpassFilters[0]),this.effectSendR.connect(this._allpassFilters[0]),this._readOnly(["roomSize"])},s.extend(s.JCReverb,s.StereoEffect),s.JCReverb.defaults={roomSize:.5},s.JCReverb.prototype.dispose=function(){s.StereoEffect.prototype.dispose.call(this);for(var t=0;t<this._allpassFilters.length;t++)this._allpassFilters[t].disconnect(),this._allpassFilters[t]=null;this._allpassFilters=null;for(var e=0;e<this._feedbackCombFilters.length;e++)this._feedbackCombFilters[e].dispose(),this._feedbackCombFilters[e]=null;return this._feedbackCombFilters=null,this._writable(["roomSize"]),this.roomSize.dispose(),this.roomSize=null,this._scaleRoomSize.dispose(),this._scaleRoomSize=null,this},s.JCReverb}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(54),i(15),i(1),i(16),i(9),i(42)],void 0===(o=function(a){"use strict";var l=[1557/44100,1617/44100,1491/44100,1422/44100,1277/44100,1356/44100,1188/44100,1116/44100],h=[225,556,441,341];return a.Freeverb=function(){var t=a.defaults(arguments,["roomSize","dampening"],a.Freeverb);a.StereoEffect.call(this,t),this.roomSize=new a.Signal(t.roomSize,a.Type.NormalRange),this.dampening=new a.Signal(t.dampening,a.Type.Frequency),this._combFilters=[],this._allpassFiltersL=[],this._allpassFiltersR=[];for(var e=0;e<h.length;e++){var i=this.context.createBiquadFilter();i.type="allpass",i.frequency.value=h[e],this._allpassFiltersL.push(i)}for(var n=0;n<h.length;n++){var o=this.context.createBiquadFilter();o.type="allpass",o.frequency.value=h[n],this._allpassFiltersR.push(o)}for(var s=0;s<l.length;s++){var r=new a.LowpassCombFilter(l[s]);s<l.length/2?this.effectSendL.chain(r,this._allpassFiltersL[0]):this.effectSendR.chain(r,this._allpassFiltersR[0]),this.roomSize.connect(r.resonance),this.dampening.connect(r.dampening),this._combFilters.push(r)}a.connectSeries.apply(a,this._allpassFiltersL),a.connectSeries.apply(a,this._allpassFiltersR),this._allpassFiltersL[this._allpassFiltersL.length-1].connect(this.effectReturnL),this._allpassFiltersR[this._allpassFiltersR.length-1].connect(this.effectReturnR),this._readOnly(["roomSize","dampening"])},a.extend(a.Freeverb,a.StereoEffect),a.Freeverb.defaults={roomSize:.7,dampening:3e3},a.Freeverb.prototype.dispose=function(){a.StereoEffect.prototype.dispose.call(this);for(var t=0;t<this._allpassFiltersL.length;t++)this._allpassFiltersL[t].disconnect(),this._allpassFiltersL[t]=null;this._allpassFiltersL=null;for(var e=0;e<this._allpassFiltersR.length;e++)this._allpassFiltersR[e].disconnect(),this._allpassFiltersR[e]=null;this._allpassFiltersR=null;for(var i=0;i<this._combFilters.length;i++)this._combFilters[i].dispose(),this._combFilters[i]=null;return this._combFilters=null,this._writable(["roomSize","dampening"]),this.roomSize.dispose(),this.roomSize=null,this.dampening.dispose(),this.dampening=null,this},a.Freeverb}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(32),i(1),i(19)],void 0===(o=function(e){"use strict";return e.FeedbackDelay=function(){var t=e.defaults(arguments,["delayTime","feedback"],e.FeedbackDelay);e.FeedbackEffect.call(this,t),this._delayNode=new e.Delay(t.delayTime,t.maxDelay),this.delayTime=this._delayNode.delayTime,this.connectEffect(this._delayNode),this._readOnly(["delayTime"])},e.extend(e.FeedbackDelay,e.FeedbackEffect),e.FeedbackDelay.defaults={delayTime:.25,maxDelay:1},e.FeedbackDelay.prototype.dispose=function(){return e.FeedbackEffect.prototype.dispose.call(this),this._delayNode.dispose(),this._delayNode=null,this._writable(["delayTime"]),this.delayTime=null,this},e.FeedbackDelay}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(8),i(7)],void 0===(o=function(e){"use strict";return e.Distortion=function(){var t=e.defaults(arguments,["distortion"],e.Distortion);e.Effect.call(this,t),this._shaper=new e.WaveShaper(4096),this._distortion=t.distortion,this.connectEffect(this._shaper),this.distortion=t.distortion,this.oversample=t.oversample},e.extend(e.Distortion,e.Effect),e.Distortion.defaults={distortion:.4,oversample:"none"},Object.defineProperty(e.Distortion.prototype,"distortion",{get:function(){return this._distortion},set:function(t){var e=100*(this._distortion=t),i=Math.PI/180;this._shaper.setMap(function(t){return Math.abs(t)<.001?0:(3+e)*t*20*i/(Math.PI+e*Math.abs(t))})}}),Object.defineProperty(e.Distortion.prototype,"oversample",{get:function(){return this._shaper.oversample},set:function(t){this._shaper.oversample=t}}),e.Distortion.prototype.dispose=function(){return e.Effect.prototype.dispose.call(this),this._shaper.dispose(),this._shaper=null,this},e.Distortion}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(12),i(15),i(19)],void 0===(o=function(e){"use strict";return e.Chorus=function(){var t=e.defaults(arguments,["frequency","delayTime","depth"],e.Chorus);e.StereoEffect.call(this,t),this._depth=t.depth,this._delayTime=t.delayTime/1e3,this._lfoL=new e.LFO({frequency:t.frequency,min:0,max:1}),this._lfoR=new e.LFO({frequency:t.frequency,min:0,max:1,phase:180}),this._delayNodeL=new e.Delay,this._delayNodeR=new e.Delay,this.frequency=this._lfoL.frequency,this.effectSendL.chain(this._delayNodeL,this.effectReturnL),this.effectSendR.chain(this._delayNodeR,this.effectReturnR),this.effectSendL.connect(this.effectReturnL),this.effectSendR.connect(this.effectReturnR),this._lfoL.connect(this._delayNodeL.delayTime),this._lfoR.connect(this._delayNodeR.delayTime),this._lfoL.start(),this._lfoR.start(),this._lfoL.frequency.connect(this._lfoR.frequency),this.depth=this._depth,this.frequency.value=t.frequency,this.type=t.type,this._readOnly(["frequency"]),this.spread=t.spread},e.extend(e.Chorus,e.StereoEffect),e.Chorus.defaults={frequency:1.5,delayTime:3.5,depth:.7,type:"sine",spread:180},Object.defineProperty(e.Chorus.prototype,"depth",{get:function(){return this._depth},set:function(t){this._depth=t;var e=this._delayTime*t;this._lfoL.min=Math.max(this._delayTime-e,0),this._lfoL.max=this._delayTime+e,this._lfoR.min=Math.max(this._delayTime-e,0),this._lfoR.max=this._delayTime+e}}),Object.defineProperty(e.Chorus.prototype,"delayTime",{get:function(){return 1e3*this._delayTime},set:function(t){this._delayTime=t/1e3,this.depth=this._depth}}),Object.defineProperty(e.Chorus.prototype,"type",{get:function(){return this._lfoL.type},set:function(t){this._lfoL.type=t,this._lfoR.type=t}}),Object.defineProperty(e.Chorus.prototype,"spread",{get:function(){return this._lfoR.phase-this._lfoL.phase},set:function(t){this._lfoL.phase=90-t/2,this._lfoR.phase=t/2+90}}),e.Chorus.prototype.dispose=function(){return e.StereoEffect.prototype.dispose.call(this),this._lfoL.dispose(),this._lfoL=null,this._lfoR.dispose(),this._lfoR=null,this._delayNodeL.dispose(),this._delayNodeL=null,this._delayNodeR.dispose(),this._delayNodeR=null,this._writable("frequency"),this.frequency=null,this},e.Chorus}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(8),i(7)],void 0===(o=function(e){"use strict";return e.Chebyshev=function(){var t=e.defaults(arguments,["order"],e.Chebyshev);e.Effect.call(this,t),this._shaper=new e.WaveShaper(4096),this._order=t.order,this.connectEffect(this._shaper),this.order=t.order,this.oversample=t.oversample},e.extend(e.Chebyshev,e.Effect),e.Chebyshev.defaults={order:1,oversample:"none"},e.Chebyshev.prototype._getCoefficient=function(t,e,i){return i.hasOwnProperty(e)||(i[e]=0===e?0:1===e?t:2*t*this._getCoefficient(t,e-1,i)-this._getCoefficient(t,e-2,i)),i[e]},Object.defineProperty(e.Chebyshev.prototype,"order",{get:function(){return this._order},set:function(t){this._order=t;for(var e=new Array(4096),i=e.length,n=0;n<i;++n){var o=2*n/i-1;e[n]=0===o?0:this._getCoefficient(o,t,{})}this._shaper.curve=e}}),Object.defineProperty(e.Chebyshev.prototype,"oversample",{get:function(){return this._shaper.oversample},set:function(t){this._shaper.oversample=t}}),e.Chebyshev.prototype.dispose=function(){return e.Effect.prototype.dispose.call(this),this._shaper.dispose(),this._shaper=null,this},e.Chebyshev}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(8),i(13),i(77)],void 0===(o=function(i){"use strict";return i.BitCrusher=function(){var t=i.defaults(arguments,["bits"],i.BitCrusher);i.Effect.call(this,t);var e=1/Math.pow(2,t.bits-1);this._subtract=new i.Subtract,this._modulo=new i.Modulo(e),this._bits=t.bits,this.effectSend.fan(this._subtract,this._modulo),this._modulo.connect(this._subtract,0,1),this._subtract.connect(this.effectReturn)},i.extend(i.BitCrusher,i.Effect),i.BitCrusher.defaults={bits:4},Object.defineProperty(i.BitCrusher.prototype,"bits",{get:function(){return this._bits},set:function(t){this._bits=t;var e=1/Math.pow(2,t-1);this._modulo.value=e}}),i.BitCrusher.prototype.dispose=function(){return i.Effect.prototype.dispose.call(this),this._subtract.dispose(),this._subtract=null,this._modulo.dispose(),this._modulo=null,this},i.BitCrusher}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(58),i(42),i(8),i(10)],void 0===(o=function(e){"use strict";return e.AutoWah=function(){var t=e.defaults(arguments,["baseFrequency","octaves","sensitivity"],e.AutoWah);e.Effect.call(this,t),this.follower=new e.Follower(t.follower),this._sweepRange=new e.ScaleExp(0,1,.5),this._baseFrequency=t.baseFrequency,this._octaves=t.octaves,this._inputBoost=new e.Gain,this._bandpass=new e.Filter({rolloff:-48,frequency:0,Q:t.Q}),this._peaking=new e.Filter(0,"peaking"),this._peaking.gain.value=t.gain,this.gain=this._peaking.gain,this.Q=this._bandpass.Q,this.effectSend.chain(this._inputBoost,this.follower,this._sweepRange),this._sweepRange.connect(this._bandpass.frequency),this._sweepRange.connect(this._peaking.frequency),this.effectSend.chain(this._bandpass,this._peaking,this.effectReturn),this._setSweepRange(),this.sensitivity=t.sensitivity,this._readOnly(["gain","Q"])},e.extend(e.AutoWah,e.Effect),e.AutoWah.defaults={baseFrequency:100,octaves:6,sensitivity:0,Q:2,gain:2,follower:{attack:.3,release:.5}},Object.defineProperty(e.AutoWah.prototype,"octaves",{get:function(){return this._octaves},set:function(t){this._octaves=t,this._setSweepRange()}}),Object.defineProperty(e.AutoWah.prototype,"baseFrequency",{get:function(){return this._baseFrequency},set:function(t){this._baseFrequency=t,this._setSweepRange()}}),Object.defineProperty(e.AutoWah.prototype,"sensitivity",{get:function(){return e.gainToDb(1/this._inputBoost.gain.value)},set:function(t){this._inputBoost.gain.value=1/e.dbToGain(t)}}),e.AutoWah.prototype._setSweepRange=function(){this._sweepRange.min=this._baseFrequency,this._sweepRange.max=Math.min(this._baseFrequency*Math.pow(2,this._octaves),this.context.sampleRate/2)},e.AutoWah.prototype.dispose=function(){return e.Effect.prototype.dispose.call(this),this.follower.dispose(),this.follower=null,this._sweepRange.dispose(),this._sweepRange=null,this._bandpass.dispose(),this._bandpass=null,this._peaking.dispose(),this._peaking=null,this._inputBoost.dispose(),this._inputBoost=null,this._writable(["gain","Q"]),this.gain=null,this.Q=null,this},e.AutoWah}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(8),i(12),i(51)],void 0===(o=function(e){"use strict";return e.AutoPanner=function(){var t=e.defaults(arguments,["frequency"],e.AutoPanner);e.Effect.call(this,t),this._lfo=new e.LFO({frequency:t.frequency,amplitude:t.depth,min:-1,max:1}),this.depth=this._lfo.amplitude,this._panner=new e.Panner,this.frequency=this._lfo.frequency,this.connectEffect(this._panner),this._lfo.connect(this._panner.pan),this.type=t.type,this._readOnly(["depth","frequency"])},e.extend(e.AutoPanner,e.Effect),e.AutoPanner.defaults={frequency:1,type:"sine",depth:1},e.AutoPanner.prototype.start=function(t){return this._lfo.start(t),this},e.AutoPanner.prototype.stop=function(t){return this._lfo.stop(t),this},e.AutoPanner.prototype.sync=function(t){return this._lfo.sync(t),this},e.AutoPanner.prototype.unsync=function(){return this._lfo.unsync(),this},Object.defineProperty(e.AutoPanner.prototype,"type",{get:function(){return this._lfo.type},set:function(t){this._lfo.type=t}}),e.AutoPanner.prototype.dispose=function(){return e.Effect.prototype.dispose.call(this),this._lfo.dispose(),this._lfo=null,this._panner.dispose(),this._panner=null,this._writable(["depth","frequency"]),this.frequency=null,this.depth=null,this},e.AutoPanner}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(8),i(12),i(10)],void 0===(o=function(e){"use strict";return e.AutoFilter=function(){var t=e.defaults(arguments,["frequency","baseFrequency","octaves"],e.AutoFilter);e.Effect.call(this,t),this._lfo=new e.LFO({frequency:t.frequency,amplitude:t.depth}),this.depth=this._lfo.amplitude,this.frequency=this._lfo.frequency,this.filter=new e.Filter(t.filter),this._octaves=0,this.connectEffect(this.filter),this._lfo.connect(this.filter.frequency),this.type=t.type,this._readOnly(["frequency","depth"]),this.octaves=t.octaves,this.baseFrequency=t.baseFrequency},e.extend(e.AutoFilter,e.Effect),e.AutoFilter.defaults={frequency:1,type:"sine",depth:1,baseFrequency:200,octaves:2.6,filter:{type:"lowpass",rolloff:-12,Q:1}},e.AutoFilter.prototype.start=function(t){return this._lfo.start(t),this},e.AutoFilter.prototype.stop=function(t){return this._lfo.stop(t),this},e.AutoFilter.prototype.sync=function(t){return this._lfo.sync(t),this},e.AutoFilter.prototype.unsync=function(){return this._lfo.unsync(),this},Object.defineProperty(e.AutoFilter.prototype,"type",{get:function(){return this._lfo.type},set:function(t){this._lfo.type=t}}),Object.defineProperty(e.AutoFilter.prototype,"baseFrequency",{get:function(){return this._lfo.min},set:function(t){this._lfo.min=this.toFrequency(t),this.octaves=this._octaves}}),Object.defineProperty(e.AutoFilter.prototype,"octaves",{get:function(){return this._octaves},set:function(t){this._octaves=t,this._lfo.max=this.baseFrequency*Math.pow(2,t)}}),e.AutoFilter.prototype.dispose=function(){return e.Effect.prototype.dispose.call(this),this._lfo.dispose(),this._lfo=null,this.filter.dispose(),this.filter=null,this._writable(["frequency","depth"]),this.frequency=null,this.depth=null,this},e.AutoFilter}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(23),i(9),i(16),i(1),i(22),i(26)],void 0===(o=function(e){"use strict";e.Listener=function(){e.call(this),this._orientation=[0,0,0,0,0,0],this._position=[0,0,0],e.getContext(function(){this.set(i.defaults),this.context.listener=this}.bind(this))},e.extend(e.Listener),e.Listener.defaults={positionX:0,positionY:0,positionZ:0,forwardX:0,forwardY:0,forwardZ:1,upX:0,upY:1,upZ:0},e.Listener.prototype.isListener=!0,e.Listener.prototype._rampTimeConstant=.01,e.Listener.prototype.setPosition=function(t,e,i){if(this.context.rawContext.listener.positionX){var n=this.now();this.context.rawContext.listener.positionX.setTargetAtTime(t,n,this._rampTimeConstant),this.context.rawContext.listener.positionY.setTargetAtTime(e,n,this._rampTimeConstant),this.context.rawContext.listener.positionZ.setTargetAtTime(i,n,this._rampTimeConstant)}else this.context.rawContext.listener.setPosition(t,e,i);return this._position=Array.prototype.slice.call(arguments),this},e.Listener.prototype.setOrientation=function(t,e,i,n,o,s){if(this.context.rawContext.listener.forwardX){var r=this.now();this.context.rawContext.listener.forwardX.setTargetAtTime(t,r,this._rampTimeConstant),this.context.rawContext.listener.forwardY.setTargetAtTime(e,r,this._rampTimeConstant),this.context.rawContext.listener.forwardZ.setTargetAtTime(i,r,this._rampTimeConstant),this.context.rawContext.listener.upX.setTargetAtTime(n,r,this._rampTimeConstant),this.context.rawContext.listener.upY.setTargetAtTime(o,r,this._rampTimeConstant),this.context.rawContext.listener.upZ.setTargetAtTime(s,r,this._rampTimeConstant)}else this.context.rawContext.listener.setOrientation(t,e,i,n,o,s);return this._orientation=Array.prototype.slice.call(arguments),this},Object.defineProperty(e.Listener.prototype,"positionX",{set:function(t){this._position[0]=t,this.setPosition.apply(this,this._position)},get:function(){return this._position[0]}}),Object.defineProperty(e.Listener.prototype,"positionY",{set:function(t){this._position[1]=t,this.setPosition.apply(this,this._position)},get:function(){return this._position[1]}}),Object.defineProperty(e.Listener.prototype,"positionZ",{set:function(t){this._position[2]=t,this.setPosition.apply(this,this._position)},get:function(){return this._position[2]}}),Object.defineProperty(e.Listener.prototype,"forwardX",{set:function(t){this._orientation[0]=t,this.setOrientation.apply(this,this._orientation)},get:function(){return this._orientation[0]}}),Object.defineProperty(e.Listener.prototype,"forwardY",{set:function(t){this._orientation[1]=t,this.setOrientation.apply(this,this._orientation)},get:function(){return this._orientation[1]}}),Object.defineProperty(e.Listener.prototype,"forwardZ",{set:function(t){this._orientation[2]=t,this.setOrientation.apply(this,this._orientation)},get:function(){return this._orientation[2]}}),Object.defineProperty(e.Listener.prototype,"upX",{set:function(t){this._orientation[3]=t,this.setOrientation.apply(this,this._orientation)},get:function(){return this._orientation[3]}}),Object.defineProperty(e.Listener.prototype,"upY",{set:function(t){this._orientation[4]=t,this.setOrientation.apply(this,this._orientation)},get:function(){return this._orientation[4]}}),Object.defineProperty(e.Listener.prototype,"upZ",{set:function(t){this._orientation[5]=t,this.setOrientation.apply(this,this._orientation)},get:function(){return this._orientation[5]}}),e.Listener.prototype.dispose=function(){return this._orientation=null,this._position=null,this};var i=e.Listener;return e.Listener=new i,e.Context.on("init",function(t){t.listener&&t.listener.isListener?e.Listener=t.listener:e.Listener=new i}),e.Listener}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(24)],void 0===(o=function(i){"use strict";return i.Draw=function(){i.call(this),this._events=new i.Timeline,this.expiration=.25,this.anticipation=.008,this._boundDrawLoop=this._drawLoop.bind(this)},i.extend(i.Draw),i.Draw.prototype.schedule=function(t,e){return this._events.add({callback:t,time:this.toSeconds(e)}),1===this._events.length&&requestAnimationFrame(this._boundDrawLoop),this},i.Draw.prototype.cancel=function(t){return this._events.cancel(this.toSeconds(t)),this},i.Draw.prototype._drawLoop=function(){for(var t=i.context.currentTime;this._events.length&&this._events.peek().time-this.anticipation<=t;){var e=this._events.shift();t-e.time<=this.expiration&&e.callback()}0<this._events.length&&requestAnimationFrame(this._boundDrawLoop)},i.Draw=new i.Draw,i.Draw}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(3)],void 0===(o=function(n){"use strict";var o={};return n.prototype.send=function(t,e){o.hasOwnProperty(t)||(o[t]=this.context.createGain()),e=n.defaultArg(e,0);var i=new n.Gain(e,n.Type.Decibels);return this.connect(i),i.connect(o[t]),i},n.prototype.receive=function(t,e){return o.hasOwnProperty(t)||(o[t]=this.context.createGain()),o[t].connect(this,0,e),this},n.Context.on("init",function(t){t.buses?o=t.buses:(o={},t.buses=o)}),n}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(4)],void 0===(o=function(e){"use strict";return e.CtrlRandom=function(){var t=e.defaults(arguments,["min","max"],e.CtrlRandom);e.call(this),this.min=t.min,this.max=t.max,this.integer=t.integer},e.extend(e.CtrlRandom),e.CtrlRandom.defaults={min:0,max:1,integer:!1},Object.defineProperty(e.CtrlRandom.prototype,"value",{get:function(){var t=this.toSeconds(this.min),e=this.toSeconds(this.max),i=Math.random(),n=i*t+(1-i)*e;return this.integer&&(n=Math.floor(n)),n}}),e.CtrlRandom}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0)],void 0===(o=function(a){"use strict";return a.CtrlMarkov=function(t,e){a.call(this),this.values=a.defaultArg(t,{}),this.value=a.defaultArg(e,Object.keys(this.values)[0])},a.extend(a.CtrlMarkov),a.CtrlMarkov.prototype.next=function(){if(this.values.hasOwnProperty(this.value)){var t=this.values[this.value];if(a.isArray(t))for(var e=this._getProbDistribution(t),i=Math.random(),n=0,o=0;o<e.length;o++){var s=e[o];if(n<i&&i<n+s){var r=t[o];a.isObject(r)?this.value=r.value:this.value=r}n+=s}else this.value=t}return this.value},a.CtrlMarkov.prototype._getProbDistribution=function(t){for(var e=[],i=0,n=!1,o=0;o<t.length;o++){var s=t[o];a.isObject(s)?(n=!0,e[o]=s.probability):e[o]=1/t.length,i+=e[o]}if(n)for(var r=0;r<e.length;r++)e[r]=e[r]/i;return e},a.CtrlMarkov.prototype.dispose=function(){this.values=null},a.CtrlMarkov}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(4)],void 0===(o=function(a){"use strict";return a.CtrlInterpolate=function(){var t=a.defaults(arguments,["values","index"],a.CtrlInterpolate);a.call(this),this.values=t.values,this.index=t.index},a.extend(a.CtrlInterpolate),a.CtrlInterpolate.defaults={index:0,values:[]},Object.defineProperty(a.CtrlInterpolate.prototype,"value",{get:function(){var t=this.index;t=Math.min(t,this.values.length-1);var e=Math.floor(t),i=this.values[e],n=this.values[Math.ceil(t)];return this._interpolate(t-e,i,n)}}),a.CtrlInterpolate.prototype._interpolate=function(t,e,i){if(a.isArray(e)){for(var n=[],o=0;o<e.length;o++)n[o]=this._interpolate(t,e[o],i[o]);return n}if(a.isObject(e)){var s={};for(var r in e)s[r]=this._interpolate(t,e[r],i[r]);return s}return(1-t)*(e=this._toNumber(e))+t*this._toNumber(i)},a.CtrlInterpolate.prototype._toNumber=function(t){return a.isNumber(t)?t:this.toSeconds(t)},a.CtrlInterpolate.prototype.dispose=function(){this.values=null},a.CtrlInterpolate}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(44),i(2)],void 0===(o=function(e){return e.Waveform=function(){var t=e.defaults(arguments,["size"],e.Waveform);t.type=e.Analyser.Type.Waveform,e.AudioNode.call(this),this._analyser=this.input=this.output=new e.Analyser(t)},e.extend(e.Waveform,e.AudioNode),e.Waveform.defaults={size:1024},e.Waveform.prototype.getValue=function(){return this._analyser.getValue()},Object.defineProperty(e.Waveform.prototype,"size",{get:function(){return this._analyser.size},set:function(t){this._analyser.size=t}}),e.Waveform.prototype.dispose=function(){e.AudioNode.prototype.dispose.call(this),this._analyser.dispose(),this._analyser=null},e.Waveform}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(3),i(2)],void 0===(o=function(e){return e.Solo=function(){var t=e.defaults(arguments,["solo"],e.Solo);e.AudioNode.call(this),this.input=this.output=new e.Gain,this._soloBind=this._soloed.bind(this),this.context.on("solo",this._soloBind),this.solo=t.solo},e.extend(e.Solo,e.AudioNode),e.Solo.defaults={solo:!1},Object.defineProperty(e.Solo.prototype,"solo",{get:function(){return this._isSoloed()},set:function(t){t?this._addSolo():this._removeSolo(),this.context.emit("solo",this)}}),Object.defineProperty(e.Solo.prototype,"muted",{get:function(){return 0===this.input.gain.value}}),e.Solo.prototype._addSolo=function(){e.isArray(this.context._currentSolo)||(this.context._currentSolo=[]),this._isSoloed()||this.context._currentSolo.push(this)},e.Solo.prototype._removeSolo=function(){if(this._isSoloed()){var t=this.context._currentSolo.indexOf(this);this.context._currentSolo.splice(t,1)}},e.Solo.prototype._isSoloed=function(){return!!e.isArray(this.context._currentSolo)&&0!==this.context._currentSolo.length&&-1!==this.context._currentSolo.indexOf(this)},e.Solo.prototype._noSolos=function(){return!e.isArray(this.context._currentSolo)||0===this.context._currentSolo.length},e.Solo.prototype._soloed=function(){this._isSoloed()?this.input.gain.value=1:this._noSolos()?this.input.gain.value=1:this.input.gain.value=0},e.Solo.prototype.dispose=function(){return this.context.off("solo",this._soloBind),this._removeSolo(),this._soloBind=null,e.AudioNode.prototype.dispose.call(this),this},e.Solo}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(51),i(27),i(2)],void 0===(o=function(e){"use strict";return e.PanVol=function(){var t=e.defaults(arguments,["pan","volume"],e.PanVol);e.AudioNode.call(this),this._panner=this.input=new e.Panner(t.pan),this.pan=this._panner.pan,this._volume=this.output=new e.Volume(t.volume),this.volume=this._volume.volume,this._panner.connect(this._volume),this.mute=t.mute,this._readOnly(["pan","volume"])},e.extend(e.PanVol,e.AudioNode),e.PanVol.defaults={pan:0,volume:0,mute:!1},Object.defineProperty(e.PanVol.prototype,"mute",{get:function(){return this._volume.mute},set:function(t){this._volume.mute=t}}),e.PanVol.prototype.dispose=function(){return e.AudioNode.prototype.dispose.call(this),this._writable(["pan","volume"]),this._panner.dispose(),this._panner=null,this.pan=null,this._volume.dispose(),this._volume=null,this.volume=null,this},e.PanVol}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(23),i(9),i(16),i(1),i(22),i(26),i(2)],void 0===(o=function(i){"use strict";return i.Panner3D=function(){var t=i.defaults(arguments,["positionX","positionY","positionZ"],i.Panner3D);i.AudioNode.call(this),this._panner=this.input=this.output=this.context.createPanner(),this._panner.panningModel=t.panningModel,this._panner.maxDistance=t.maxDistance,this._panner.distanceModel=t.distanceModel,this._panner.coneOuterGain=t.coneOuterGain,this._panner.coneOuterAngle=t.coneOuterAngle,this._panner.coneInnerAngle=t.coneInnerAngle,this._panner.refDistance=t.refDistance,this._panner.rolloffFactor=t.rolloffFactor,this._orientation=[t.orientationX,t.orientationY,t.orientationZ],this._position=[t.positionX,t.positionY,t.positionZ],this.orientationX=t.orientationX,this.orientationY=t.orientationY,this.orientationZ=t.orientationZ,this.positionX=t.positionX,this.positionY=t.positionY,this.positionZ=t.positionZ},i.extend(i.Panner3D,i.AudioNode),i.Panner3D.defaults={positionX:0,positionY:0,positionZ:0,orientationX:0,orientationY:0,orientationZ:0,panningModel:"equalpower",maxDistance:1e4,distanceModel:"inverse",coneOuterGain:0,coneOuterAngle:360,coneInnerAngle:360,refDistance:1,rolloffFactor:1},i.Panner3D.prototype._rampTimeConstant=.01,i.Panner3D.prototype.setPosition=function(t,e,i){if(this._panner.positionX){var n=this.now();this._panner.positionX.setTargetAtTime(t,n,this._rampTimeConstant),this._panner.positionY.setTargetAtTime(e,n,this._rampTimeConstant),this._panner.positionZ.setTargetAtTime(i,n,this._rampTimeConstant)}else this._panner.setPosition(t,e,i);return this._position=Array.prototype.slice.call(arguments),this},i.Panner3D.prototype.setOrientation=function(t,e,i){if(this._panner.orientationX){var n=this.now();this._panner.orientationX.setTargetAtTime(t,n,this._rampTimeConstant),this._panner.orientationY.setTargetAtTime(e,n,this._rampTimeConstant),this._panner.orientationZ.setTargetAtTime(i,n,this._rampTimeConstant)}else this._panner.setOrientation(t,e,i);return this._orientation=Array.prototype.slice.call(arguments),this},Object.defineProperty(i.Panner3D.prototype,"positionX",{set:function(t){this._position[0]=t,this.setPosition.apply(this,this._position)},get:function(){return this._position[0]}}),Object.defineProperty(i.Panner3D.prototype,"positionY",{set:function(t){this._position[1]=t,this.setPosition.apply(this,this._position)},get:function(){return this._position[1]}}),Object.defineProperty(i.Panner3D.prototype,"positionZ",{set:function(t){this._position[2]=t,this.setPosition.apply(this,this._position)},get:function(){return this._position[2]}}),Object.defineProperty(i.Panner3D.prototype,"orientationX",{set:function(t){this._orientation[0]=t,this.setOrientation.apply(this,this._orientation)},get:function(){return this._orientation[0]}}),Object.defineProperty(i.Panner3D.prototype,"orientationY",{set:function(t){this._orientation[1]=t,this.setOrientation.apply(this,this._orientation)},get:function(){return this._orientation[1]}}),Object.defineProperty(i.Panner3D.prototype,"orientationZ",{set:function(t){this._orientation[2]=t,this.setOrientation.apply(this,this._orientation)},get:function(){return this._orientation[2]}}),i.Panner3D._aliasProperty=function(e){Object.defineProperty(i.Panner3D.prototype,e,{set:function(t){this._panner[e]=t},get:function(){return this._panner[e]}})},i.Panner3D._aliasProperty("panningModel"),i.Panner3D._aliasProperty("refDistance"),i.Panner3D._aliasProperty("rolloffFactor"),i.Panner3D._aliasProperty("distanceModel"),i.Panner3D._aliasProperty("coneInnerAngle"),i.Panner3D._aliasProperty("coneOuterAngle"),i.Panner3D._aliasProperty("coneOuterGain"),i.Panner3D._aliasProperty("maxDistance"),i.Panner3D.prototype.dispose=function(){return i.AudioNode.prototype.dispose.call(this),this._panner.disconnect(),this._panner=null,this._orientation=null,this._position=null,this},i.Panner3D}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(60),i(43),i(2)],void 0===(o=function(e){"use strict";return e.MultibandCompressor=function(t){e.AudioNode.call(this),t=e.defaultArg(arguments,e.MultibandCompressor.defaults),this._splitter=this.input=new e.MultibandSplit({lowFrequency:t.lowFrequency,highFrequency:t.highFrequency}),this.lowFrequency=this._splitter.lowFrequency,this.highFrequency=this._splitter.highFrequency,this.output=new e.Gain,this.low=new e.Compressor(t.low),this.mid=new e.Compressor(t.mid),this.high=new e.Compressor(t.high),this._splitter.low.chain(this.low,this.output),this._splitter.mid.chain(this.mid,this.output),this._splitter.high.chain(this.high,this.output),this._readOnly(["high","mid","low","highFrequency","lowFrequency"])},e.extend(e.MultibandCompressor,e.AudioNode),e.MultibandCompressor.defaults={low:e.Compressor.defaults,mid:e.Compressor.defaults,high:e.Compressor.defaults,lowFrequency:250,highFrequency:2e3},e.MultibandCompressor.prototype.dispose=function(){return e.AudioNode.prototype.dispose.call(this),this._splitter.dispose(),this._writable(["high","mid","low","highFrequency","lowFrequency"]),this.low.dispose(),this.mid.dispose(),this.high.dispose(),this._splitter=null,this.low=null,this.mid=null,this.high=null,this.lowFrequency=null,this.highFrequency=null,this},e.MultibandCompressor}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(9),i(2)],void 0===(o=function(t){"use strict";return t.Mono=function(){t.AudioNode.call(this),this.createInsOuts(1,0),this._merge=this.output=new t.Merge,this.input.connect(this._merge,0,0),this.input.connect(this._merge,0,1)},t.extend(t.Mono,t.AudioNode),t.Mono.prototype.dispose=function(){return t.AudioNode.prototype.dispose.call(this),this._merge.dispose(),this._merge=null,this},t.Mono}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(53),i(52),i(43),i(2)],void 0===(o=function(e){"use strict";return e.MidSideCompressor=function(t){e.AudioNode.call(this),t=e.defaultArg(t,e.MidSideCompressor.defaults),this._midSideSplit=this.input=new e.MidSideSplit,this._midSideMerge=this.output=new e.MidSideMerge,this.mid=new e.Compressor(t.mid),this.side=new e.Compressor(t.side),this._midSideSplit.mid.chain(this.mid,this._midSideMerge.mid),this._midSideSplit.side.chain(this.side,this._midSideMerge.side),this._readOnly(["mid","side"])},e.extend(e.MidSideCompressor,e.AudioNode),e.MidSideCompressor.defaults={mid:{ratio:3,threshold:-24,release:.03,attack:.02,knee:16},side:{ratio:6,threshold:-30,release:.25,attack:.03,knee:10}},e.MidSideCompressor.prototype.dispose=function(){return e.AudioNode.prototype.dispose.call(this),this._writable(["mid","side"]),this.mid.dispose(),this.mid=null,this.side.dispose(),this.side=null,this._midSideSplit.dispose(),this._midSideSplit=null,this._midSideMerge.dispose(),this._midSideMerge=null,this},e.MidSideCompressor}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(44),i(2)],void 0===(o=function(s){"use strict";return s.Meter=function(){var t=s.defaults(arguments,["smoothing"],s.Meter);s.AudioNode.call(this),this.smoothing=t.smoothing,this._rms=0,this.input=this.output=this._analyser=new s.Analyser("waveform",1024)},s.extend(s.Meter,s.AudioNode),s.Meter.defaults={smoothing:.8},s.Meter.prototype.getLevel=function(){for(var t=this._analyser.getValue(),e=0,i=0;i<t.length;i++){var n=t[i];e+=n*n}var o=Math.sqrt(e/t.length);return this._rms=Math.max(o,this._rms*this.smoothing),s.gainToDb(this._rms)},s.Meter.prototype.getValue=function(){return this._analyser.getValue()[0]},s.Meter.prototype.dispose=function(){return s.AudioNode.prototype.dispose.call(this),this._analyser.dispose(),this._analyser=null,this},s.Meter}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(43),i(2)],void 0===(o=function(e){"use strict";return e.Limiter=function(){var t=e.defaults(arguments,["threshold"],e.Limiter);e.AudioNode.call(this),this._compressor=this.input=this.output=new e.Compressor({attack:.001,decay:.001,threshold:t.threshold}),this.threshold=this._compressor.threshold,this._readOnly("threshold")},e.extend(e.Limiter,e.AudioNode),e.Limiter.defaults={threshold:-12},e.Limiter.prototype.dispose=function(){return e.AudioNode.prototype.dispose.call(this),this._compressor.dispose(),this._compressor=null,this._writable("threshold"),this.threshold=null,this},e.Limiter}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(58),i(89),i(2)],void 0===(o=function(e){"use strict";return e.Gate=function(){var t=e.defaults(arguments,["threshold","smoothing"],e.Gate);e.AudioNode.call(this),this.createInsOuts(1,1),this._follower=new e.Follower(t.smoothing),this._gt=new e.GreaterThan(e.dbToGain(t.threshold)),this.input.connect(this.output),this.input.chain(this._follower,this._gt,this.output.gain)},e.extend(e.Gate,e.AudioNode),e.Gate.defaults={smoothing:.1,threshold:-40},Object.defineProperty(e.Gate.prototype,"threshold",{get:function(){return e.gainToDb(this._gt.value)},set:function(t){this._gt.value=e.dbToGain(t)}}),Object.defineProperty(e.Gate.prototype,"smoothing",{get:function(){return this._follower.smoothing},set:function(t){this._follower.smoothing=t}}),e.Gate.prototype.dispose=function(){return e.AudioNode.prototype.dispose.call(this),this._follower.dispose(),this._gt.dispose(),this._follower=null,this._gt=null,this},e.Gate}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(44),i(2)],void 0===(o=function(e){return e.FFT=function(){var t=e.defaults(arguments,["size"],e.FFT);t.type=e.Analyser.Type.FFT,e.AudioNode.call(this),this._analyser=this.input=this.output=new e.Analyser(t)},e.extend(e.FFT,e.AudioNode),e.FFT.defaults={size:1024},e.FFT.prototype.getValue=function(){return this._analyser.getValue()},Object.defineProperty(e.FFT.prototype,"size",{get:function(){return this._analyser.size},set:function(t){this._analyser.size=t}}),e.FFT.prototype.dispose=function(){e.AudioNode.prototype.dispose.call(this),this._analyser.dispose(),this._analyser=null},e.FFT}.apply(e,n))||(t.exports=o)},function(t,e,i){var n,o;n=[i(0),i(60),i(3),i(2)],void 0===(o=function(e){"use strict";return e.EQ3=function(){var t=e.defaults(arguments,["low","mid","high"],e.EQ3);e.AudioNode.call(this),this.output=new e.Gain,this._multibandSplit=this.input=new e.MultibandSplit({lowFrequency:t.lowFrequency,highFrequency:t.highFrequency}),this._lowGain=new e.Gain(t.low,e.Type.Decibels),this._midGain=new e.Gain(t.mid,e.Type.Decibels),this._highGain=new e.Gain(t.high,e.Type.Decibels),this.low=this._lowGain.gain,this.mid=this._midGain.gain,this.high=this._highGain.gain,this.Q=this._multibandSplit.Q,this.lowFrequency=this._multibandSplit.lowFrequency,this.highFrequency=this._multibandSplit.highFrequency,this._multibandSplit.low.chain(this._lowGain,this.output),this._multibandSplit.mid.chain(this._midGain,this.output),this._multibandSplit.high.chain(this._highGain,this.output),this._readOnly(["low","mid","high","lowFrequency","highFrequency"])},e.extend(e.EQ3,e.AudioNode),e.EQ3.defaults={low:0,mid:0,high:0,lowFrequency:400,highFrequency:2500},e.EQ3.prototype.dispose=function(){return e.AudioNode.prototype.dispose.call(this),this._writable(["low","mid","high","lowFrequency","highFrequency"]),this._multibandSplit.dispose(),this._multibandSplit=null,this.lowFrequency=null,this.highFrequency=null,this._lowGain.dispose(),this._lowGain=null,this._midGain.dispose(),this._midGain=null,this._highGain.dispose(),this._highGain=null,this.low=null,this.mid=null,this.high=null,this.Q=null,this},e.EQ3}.apply(e,n))||(t.exports=o)},function(t,e){t.exports="13.3.11"},function(UV,VV){var WV;WV=function(){return this}();try{WV=WV||Function("return this")()||eval("this")}catch(UV){"object"==typeof window&&(WV=window)}UV.exports=WV},function(t,e,i){i(30),i(44),i(43),i(23),i(47),i(151),i(59),i(150),i(10),i(58),i(41),i(149),i(12),i(148),i(54),i(9),i(147),i(146),i(52),i(53),i(145),i(144),i(60),i(51),i(143),i(142),i(90),i(141),i(16),i(27),i(140),i(139),i(138),i(80),i(137),i(2),i(11),i(79),i(136),i(87),i(20),i(19),i(135),i(35),i(3),i(85),i(134),i(40),i(78),i(62),i(14),i(24),i(33),i(17),i(56),i(84),i(133),i(132),i(131),i(130),i(129),i(128),i(76),i(127),i(8),i(126),i(32),i(125),i(124),i(75),i(123),i(122),i(121),i(120),i(15),i(119),i(118),i(74),i(117),i(116),i(50),i(73),i(72),i(115),i(114),i(113),i(112),i(111),i(21),i(110),i(109),i(25),i(68),i(108),i(107),i(106),i(105),i(38),i(94),i(82),i(34),i(63),i(95),i(66),i(104),i(81),i(96),i(91),i(29),i(22),i(92),i(103),i(89),i(88),i(77),i(5),i(93),i(102),i(61),i(28),i(42),i(1),i(36),i(13),i(86),i(101),i(7),i(26),i(70),i(31),i(69),i(48),i(100),i(39),i(37),i(18),i(83),i(67),i(99),i(49),i(71),i(6),i(57),i(98),i(46),i(97),i(55),i(65),i(64),i(45),i(4),t.exports=i(0)}])});