text: !function t(e,o,n){function i(s,a){if(!o[s]){if(!e[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(r)return r(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var p=o[s]={exports:{}};e[s][0].call(p.exports,function(t){var o=e[s][1][t];return i(o?o:t)},p,p.exports,t,e,o,n)}return o[s].exports}for(var r="function"==typeof require&&require,s=0;s<n.length;s++)i(n[s]);return i}({1:[function(t,e,o){function n(t,e,o){this.endPoint=t,this.connections=[],a.call(this,t,e,o)}function i(t,e,o){n.call(this,t,e,o)}function r(t,e,o){n.call(this,t,e,o)}var s=t("./connectors"),a=t("./Connector");inherits(n,a),n.prototype.color="#fd870e",n.prototype.type="audio",n.prototype.bind=function(t,e,o){var n=o.endPoint.split(".");this.endPoint=t;for(var i=0;i<n.length;i++)this.endPoint=this.endPoint[n[i]];var r=this.connections;this.connections=[];for(var i=r.length-1;i>=0;i--)this.connect(r[i])},n.prototype.connect=function(t){a.prototype.connect.call(this,t),this._addConnection(t),t._addConnection(this)},n.prototype.disconnect=function(t){a.prototype.disconnect.call(this,t),this._removeConnection(t),t._removeConnection(this)},n.prototype._addConnection=function(t){this.connections.push(t)},n.prototype._removeConnection=function(t){var e=this.connections.indexOf(t);e!==-1&&this.connections.splice(e,1)},inherits(i,n),i.prototype.cssClassName="audioIn",i.prototype.way="input",s.register(i,"input","audio"),i.prototype.connect=function(t){n.prototype.connect.call(this,t),t.endPoint.connect(this.endPoint)},inherits(r,n),r.prototype.cssClassName="audioOut",r.prototype.way="output",s.register(r,"output","audio"),r.prototype.connect=function(t){n.prototype.connect.call(this,t),this.endPoint.connect(t.endPoint)},r.prototype.disconnect=function(t){n.prototype.disconnect.call(this,t),this.endPoint.disconnect(t.endPoint)},r.prototype.isCompatible=function(t){return"param"===t.type&&"input"===t.way||n.prototype.isCompatible.call(this,t)}},{"./Connector":5,"./connectors":14}],2:[function(t,e,o){function n(t){i.call(this,t);var e="bufferAudio";if(t.ir&&(e="bufferIR"),"ProceduralBuffer"===t.type&&(e="bufferProcedural"),this.addClassName(e),this.setTitle(t.id),this.buffer=null,!t)return console.warn("Buffer module should be initialized with buffer data.");var o=this;t.loadAudioBuffer(function(e){return e?(console.error("Could not load buffer",t,e),void o.addClassName("bufferFailed")):(o.buffer=t,void o.onLoad())})}var i=t("./Module");inherits(n,i),n.prototype.onConnect=function(t){this.buffer&&this.$data.emitTo(t,{_type:"buffer",buffer:this.buffer})},n.prototype.onLoad=function(){this.$data.emit({_type:"buffer",buffer:this.buffer})},n.prototype.descriptor={type:"Buffer",size:1,outputs:{data:{type:"event",x:5,y:0,label:null,onConnect:"onConnect"}}},e.exports=n},{"./Module":10}],3:[function(t,e,o){function n(t,e,o){this.initGUI(t,e,o),this.bind(t,e,o)}n.prototype.initGUI=function(t,e,o){},n.prototype.setTitle=function(t){},n.prototype.bind=function(t,e,o){var n=o.endPoint;if(n){var i=t;n=n.split(".");for(var r=n.pop(),s=0;s<n.length;s++)i=i[n[s]];this.caller=i,this.endPoint=this.caller[r]}},e.exports=n},{}],4:[function(t,e,o){function n(t,e,o){this.endPointA=t,this.endPointB=e,this.color=o||"#555",this.id=this.getId(t,e),this.x=0,this.y=0,this.a=0,this.b=0,this.c=0,this.d=0,this.w=0,this.h=0,this.update(),t.module.addCable(this),e.module.addCable(this)}e.exports=n,n.prototype.getId=function(t,e){return t.module.id+":"+t.id+"--"+e.module.id+":"+e.id},n.prototype.draw=function(){},n.prototype.update=function(){},n.prototype.disconnect=function(){this.endPointA&&(this.endPointA.disconnect(this.endPointB),this.endPointB.disconnect(this.endPointA),this.endPointA.module.removeCable(this),this.endPointB.module.removeCable(this)),this.endPointA=null,this.endPointB=null}},{}],5:[function(t,e,o){function n(t,e,o){this.module=t,this.id=e,this.x=o.x,this.y=o.y,this.singleConnection=void 0!==o.singleConnection&&!!o.singleConnection,this.initGUI(t,e,o),this.bind(t,e,o)}var i=t("./connectors");e.exports=n,n.prototype.cssClassName="connector",n.prototype.color="#2da8ff",n.prototype.type="none",n.prototype.way="input",i.register(n,"input","none"),n.prototype.bind=function(t,e,o){},n.prototype.connect=function(t){var e=this.module.patch;this.singleConnection&&e.disconnect(this),t.singleConnection&&e.disconnect(t),e.addCable(this,t,this.color)},n.prototype.disconnect=function(t){},n.prototype.isCompatible=function(t){return t!==this&&(this.type===t.type&&this.way!==t.way)},n.prototype.initGUI=function(t,e,o){}},{"./connectors":14}],6:[function(t,e,o){function n(t,e){e=e||"",e=e.split("."),endPoint=t;for(var o=0;o<e.length;o++)endPoint=endPoint[e[o]];return endPoint}function i(t,e,o){this.module=t,a.call(this,t,e,o)}function r(t,e,o){a.call(this,t,e,o),this.connections=[],this.onConnect=null,o.onConnect&&(this.onConnect=n(t,o.onConnect))}var s=t("./connectors"),a=t("./Connector"),u="#2da8ff";inherits(i,a),i.prototype.cssClassName="eventIn",i.prototype.color=u,i.prototype.type="event",i.prototype.way="input",s.register(i,"input","event"),i.prototype.bind=function(t,e,o){this.endPoint=n(t,o.endPoint)},i.prototype.connect=function(t){t.connect(this)},inherits(r,a),r.prototype.cssClassName="eventOut",r.prototype.color=u,r.prototype.type="event",r.prototype.way="output",s.register(r,"output","event"),r.prototype.connect=function(t){a.prototype.connect.call(this,t),this.connections.push(t),this.onConnect&&this.onConnect.call(this.module,t)},r.prototype.disconnect=function(t){var e=this.connections.indexOf(t);e!==-1&&this.connections.splice(e,1)},r.prototype.emit=function(t){t=t||{};for(var e=0;e<this.connections.length;e++){var o=this.connections[e];o.endPoint.call(o.module,t)}},r.prototype.emitTo=function(t,e){t.endPoint.call(t.module,e)}},{"./Connector":5,"./connectors":14}],7:[function(t,e,o){function n(){this._events={}}e.exports=n,n.listenerCount=function(t,e){var o=t._events[e];return o?o.length:0},n.prototype.on=function(t,e){if("function"!=typeof e)throw new TypeError("Tried to register non-function as event handler: "+t);var o=this._events,n=o[t];return void 0===n?o[t]=[e]:n.push(e),this},n.prototype.addListener=n.prototype.on,n.prototype.once=function(t,e){return e.once?e.once+=1:e.once=1,this.on(t,e)},n.prototype.removeListener=function(t,e){var o=this._events[t];if(void 0!==o){var n=o.indexOf(e);if(n===-1)return console.warn("No event listener registered",t,e),this;o.splice(n,1),0===o.length&&delete this._events[t]}return this},n.prototype.off=n.prototype.removeListener,n.prototype.removeAllListeners=function(t){return t?delete this._events[t]:this._events={},this},n.prototype.hasListeners=function(t){return void 0!==this._events[t]},n.prototype.listeners=function(t){var e=this._events[t];return void 0!==e?e.slice():[]},n.prototype.emit=function(t){var e=this._events[t];if(void 0===e)return!1;e=e.slice();for(var o=!1,n=[],i=1;i<arguments.length;i++)n.push(arguments[i]);for(var i=0,r=e.length;i<r;i++){var s=e[i];s.apply(this,n),o=!0,s.once&&(s.once>1?s.once--:delete s.once,this.removeListener(t,s))}return o}},{}],8:[function(t,e,o){function n(t,e,o){this.value=0,this.x=o.x,this.y=o.y,this.min=o.min||0,this.max=void 0!==o.max?o.max:1,this.int=o.int||!1,this.initGUI(t,e,o),this.bind(t,e,o)}var i=t("./utils").map;n.prototype.bind=function(t,e,o){this.id=e,this.module=t,this.valueId=o.value||"value",this.endPoint=t;var n=o.endPoint;if(n){n=n.split(".");for(var i=0;i<n.length;i++)this.endPoint=this.endPoint[n[i]]}this.initValue()},n.prototype.initValue=function(){var t=this.endPoint[this.valueId];void 0===t&&(t=0),this.value=i(t,this.min,this.max,-68,68),this.updateGUI()},n.prototype.updateValue=function(){var t=i(this.value,-68,68,this.min,this.max);this.int&&(t=~~Math.round(t)),this.endPoint[this.valueId]=t,this.displayValue(t)},n.prototype.getState=function(){return this.value},n.prototype.setState=function(t){this.value=t,this.updateValue(),this.updateGUI()},n.prototype.initGUI=function(t,e,o){},n.prototype.updateGUI=function(){},n.prototype.displayValue=function(t){},e.exports=n},{"./utils":17}],9:[function(t,e,o){function n(t){var e=t.data,o=e[0];if(!(o>=240)){var n=(240&o)>>4,i=MIDI_MESSAGE_TYPES[n];if(i){var r=15&o,s=e[1],u=e[2],c={_type:"midi message",channel:r,midiType:i};switch(i){case"note on":case"note off":c.note=s,c.velocity=u;break;case"control change":c.control=s,c.value=u;break;default:c.data1=s,c.data2=u}a.emit("message",c)}}}function i(t){console.error("requestMIDIAccess failed",t)}function r(t){for(var e=t.inputs.values(),o=e.next();o&&!o.done;o=e.next())o.value.onmidimessage=n}var s=t("./EventEmitter");MIDI_MESSAGE_TYPES={8:"note off",9:"note on",10:"aftertouch",11:"control change",12:"program change",13:"channel pressure",14:"pitch bend"};var a=new s,u=!1;e.exports=a,a.open=function(){u||(u=!0,navigator.requestMIDIAccess({sysex:!1}).then(r,i))}},{"./EventEmitter":7}],10:[function(t,e,o){function n(){if(this.patch=null,this.id=null,this.x=null,this.y=null,this.cables={},this.initGUI(),this.createInterface(),arguments.length){this._arguments=[];for(var t=0;t<arguments.length;t++){var e=arguments[t];e.serialize?this._arguments.push(e.serialize()):this._arguments.push(e)}}}var i=t("./connectors"),r={knob:t("./Knob"),button:t("./Button")};n.prototype.descriptor={},n.prototype.createInterface=function(){if(this.descriptor.inputs)for(var t in this.descriptor.inputs){var e=this.descriptor.inputs[t],o=i.getConnector("input",e.type);o&&(this["$"+t]=new o(this,t,e))}if(this.descriptor.outputs)for(var t in this.descriptor.outputs){var n=this.descriptor.outputs[t],o=i.getConnector("output",n.type);o&&(this["$"+t]=new o(this,t,n))}if(this.descriptor.controls)for(var t in this.descriptor.controls){var s=this.descriptor.controls[t],a=r[s.type];this["$$"+t]=new a(this,t,s)}},n.prototype.rebind=function(){if(this.descriptor.inputs)for(var t in this.descriptor.inputs)this["$"+t]&&this["$"+t].bind(this,t,this.descriptor.inputs[t]);if(this.descriptor.outputs)for(var t in this.descriptor.outputs)this["$"+t]&&this["$"+t].bind(this,t,this.descriptor.outputs[t]);if(this.descriptor.controls)for(var t in this.descriptor.controls)this["$$"+t]&&this["$$"+t].bind(this,t,this.descriptor.controls[t])},n.prototype.setPosition=function(t,e){this.x=t,this.y=e},n.prototype.remove=function(){for(var t in this.cables)this.patch.removeCable(this.cables[t])},n.prototype.addCable=function(t){this.cables[t.id]=t},n.prototype.removeCable=function(t){delete this.cables[t.id]},n.prototype.getState=function(){var t={_type:this.descriptor.type,id:this.id,x:this.x,y:this.y};if(this._arguments&&(t.arguments=this._arguments),this.descriptor.controls){t.controls={};for(var e in this.descriptor.controls)this["$$"+e].getState&&(t.controls[e]=this["$$"+e].getState())}var o=this.descriptor.persistent;if(o){t.persistent=[];for(var n=0;n<o.length;n++)t.persistent.push(this[o[n]])}return t},n.prototype.setState=function(t){if(t.controls)for(var e in this.descriptor.controls)t.controls[e]&&this["$$"+e].setState(t.controls[e]);if(t.persistent)for(var o=0;o<this.descriptor.persistent.length;o++){var e=this.descriptor.persistent[o];this[e]=t.persistent[o]}},n.prototype.initGUI=function(){},n.prototype.select=function(){},n.prototype.deselect=function(){},n.prototype.setTitle=function(){},n.prototype.setColor=function(){},n.prototype.setBorder=function(){},n.prototype.addClassName=function(){},e.exports=n},{"./Button":3,"./Knob":8,"./connectors":14}],11:[function(t,e,o){function n(t,e,o){this.connections=[],a.call(this,t,e,o)}function i(t,e,o){this.endPoint=t,this.min=void 0===o.min?0:o.min,this.max=void 0===o.max?1:o.max,n.call(this,t,e,o)}function r(t,e,o){n.call(this,t,e,o)}var s=t("./connectors"),a=t("./Connector");inherits(n,a),n.prototype.color="#2da8ff",n.prototype.type="param",n.prototype.connect=function(t){a.prototype.connect.call(this,t),this._addConnection(t),t._addConnection(this)},n.prototype.disconnect=function(t){a.prototype.disconnect.call(this,t),this._removeConnection(t),t._removeConnection(this)},n.prototype._addConnection=function(t){this.connections.push(t)},n.prototype._removeConnection=function(t){var e=this.connections.indexOf(t);e!==-1&&this.connections.splice(e,1)},inherits(i,n),i.prototype.cssClassName="paramIn",i.prototype.way="input",s.register(i,"input","param"),i.prototype.bind=function(t,e,o){var n=o.endPoint.split(".");this.endPoint=t;for(var i=0;i<n.length;i++)this.endPoint=this.endPoint[n[i]];var r=this.connections;this.connections=[];for(var i=r.length-1;i>=0;i--)this.connect(r[i])},i.prototype.isCompatible=function(t){return"audio"===t.type&&"output"===t.way||n.prototype.isCompatible.call(this,t)},i.prototype.connect=function(t){n.prototype.connect.call(this,t),"audio"===t.type&&"output"===t.way&&t.endPoint.connect(this.endPoint)},inherits(r,n),r.prototype.cssClassName="paramOut",r.prototype.way="output",s.register(r,"output","param"),r.prototype.setAutomation=function(t){for(var e=this.connections,o=0;o<e.length;o++){var n=e[o];t(n.endPoint,n.min,n.max)}}},{"./Connector":5,"./connectors":14}],12:[function(t,e,o){function n(){this._idCount=0,this.modules={},this.cables={},this.grid=[[]]}function i(t,e){function o(){return t.apply(this,e)}return o.prototype=t.prototype,new o}var r=t("./Cable"),s=t("./modules"),a=t("../data/dataTypes");n.prototype.addModule=function(t,e){for(void 0===e?e=this._idCount++:this.modules[e]&&console.error("Provided id is already used.");this.modules[e];)e=this._idCount++;return t.id=e,t.patch=this,this.modules[e]=t,t},n.prototype.removeModule=function(t){function e(e){var o=e.indexOf(t);return o===-1?console.error("Module not found."):void e.splice(o,1)}delete this.modules[t.id],t.id<this._idCount&&(this._idCount=t.id),e(this.grid[t.x]),t.remove()},n.prototype.disconnect=function(t){for(var e=this.findCables(t),o=0;o<e.length;o++)this.removeCable(e[o])},n.prototype.findCables=function(t){var e=t.module.id+":"+t.id,o=[];for(var n in this.cables){var i=n.split("--");i[0]!==e&&i[1]!==e||o.push(this.cables[n])}return o},n.prototype.areConnected=function(t,e){var o=t.module.id+":"+t.id,n=e.module.id+":"+e.id;return this.cables[o+"--"+n]||this.cables[n+"--"+o]},n.prototype.addCable=function(t,e,o){if(!this.areConnected(t,e)){var n=new r(t,e,o);this.cables[n.id]=n}},n.prototype.removeCable=function(t){this.cables[t.id]&&(t.disconnect(),delete this.cables[t.id])},n.prototype.clearPatch=function(){for(var t in this.cables)this.removeCable(this.cables[t]);for(var t in this.modules)this.removeModule(this.modules[t]);this._idCount=0},n.prototype.getPatch=function(){var t={_type:"modularPatch",version:1,modules:[],cables:[]};for(var e in this.modules)t.modules.push(this.modules[e].getState());for(var e in this.cables)t.cables.push(e);return t},n.prototype.setPatch=function(t){if(!t||"modularPatch"===!t._type)return console.error("Wrong format");this.clearPatch();for(var e=t.modules||[],o=0;o<e.length;o++){var n=e[o],r=s.getModuleConstructor(n._type);if(r){var u;if(n.arguments){for(var c=n.arguments,p=0;p<c.length;p++)c[p]=a.deserialize(c[p]);u=i(r,c)}else u=new r;this.addModule(u,n.id),this._addModuleInGrid(u,n.x,n.y),u.setState(n)}else console.error("Could not create module of type",n._type)}for(var l=t.cables||[],o=0;o<l.length;o++){var d=l[o];connections=d.split("--"),connectionA=connections[0].split(":"),connectionB=connections[1].split(":"),moduleA=this.modules[connectionA[0]],moduleB=this.modules[connectionB[0]],connectorA=moduleA["$"+connectionA[1]],connectorB=moduleB["$"+connectionB[1]],connectorA.connect(connectorB)}},n.prototype._addModuleInGrid=function(t,e,o){e=e||0,o=o||1,this.grid[e]||(this.grid[e]=[]);for(var n=this.grid[e],i=(t.descriptor.size,0),r=o;i<n.length;i++){var s=n[i];if(s.y<o&&s.y+s.descriptor.size>=o){r=s.y+s.descriptor.size,i++;break}if(s.y>=o)break}t.setPosition(e,r),n.splice(i,0,t),r+=t.descriptor.size;for(var a=i+1;a<n.length;a++){var s=n[a];if(s.y>=r)break;s.setPosition(s.x,r),r+=s.descriptor.size}},n.prototype.moveModule=function(t,e,o){if(null!==t.x){var n=this.grid[t.x],i=n.indexOf(t);if(i===-1)return console.error("Module not found in grid.");n.splice(i,1)}this._addModuleInGrid(t,e,o)},e.exports=n},{"../data/dataTypes":20,"./Cable":4,"./modules":16}],13:[function(t,e,o){var n=window.AudioContext||window.webkitAudioContext,i=new n;e.exports=i},{}],14:[function(t,e,o){connectors={input:{},output:{}},o.register=function(t,e,o){connectors[e]&&(connectors[e][o]=t)},o.getConnector=function(t,e){if(connectors[t])return connectors[t][e]},t("./AudioConnector"),t("./EventConnector"),t("./ParamConnector")},{"./AudioConnector":1,"./EventConnector":6,"./ParamConnector":11}],15:[function(t,e,o){var n=t("./audioContext");e.exports=function(t,e){var o=new XMLHttpRequest;o.responseType="arraybuffer",o.onreadystatechange=function(){if(4===~~o.readyState)return 200!==~~o.status&&0!==~~o.status?e("xhrError:"+o.status):void n.decodeAudioData(o.response,function(t){return e(null,t)},e)},o.open("GET",t,!0),o.send()}},{"./audioContext":13}],16:[function(t,e,o){var n={};o.add=function(t){var e=t.prototype.descriptor;n[e.type]=t},o.getModuleConstructor=function(t){return n[t]},o.getList=function(){return n}},{}],17:[function(t,e,o){o.map=function(t,e,o,n,i){return n+(i-n)*(t-e)/(o-e)}},{}],18:[function(t,e,o){function n(t,e){this.id=t,this.buffer=void 0,this.uri=e.uri,this.loop=e.loop||!1,this.ir=e.ir||!1,this.start=e.start||0,this.end=e.end||0,this.tag=e.tag||[]}var i=t("../core/loadAudioBuffer");n.deserialize=function(t){return new n(t.id,t)},n.prototype.serialize=function(){return{_type:"BufferData",id:this.id,uri:this.uri,loop:this.loop,ir:this.ir,start:this.start,end:this.end,tag:this.tag}},n.prototype.loadAudioBuffer=function(t){if(this.buffer)return window.setTimeout(t,0);var e=this;i(this.uri,function(o,n){return o?t(o):(e.buffer=n,t())})},e.exports=n},{"../core/loadAudioBuffer":15}],19:[function(t,e,o){function n(t,e){this.id=t,this.buffer=void 0,this.synthesizer=e.synthesizer,this.params=e.params,this.loop=e.loop||!1,this.ir=e.ir||!1,this.start=e.start||0,this.end=e.end||0,this.tag=e.tag||[]}var i=t("../synthesizers");n.deserialize=function(t){return new n(t.id,t)},n.prototype.type="ProceduralBuffer",n.prototype.serialize=function(){return{_type:"ProceduralBuffer",id:this.id,synthesizer:this.synthesizer,params:this.params,loop:this.loop,ir:this.ir,start:this.start,end:this.end,tag:this.tag}},n.prototype.loadAudioBuffer=function(t){if(this.buffer)return window.setTimeout(t,0);var e=i.getSynth(this.synthesizer);return e?void e.generate(this,t):void window.setTimeout(function(){t("Synthesizer "+this.synthesizer+" does not exists.")},0)},e.exports=n},{"../synthesizers":49}],20:[function(t,e,o){function n(t){var e=t._type,o=i[e];return o?o.deserialize(t):t}var i={BufferData:t("./BufferData"),ProceduralBuffer:t("./ProceduralBuffer")};o.deserialize=n,o.initializeDatabase=function(t){for(var e in t){var o=t[e];o.id||(o.id=e),t[e]=n(o)}}},{"./BufferData":18,"./ProceduralBuffer":19}],21:[function(t,e,o){window.inherits=function(t,e){t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})},t("./modules/index.js"),t("./data/dataTypes.js"),window.MODULAR={Patch:t("./core/Patch")}},{"./core/Patch":12,"./data/dataTypes.js":20,"./modules/index.js":47}],22:[function(t,e,o){function n(){this.node=i.createGain(),this.node.gain.value=0,r.call(this)}var i=t("../core/audioContext"),r=t("../core/Module");inherits(n,r),n.prototype.descriptor={type:"Amp",name:"Amp",size:2,inputs:{IN:{type:"audio",x:0,y:1,endPoint:"node",label:"IN"},MOD:{type:"param",x:3.5,y:0,endPoint:"node.gain",label:"MOD"}},outputs:{OUT:{type:"audio",x:3.5,y:1,endPoint:"node",label:"OUT"}}},e.exports=n},{"../core/Module":10,"../core/audioContext":13}],23:[function(t,e,o){function n(){this.data=null,this.duration=5,this.timeout=null,i.call(this),this.scheduleNext()}var i=t("../core/Module");inherits(n,i),n.prototype.onDataIn=function(t){this.data=t},n.prototype.scheduleNext=function(){var t=this;this.timeout=window.setTimeout(function(){t.$OUT.emit(this.data),t.scheduleNext()},1e3*this.duration)},n.prototype.remove=function(){null!==this.timeout&&(window.clearTimeout(this.timeout),this.timeout=null),i.prototype.remove.call(this)},n.prototype.descriptor={type:"AutoBang",name:"AutoBang",size:2,inputs:{IN:{type:"event",x:0,y:1,label:"DATA",endPoint:"onDataIn"}},outputs:{OUT:{type:"event",x:2.3,y:1}},controls:{duration:{type:"knob",x:4,y:.1,min:1,max:10,value:"duration"}}},e.exports=n},{"../core/Module":10}],24:[function(t,e,o){function n(){this.gainA=i.createGain(),this.gainB=i.createGain(),this.mix=i.createGain(),this.gainA.connect(this.mix),this.gainB.connect(this.mix),this.duration=5,this.channel=!1,this.gainA.gain.value=1,this.gainB.gain.value=0,r.call(this)}var i=t("../core/audioContext"),r=t("../core/Module");inherits(n,r),n.prototype.trigger=function(){var t=i.currentTime;this.channel=!this.channel;var e=this.gainA.gain.value,o=this.gainB.gain.value,n=this.channel?0:1,r=this.channel?1:0;this.gainA.gain.cancelScheduledValues(0),this.gainB.gain.cancelScheduledValues(0),this.gainA.gain.setValueAtTime(e,t),this.gainA.gain.linearRampToValueAtTime(n,t+this.duration),this.gainB.gain.setValueAtTime(o,t),this.gainB.gain.linearRampToValueAtTime(r,t+this.duration)},n.prototype.descriptor={type:"AutoXFade",name:"AutoXFade",size:4,inputs:{A:{type:"audio",x:0,y:.8,endPoint:"gainA",label:"A"},B:{type:"audio",x:0,y:1.8,endPoint:"gainB",label:"B"},TRG:{type:"event",x:0,y:3.2,endPoint:"trigger",label:"TRG"}},outputs:{OUT:{type:"audio",x:3.5,y:3.2,endPoint:"mix",label:"OUT"}},controls:{duration:{type:"knob",x:2.2,y:.8,min:.5,max:20,endPoint:null,value:"duration",label:"TIME"},volume:{type:"knob",x:4.2,y:.8,min:0,max:1,endPoint:"mix.gain",value:"value",label:"VOL"}}},e.exports=n},{"../core/Module":10,"../core/audioContext":13}],25:[function(t,e,o){function n(){i.call(this),this.data=null}var i=t("../core/Module");inherits(n,i),n.prototype.onDataIn=function(t){this.data=t},n.prototype.pushButton=function(){this.$OUT.emit(this.data)},n.prototype.descriptor={type:"Bang",name:"Bang",size:2,inputs:{IN:{type:"event",x:3.5,y:0,label:"DATA",endPoint:"onDataIn"}},outputs:{OUT:{type:"event",x:3.5,y:1,label:"OUT"}},controls:{BTN:{type:"button",x:1.8,y:.1,endPoint:"pushButton"}}},e.exports=n},{"../core/Module":10}],26:[function(t,e,o){function n(){this.buffer=null,r.call(this)}var i=t("../core/audioContext"),r=t("../core/Module");inherits(n,r),n.prototype.setBuffer=function(t){if("buffer"===t._type){for(var e=t.buffer.buffer,o=e.numberOfChannels,n=e.sampleRate,r=t.buffer.start*n,s=e.length-r,a=i.createBuffer(o,s,n),u=0;u<o;u++)e.copyFromChannel(a.getChannelData(u),u,r);this.buffer={buffer:a,start:0,end:0,loop:!1},this.$data.emit({_type:"buffer",buffer:this.buffer})}},n.prototype.onConnect=function(t){this.buffer&&this.$data.emitTo(t,{_type:"buffer",buffer:this.buffer})},n.prototype.descriptor={type:"BufferTrim",name:"BufferTrim",size:2,inputs:{buffer:{type:"event",x:0,y:1,endPoint:"setBuffer",label:"BUF",singleConnection:!0}},outputs:{data:{type:"event",x:3,y:1,label:"TRIM",onConnect:"onConnect"}},controls:{}},e.exports=n},{"../core/Module":10,"../core/audioContext":13}],27:[function(t,e,o){function n(){this.node=i,r.call(this)}var i=t("../core/audioContext"),r=t("../core/Module");inherits(n,r),n.prototype.descriptor={type:"Context",name:"Context",size:1,inputs:{DEST:{type:"audio",x:3,y:0,endPoint:"node.destination",label:"DEST"}}},e.exports=n},{"../core/Module":10,"../core/audioContext":13}],28:[function(t,e,o){function n(){this.channel=0,this.control=0,this.learn=!1,this.glide=.1,r.call(this),this._setTitle()}var i=t("../core/audioContext"),r=t("../core/Module"),s=t("../core/utils").map;inherits(n,r),n.prototype.onMessage=function(t){if("midi message"===t._type&&"control change"===t.midiType){if(this.learn)return this.channel=t.channel,this.control=t.control,this.learn=!1,this.setBorder(""),void this._setTitle();if(t.channel===this.channel&&t.control===this.control){var e=i.currentTime,o=this.glide,n=s(t.value,0,127,0,1);this.$OUT.setAutomation(function(t,i,r){t.cancelScheduledValues(0),t.setValueAtTime(t.value,e),t.linearRampToValueAtTime(s(n,0,1,i,r),e+o)})}}},n.prototype.midiLearn=function(){this.learn=!0,this.setBorder("#F00")},n.prototype._setTitle=function(){this.setTitle("CC#"+this.channel+":"+this.control)},n.prototype.setState=function(t){r.prototype.setState.call(this,t),this._setTitle()},n.prototype.descriptor={type:"ControlChange",name:"Control Change",size:3,inputs:{IN:{type:"event",x:0,y:1,label:"IN",endPoint:"onMessage"}},outputs:{OUT:{type:"param",x:0,y:2,label:"OUT"}},controls:{glide:{type:"knob",x:4,y:.5,min:0,max:1,endPoint:"",value:"glide",label:"GLID"},midiLearn:{type:"button",x:2.3,y:1,endPoint:"midiLearn"}},persistent:["channel","control"]},e.exports=n},{"../core/Module":10,"../core/audioContext":13,"../core/utils":17}],29:[function(t,e,o){function n(){this.node=i.createConvolver(),this.bufferData=null,r.call(this)}var i=t("../core/audioContext"),r=t("../core/Module");inherits(n,r),n.prototype.setBuffer=function(t){if("buffer"===t._type){this.bufferData&&(this.node.disconnect(),this.node=i.createConvolver(),this.bufferData=null,this.rebind()),this.bufferData=t.buffer;var e=this.bufferData.buffer;this.node.buffer=e}},n.prototype.descriptor={type:"Convolver",name:"Convolver",size:3,inputs:{IN:{type:"audio",x:3,y:1,endPoint:"node",label:"IN"},buffer:{type:"event",x:0,y:1,endPoint:"setBuffer",label:"BUF"}},outputs:{OUT:{type:"audio",x:3,y:2,endPoint:"node",label:"OUT"}},controls:{}},e.exports=n},{"../core/Module":10,"../core/audioContext":13}],30:[function(t,e,o){function n(){this.node=i.createDelay(1),r.call(this)}var i=t("../core/audioContext"),r=t("../core/Module");inherits(n,r),n.prototype.descriptor={type:"Delay",name:"Delay",size:3,inputs:{IN:{type:"audio",x:0,y:1,endPoint:"node",label:"IN"}},outputs:{OUT:{type:"audio",x:3.6,y:1,endPoint:"node",label:"OUT"}},controls:{delay:{type:"knob",x:2,y:.3,min:.01,max:1,endPoint:"node.delayTime",value:"value",label:"TIME"}}},e.exports=n},{"../core/Module":10,"../core/audioContext":13}],31:[function(t,e,o){function n(){r.call(this)}var i=t("../core/audioContext"),r=t("../core/Module");inherits(n,r),n.prototype.onTrigger=function(){var t=i.currentTime,e=1,o=1,n=2;this.$OUT.setAutomation(function(i,r,s){var a=i.value;i.cancelScheduledValues(0),i.setValueAtTime(a,t),i.linearRampToValueAtTime(s,t+e),i.setValueAtTime(s,t+e+o),i.linearRampToValueAtTime(r,t+e+o+n)})},n.prototype.descriptor={type:"Envelope",name:"Envelope",size:2,inputs:{TRG:{type:"event",x:0,y:1,label:"TRG",endPoint:"onTrigger"}},outputs:{OUT:{type:"param",x:3.5,y:1,label:"OUT"}},controls:{}},e.exports=n},{"../core/Module":10,"../core/audioContext":13}],32:[function(t,e,o){function n(){this.target=.5,this.duration=4,r.call(this)}var i=t("../core/audioContext"),r=t("../core/Module"),s=t("../core/utils").map;inherits(n,r),n.prototype.onTrigger=function(){var t=i.currentTime,e=this.target,o=this.duration;this.$OUT.setAutomation(function(n,i,r){var a=n.value;n.cancelScheduledValues(0),n.setValueAtTime(a,t),n.linearRampToValueAtTime(s(e,0,1,i,r),t+o)})},n.prototype.descriptor={type:"Fade",name:"Fade",size:3,inputs:{TRG:{type:"event",x:0,y:1,label:"TRG",endPoint:"onTrigger"}},outputs:{OUT:{type:"param",x:0,y:2,label:"ENV"}},controls:{target:{type:"knob",x:2.1,y:.3,min:0,max:1,value:"target",label:"TO"},duration:{type:"knob",x:4,y:.3,min:.1,max:20,value:"duration",label:"TIME"}}},e.exports=n},{"../core/Module":10,"../core/audioContext":13,"../core/utils":17}],33:[function(t,e,o){function n(){this.node=i.createBiquadFilter(),this._filterType=0,this.node.type=s[this._filterType].id,r.call(this),this.$$type.setTitle(s[this._filterType].caption)}var i=t("../core/audioContext"),r=t("../core/Module"),s=[{id:"lowpass",caption:"LP"},{id:"highpass",caption:"HP"},{id:"bandpass",caption:"BP"}];inherits(n,r),n.prototype.switchType=function(){this.filterType+=1},Object.defineProperty(n.prototype,"filterType",{get:function(){return this._filterType},set:function(t){this._filterType=t%s.length,this.node.type=s[this._filterType].id,this.$$type.setTitle(s[this._filterType].caption)}}),n.prototype.descriptor={type:"Filter",name:"Filter",size:4,inputs:{IN:{type:"audio",x:.5,y:3,endPoint:"node",label:"IN"}},outputs:{OUT:{type:"audio",x:3,y:3,endPoint:"node",label:"OUT"}},controls:{cut:{type:"knob",x:2,y:.3,min:10,max:8e3,endPoint:"node.frequency",value:"value",label:"CUT"},res:{type:"knob",x:4,y:.3,min:0,max:40,endPoint:"node.Q",value:"value",label:"REZ"},type:{type:"button",x:.2,y:1.2,endPoint:"switchType"}},persistent:["filterType"]},e.exports=n},{"../core/Module":10,"../core/audioContext":13}],34:[function(t,e,o){function n(){i.call(this)}var i=(t("../core/audioContext"),t("./Filter"));inherits(n,i),n.prototype.descriptor={type:"FilterMod",name:"FilterMod",size:3,inputs:{IN:{type:"audio",x:2.2,y:1,endPoint:"node",label:"IN"},CUT:{type:"param",x:0,y:1,endPoint:"node.frequency",label:"CUT",min:10,max:8e3},RES:{type:"param",x:0,y:2,endPoint:"node.Q",label:"RES",min:0,max:40}},outputs:{OUT:{type:"audio",x:2.2,y:2,endPoint:"node",label:"OUT"}},controls:{type:{type:"button",x:4.2,y:1.1,endPoint:"switchType"}},persistent:["filterType"]},e.exports=n},{"../core/audioContext":13,"./Filter":33}],35:[function(t,e,o){function n(){this.node=i.createGain(),r.call(this)}var i=t("../core/audioContext"),r=t("../core/Module");inherits(n,r),n.prototype.descriptor={type:"Gain",name:"Gain x100",size:3,inputs:{IN:{type:"audio",x:3.5,y:.2,endPoint:"node",label:"IN"}},outputs:{OUT:{type:"audio",x:3.5,y:2,endPoint:"node",label:"OUT"}},controls:{gain:{type:"knob",x:1.5,y:.5,min:1,max:100,endPoint:"node.gain",value:"value",label:"GAIN"}}},e.exports=n},{"../core/Module":10,"../core/audioContext":13}],36:[function(t,e,o){function n(){this._waveType=0,this.node=i.createOscillator(),this.node.frequency.value=2,this.node.type=WAVEFORM_TYPE_ENUM[this._waveType].id,this.node.start(),r.call(this),this.$$type.setTitle(WAVEFORM_TYPE_ENUM[this._waveType].caption)}var i=t("../core/audioContext"),r=t("../core/Module");WAVEFORM_TYPE_ENUM=[{id:"sine",caption:"sin"},{id:"square",caption:"sqr"},{id:"sawtooth",caption:"saw"},{id:"triangle",caption:"tri"}],inherits(n,r),n.prototype.switchType=function(){this.waveform+=1},Object.defineProperty(n.prototype,"waveform",{get:function(){return this._waveType},set:function(t){this._waveType=t%WAVEFORM_TYPE_ENUM.length,this.node.type=WAVEFORM_TYPE_ENUM[this._waveType].id,this.$$type.setTitle(WAVEFORM_TYPE_ENUM[this._waveType].caption)}}),n.prototype.descriptor={type:"LFO",name:"LFO",size:3,inputs:{},outputs:{OUT:{type:"audio",x:5,y:1,endPoint:"node",label:null}},controls:{frequency:{type:"knob",x:2.5,y:.3,min:.001,max:10,endPoint:"node.frequency",value:"value",label:"FREQ"},type:{type:"button",x:.2,y:1.2,endPoint:"switchType"}},persistent:["waveform"]},e.exports=n},{"../core/Module":10,"../core/audioContext":13}],37:[function(t,e,o){function n(){i.call(this),r.open();var t=this;this.onMessage=function(e){t.$OUT.emit(e)},r.on("message",this.onMessage)}var i=t("../core/Module"),r=t("../core/MIDI");inherits(n,i),n.prototype.remove=function(){r.removeListener("message",this.onMessage),i.prototype.remove.call(this)},n.prototype.descriptor={type:"MidiIn",name:"MidiIn",size:1,inputs:{},outputs:{OUT:{type:"event",x:5,y:0}},controls:{}},e.exports=n},{"../core/MIDI":9,"../core/Module":10}],38:[function(t,e,o){function n(){this.node=i.createDelay(1),r.call(this)}var i=t("../core/audioContext"),r=t("../core/Module");inherits(n,r),n.prototype.descriptor={type:"ModDelay",name:"ModDelay",size:2,inputs:{time:{type:"param",x:0,y:1,endPoint:"node.delayTime",label:"TIME"},IN:{type:"audio",x:3.6,y:0,endPoint:"node",label:"IN"}},outputs:{OUT:{type:"audio",x:3.6,y:1,endPoint:"node",label:"OUT"}},controls:{}},
  e.exports=n},{"../core/Module":10,"../core/audioContext":13}],39:[function(t,e,o){function n(){this.node=i.createStereoPanner(),r.call(this)}var i=t("../core/audioContext"),r=t("../core/Module");inherits(n,r),n.prototype.descriptor={type:"ModPanner",name:"ModPan",size:2,inputs:{IN:{type:"audio",x:3.5,y:0,endPoint:"node",label:"IN"},pan:{type:"param",x:0,y:1,endPoint:"node.pan",label:"PAN"}},outputs:{OUT:{type:"audio",x:3.5,y:1,endPoint:"node",label:"OUT"}}},e.exports=n},{"../core/Module":10,"../core/audioContext":13}],40:[function(t,e,o){function n(){i.call(this)}var i=t("../core/Module"),r=60;inherits(n,i),n.prototype.onEvent=function(t){if("midi message"===t._type&&"note on"===t.midiType){var e=t.note-r;t.playbackRate=Math.pow(2,e/12),this.$OUT.emit(t)}},n.prototype.descriptor={type:"noteOnFilter",name:"noteOn",size:1,inputs:{IN:{type:"event",x:4,y:0,endPoint:"onEvent"}},outputs:{OUT:{type:"event",x:5,y:0}},controls:{}},e.exports=n},{"../core/Module":10}],41:[function(t,e,o){function n(){this.node=i.createGain(),this.bufferData=null,r.call(this)}var i=t("../core/audioContext"),r=t("../core/Module");inherits(n,r),n.prototype.setBuffer=function(t){"buffer"===t._type&&(this.bufferData=t.buffer)},n.prototype.trigger=function(t){if(this.bufferData){var e=i.createBufferSource();e.connect(this.node),e.buffer=this.bufferData.buffer,t.playbackRate&&(e.playbackRate.value=t.playbackRate);var o=t.offset||0;e.start(0,o)}},n.prototype.descriptor={type:"OneShotSampler",name:"OneShot",size:3,inputs:{buffer:{type:"event",x:0,y:1,endPoint:"setBuffer",label:"BUF"},trigger:{type:"event",x:0,y:2,endPoint:"trigger",label:"TRIG"}},outputs:{OUT:{type:"audio",x:5,y:2,endPoint:"node"}},controls:{volume:{type:"knob",x:2.8,y:.5,min:0,max:1,endPoint:"node.gain",value:"value",label:"VOL"}}},e.exports=n},{"../core/Module":10,"../core/audioContext":13}],42:[function(t,e,o){function n(){this.node=i.createOscillator(),this.node.frequency.value=220,this.node.start(),r.call(this)}var i=t("../core/audioContext"),r=t("../core/Module");inherits(n,r),n.prototype.descriptor={type:"Oscillator",name:"Oscillator",size:3,inputs:{detune:{type:"param",x:0,y:1,endPoint:"node.detune",label:"DTN"}},outputs:{OUT:{type:"audio",x:0,y:2,endPoint:"node",label:"OUT"}},controls:{frequency:{type:"knob",x:3.7,y:.3,min:110,max:880,endPoint:"node.frequency",value:"value",label:"FREQ"}}},e.exports=n},{"../core/Module":10,"../core/audioContext":13}],43:[function(t,e,o){function n(){this.node=i.createStereoPanner(),r.call(this)}var i=t("../core/audioContext"),r=t("../core/Module");inherits(n,r),n.prototype.descriptor={type:"Panner",name:"Pan",size:2,inputs:{IN:{type:"audio",x:3.5,y:0,endPoint:"node",label:"IN"}},outputs:{OUT:{type:"audio",x:3.5,y:1,endPoint:"node",label:"OUT"}},controls:{pan:{type:"knob",x:1.5,y:0,min:-1,max:1,endPoint:"node.pan",value:"value"}}},e.exports=n},{"../core/Module":10,"../core/audioContext":13}],44:[function(t,e,o){function n(){this.node=i.createBufferSource(),this.bufferData=null,r.call(this)}var i=t("../core/audioContext"),r=t("../core/Module");inherits(n,r),n.prototype.setBuffer=function(t){if("buffer"===t._type){if(this.bufferData){var e=this.node.playbackRate.value;this.node.disconnect(),this.node=i.createBufferSource(),this.bufferData=null,this.node.playbackRate.value=e,this.rebind()}this.bufferData=t.buffer;var o=this.bufferData.buffer,n=this.bufferData.loop||!1;if(this.node.buffer=o,this.node.loop=n,n){var r=this.bufferData.start||0,s=this.bufferData.end||o.duration;s<0&&(s=o.duration+s),s<0&&(s=0),this.node.loopStart=r,this.node.loopEnd=s}this.node.start()}},n.prototype.descriptor={type:"Sampler",name:"Sampler",size:3,inputs:{buffer:{type:"event",x:0,y:1,endPoint:"setBuffer",label:"BUF"}},outputs:{OUT:{type:"audio",x:0,y:2,endPoint:"node",label:"OUT"}},controls:{rate:{type:"knob",x:3.7,y:.3,min:.01,max:2,endPoint:"node.playbackRate",value:"value",label:"RATE"}}},e.exports=n},{"../core/Module":10,"../core/audioContext":13}],45:[function(t,e,o){function n(){i.call(this)}var i=t("../core/Module");inherits(n,i),n.prototype.doStuff=function(t){"color"===t._type&&(this.setTitle("#"+t.hex),this.setColor("#"+t.hex))},n.prototype.onConnect=function(t){console.log("module has connected",this,t)},n.prototype.pushButton=function(){var t=("000"+(~~(4096*Math.random())).toString(16)).substr(-3);this.$B.emit({_type:"color",hex:t})},n.prototype.descriptor={type:"TestModule",name:"TestModule",size:5,inputs:{A:{type:"event",x:.2,y:1,label:"A",endPoint:"doStuff"}},outputs:{B:{type:"event",x:3.2,y:1,label:"B",onConnect:"onConnect"}},controls:{a:{type:"knob",x:.1,y:2.3,label:"KNB"},b:{type:"knob",x:2.1,y:2.3,label:"KNB"},c:{type:"button",x:4.1,y:2.3,label:"BTN",endPoint:"pushButton"}}},e.exports=n},{"../core/Module":10}],46:[function(t,e,o){function n(){this.node=i.createGain(),r.call(this)}var i=t("../core/audioContext"),r=t("../core/Module");inherits(n,r),n.prototype.descriptor={type:"Volume",name:"Volume",size:3,inputs:{IN:{type:"audio",x:3.5,y:.2,endPoint:"node",label:"IN"}},outputs:{OUT:{type:"audio",x:3.5,y:2,endPoint:"node",label:"OUT"}},controls:{volume:{type:"knob",x:1.5,y:.5,min:0,max:1,endPoint:"node.gain",value:"value",label:"VOL"}}},e.exports=n},{"../core/Module":10,"../core/audioContext":13}],47:[function(t,e,o){var n=t("../core/modules");n.add(t("../core/Buffer")),n.add(t("./TestModule")),n.add(t("./Bang")),n.add(t("./AutoBang")),n.add(t("./MidiIn")),n.add(t("./NoteOnFilter")),n.add(t("./ControlChange")),n.add(t("./Oscillator")),n.add(t("./BufferTrim")),n.add(t("./LFO")),n.add(t("./Envelope")),n.add(t("./Fade")),n.add(t("./AutoXFade")),n.add(t("./Amp")),n.add(t("./Gain")),n.add(t("./Panner")),n.add(t("./ModPanner")),n.add(t("./Sampler")),n.add(t("./OneShotSampler")),n.add(t("./Filter")),n.add(t("./FilterMod")),n.add(t("./Convolver")),n.add(t("./Delay")),n.add(t("./ModDelay")),n.add(t("./Volume")),n.add(t("./Context"))},{"../core/Buffer":2,"../core/modules":16,"./Amp":22,"./AutoBang":23,"./AutoXFade":24,"./Bang":25,"./BufferTrim":26,"./Context":27,"./ControlChange":28,"./Convolver":29,"./Delay":30,"./Envelope":31,"./Fade":32,"./Filter":33,"./FilterMod":34,"./Gain":35,"./LFO":36,"./MidiIn":37,"./ModDelay":38,"./ModPanner":39,"./NoteOnFilter":40,"./OneShotSampler":41,"./Oscillator":42,"./Panner":43,"./Sampler":44,"./TestModule":45,"./Volume":46}],48:[function(t,e,o){function n(t){this.sample=t,this.head=0,this.decay=1,this.env=1,this.volume=1,this.stopped=!0}var i=t("../core/audioContext"),r=t("../core/loadAudioBuffer"),s=1e-4;n.prototype.start=function(t,e){this.decay=t,this.volume=e,this.head=0,this.env=1,this.stopped=!1},n.prototype.play=function(){if(this.stopped)return 0;if(this.head>=this.sample.length)return this.stopped=!0,0;var t=this.sample[this.head++],e=this.env*this.volume;return t*=e,this.env*=this.decay,e<s&&(this.stopped=!0),t},o.generate=function(t,e){var o=t.params,s=o.pattern||"C...",a=o.offset||0,u=o.polyphony||1,c=o.tempo||120,p=o.close||.5,l=o.accent||.5;r(o.uri,function(o,r){if(o)return e(o);var d=r.length-a,h=new Float32Array(d);r.copyFromChannel(h,0,a);for(var f=[],y=0;y<u;y++)f.push(new n(h));var v=r.sampleRate,m=~~(15*v/c),b=m*s.length;p=Math.pow(p,10/d);for(var x={O:{volume:1,decay:1},o:{volume:l,decay:1},C:{volume:1,decay:p},c:{volume:l,decay:p}},g=i.createBuffer(1,b,v),C=g.getChannelData(0),T=0,P=0,M=0,O=0;O<b;O++){if(0===P--){P=m;var _=x[s[T]];_&&(M=(M+1)%f.length,f[M].start(_.decay,_.volume)),T++}for(var B=0,y=0;y<f.length;y++)B+=f[y].play();C[O]=B}return t.buffer=g,t.start=0,t.end=g.duration,e()})}},{"../core/audioContext":13,"../core/loadAudioBuffer":15}],49:[function(t,e,o){var n={noize:t("./noize"),hats:t("./hats")};o.getSynth=function(t){return n[t]}},{"./hats":48,"./noize":50}],50:[function(t,e,o){function n(){return Math.random()-.5}function i(){for(;;){var t=n();if(u+=t,!(u<-8||u>8))break;u-=t}return u/16}function r(t){return i()*t+n()*(1-t)}var s=t("../core/audioContext"),a=44100,u=0;o.generate=function(t,e){var o=t.params,u=o.length||1,c=o.color||0,p=r;c<0&&(p=n),c>1&&(p=i);for(var l=s.createBuffer(1,u*a,a),d=l.getChannelData(0),h=0;h<d.length;h++)d[h]=p(c);return t.buffer=l,t.start=0,t.end=u,window.setTimeout(e,0)}},{"../core/audioContext":13}]},{},[21]);
  