UNPKG

smartdown

Version:

A library for translating, rendering and interacting with Smartdown documents. Smartdown is an extension of Markdown that provides richer media support and reactive programming capability.

10 lines (8 loc) 200 kB
(self["webpackChunksmartdown"] = self["webpackChunksmartdown"] || []).push([["p5Sound"],{ /***/ "../node_modules/p5/lib/addons/p5.sound.min.js": /*!*****************************************************!*\ !*** ../node_modules/p5/lib/addons/p5.sound.min.js ***! \*****************************************************/ /***/ (() => { /** [p5.sound] Version: 1.0.1 - 2021-05-25 */ !function(n){var i={};function r(t){if(i[t])return i[t].exports;var e=i[t]={i:t,l:!1,exports:{}};return n[t].call(e.exports,e,e.exports,r),e.l=!0,e.exports}r.m=n,r.c=i,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=40)}([function(t,e,n){var i;void 0===(i=function(){"use strict";function l(t,e){this.isUndef(t)||1===t?this.input=this.context.createGain():1<t&&(this.input=new Array(t)),this.isUndef(e)||1===e?this.output=this.context.createGain():1<e&&(this.output=new Array(t))}var e;return l.prototype.set=function(t,e,n){if(this.isObject(t))n=e;else if(this.isString(t)){var i={};i[t]=e,t=i}t:for(var r in t){e=t[r];var o=this;if(-1!==r.indexOf(".")){for(var s=r.split("."),a=0;a<s.length-1;a++)if((o=o[s[a]])instanceof l){s.splice(0,a+1);var u=s.join(".");o.set(u,e);continue t}r=s[s.length-1]}var c=o[r];this.isUndef(c)||(l.Signal&&c instanceof l.Signal||l.Param&&c instanceof l.Param?c.value!==e&&(this.isUndef(n)?c.value=e:c.rampTo(e,n)):c instanceof AudioParam?c.value!==e&&(c.value=e):c instanceof l?c.set(e):c!==e&&(o[r]=e))}return this},l.prototype.get=function(t){this.isUndef(t)?t=this._collectDefaults(this.constructor):this.isString(t)&&(t=[t]);for(var e={},n=0;n<t.length;n++){var i=t[n],r=this,o=e;if(-1!==i.indexOf(".")){for(var s=i.split("."),a=0;a<s.length-1;a++){var u=s[a];o[u]=o[u]||{},o=o[u],r=r[u]}i=s[s.length-1]}var c=r[i];this.isObject(t[i])?o[i]=c.get():l.Signal&&c instanceof l.Signal?o[i]=c.value:l.Param&&c instanceof l.Param?o[i]=c.value:c instanceof AudioParam?o[i]=c.value:c instanceof l?o[i]=c.get():this.isFunction(c)||this.isUndef(c)||(o[i]=c)}return e},l.prototype._collectDefaults=function(t){var e=[];if(this.isUndef(t.defaults)||(e=Object.keys(t.defaults)),!this.isUndef(t._super))for(var n=this._collectDefaults(t._super),i=0;i<n.length;i++)-1===e.indexOf(n[i])&&e.push(n[i]);return e},l.prototype.toString=function(){for(var t in l){var e=t[0].match(/^[A-Z]$/),n=l[t]===this.constructor;if(this.isFunction(l[t])&&e&&n)return t}return"Tone"},Object.defineProperty(l.prototype,"numberOfInputs",{get:function(){return this.input?this.isArray(this.input)?this.input.length:1:0}}),Object.defineProperty(l.prototype,"numberOfOutputs",{get:function(){return this.output?this.isArray(this.output)?this.output.length:1:0}}),l.prototype.dispose=function(){return this.isUndef(this.input)||(this.input instanceof AudioNode&&this.input.disconnect(),this.input=null),this.isUndef(this.output)||(this.output instanceof AudioNode&&this.output.disconnect(),this.output=null),this},l.prototype.connect=function(t,e,n){return Array.isArray(this.output)?(e=this.defaultArg(e,0),this.output[e].connect(t,0,n)):this.output.connect(t,e,n),this},l.prototype.disconnect=function(t,e,n){this.isArray(this.output)?this.isNumber(t)?this.output[t].disconnect():(e=this.defaultArg(e,0),this.output[e].disconnect(t,0,n)):this.output.disconnect.apply(this.output,arguments)},l.prototype.connectSeries=function(){if(1<arguments.length)for(var t=arguments[0],e=1;e<arguments.length;e++){var n=arguments[e];t.connect(n),t=n}return this},l.prototype.chain=function(){if(0<arguments.length)for(var t=this,e=0;e<arguments.length;e++){var n=arguments[e];t.connect(n),t=n}return this},l.prototype.fan=function(){if(0<arguments.length)for(var t=0;t<arguments.length;t++)this.connect(arguments[t]);return this},AudioNode.prototype.chain=l.prototype.chain,AudioNode.prototype.fan=l.prototype.fan,l.prototype.defaultArg=function(t,e){if(this.isObject(t)&&this.isObject(e)){var n={};for(var i in t)n[i]=this.defaultArg(e[i],t[i]);for(var r in e)n[r]=this.defaultArg(t[r],e[r]);return n}return this.isUndef(t)?e:t},l.prototype.optionsObject=function(t,e,n){var i={};if(1===t.length&&this.isObject(t[0]))i=t[0];else for(var r=0;r<e.length;r++)i[e[r]]=t[r];return this.isUndef(n)?i:this.defaultArg(i,n)},l.prototype.isUndef=function(t){return void 0===t},l.prototype.isFunction=function(t){return"function"==typeof t},l.prototype.isNumber=function(t){return"number"==typeof t},l.prototype.isObject=function(t){return"[object Object]"===Object.prototype.toString.call(t)&&t.constructor===Object},l.prototype.isBoolean=function(t){return"boolean"==typeof t},l.prototype.isArray=function(t){return Array.isArray(t)},l.prototype.isString=function(t){return"string"==typeof t},l.noOp=function(){},l.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})},l.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})},l.State={Started:"started",Stopped:"stopped",Paused:"paused"},l.prototype.equalPowerScale=function(t){var e=.5*Math.PI;return Math.sin(t*e)},l.prototype.dbToGain=function(t){return Math.pow(2,t/6)},l.prototype.gainToDb=function(t){return Math.log(t)/Math.LN10*20},l.prototype.intervalToFrequencyRatio=function(t){return Math.pow(2,t/12)},l.prototype.now=function(){return l.context.now()},l.now=function(){return l.context.now()},l.extend=function(t,e){function n(){}l.prototype.isUndef(e)&&(e=l),n.prototype=e.prototype,t.prototype=new n,(t.prototype.constructor=t)._super=e},Object.defineProperty(l,"context",{get:function(){return e},set:function(t){e=l.Context&&t instanceof l.Context?t:new l.Context(t),l.Context&&l.Context.emit("init",e)}}),Object.defineProperty(l.prototype,"context",{get:function(){return l.context}}),l.setContext=function(t){l.context=t},Object.defineProperty(l.prototype,"blockTime",{get:function(){return 128/this.context.sampleRate}}),Object.defineProperty(l.prototype,"sampleTime",{get:function(){return 1/this.context.sampleRate}}),Object.defineProperty(l,"supported",{get:function(){var t=window.hasOwnProperty("AudioContext")||window.hasOwnProperty("webkitAudioContext"),e=window.hasOwnProperty("Promise"),n=window.hasOwnProperty("Worker");return t&&e&&n}}),l.version="r10",window.TONE_SILENCE_VERSION_LOGGING,l}.call(e,n,e,t))||(t.exports=i)},function(t,e,n){var i,r;i=[n(0),n(2),n(10)],void 0===(r=function(e){"use strict";return e.Multiply=function(t){this.createInsOuts(2,0),this._mult=this.input[0]=this.output=new e.Gain,this._param=this.input[1]=this.output.gain,this._param.value=this.defaultArg(t,0)},e.extend(e.Multiply,e.Signal),e.Multiply.prototype.dispose=function(){return e.prototype.dispose.call(this),this._mult.dispose(),this._mult=null,this._param=null,this},e.Multiply}.apply(e,i))||(t.exports=r)},function(t,e,n){var i,r;i=[n(0),n(6),n(9),n(18),n(10)],void 0===(r=function(e){"use strict";return e.Signal=function(){var t=this.optionsObject(arguments,["value","units"],e.Signal.defaults);this.output=this._gain=this.context.createGain(),t.param=this._gain.gain,e.Param.call(this,t),this.input=this._param=this._gain.gain,this.context.getConstant(1).chain(this._gain)},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.dispose=function(){return e.Param.prototype.dispose.call(this),this._param=null,this._gain.disconnect(),this._gain=null,this},e.Signal}.apply(e,i))||(t.exports=r)},function(t,u,c){"use strict";(function(t){c.d(u,"b",function(){return s}),c.d(u,"c",function(){return a});var e=c(22),i=c.n(e),n=c(0),r=c.n(n);c(12);t.TONE_SILENCE_VERSION_LOGGING=!0;var o=new window.AudioContext;function s(){return o}function a(t,e){var n=t;return t instanceof p5.Element?n=t.elt:t instanceof Array&&t[0]instanceof p5.Element&&(n=t.map(function(t){return t.elt})),i()(o,n,e)}r.a.setContext(o),u.a=o}).call(this,c(26))},function(t,e,n){var i,r;i=[n(0),n(2),n(10)],void 0===(r=function(e){"use strict";return e.Add=function(t){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)},e.extend(e.Add,e.Signal),e.Add.prototype.dispose=function(){return e.prototype.dispose.call(this),this._sum.dispose(),this._sum=null,this._param.dispose(),this._param=null,this},e.Add}.apply(e,i))||(t.exports=r)},function(t,e){t.exports={recorderProcessor:"recorder-processor",soundFileProcessor:"sound-file-processor",amplitudeProcessor:"amplitude-processor"}},function(t,e,n){var i,r;i=[n(0),n(15)],void 0===(r=function(t){"use strict";return t.WaveShaper=function(t,e){this._shaper=this.input=this.output=this.context.createWaveShaper(),this._curve=null,Array.isArray(t)?this.curve=t:isFinite(t)||this.isUndef(t)?this._curve=new Float32Array(this.defaultArg(t,1024)):this.isFunction(t)&&(this._curve=new Float32Array(this.defaultArg(e,1024)),this.setMap(t))},t.extend(t.WaveShaper,t.SignalBase),t.WaveShaper.prototype.setMap=function(t){for(var e=0,n=this._curve.length;e<n;e++){var i=e/(n-1)*2-1;this._curve[e]=t(i,e)}return this._shaper.curve=this._curve,this},Object.defineProperty(t.WaveShaper.prototype,"curve",{get:function(){return this._shaper.curve},set:function(t){this._curve=new Float32Array(t),this._shaper.curve=this._curve}}),Object.defineProperty(t.WaveShaper.prototype,"oversample",{get:function(){return this._shaper.oversample},set:function(t){if(-1===["none","2x","4x"].indexOf(t))throw new RangeError("Tone.WaveShaper: oversampling must be either 'none', '2x', or '4x'");this._shaper.oversample=t}}),t.WaveShaper.prototype.dispose=function(){return t.prototype.dispose.call(this),this._shaper.disconnect(),this._shaper=null,this._curve=null,this},t.WaveShaper}.apply(e,i))||(t.exports=r)},function(t,e,n){var i,r;i=[n(0),n(2),n(19)],void 0===(r=function(u){"use strict";return u.TimelineSignal=function(){var t=this.optionsObject(arguments,["value","units"],u.Signal.defaults);this._events=new u.Timeline(10),u.Signal.apply(this,t),t.param=this._param,u.Param.call(this,t),this._initial=this._fromUnits(this._param.value)},u.extend(u.TimelineSignal,u.Param),u.TimelineSignal.Type={Linear:"linear",Exponential:"exponential",Target:"target",Curve:"curve",Set:"set"},Object.defineProperty(u.TimelineSignal.prototype,"value",{get:function(){var t=this.now(),e=this.getValueAtTime(t);return this._toUnits(e)},set:function(t){var e=this._fromUnits(t);this._initial=e,this.cancelScheduledValues(),this._param.value=e}}),u.TimelineSignal.prototype.setValueAtTime=function(t,e){return t=this._fromUnits(t),e=this.toSeconds(e),this._events.add({type:u.TimelineSignal.Type.Set,value:t,time:e}),this._param.setValueAtTime(t,e),this},u.TimelineSignal.prototype.linearRampToValueAtTime=function(t,e){return t=this._fromUnits(t),e=this.toSeconds(e),this._events.add({type:u.TimelineSignal.Type.Linear,value:t,time:e}),this._param.linearRampToValueAtTime(t,e),this},u.TimelineSignal.prototype.exponentialRampToValueAtTime=function(t,e){e=this.toSeconds(e);var n=this._searchBefore(e);n&&0===n.value&&this.setValueAtTime(this._minOutput,n.time),t=this._fromUnits(t);var i=Math.max(t,this._minOutput);return this._events.add({type:u.TimelineSignal.Type.Exponential,value:i,time:e}),t<this._minOutput?(this._param.exponentialRampToValueAtTime(this._minOutput,e-this.sampleTime),this.setValueAtTime(0,e)):this._param.exponentialRampToValueAtTime(t,e),this},u.TimelineSignal.prototype.setTargetAtTime=function(t,e,n){return t=this._fromUnits(t),t=Math.max(this._minOutput,t),n=Math.max(this._minOutput,n),e=this.toSeconds(e),this._events.add({type:u.TimelineSignal.Type.Target,value:t,time:e,constant:n}),this._param.setTargetAtTime(t,e,n),this},u.TimelineSignal.prototype.setValueCurveAtTime=function(t,e,n,i){i=this.defaultArg(i,1);for(var r=new Array(t.length),o=0;o<r.length;o++)r[o]=this._fromUnits(t[o])*i;e=this.toSeconds(e),n=this.toSeconds(n),this._events.add({type:u.TimelineSignal.Type.Curve,value:r,time:e,duration:n}),this._param.setValueAtTime(r[0],e);for(var s=1;s<r.length;s++){var a=e+s/(r.length-1)*n;this._param.linearRampToValueAtTime(r[s],a)}return this},u.TimelineSignal.prototype.cancelScheduledValues=function(t){return t=this.toSeconds(t),this._events.cancel(t),this._param.cancelScheduledValues(t),this},u.TimelineSignal.prototype.setRampPoint=function(t){t=this.toSeconds(t);var e=this._toUnits(this.getValueAtTime(t)),n=this._searchBefore(t);if(n&&n.time===t)this.cancelScheduledValues(t+this.sampleTime);else if(n&&n.type===u.TimelineSignal.Type.Curve&&n.time+n.duration>t)this.cancelScheduledValues(t),this.linearRampToValueAtTime(e,t);else{var i=this._searchAfter(t);i&&(this.cancelScheduledValues(t),i.type===u.TimelineSignal.Type.Linear?this.linearRampToValueAtTime(e,t):i.type===u.TimelineSignal.Type.Exponential&&this.exponentialRampToValueAtTime(e,t)),this.setValueAtTime(e,t)}return this},u.TimelineSignal.prototype.linearRampToValueBetween=function(t,e,n){return this.setRampPoint(e),this.linearRampToValueAtTime(t,n),this},u.TimelineSignal.prototype.exponentialRampToValueBetween=function(t,e,n){return this.setRampPoint(e),this.exponentialRampToValueAtTime(t,n),this},u.TimelineSignal.prototype._searchBefore=function(t){return this._events.get(t)},u.TimelineSignal.prototype._searchAfter=function(t){return this._events.getAfter(t)},u.TimelineSignal.prototype.getValueAtTime=function(t){t=this.toSeconds(t);var e=this._searchAfter(t),n=this._searchBefore(t),i=this._initial;if(null===n)i=this._initial;else if(n.type===u.TimelineSignal.Type.Target){var r,o=this._events.getBefore(n.time);r=null===o?this._initial:o.value,i=this._exponentialApproach(n.time,r,n.value,n.constant,t)}else i=n.type===u.TimelineSignal.Type.Curve?this._curveInterpolate(n.time,n.value,n.duration,t):null===e?n.value:e.type===u.TimelineSignal.Type.Linear?this._linearInterpolate(n.time,n.value,e.time,e.value,t):e.type===u.TimelineSignal.Type.Exponential?this._exponentialInterpolate(n.time,n.value,e.time,e.value,t):n.value;return i},u.TimelineSignal.prototype.connect=u.SignalBase.prototype.connect,u.TimelineSignal.prototype._exponentialApproach=function(t,e,n,i,r){return n+(e-n)*Math.exp(-(r-t)/i)},u.TimelineSignal.prototype._linearInterpolate=function(t,e,n,i,r){return e+(r-t)/(n-t)*(i-e)},u.TimelineSignal.prototype._exponentialInterpolate=function(t,e,n,i,r){return(e=Math.max(this._minOutput,e))*Math.pow(i/e,(r-t)/(n-t))},u.TimelineSignal.prototype._curveInterpolate=function(t,e,n,i){var r=e.length;if(t+n<=i)return e[r-1];if(i<=t)return e[0];var o=(i-t)/n,s=Math.floor((r-1)*o),a=Math.ceil((r-1)*o),u=e[s],c=e[a];return a===s?u:this._linearInterpolate(s,u,a,c,o*(r-1))},u.TimelineSignal.prototype.dispose=function(){u.Signal.prototype.dispose.call(this),u.Param.prototype.dispose.call(this),this._events.dispose(),this._events=null},u.TimelineSignal}.apply(e,i))||(t.exports=r)},function(t,e,n){var i,r;i=[n(0),n(4),n(1),n(2)],void 0===(r=function(n){"use strict";return n.Scale=function(t,e){this._outputMin=this.defaultArg(t,0),this._outputMax=this.defaultArg(e,1),this._scale=this.input=new n.Multiply(1),this._add=this.output=new n.Add(0),this._scale.connect(this._add),this._setRange()},n.extend(n.Scale,n.SignalBase),Object.defineProperty(n.Scale.prototype,"min",{get:function(){return this._outputMin},set:function(t){this._outputMin=t,this._setRange()}}),Object.defineProperty(n.Scale.prototype,"max",{get:function(){return this._outputMax},set:function(t){this._outputMax=t,this._setRange()}}),n.Scale.prototype._setRange=function(){this._add.value=this._outputMin,this._scale.value=this._outputMax-this._outputMin},n.Scale.prototype.dispose=function(){return n.prototype.dispose.call(this),this._add.dispose(),this._add=null,this._scale.dispose(),this._scale=null,this},n.Scale}.apply(e,i))||(t.exports=r)},function(t,e,n){var i,r;i=[n(0),n(16),n(30),n(31),n(12)],void 0===(r=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",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 this.isNumber(t)?t:this.isUndef(t)?this.now():this.isString(t)?new e.Time(t).toSeconds():t instanceof e.TimeBase?t.toSeconds():void 0},e.prototype.toFrequency=function(t){return this.isNumber(t)?t:this.isString(t)||this.isUndef(t)?new e.Frequency(t).valueOf():t instanceof e.TimeBase?t.toFrequency():void 0},e.prototype.toTicks=function(t){return this.isNumber(t)||this.isString(t)?new e.TransportTime(t).toTicks():this.isUndef(t)?e.Transport.ticks:t instanceof e.TimeBase?t.toTicks():void 0},e}.apply(e,i))||(t.exports=r)},function(t,e,n){var i,r;i=[n(0),n(18),n(9)],void 0===(r=function(n){"use strict";return window.GainNode&&!AudioContext.prototype.createGain&&(AudioContext.prototype.createGain=AudioContext.prototype.createGainNode),n.Gain=function(){var t=this.optionsObject(arguments,["gain","units"],n.Gain.defaults);this.input=this.output=this._gainNode=this.context.createGain(),this.gain=new n.Param({param:this._gainNode.gain,units:t.units,value:t.gain,convert:t.convert}),this._readOnly("gain")},n.extend(n.Gain),n.Gain.defaults={gain:1,convert:!0},n.Gain.prototype.dispose=function(){n.Param.prototype.dispose.call(this),this._gainNode.disconnect(),this._gainNode=null,this._writable("gain"),this.gain.dispose(),this.gain=null},n.prototype.createInsOuts=function(t,e){1===t?this.input=new n.Gain:1<t&&(this.input=new Array(t)),1===e?this.output=new n.Gain:1<e&&(this.output=new Array(t))},n.Gain}.apply(e,i))||(t.exports=r)},function(t,e,n){var i,r;i=[n(0),n(7),n(39),n(14),n(12)],void 0===(r=function(r){"use strict";return r.Clock=function(){r.Emitter.call(this);var t=this.optionsObject(arguments,["callback","frequency"],r.Clock.defaults);this.callback=t.callback,this._nextTick=0,this._lastState=r.State.Stopped,this.frequency=new r.TimelineSignal(t.frequency,r.Type.Frequency),this._readOnly("frequency"),this.ticks=0,this._state=new r.TimelineState(r.State.Stopped),this._boundLoop=this._loop.bind(this),this.context.on("tick",this._boundLoop)},r.extend(r.Clock,r.Emitter),r.Clock.defaults={callback:r.noOp,frequency:1,lookAhead:"auto"},Object.defineProperty(r.Clock.prototype,"state",{get:function(){return this._state.getValueAtTime(this.now())}}),r.Clock.prototype.start=function(t,e){return t=this.toSeconds(t),this._state.getValueAtTime(t)!==r.State.Started&&this._state.add({state:r.State.Started,time:t,offset:e}),this},r.Clock.prototype.stop=function(t){return t=this.toSeconds(t),this._state.cancel(t),this._state.setStateAtTime(r.State.Stopped,t),this},r.Clock.prototype.pause=function(t){return t=this.toSeconds(t),this._state.getValueAtTime(t)===r.State.Started&&this._state.setStateAtTime(r.State.Paused,t),this},r.Clock.prototype._loop=function(){for(var t=this.now()+this.context.lookAhead+this.context.updateInterval+2*this.context.lag;t>this._nextTick&&this._state;){var e=this._state.getValueAtTime(this._nextTick);if(e!==this._lastState){this._lastState=e;var n=this._state.get(this._nextTick);e===r.State.Started?(this._nextTick=n.time,this.isUndef(n.offset)||(this.ticks=n.offset),this.emit("start",n.time,this.ticks)):e===r.State.Stopped?(this.ticks=0,this.emit("stop",n.time)):e===r.State.Paused&&this.emit("pause",n.time)}var i=this._nextTick;this.frequency&&(this._nextTick+=1/this.frequency.getValueAtTime(this._nextTick),e===r.State.Started&&(this.callback(i),this.ticks++))}},r.Clock.prototype.getStateAtTime=function(t){return t=this.toSeconds(t),this._state.getValueAtTime(t)},r.Clock.prototype.dispose=function(){r.Emitter.prototype.dispose.call(this),this.context.off("tick",this._boundLoop),this._writable("frequency"),this.frequency.dispose(),this.frequency=null,this._boundLoop=null,this._nextTick=1/0,this.callback=null,this._state.dispose(),this._state=null},r.Clock}.apply(e,i))||(t.exports=r)},function(t,e,n){var i,r;i=[n(0),n(14)],void 0===(r=function(i){function t(t,e,n){if(t.input)Array.isArray(t.input)?(i.prototype.isUndef(n)&&(n=0),this.connect(t.input[n])):this.connect(t.input,e,n);else try{t instanceof AudioNode?r.call(this,t,e,n):r.call(this,t,e)}catch(e){throw new Error("error connecting to node: "+t+"\n"+e)}}var r,o;return!window.hasOwnProperty("AudioContext")&&window.hasOwnProperty("webkitAudioContext")&&(window.AudioContext=window.webkitAudioContext),i.Context=function(t){for(var e in i.Emitter.call(this),t=t||new window.AudioContext,this._context=t,this._context)this._defineProperty(this._context,e);this._latencyHint="interactive",this._lookAhead=.1,this._updateInterval=this._lookAhead/3,this._computedUpdateInterval=0,this._worker=this._createWorker(),this._constants={}},i.extend(i.Context,i.Emitter),i.Emitter.mixin(i.Context),i.Context.prototype._defineProperty=function(e,n){this.isUndef(this[n])&&Object.defineProperty(this,n,{get:function(){return"function"==typeof e[n]?e[n].bind(e):e[n]},set:function(t){e[n]=t}})},i.Context.prototype.now=function(){return this._context.currentTime},i.Context.prototype._createWorker=function(){window.URL=window.URL||window.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),n=new Worker(e);return n.addEventListener("message",function(){this.emit("tick")}.bind(this)),n.addEventListener("message",function(){var t=this.now();if(this.isNumber(this._lastUpdate)){var e=t-this._lastUpdate;this._computedUpdateInterval=Math.max(e,.97*this._computedUpdateInterval)}this._lastUpdate=t}.bind(this)),n},i.Context.prototype.getConstant=function(t){if(this._constants[t])return this._constants[t];for(var e=this._context.createBuffer(1,128,this._context.sampleRate),n=e.getChannelData(0),i=0;i<n.length;i++)n[i]=t;var r=this._context.createBufferSource();return r.channelCount=1,r.channelCountMode="explicit",r.buffer=e,r.loop=!0,r.start(0),this._constants[t]=r},Object.defineProperty(i.Context.prototype,"lag",{get:function(){var t=this._computedUpdateInterval-this._updateInterval;return Math.max(t,0)}}),Object.defineProperty(i.Context.prototype,"lookAhead",{get:function(){return this._lookAhead},set:function(t){this._lookAhead=t}}),Object.defineProperty(i.Context.prototype,"updateInterval",{get:function(){return this._updateInterval},set:function(t){this._updateInterval=Math.max(t,i.prototype.blockTime),this._worker.postMessage(Math.max(1e3*t,1))}}),Object.defineProperty(i.Context.prototype,"latencyHint",{get:function(){return this._latencyHint},set:function(t){var e=t;if(this._latencyHint=t,this.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":e=.01}this.lookAhead=e,this.updateInterval=e/3}}),i.supported&&(r=AudioNode.prototype.connect,o=AudioNode.prototype.disconnect,AudioNode.prototype.connect!==t&&(AudioNode.prototype.connect=t,AudioNode.prototype.disconnect=function(t,e,n){if(t&&t.input&&Array.isArray(t.input))i.prototype.isUndef(n)&&(n=0),this.disconnect(t.input[n],e,n);else if(t&&t.input)this.disconnect(t.input,e,n);else try{o.apply(this,arguments)}catch(e){throw new Error("error disconnecting node: "+t+"\n"+e)}}),i.context=new i.Context),i.Context}.apply(e,i))||(t.exports=r)},function(t,e,n){var i,r;i=[n(0),n(4),n(20),n(2),n(10)],void 0===(r=function(e){"use strict";return e.Subtract=function(t){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)},e.extend(e.Subtract,e.Signal),e.Subtract.prototype.dispose=function(){return e.prototype.dispose.call(this),this._neg.dispose(),this._neg=null,this._sum.disconnect(),this._sum=null,this._param.dispose(),this._param=null,this},e.Subtract}.apply(e,i))||(t.exports=r)},function(t,e,n){var i,r;i=[n(0)],void 0===(r=function(s){"use strict";return s.Emitter=function(){this._events={}},s.extend(s.Emitter),s.Emitter.prototype.on=function(t,e){for(var n=t.split(/\W+/),i=0;i<n.length;i++){var r=n[i];this._events.hasOwnProperty(r)||(this._events[r]=[]),this._events[r].push(e)}return this},s.Emitter.prototype.off=function(t,e){for(var n=t.split(/\W+/),i=0;i<n.length;i++)if(t=n[i],this._events.hasOwnProperty(t))if(s.prototype.isUndef(e))this._events[t]=[];else for(var r=this._events[t],o=0;o<r.length;o++)r[o]===e&&r.splice(o,1);return this},s.Emitter.prototype.emit=function(t){if(this._events){var e=Array.apply(null,arguments).slice(1);if(this._events.hasOwnProperty(t))for(var n=this._events[t],i=0,r=n.length;i<r;i++)n[i].apply(this,e)}return this},s.Emitter.mixin=function(t){var e=["on","off","emit"];t._events={};for(var n=0;n<e.length;n++){var i=e[n],r=s.Emitter.prototype[i];t[i]=r}},s.Emitter.prototype.dispose=function(){return s.prototype.dispose.call(this),this._events=null,this},s.Emitter}.apply(e,i))||(t.exports=r)},function(t,e,n){var i,r;i=[n(0)],void 0===(r=function(i){"use strict";return i.SignalBase=function(){},i.extend(i.SignalBase),i.SignalBase.prototype.connect=function(t,e,n){return i.Signal&&i.Signal===t.constructor||i.Param&&i.Param===t.constructor||i.TimelineSignal&&i.TimelineSignal===t.constructor?(t._param.cancelScheduledValues(0),t._param.value=0,t.overridden=!0):t instanceof AudioParam&&(t.cancelScheduledValues(0),t.value=0),i.prototype.connect.call(this,t,e,n),this},i.SignalBase}.apply(e,i))||(t.exports=r)},function(t,e,n){var i,r;i=[n(0),n(17)],void 0===(r=function(n){return n.Time=function(t,e){if(!(this instanceof n.Time))return new n.Time(t,e);this._plusNow=!1,n.TimeBase.call(this,t,e)},n.extend(n.Time,n.TimeBase),n.Time.prototype._unaryExpressions=Object.create(n.TimeBase.prototype._unaryExpressions),n.Time.prototype._unaryExpressions.quantize={regexp:/^@/,method:function(t){return n.Transport.nextSubdivision(t())}},n.Time.prototype._unaryExpressions.now={regexp:/^\+/,method:function(t){return this._plusNow=!0,t()}},n.Time.prototype.quantize=function(t,e){return e=this.defaultArg(e,1),this._expr=function(t,e,n){return t=t(),e=e.toSeconds(),t+(Math.round(t/e)*e-t)*n}.bind(this,this._expr,new this.constructor(t),e),this},n.Time.prototype.addNow=function(){return this._plusNow=!0,this},n.Time.prototype._defaultExpr=function(){return this._plusNow=!0,this._noOp},n.Time.prototype.copy=function(t){return n.TimeBase.prototype.copy.call(this,t),this._plusNow=t._plusNow,this},n.Time.prototype.toNotation=function(){var t=this.toSeconds(),e=this._toNotationHelper(t,["1m","2n","4n","8n","16n","32n","64n","128n"]),n=this._toNotationHelper(t,["1m","2n","2t","4n","4t","8n","8t","16n","16t","32n","32t","64n","64t","128n"]);return n.split("+").length<e.split("+").length?n:e},n.Time.prototype._toNotationHelper=function(t,e){for(var n=this._notationToUnits(e[e.length-1]),i="",r=0;r<e.length;r++){var o=this._notationToUnits(e[r]),s=t/o;if(1-s%1<1e-6&&(s+=1e-6),0<(s=Math.floor(s))){if(i+=1===s?e[r]:s.toString()+"*"+e[r],(t-=s*o)<n)break;i+=" + "}}return""===i&&(i="0"),i},n.Time.prototype._notationToUnits=function(t){for(var e=this._primaryExpressions,n=[e.n,e.t,e.m],i=0;i<n.length;i++){var r=n[i],o=t.match(r.regexp);if(o)return r.method.call(this,o[1])}},n.Time.prototype.toBarsBeatsSixteenths=function(){var t=this._beatsToUnits(1),e=this.toSeconds()/t,n=Math.floor(e/this._timeSignature()),i=e%1*4;return e=Math.floor(e)%this._timeSignature(),3<(i=i.toString()).length&&(i=parseFloat(i).toFixed(3)),[n,e,i].join(":")},n.Time.prototype.toTicks=function(){var t=this._beatsToUnits(1),e=this.valueOf()/t;return Math.floor(e*n.Transport.PPQ)},n.Time.prototype.toSamples=function(){return this.toSeconds()*this.context.sampleRate},n.Time.prototype.toFrequency=function(){return 1/this.toSeconds()},n.Time.prototype.toSeconds=function(){return this.valueOf()},n.Time.prototype.toMilliseconds=function(){return 1e3*this.toSeconds()},n.Time.prototype.valueOf=function(){return this._expr()+(this._plusNow?this.now():0)},n.Time}.apply(e,i))||(t.exports=r)},function(t,e,n){var i,r;i=[n(0)],void 0===(r=function(i){return i.TimeBase=function(t,e){if(!(this instanceof i.TimeBase))return new i.TimeBase(t,e);if(this._expr=this._noOp,t instanceof i.TimeBase)this.copy(t);else if(!this.isUndef(e)||this.isNumber(t)){e=this.defaultArg(e,this._defaultUnits);var n=this._primaryExpressions[e].method;this._expr=n.bind(this,t)}else this.isString(t)?this.set(t):this.isUndef(t)&&(this._expr=this._defaultExpr())},i.extend(i.TimeBase),i.TimeBase.prototype.set=function(t){return this._expr=this._parseExprString(t),this},i.TimeBase.prototype.clone=function(){var t=new this.constructor;return t.copy(this),t},i.TimeBase.prototype.copy=function(t){var e=t._expr();return this.set(e)},i.TimeBase.prototype._primaryExpressions={n:{regexp:/^(\d+)n/i,method:function(t){return 1===(t=parseInt(t))?this._beatsToUnits(this._timeSignature()):this._beatsToUnits(4/t)}},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._timeSignature())}},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,n){var i=0;return t&&"0"!==t&&(i+=this._beatsToUnits(this._timeSignature()*parseFloat(t))),e&&"0"!==e&&(i+=this._beatsToUnits(parseFloat(e))),n&&"0"!==n&&(i+=this._beatsToUnits(parseFloat(n)/4)),i}},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._primaryExpressions[this._defaultUnits].method.call(this,t)}}},i.TimeBase.prototype._binaryExpressions={"+":{regexp:/^\+/,precedence:2,method:function(t,e){return t()+e()}},"-":{regexp:/^\-/,precedence:2,method:function(t,e){return t()-e()}},"*":{regexp:/^\*/,precedence:1,method:function(t,e){return t()*e()}},"/":{regexp:/^\//,precedence:1,method:function(t,e){return t()/e()}}},i.TimeBase.prototype._unaryExpressions={neg:{regexp:/^\-/,method:function(t){return-t()}}},i.TimeBase.prototype._syntaxGlue={"(":{regexp:/^\(/},")":{regexp:/^\)/}},i.TimeBase.prototype._tokenize=function(t){for(var e=-1,n=[];0<t.length;){var i=r(t=t.trim(),this);n.push(i),t=t.substr(i.value.length)}function r(t,e){for(var n=["_binaryExpressions","_unaryExpressions","_primaryExpressions","_syntaxGlue"],i=0;i<n.length;i++){var r=e[n[i]];for(var o in r){var s=r[o],a=s.regexp,u=t.match(a);if(null!==u)return{method:s.method,precedence:s.precedence,regexp:s.regexp,value:u[0]}}}throw new SyntaxError("Tone.TimeBase: Unexpected token "+t)}return{next:function(){return n[++e]},peek:function(){return n[e+1]}}},i.TimeBase.prototype._matchGroup=function(t,e,n){if(!this.isUndef(t))for(var i in e){var r=e[i];if(r.regexp.test(t.value)){if(this.isUndef(n))return r;if(r.precedence===n)return r}}return!1},i.TimeBase.prototype._parseBinary=function(t,e){var n;this.isUndef(e)&&(e=2),n=e<0?this._parseUnary(t):this._parseBinary(t,e-1);for(var i=t.peek();i&&this._matchGroup(i,this._binaryExpressions,e);)n=(i=t.next()).method.bind(this,n,this._parseBinary(t,e-1)),i=t.peek();return n},i.TimeBase.prototype._parseUnary=function(t){var e,n;e=t.peek();var i=this._matchGroup(e,this._unaryExpressions);return i?(e=t.next(),n=this._parseUnary(t),i.method.bind(this,n)):this._parsePrimary(t)},i.TimeBase.prototype._parsePrimary=function(t){var e,n;if(e=t.peek(),this.isUndef(e))throw new SyntaxError("Tone.TimeBase: Unexpected end of expression");if(this._matchGroup(e,this._primaryExpressions)){var i=(e=t.next()).value.match(e.regexp);return e.method.bind(this,i[1],i[2],i[3])}if(e&&"("===e.value){if(t.next(),n=this._parseBinary(t),!(e=t.next())||")"!==e.value)throw new SyntaxError("Expected )");return n}throw new SyntaxError("Tone.TimeBase: Cannot process token "+e.value)},i.TimeBase.prototype._parseExprString=function(t){this.isString(t)||(t=t.toString());var e=this._tokenize(t);return this._parseBinary(e)},i.TimeBase.prototype._noOp=function(){return 0},i.TimeBase.prototype._defaultExpr=function(){return this._noOp},i.TimeBase.prototype._defaultUnits="s",i.TimeBase.prototype._frequencyToUnits=function(t){return 1/t},i.TimeBase.prototype._beatsToUnits=function(t){return 60/i.Transport.bpm.value*t},i.TimeBase.prototype._secondsToUnits=function(t){return t},i.TimeBase.prototype._ticksToUnits=function(t){return t*(this._beatsToUnits(1)/i.Transport.PPQ)},i.TimeBase.prototype._timeSignature=function(){return i.Transport.timeSignature},i.TimeBase.prototype._pushExpr=function(t,e,n){return t instanceof i.TimeBase||(t=new this.constructor(t,n)),this._expr=this._binaryExpressions[e].method.bind(this,this._expr,t._expr),this},i.TimeBase.prototype.add=function(t,e){return this._pushExpr(t,"+",e)},i.TimeBase.prototype.sub=function(t,e){return this._pushExpr(t,"-",e)},i.TimeBase.prototype.mult=function(t,e){return this._pushExpr(t,"*",e)},i.TimeBase.prototype.div=function(t,e){return this._pushExpr(t,"/",e)},i.TimeBase.prototype.valueOf=function(){return this._expr()},i.TimeBase.prototype.dispose=function(){this._expr=null},i.TimeBase}.apply(e,i))||(t.exports=r)},function(t,e,n){var i,r;i=[n(0),n(9)],void 0===(r=function(i){"use strict";return i.Param=function(){var t=this.optionsObject(arguments,["param","units","convert"],i.Param.defaults);this._param=this.input=t.param,this.units=t.units,this.convert=t.convert,this.overridden=!1,this._lfo=null,this.isObject(t.lfo)?this.value=t.lfo:this.isUndef(t.value)||(this.value=t.value)},i.extend(i.Param),i.Param.defaults={units:i.Type.Default,convert:!0,param:void 0},Object.defineProperty(i.Param.prototype,"value",{get:function(){return this._toUnits(this._param.value)},set:function(t){if(this.isObject(t)){if(this.isUndef(i.LFO))throw new Error("Include 'Tone.LFO' to use an LFO as a Param value.");this._lfo&&this._lfo.dispose(),this._lfo=new i.LFO(t).start(),this._lfo.connect(this.input)}else{var e=this._fromUnits(t);this._param.cancelScheduledValues(0),this._param.value=e}}}),i.Param.prototype._fromUnits=function(t){if(!this.convert&&!this.isUndef(this.convert))return t;switch(this.units){case i.Type.Time:return this.toSeconds(t);case i.Type.Frequency:return this.toFrequency(t);case i.Type.Decibels:return this.dbToGain(t);case i.Type.NormalRange:return Math.min(Math.max(t,0),1);case i.Type.AudioRange:return Math.min(Math.max(t,-1),1);case i.Type.Positive:return Math.max(t,0);default:return t}},i.Param.prototype._toUnits=function(t){if(!this.convert&&!this.isUndef(this.convert))return t;switch(this.units){case i.Type.Decibels:return this.gainToDb(t);default:return t}},i.Param.prototype._minOutput=1e-5,i.Param.prototype.setValueAtTime=function(t,e){return t=this._fromUnits(t),(e=this.toSeconds(e))<=this.now()+this.blockTime?this._param.value=t:this._param.setValueAtTime(t,e),this},i.Param.prototype.setRampPoint=function(t){t=this.defaultArg(t,this.now());var e=this._param.value;return 0===e&&(e=this._minOutput),this._param.setValueAtTime(e,t),this},i.Param.prototype.linearRampToValueAtTime=function(t,e){return t=this._fromUnits(t),this._param.linearRampToValueAtTime(t,this.toSeconds(e)),this},i.Param.prototype.exponentialRampToValueAtTime=function(t,e){return t=this._fromUnits(t),t=Math.max(this._minOutput,t),this._param.exponentialRampToValueAtTime(t,this.toSeconds(e)),this},i.Param.prototype.exponentialRampToValue=function(t,e,n){return n=this.toSeconds(n),this.setRampPoint(n),this.exponentialRampToValueAtTime(t,n+this.toSeconds(e)),this},i.Param.prototype.linearRampToValue=function(t,e,n){return n=this.toSeconds(n),this.setRampPoint(n),this.linearRampToValueAtTime(t,n+this.toSeconds(e)),this},i.Param.prototype.setTargetAtTime=function(t,e,n){return t=this._fromUnits(t),t=Math.max(this._minOutput,t),n=Math.max(this._minOutput,n),this._param.setTargetAtTime(t,this.toSeconds(e),n),this},i.Param.prototype.setValueCurveAtTime=function(t,e,n){for(var i=0;i<t.length;i++)t[i]=this._fromUnits(t[i]);return this._param.setValueCurveAtTime(t,this.toSeconds(e),this.toSeconds(n)),this},i.Param.prototype.cancelScheduledValues=function(t){return this._param.cancelScheduledValues(this.toSeconds(t)),this},i.Param.prototype.rampTo=function(t,e,n){return e=this.defaultArg(e,0),this.units===i.Type.Frequency||this.units===i.Type.BPM||this.units===i.Type.Decibels?this.exponentialRampToValue(t,e,n):this.linearRampToValue(t,e,n),this},Object.defineProperty(i.Param.prototype,"lfo",{get:function(){return this._lfo}}),i.Param.prototype.dispose=function(){return i.prototype.dispose.call(this),this._param=null,this._lfo&&(this._lfo.dispose(),this._lfo=null),this},i.Param}.apply(e,i))||(t.exports=r)},function(t,e,n){var i,r;i=[n(0),n(9)],void 0===(r=function(e){"use strict";return e.Timeline=function(){var t=this.optionsObject(arguments,["memory"],e.Timeline.defaults);this._timeline=[],this._toRemove=[],this._iterating=!1,this.memory=t.memory},e.extend(e.Timeline),e.Timeline.defaults={memory:1/0},Object.defineProperty(e.Timeline.prototype,"length",{get:function(){return this._timeline.length}}),e.Timeline.prototype.add=function(t){if(this.isUndef(t.time))throw new Error("Tone.Timeline: events must have a time attribute");if(this._timeline.length){var e=this._search(t.time);this._timeline.splice(e+1,0,t)}else this._timeline.push(t);if(this.length>this.memory){var n=this.length-this.memory;this._timeline.splice(0,n)}return this},e.Timeline.prototype.remove=function(t){if(this._iterating)this._toRemove.push(t);else{var e=this._timeline.indexOf(t);-1!==e&&this._timeline.splice(e,1)}return this},e.Timeline.prototype.get=function(t){var e=this._search(t);return-1!==e?this._timeline[e]:null},e.Timeline.prototype.peek=function(){return this._timeline[0]},e.Timeline.prototype.shift=function(){return this._timeline.shift()},e.Timeline.prototype.getAfter=function(t){var e=this._search(t);return e+1<this._timeline.length?this._timeline[e+1]:null},e.Timeline.prototype.getBefore=function(t){var e=this._timeline.length;if(0<e&&this._timeline[e-1].time<t)return this._timeline[e-1];var n=this._search(t);return 0<=n-1?this._timeline[n-1]:null},e.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 n=e;0<=n&&this._timeline[n].time===t;n--)e=n;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},e.Timeline.prototype.cancelBefore=function(t){if(this._timeline.length){var e=this._search(t);0<=e&&(this._timeline=this._timeline.slice(e+1))}return this},e.Timeline.prototype._search=function(t){var e=0,n=this._timeline.length,i=n;if(0<n&&this._timeline[n-1].time<=t)return n-1;for(;e<i;){var r=Math.floor(e+(i-e)/2),o=this._timeline[r],s=this._timeline[r+1];if(o.time===t){for(var a=r;a<this._timeline.length;a++)this._timeline[a].time===t&&(r=a);return r}if(o.time<t&&s.time>t)return r;o.time>t?i=r:o.time<t&&(e=r+1)}return-1},e.Timeline.prototype._iterate=function(t,e,n){this._iterating=!0,e=this.defaultArg(e,0),n=this.defaultArg(n,this._timeline.length-1);for(var i=e;i<=n;i++)t(this._timeline[i]);if(this._iterating=!1,0<this._toRemove.length){for(var r=0;r<this._toRemove.length;r++){var o=this._timeline.indexOf(this._toRemove[r]);-1!==o&&this._timeline.splice(o,1)}this._toRemove=[]}},e.Timeline.prototype.forEach=function(t){return this._iterate(t),this},e.Timeline.prototype.forEachBefore=function(t,e){var n=this._search(t);return-1!==n&&this._iterate(e,0,n),this},e.Timeline.prototype.forEachAfter=function(t,e){var n=this._search(t);return this._iterate(e,n+1),this},e.Timeline.prototype.forEachFrom=function(t,e){for(var n=this._search(t);0<=n&&this._timeline[n].time>=t;)n--;return this._iterate(e,n+1),this},e.Timeline.prototype.forEachAtTime=function(e,n){var t=this._search(e);return-1!==t&&this._iterate(function(t){t.time===e&&n(t)},0,t),this},e.Timeline.prototype.dispose=function(){e.prototype.dispose.call(this),this._timeline=null,this._toRemove=null},e.Timeline}.apply(e,i))||(t.exports=r)},function(t,e,n){var i,r;i=[n(0),n(1),n(2)],void 0===(r=function(t){"use strict";return t.Negate=function(){this._multiply=this.input=this.output=new t.Multiply(-1)},t.extend(t.Negate,t.SignalBase),t.Negate.prototype.dispose=function(){return t.prototype.dispose.call(this),this._multiply.dispose(),this._multiply=null,this},t.Negate}.apply(e,i))||(t.exports=r)},function(t,e,n){var i,r;i=[n(0),n(2),n(1),n(6)],void 0===(r=function(t){"use strict";return t.GreaterThanZero=function(){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.prototype.dispose.call(this),this._scale.dispose(),this._scale=null,this._thresh.dispose(),this._thresh=null,this},t.GreaterThanZero}.apply(e,i))||(t.exports=r)},function(t,e,n){var i,r,o;r=[],void 0===(o="function"==typeof(i=function(){var s=function(t,e){this._dragged=!1,this._element=t,this._bindedMove=this._moved.bind(this),this._bindedEnd=this._ended.bind(this,e),t.addEventListener("touchstart",this._bindedEnd),t.addEventListener("touchmove",this._bindedMove),t.addEventListener("touchend",this._bindedEnd),t.addEventListener("mouseup",this._bindedEnd)};function o(t){return"running"===t.state}return s.prototype._moved=function(t){this._dragged=!0},s.prototype._ended=function(t){this._dragged||function(t){var e=t.createBuffer(1,1,t.sampleRate),n=t.createBufferSource();n.buffer=e,n.connect(t.destination),n.start(0),t.resume&&t.resume()}(t),this._dragged=!1},s.prototype.dispose=function(){this._element.removeEventListener("touchstart",this._bindedEnd),this._element.removeEventListener("touchmove",this._bindedMove),this._element.removeEventListener("touchend",this._bindedEnd),this._element.removeEventListener("mouseup",this._bindedEnd),this._bindedMove=null,this._bindedEnd=null,this._element=null},function(e,t,n){var i=new Promise(function(t){!function(e,n){o(e)?n():function t(){o(e)?n():(requestAnimationFrame(t),e.resume&&e.resume())}()}(e,t)}),r=[];return function t(e,n,i){if(Array.isArray(e)||NodeList&&e instanceof NodeList)for(var r=0;r<e.length;r++)t(e[r],n,i);else if("string"==typeof e)t(document.querySelectorAll(e),n,i);else if(e.jquery&&"function"==typeof e.toArray)t(e.toArray(),n,i);else if(Element&&e instanceof Element){var o=new s(e,i);n.push(o)}}(t=t||document.body,r,e),i.then(function(){for(var t=0;t<r.length;t++)r[t].dispose();r=null,n&&n()}),i}})?i.apply(e,r):i)||(t.exports=o)},function(t,e,n){var i,r;i=[n(0),n(2),n(32),n(38),n(10)],void 0===(r=function(e){"use strict";return e.CrossFade=function(t){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(this.defaultArg(t,.5),e.Type.NormalRange),this._equalPowerA=new e.EqualPowerGain,this._equalPowerB=new e.EqualPowerGain,this._invert=new e.Expr("1 - $0"),this.a.connect(this.output),this.b.connect(this.output),this.fade.chain(this._equalPowerB,this.b.gain),this.fade.chain(this._invert,this._equalPowerA,this.a.gain),this._readOnly("fade")},e.extend(e.CrossFade),e.CrossFade.prototype.dispose=function(){return e.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.a.dispose(),this.a=null,this.b.dispose(),this.b=null,this},e.CrossFade}.apply(e,i))||(t.exports=r)},function(t,e){function l(t){var i=this,r={},o=-1;this.parameters.forEach(function(t,e){var n=a[++o]||(a[o]=new Float32Array(i.bufferSize));n.fill(t.value),r[e]=n}),this.processor.realm.exec("self.sampleRate=sampleRate="+this.context.sampleRate+";self.currentTime=currentTime="+this.context.currentTime);var e=s(t.inputBuffer),n=s(t.outputBuffer);this.instance.process([e],[n],r)}function s(t){for(var e=[],n=0;n<t.numberOfChannels;n++)e[n]=t.getChannelData(n);return e}function h(t){return t.$$processors||(t.$$processors={})}function n(t){this.$$context=t}var p,a;a=[],"function"!=typeof AudioWorkletNode&&(self.AudioWorkletNode=function(t,e,n){var i=h(t)[e],r=t.createScriptProcessor(void 0,2,n&&n.outputChannelCount?n.outputChannelCount[0]:2);if(r.parameters=new Map,i.properties)for(var o=0;o<i.properties.length;o++){var s=i.properties[o],a=t.createGain().gain;a.value=s.defaultValue,r.parameters.set(s.name,a)}var u=new MessageChannel;p=u.port2;var c=new i.Processor(n||{});return p=null,r.port=u.port1,r.processor=i,r.instance=c,r.onaudioprocess=l,r},Object.defineProperty((self.AudioContext||self.webkitAudioContext).prototype,"audioWorklet",{get:function(){return this.$$audioWorklet||(this.$$audioWorklet=new self.AudioWorklet(this))}}),self.AudioWorklet=(n.prototype.addModule=function(t,e){var r=this;return fetch(t).then(function(t){if(!t.ok)throw Error(t.status);return t.text()}).then(function(t){var n={sampleRate:0,currentTime:0,AudioWorkletProcessor:function(){this.port=p},registerProcessor:function(t,e){h(r.$$context)[t]={realm:i,context:n,Processor:e,properties:e.parameterDescriptors||[]}}},i=new function(t,e){var n=document.createElement("iframe");n.style.cssText="position:absolute;left:0;top:-999px;width:1px;height:1px;",e.appendChild(n);var i=n.contentWindow,r=i.document,o="var window,$hook";for(var s in i)s in t||"eval"===s||(o+=",",o+=s);for(var a in t)o+=",",o+=a,o+="=self.",o+=a;var u=r.createElement("script");u.appendChild(r.createTextNode('function $hook(self,console) {"use strict";\n '+o+";return function() {return eval(arguments[0])}}")),r.body.appendChild(u),this.exec=i.$hook(t,console)}(n.self=n,document.documentElement);return i.exec((e&&e.transpile||String)(t)),null})},n))},function(t,e){function n(t){t&&(t.setTargetAtTime||(t.setTargetAtTime=t.setTargetValueAtTime))}window,window.hasOwnProperty("webkitAudioContext")&&!window.hasOwnProperty("AudioContext")&&(window.AudioContext=window.webkitAudioContext,"function"!=typeof AudioContext.prototype.createGain&&(AudioContext.prototype.createGain=AudioContext.prototype.createGainNode),"function"!=typeof AudioContext.prototype.createDelay&&(AudioContext.prototype.createDelay=AudioContext.prototype.createDelayNode),"function"!=typeof AudioContext.prototype.createScriptProcessor&&(AudioContext.prototype.createScriptProcessor=AudioContext.prototype.createJavaScriptNode),"function"!=typeof AudioContext.prototype.createPeriodicWave&&(AudioContext.prototype.createPeriodicWave=AudioContext.prototype.createWaveTable),AudioContext.prototype.internal_createGain=AudioContext.prototype.createGain,AudioContext.prototype.createGain=function(){var t=this.internal_createGain();return n(t.gain),t},AudioContext.prototype.internal_createDelay=AudioContext.prototype.createDelay,AudioContext.prototype.createDelay=function(t){var e=t?this.internal_createDelay(t):this.internal_createDelay();return n(e.delayTime),e},AudioContext.prototype.internal_createBufferSource=AudioContext.prototype.createBufferSource,AudioContext.prototype.createBufferSource=function(){var i=this.internal_createBufferSource();return i.start?(i.internal_start=i.start,i.start=function(t,e,n){void 0!==n?i.internal_start(t||0,e,n):i.internal_start(t||0,e||0)}):i.start=function(t,e,n){e||n?this.noteGrainOn(t||0,e,n):this.noteOn(t||0)},i.stop?(i.internal_stop=i.stop,i.stop=function(t){i.internal_stop(t||0)}):i.stop=function(t){this.noteOff(t||0)},n(i.playbackRate),i},AudioContext.prototype.internal_createDynamicsCompressor=AudioContext.prototype.createDynamicsCompressor,AudioContext.prototype.createDynamicsCompressor=function(){var t=this.internal_createDynamicsCompressor();return n(t.threshold),n(t.knee),n(t.ratio),n(t.reduction),n(t.attack),n(t.release),t},AudioContext.prototype.internal_createBiquadFilter=AudioContext.prototype.createBiquadFilter,AudioContext.prototype.createBiquadFilter=function(){var t=this.internal_createBiquadFilter();return n(t.frequency),n(t.detune),n(t.Q),n(t.gain),t},"function"!=typeof AudioContext.prototype.createOscillator&&(AudioContext.prototype.internal_createOscillator=AudioContext.prototype.createOscillator,AudioContext.prototype.createOscillator=function(){var e=this.internal_createOscillator();return e.start?(e.internal_start=e.start,e.start=function(t){e.internal_start(t||0)}):e.start=function(t){this.noteOn(t||0)},e.stop?(e.internal_stop=e.stop,e.stop=function(t){e.internal_stop(t||0)}):e.stop=function(t){this.noteOff(t||0)},e.setPeri