p5-breakout/libraries/p5.sound.min.js

3 lines
181 KiB
JavaScript
Raw Normal View History

2021-08-04 21:53:41 +00:00
/** [p5.sound] Version: 0.3.12 - 2020-01-06 */
!function(n){var i={};function o(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,o),e.l=!0,e.exports}o.m=n,o.c=i,o.d=function(t,e,n){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)o.d(n,i,function(t){return e[t]}.bind(null,i));return n},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=31)}([function(t,e,n){var i;void 0===(i=function(){"use strict";function c(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 c.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 o in t){e=t[o];var r=this;if(-1!==o.indexOf(".")){for(var s=o.split("."),a=0;a<s.length-1;a++)if((r=r[s[a]])instanceof c){s.splice(0,a+1);var u=s.join(".");r.set(u,e);continue t}o=s[s.length-1]}var p=r[o];this.isUndef(p)||(c.Signal&&p instanceof c.Signal||c.Param&&p instanceof c.Param?p.value!==e&&(this.isUndef(n)?p.value=e:p.rampTo(e,n)):p instanceof AudioParam?p.value!==e&&(p.value=e):p instanceof c?p.set(e):p!==e&&(r[o]=e))}return this},c.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],o=this,r=e;if(-1!==i.indexOf(".")){for(var s=i.split("."),a=0;a<s.length-1;a++){var u=s[a];r[u]=r[u]||{},r=r[u],o=o[u]}i=s[s.length-1]}var p=o[i];this.isObject(t[i])?r[i]=p.get():c.Signal&&p instanceof c.Signal?r[i]=p.value:c.Param&&p instanceof c.Param?r[i]=p.value:p instanceof AudioParam?r[i]=p.value:p instanceof c?r[i]=p.get():this.isFunction(p)||this.isUndef(p)||(r[i]=p)}return e},c.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},c.prototype.toString=function(){for(var t in c){var e=t[0].match(/^[A-Z]$/),n=c[t]===this.constructor;if(this.isFunction(c[t])&&e&&n)return t}return"Tone"},Object.defineProperty(c.prototype,"numberOfInputs",{get:function(){return this.input?this.isArray(this.input)?this.input.length:1:0}}),Object.defineProperty(c.prototype,"numberOfOutputs",{get:function(){return this.output?this.isArray(this.output)?this.output.length:1:0}}),c.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},c.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},c.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)},c.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},c.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},c.prototype.fan=function(){if(0<arguments.length)for(var t=0;t<arguments.length;t++)this.connect(arguments[t]);return this},AudioNode.prototype.chain=c.prototype.chain,AudioNode.prototype.fan=c.prototype.fan,c.pr
//# sourceMappingURL=p5.sound.min.js.map