UNPKG

wam-community

Version:

A collection of prebuilt Web Audio Modules ready for use

147 lines (106 loc) 108 kB
/* * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development"). * This devtool is neither made for production nor for readable output files. * It uses "eval()" calls to create a separate source file in the browser devtools. * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/) * or disable the default devtool with "devtool: false". * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/). */ /******/ var __webpack_modules__ = ({ /***/ "./node_modules/css-loader/dist/runtime/api.js": /*!*****************************************************!*\ !*** ./node_modules/css-loader/dist/runtime/api.js ***! \*****************************************************/ /***/ ((module) => { eval("\n\n/*\n MIT License http://www.opensource.org/licenses/mit-license.php\n Author Tobias Koppers @sokra\n*/\nmodule.exports = function (cssWithMappingToString) {\n var list = []; // return the list of modules as css string\n\n list.toString = function toString() {\n return this.map(function (item) {\n var content = \"\";\n var needLayer = typeof item[5] !== \"undefined\";\n\n if (item[4]) {\n content += \"@supports (\".concat(item[4], \") {\");\n }\n\n if (item[2]) {\n content += \"@media \".concat(item[2], \" {\");\n }\n\n if (needLayer) {\n content += \"@layer\".concat(item[5].length > 0 ? \" \".concat(item[5]) : \"\", \" {\");\n }\n\n content += cssWithMappingToString(item);\n\n if (needLayer) {\n content += \"}\";\n }\n\n if (item[2]) {\n content += \"}\";\n }\n\n if (item[4]) {\n content += \"}\";\n }\n\n return content;\n }).join(\"\");\n }; // import a list of modules into the list\n\n\n list.i = function i(modules, media, dedupe, supports, layer) {\n if (typeof modules === \"string\") {\n modules = [[null, modules, undefined]];\n }\n\n var alreadyImportedModules = {};\n\n if (dedupe) {\n for (var k = 0; k < this.length; k++) {\n var id = this[k][0];\n\n if (id != null) {\n alreadyImportedModules[id] = true;\n }\n }\n }\n\n for (var _k = 0; _k < modules.length; _k++) {\n var item = [].concat(modules[_k]);\n\n if (dedupe && alreadyImportedModules[item[0]]) {\n continue;\n }\n\n if (typeof layer !== \"undefined\") {\n if (typeof item[5] === \"undefined\") {\n item[5] = layer;\n } else {\n item[1] = \"@layer\".concat(item[5].length > 0 ? \" \".concat(item[5]) : \"\", \" {\").concat(item[1], \"}\");\n item[5] = layer;\n }\n }\n\n if (media) {\n if (!item[2]) {\n item[2] = media;\n } else {\n item[1] = \"@media \".concat(item[2], \" {\").concat(item[1], \"}\");\n item[2] = media;\n }\n }\n\n if (supports) {\n if (!item[4]) {\n item[4] = \"\".concat(supports);\n } else {\n item[1] = \"@supports (\".concat(item[4], \") {\").concat(item[1], \"}\");\n item[4] = supports;\n }\n }\n\n list.push(item);\n }\n };\n\n return list;\n};\n\n//# sourceURL=webpack://midi_debug/./node_modules/css-loader/dist/runtime/api.js?"); /***/ }), /***/ "./node_modules/css-loader/dist/runtime/noSourceMaps.js": /*!**************************************************************!*\ !*** ./node_modules/css-loader/dist/runtime/noSourceMaps.js ***! \**************************************************************/ /***/ ((module) => { eval("\n\nmodule.exports = function (i) {\n return i[1];\n};\n\n//# sourceURL=webpack://midi_debug/./node_modules/css-loader/dist/runtime/noSourceMaps.js?"); /***/ }), /***/ "./src/MIDIDebugView.scss": /*!********************************!*\ !*** ./src/MIDIDebugView.scss ***! \********************************/ /***/ ((module, __webpack_exports__, __webpack_require__) => { eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/noSourceMaps.js */ \"./node_modules/css-loader/dist/runtime/noSourceMaps.js\");\n/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/api.js */ \"./node_modules/css-loader/dist/runtime/api.js\");\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);\n// Imports\n\n\nvar ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".mpEjnVbImQxBpca__Svv {\\n user-select: text;\\n -webkit-user-select: text;\\n}\", \"\"]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"allowSelect\": \"mpEjnVbImQxBpca__Svv\"\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);\n\n\n//# sourceURL=webpack://midi_debug/./src/MIDIDebugView.scss?"); /***/ }), /***/ "./node_modules/preact/dist/preact.module.js": /*!***************************************************!*\ !*** ./node_modules/preact/dist/preact.module.js ***! \***************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Component: () => (/* binding */ _),\n/* harmony export */ Fragment: () => (/* binding */ d),\n/* harmony export */ cloneElement: () => (/* binding */ B),\n/* harmony export */ createContext: () => (/* binding */ D),\n/* harmony export */ createElement: () => (/* binding */ v),\n/* harmony export */ createRef: () => (/* binding */ p),\n/* harmony export */ h: () => (/* binding */ v),\n/* harmony export */ hydrate: () => (/* binding */ q),\n/* harmony export */ isValidElement: () => (/* binding */ i),\n/* harmony export */ options: () => (/* binding */ l),\n/* harmony export */ render: () => (/* binding */ S),\n/* harmony export */ toChildArray: () => (/* binding */ A)\n/* harmony export */ });\nvar n,l,u,i,t,o,r,f,e={},c=[],s=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function a(n,l){for(var u in l)n[u]=l[u];return n}function h(n){var l=n.parentNode;l&&l.removeChild(n)}function v(l,u,i){var t,o,r,f={};for(r in u)\"key\"==r?t=u[r]:\"ref\"==r?o=u[r]:f[r]=u[r];if(arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):i),\"function\"==typeof l&&null!=l.defaultProps)for(r in l.defaultProps)void 0===f[r]&&(f[r]=l.defaultProps[r]);return y(l,f,t,o,null)}function y(n,i,t,o,r){var f={type:n,props:i,key:t,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==r?++u:r};return null!=l.vnode&&l.vnode(f),f}function p(){return{current:null}}function d(n){return n.children}function _(n,l){this.props=n,this.context=l}function k(n,l){if(null==l)return n.__?k(n.__,n.__.__k.indexOf(n)+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e)return u.__e;return\"function\"==typeof n.type?k(n):null}function b(n){var l,u;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e){n.__e=n.__c.base=u.__e;break}return b(n)}}function m(n){(!n.__d&&(n.__d=!0)&&t.push(n)&&!g.__r++||r!==l.debounceRendering)&&((r=l.debounceRendering)||o)(g)}function g(){for(var n;g.__r=t.length;)n=t.sort(function(n,l){return n.__v.__b-l.__v.__b}),t=[],n.some(function(n){var l,u,i,t,o,r;n.__d&&(o=(t=(l=n).__v).__e,(r=l.__P)&&(u=[],(i=a({},t)).__v=t.__v+1,j(r,t,i,l.__n,void 0!==r.ownerSVGElement,null!=t.__h?[o]:null,u,null==o?k(t):o,t.__h),z(u,t),t.__e!=o&&b(t)))})}function w(n,l,u,i,t,o,r,f,s,a){var h,v,p,_,b,m,g,w=i&&i.__k||c,A=w.length;for(u.__k=[],h=0;h<l.length;h++)if(null!=(_=u.__k[h]=null==(_=l[h])||\"boolean\"==typeof _?null:\"string\"==typeof _||\"number\"==typeof _||\"bigint\"==typeof _?y(null,_,null,null,_):Array.isArray(_)?y(d,{children:_},null,null,null):_.__b>0?y(_.type,_.props,_.key,null,_.__v):_)){if(_.__=u,_.__b=u.__b+1,null===(p=w[h])||p&&_.key==p.key&&_.type===p.type)w[h]=void 0;else for(v=0;v<A;v++){if((p=w[v])&&_.key==p.key&&_.type===p.type){w[v]=void 0;break}p=null}j(n,_,p=p||e,t,o,r,f,s,a),b=_.__e,(v=_.ref)&&p.ref!=v&&(g||(g=[]),p.ref&&g.push(p.ref,null,_),g.push(v,_.__c||b,_)),null!=b?(null==m&&(m=b),\"function\"==typeof _.type&&null!=_.__k&&_.__k===p.__k?_.__d=s=x(_,s,n):s=P(n,_,p,w,b,s),a||\"option\"!==u.type?\"function\"==typeof u.type&&(u.__d=s):n.value=\"\"):s&&p.__e==s&&s.parentNode!=n&&(s=k(p))}for(u.__e=m,h=A;h--;)null!=w[h]&&(\"function\"==typeof u.type&&null!=w[h].__e&&w[h].__e==u.__d&&(u.__d=k(i,h+1)),N(w[h],w[h]));if(g)for(h=0;h<g.length;h++)M(g[h],g[++h],g[++h])}function x(n,l,u){var i,t;for(i=0;i<n.__k.length;i++)(t=n.__k[i])&&(t.__=n,l=\"function\"==typeof t.type?x(t,l,u):P(u,t,t,n.__k,t.__e,l));return l}function A(n,l){return l=l||[],null==n||\"boolean\"==typeof n||(Array.isArray(n)?n.some(function(n){A(n,l)}):l.push(n)),l}function P(n,l,u,i,t,o){var r,f,e;if(void 0!==l.__d)r=l.__d,l.__d=void 0;else if(null==u||t!=o||null==t.parentNode)n:if(null==o||o.parentNode!==n)n.appendChild(t),r=null;else{for(f=o,e=0;(f=f.nextSibling)&&e<i.length;e+=2)if(f==t)break n;n.insertBefore(t,o),r=o}return void 0!==r?r:t.nextSibling}function C(n,l,u,i,t){var o;for(o in u)\"children\"===o||\"key\"===o||o in l||H(n,o,null,u[o],i);for(o in l)t&&\"function\"!=typeof l[o]||\"children\"===o||\"key\"===o||\"value\"===o||\"checked\"===o||u[o]===l[o]||H(n,o,l[o],u[o],i)}function $(n,l,u){\"-\"===l[0]?n.setProperty(l,u):n[l]=null==u?\"\":\"number\"!=typeof u||s.test(l)?u:u+\"px\"}function H(n,l,u,i,t){var o;n:if(\"style\"===l)if(\"string\"==typeof u)n.style.cssText=u;else{if(\"string\"==typeof i&&(n.style.cssText=i=\"\"),i)for(l in i)u&&l in u||$(n.style,l,\"\");if(u)for(l in u)i&&u[l]===i[l]||$(n.style,l,u[l])}else if(\"o\"===l[0]&&\"n\"===l[1])o=l!==(l=l.replace(/Capture$/,\"\")),l=l.toLowerCase()in n?l.toLowerCase().slice(2):l.slice(2),n.l||(n.l={}),n.l[l+o]=u,u?i||n.addEventListener(l,o?T:I,o):n.removeEventListener(l,o?T:I,o);else if(\"dangerouslySetInnerHTML\"!==l){if(t)l=l.replace(/xlink[H:h]/,\"h\").replace(/sName$/,\"s\");else if(\"href\"!==l&&\"list\"!==l&&\"form\"!==l&&\"tabIndex\"!==l&&\"download\"!==l&&l in n)try{n[l]=null==u?\"\":u;break n}catch(n){}\"function\"==typeof u||(null!=u&&(!1!==u||\"a\"===l[0]&&\"r\"===l[1])?n.setAttribute(l,u):n.removeAttribute(l))}}function I(n){this.l[n.type+!1](l.event?l.event(n):n)}function T(n){this.l[n.type+!0](l.event?l.event(n):n)}function j(n,u,i,t,o,r,f,e,c){var s,h,v,y,p,k,b,m,g,x,A,P=u.type;if(void 0!==u.constructor)return null;null!=i.__h&&(c=i.__h,e=u.__e=i.__e,u.__h=null,r=[e]),(s=l.__b)&&s(u);try{n:if(\"function\"==typeof P){if(m=u.props,g=(s=P.contextType)&&t[s.__c],x=s?g?g.props.value:s.__:t,i.__c?b=(h=u.__c=i.__c).__=h.__E:(\"prototype\"in P&&P.prototype.render?u.__c=h=new P(m,x):(u.__c=h=new _(m,x),h.constructor=P,h.render=O),g&&g.sub(h),h.props=m,h.state||(h.state={}),h.context=x,h.__n=t,v=h.__d=!0,h.__h=[]),null==h.__s&&(h.__s=h.state),null!=P.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=a({},h.__s)),a(h.__s,P.getDerivedStateFromProps(m,h.__s))),y=h.props,p=h.state,v)null==P.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(null==P.getDerivedStateFromProps&&m!==y&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(m,x),!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(m,h.__s,x)||u.__v===i.__v){h.props=m,h.state=h.__s,u.__v!==i.__v&&(h.__d=!1),h.__v=u,u.__e=i.__e,u.__k=i.__k,u.__k.forEach(function(n){n&&(n.__=u)}),h.__h.length&&f.push(h);break n}null!=h.componentWillUpdate&&h.componentWillUpdate(m,h.__s,x),null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(y,p,k)})}h.context=x,h.props=m,h.state=h.__s,(s=l.__r)&&s(u),h.__d=!1,h.__v=u,h.__P=n,s=h.render(h.props,h.state,h.context),h.state=h.__s,null!=h.getChildContext&&(t=a(a({},t),h.getChildContext())),v||null==h.getSnapshotBeforeUpdate||(k=h.getSnapshotBeforeUpdate(y,p)),A=null!=s&&s.type===d&&null==s.key?s.props.children:s,w(n,Array.isArray(A)?A:[A],u,i,t,o,r,f,e,c),h.base=u.__e,u.__h=null,h.__h.length&&f.push(h),b&&(h.__E=h.__=null),h.__e=!1}else null==r&&u.__v===i.__v?(u.__k=i.__k,u.__e=i.__e):u.__e=L(i.__e,u,i,t,o,r,f,c);(s=l.diffed)&&s(u)}catch(n){u.__v=null,(c||null!=r)&&(u.__e=e,u.__h=!!c,r[r.indexOf(e)]=null),l.__e(n,u,i)}}function z(n,u){l.__c&&l.__c(u,n),n.some(function(u){try{n=u.__h,u.__h=[],n.some(function(n){n.call(u)})}catch(n){l.__e(n,u.__v)}})}function L(l,u,i,t,o,r,f,c){var s,a,v,y=i.props,p=u.props,d=u.type,_=0;if(\"svg\"===d&&(o=!0),null!=r)for(;_<r.length;_++)if((s=r[_])&&(s===l||(d?s.localName==d:3==s.nodeType))){l=s,r[_]=null;break}if(null==l){if(null===d)return document.createTextNode(p);l=o?document.createElementNS(\"http://www.w3.org/2000/svg\",d):document.createElement(d,p.is&&p),r=null,c=!1}if(null===d)y===p||c&&l.data===p||(l.data=p);else{if(r=r&&n.call(l.childNodes),a=(y=i.props||e).dangerouslySetInnerHTML,v=p.dangerouslySetInnerHTML,!c){if(null!=r)for(y={},_=0;_<l.attributes.length;_++)y[l.attributes[_].name]=l.attributes[_].value;(v||a)&&(v&&(a&&v.__html==a.__html||v.__html===l.innerHTML)||(l.innerHTML=v&&v.__html||\"\"))}if(C(l,p,y,o,c),v)u.__k=[];else if(_=u.props.children,w(l,Array.isArray(_)?_:[_],u,i,t,o&&\"foreignObject\"!==d,r,f,r?r[0]:i.__k&&k(i,0),c),null!=r)for(_=r.length;_--;)null!=r[_]&&h(r[_]);c||(\"value\"in p&&void 0!==(_=p.value)&&(_!==l.value||\"progress\"===d&&!_)&&H(l,\"value\",_,y.value,!1),\"checked\"in p&&void 0!==(_=p.checked)&&_!==l.checked&&H(l,\"checked\",_,y.checked,!1))}return l}function M(n,u,i){try{\"function\"==typeof n?n(u):n.current=u}catch(n){l.__e(n,i)}}function N(n,u,i){var t,o;if(l.unmount&&l.unmount(n),(t=n.ref)&&(t.current&&t.current!==n.__e||M(t,null,u)),null!=(t=n.__c)){if(t.componentWillUnmount)try{t.componentWillUnmount()}catch(n){l.__e(n,u)}t.base=t.__P=null}if(t=n.__k)for(o=0;o<t.length;o++)t[o]&&N(t[o],u,\"function\"!=typeof n.type);i||null==n.__e||h(n.__e),n.__e=n.__d=void 0}function O(n,l,u){return this.constructor(n,u)}function S(u,i,t){var o,r,f;l.__&&l.__(u,i),r=(o=\"function\"==typeof t)?null:t&&t.__k||i.__k,f=[],j(i,u=(!o&&t||i).__k=v(d,null,[u]),r||e,e,void 0!==i.ownerSVGElement,!o&&t?[t]:r?null:i.firstChild?n.call(i.childNodes):null,f,!o&&t?t:r?r.__e:i.firstChild,o),z(f,u)}function q(n,l){S(n,l,q)}function B(l,u,i){var t,o,r,f=a({},l.props);for(r in u)\"key\"==r?t=u[r]:\"ref\"==r?o=u[r]:f[r]=u[r];return arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):i),y(l.type,f,t||l.key,o||l.ref,null)}function D(n,l){var u={__c:l=\"__cC\"+f++,__:n,Consumer:function(n,l){return n.children(l)},Provider:function(n){var u,i;return this.getChildContext||(u=[],(i={})[l]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(n){this.props.value!==n.value&&u.some(m)},this.sub=function(n){u.push(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){u.splice(u.indexOf(n),1),l&&l.call(n)}}),n.children}};return u.Provider.__=u.Consumer.contextType=u}n=c.slice,l={__e:function(n,l){for(var u,i,t;l=l.__;)if((u=l.__c)&&!u.__)try{if((i=u.constructor)&&null!=i.getDerivedStateFromError&&(u.setState(i.getDerivedStateFromError(n)),t=u.__d),null!=u.componentDidCatch&&(u.componentDidCatch(n),t=u.__d),t)return u.__E=u}catch(l){n=l}throw n}},u=0,i=function(n){return null!=n&&void 0===n.constructor},_.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=a({},this.state),\"function\"==typeof n&&(n=n(a({},u),this.props)),n&&a(u,n),null!=n&&this.__v&&(l&&this.__h.push(l),m(this))},_.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),m(this))},_.prototype.render=d,t=[],o=\"function\"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,g.__r=0,f=0;\n//# sourceMappingURL=preact.module.js.map\n\n\n//# sourceURL=webpack://midi_debug/./node_modules/preact/dist/preact.module.js?"); /***/ }), /***/ "./src/GenerateMIDIMessageView.tsx": /*!*****************************************!*\ !*** ./src/GenerateMIDIMessageView.tsx ***! \*****************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ GenerateMIDIMessageView: () => (/* binding */ GenerateMIDIMessageView)\n/* harmony export */ });\n/* harmony import */ var preact__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! preact */ \"./node_modules/preact/dist/preact.module.js\");\n/* harmony import */ var _MIDIMessageAnalyzer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./MIDIMessageAnalyzer */ \"./src/MIDIMessageAnalyzer.ts\");\n\n\nclass GenerateMIDIMessageView extends preact__WEBPACK_IMPORTED_MODULE_0__.Component {\n constructor() {\n super();\n this.state = {\n messageType: 0x90,\n channel: 0,\n byte1: 32,\n byte2: 100\n };\n }\n sendMessage() {\n let midi = [];\n midi.push(this.state.messageType + this.state.channel);\n midi.push(this.state.byte1);\n midi.push(this.state.byte2);\n this.props.plugin.emitMIDI(midi);\n }\n typeChanged(e) {\n this.setState({ messageType: parseInt(e.target.value) });\n }\n valueChanged(param, e) {\n let update = {};\n update[param] = parseInt(e.currentTarget.value);\n this.setState(update);\n }\n render() {\n (0,preact__WEBPACK_IMPORTED_MODULE_0__.h)(\"div\", {});\n let actions = [\n (0,preact__WEBPACK_IMPORTED_MODULE_0__.h)(\"button\", { class: \"border m-1 px-2 py-1 border-gray-700 bg-gray-300 text-sm\", onClick: () => this.sendMessage() }, \"Send\"),\n (0,preact__WEBPACK_IMPORTED_MODULE_0__.h)(\"button\", { class: \"border m-1 px-2 py-1 border-gray-700 bg-gray-300 text-sm\", onClick: () => this.props.onClose() }, \"Close\")\n ];\n let messageTypes = Object.keys(_MIDIMessageAnalyzer__WEBPACK_IMPORTED_MODULE_1__.channelMessages).map(v => {\n return { value: parseInt(v), name: _MIDIMessageAnalyzer__WEBPACK_IMPORTED_MODULE_1__.channelMessages[parseInt(v)].name };\n });\n let options = messageTypes.map(t => (0,preact__WEBPACK_IMPORTED_MODULE_0__.h)(\"option\", { selected: t.value == this.state.messageType, value: t.value }, t.name));\n return ((0,preact__WEBPACK_IMPORTED_MODULE_0__.h)(\"div\", null,\n (0,preact__WEBPACK_IMPORTED_MODULE_0__.h)(\"div\", null,\n (0,preact__WEBPACK_IMPORTED_MODULE_0__.h)(\"label\", null,\n \"Message Type:\",\n (0,preact__WEBPACK_IMPORTED_MODULE_0__.h)(\"select\", { onChange: (e) => this.typeChanged(e) }, options))),\n (0,preact__WEBPACK_IMPORTED_MODULE_0__.h)(\"div\", null,\n (0,preact__WEBPACK_IMPORTED_MODULE_0__.h)(\"label\", null,\n \"Channel:\",\n (0,preact__WEBPACK_IMPORTED_MODULE_0__.h)(\"input\", { placeholder: \"0-15\", value: this.state.channel, onChange: (e) => this.valueChanged('channel', e) }))),\n (0,preact__WEBPACK_IMPORTED_MODULE_0__.h)(\"div\", null,\n (0,preact__WEBPACK_IMPORTED_MODULE_0__.h)(\"label\", null,\n \"Byte 1:\",\n (0,preact__WEBPACK_IMPORTED_MODULE_0__.h)(\"input\", { value: this.state.byte1, onChange: (e) => this.valueChanged('byte1', e) }))),\n (0,preact__WEBPACK_IMPORTED_MODULE_0__.h)(\"div\", null,\n (0,preact__WEBPACK_IMPORTED_MODULE_0__.h)(\"label\", null,\n \"Byte 2:\",\n (0,preact__WEBPACK_IMPORTED_MODULE_0__.h)(\"input\", { value: this.state.byte2, onChange: (e) => this.valueChanged('byte2', e) }))),\n actions));\n }\n}\n\n\n//# sourceURL=webpack://midi_debug/./src/GenerateMIDIMessageView.tsx?"); /***/ }), /***/ "./src/MIDIDebugProcessor.ts": /*!***********************************!*\ !*** ./src/MIDIDebugProcessor.ts ***! \***********************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\nconst getMIDIDebugProcessor = (moduleId) => {\n const audioWorkletGlobalScope = globalThis;\n const { registerProcessor } = audioWorkletGlobalScope;\n const ModuleScope = audioWorkletGlobalScope.webAudioModules.getModuleScope(moduleId);\n const { WamProcessor, WamParameterInfo, } = ModuleScope;\n class MIDIDebugProcessor extends WamProcessor {\n constructor(options) {\n super(options);\n this.count = 0;\n }\n _process(startSample, endSample, inputs, outputs) {\n return;\n }\n async _onMessage(message) {\n if (message.data && message.data.source == \"midi\") {\n const { currentTime } = audioWorkletGlobalScope;\n if (message.data.bytes[0] == 0xf0) {\n this.emitEvents({\n type: 'wam-sysex',\n time: currentTime,\n data: {\n bytes: new Uint8Array(message.data.bytes)\n }\n });\n }\n else {\n this.emitEvents({ type: 'wam-midi', time: currentTime, data: { bytes: message.data.bytes } });\n }\n }\n else {\n super._onMessage(message);\n }\n }\n _onMidi(midiData) {\n const { currentTime } = audioWorkletGlobalScope;\n const bytes = midiData.bytes;\n this.port.postMessage({ source: \"midi\", timestamp: currentTime, bytes });\n this.emitEvents({ type: \"wam-midi\", time: currentTime, data: midiData });\n }\n _onSysex(sysexData) {\n const { currentTime } = audioWorkletGlobalScope;\n const bytes = sysexData.bytes;\n this.port.postMessage({ source: \"sysex\", timestamp: currentTime, bytes });\n this.emitEvents({ type: \"wam-sysex\", time: currentTime, data: sysexData });\n }\n _onTransport(transportData) {\n this.transportData = transportData;\n }\n }\n try {\n registerProcessor('com.sequencerParty.midiDebug', MIDIDebugProcessor);\n }\n catch (error) {\n console.warn(error);\n }\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getMIDIDebugProcessor);\n\n\n//# sourceURL=webpack://midi_debug/./src/MIDIDebugProcessor.ts?"); /***/ }), /***/ "./src/MIDIDebugView.tsx": /*!*******************************!*\ !*** ./src/MIDIDebugView.tsx ***! \*******************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ MIDIDebugView: () => (/* binding */ MIDIDebugView)\n/* harmony export */ });\n/* harmony import */ var preact__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! preact */ \"./node_modules/preact/dist/preact.module.js\");\n/* harmony import */ var _GenerateMIDIMessageView__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./GenerateMIDIMessageView */ \"./src/GenerateMIDIMessageView.tsx\");\n/* harmony import */ var _MIDIMessageAnalyzer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./MIDIMessageAnalyzer */ \"./src/MIDIMessageAnalyzer.ts\");\n/* harmony import */ var _MIDIDebugView_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./MIDIDebugView.scss */ \"./src/MIDIDebugView.scss\");\n\n\n\n\nlet styles = _MIDIDebugView_scss__WEBPACK_IMPORTED_MODULE_3__[\"default\"].locals;\nclass MIDIDebugView extends preact__WEBPACK_IMPORTED_MODULE_0__.Component {\n constructor() {\n super();\n }\n componentDidMount() {\n this.props.plugin.callback = () => {\n this.forceUpdate();\n };\n }\n componentWillUnmount() {\n this.props.plugin.callback = undefined;\n }\n renderMIDIMessage(msg) {\n let a = new _MIDIMessageAnalyzer__WEBPACK_IMPORTED_MODULE_2__.MIDIMessageAnalyzer(msg.bytes);\n const dir = msg.incoming ? \"<- \" : \"-> \";\n return (0,preact__WEBPACK_IMPORTED_MODULE_0__.h)(preact__WEBPACK_IMPORTED_MODULE_0__.Fragment, null,\n (0,preact__WEBPACK_IMPORTED_MODULE_0__.h)(\"tr\", null,\n (0,preact__WEBPACK_IMPORTED_MODULE_0__.h)(\"td\", { colSpan: 2 },\n (0,preact__WEBPACK_IMPORTED_MODULE_0__.h)(\"i\", null, msg.timestamp.toFixed(3)),\n \": \",\n (0,preact__WEBPACK_IMPORTED_MODULE_0__.h)(\"b\", null,\n dir,\n \" [\",\n msg.bytes.join(\", \"),\n \"]\"))),\n (0,preact__WEBPACK_IMPORTED_MODULE_0__.h)(\"tr\", null,\n (0,preact__WEBPACK_IMPORTED_MODULE_0__.h)(\"td\", null, a.description().join(\" \")),\n (0,preact__WEBPACK_IMPORTED_MODULE_0__.h)(\"td\", null,\n (0,preact__WEBPACK_IMPORTED_MODULE_0__.h)(\"button\", { onClick: () => this.replayMessage(msg.bytes) }, \"Replay\"))));\n }\n replayMessage(bytes) {\n this.props.plugin.emitMIDI(bytes);\n }\n clearPressed() {\n this.props.plugin.recording.clear();\n }\n showModal(modal) {\n this.setState({ modal });\n }\n render() {\n (0,preact__WEBPACK_IMPORTED_MODULE_0__.h)(\"div\", {});\n if (this.state.modal == 'generate') {\n return (0,preact__WEBPACK_IMPORTED_MODULE_0__.h)(_GenerateMIDIMessageView__WEBPACK_IMPORTED_MODULE_1__.GenerateMIDIMessageView, { plugin: this.props.plugin, onClose: () => this.showModal(undefined) });\n }\n else {\n let content = this.props.plugin.recording.messages.map(m => this.renderMIDIMessage(m));\n return (0,preact__WEBPACK_IMPORTED_MODULE_0__.h)(\"div\", { class: styles.allowSelect, style: \"width: 100%; display: flex; flex-direction: column; \" },\n (0,preact__WEBPACK_IMPORTED_MODULE_0__.h)(\"div\", { style: \"display: flex; flex-direction: row; height: 30px;\" },\n (0,preact__WEBPACK_IMPORTED_MODULE_0__.h)(\"button\", { onClick: () => this.clearPressed() }, \"Clear\")),\n (0,preact__WEBPACK_IMPORTED_MODULE_0__.h)(\"div\", { style: \"display: flex; height: 100%; overflow: scroll; flex-direction: column; background-color: white; color: black; padding: 8px; font-family: 'Courier New', monospace;\" },\n (0,preact__WEBPACK_IMPORTED_MODULE_0__.h)(\"table\", { cellPadding: 0, cellSpacing: 0 }, content),\n (0,preact__WEBPACK_IMPORTED_MODULE_0__.h)(\"button\", { onClick: () => this.showModal('generate') }, \"+ Generate message\")));\n }\n }\n}\n\n\n//# sourceURL=webpack://midi_debug/./src/MIDIDebugView.tsx?"); /***/ }), /***/ "./src/MIDIMessageAnalyzer.ts": /*!************************************!*\ !*** ./src/MIDIMessageAnalyzer.ts ***! \************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ MIDIMessageAnalyzer: () => (/* binding */ MIDIMessageAnalyzer),\n/* harmony export */ channelMessages: () => (/* binding */ channelMessages)\n/* harmony export */ });\nvar MIDI_MESSAGE;\n(function (MIDI_MESSAGE) {\n MIDI_MESSAGE[MIDI_MESSAGE[\"NOTE_OFF\"] = 128] = \"NOTE_OFF\";\n MIDI_MESSAGE[MIDI_MESSAGE[\"NOTE_ON\"] = 144] = \"NOTE_ON\";\n MIDI_MESSAGE[MIDI_MESSAGE[\"POLY_AFTERTOUCH\"] = 160] = \"POLY_AFTERTOUCH\";\n MIDI_MESSAGE[MIDI_MESSAGE[\"CONTROL_CHANGE\"] = 176] = \"CONTROL_CHANGE\";\n MIDI_MESSAGE[MIDI_MESSAGE[\"PROGRAM_CHANGE\"] = 192] = \"PROGRAM_CHANGE\";\n MIDI_MESSAGE[MIDI_MESSAGE[\"CHANNEL_AFTERTOUCH\"] = 208] = \"CHANNEL_AFTERTOUCH\";\n MIDI_MESSAGE[MIDI_MESSAGE[\"PITCHBEND\"] = 224] = \"PITCHBEND\";\n})(MIDI_MESSAGE || (MIDI_MESSAGE = {}));\nlet channelMessages = {\n 0x90: {\n name: \"note_on\",\n byte_names: [\"note\", \"velocity\"],\n },\n 0x80: {\n name: \"note_off\",\n byte_names: [\"note\", \"velocity\"],\n },\n 0xb0: {\n name: \"control change\",\n byte_names: [\"number\", \"value\"],\n },\n 0xc0: {\n name: \"program change\",\n byte_names: [\"num\", \"num\"],\n },\n 0xd0: {\n name: \"channel aftertouch\",\n byte_names: [\"value\"]\n },\n 0xe0: {\n name: \"pitchbend\",\n byte_names: [\"msb\", \"lsb\"],\n }\n};\nclass MIDIMessageAnalyzer {\n constructor(bytes) {\n this.bytes = bytes;\n }\n channelMessage() {\n return (this.bytes[0] & 0x80) === 0x80 && this.bytes[0] != 0xf0;\n }\n sysexMessage() {\n return (this.bytes[0] == 0xf0);\n }\n channel() {\n if (!this.channelMessage()) {\n return undefined;\n }\n else {\n return this.bytes[0] & 0x0f;\n }\n }\n description() {\n let result = [];\n if (this.channelMessage()) {\n result.push(`ch: ${this.channel() + 1}`);\n const type = this.bytes[0] & 0xf0;\n let description = channelMessages[type];\n if (!description) {\n result.push(\"UNKNOWN\");\n }\n else {\n result.push(`msg: ${description.name}`);\n description.byte_names.forEach((v, i) => {\n result.push(`${v}: ${this.bytes[1 + i]}`);\n });\n }\n }\n else if (this.sysexMessage()) {\n result.push(`Sysex`);\n }\n return result;\n }\n}\n\n\n//# sourceURL=webpack://midi_debug/./src/MIDIMessageAnalyzer.ts?"); /***/ }), /***/ "./src/MIDIRecording.ts": /*!******************************!*\ !*** ./src/MIDIRecording.ts ***! \******************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ MIDIRecording: () => (/* binding */ MIDIRecording)\n/* harmony export */ });\nclass MIDIRecording {\n constructor() {\n this.messages = [];\n }\n clear() {\n this.messages = [];\n }\n getState() {\n return {\n messages: [...this.messages.map(m => {\n return {\n incoming: m.incoming,\n timestamp: m.timestamp,\n bytes: [...m.bytes]\n };\n })]\n };\n }\n setState(state) {\n this.messages = [...state.messages.map(m => {\n return {\n incoming: m.incoming,\n timestamp: m.timestamp,\n bytes: [...m.bytes]\n };\n })];\n }\n}\n\n\n//# sourceURL=webpack://midi_debug/./src/MIDIRecording.ts?"); /***/ }), /***/ "./src/Node.ts": /*!*********************!*\ !*** ./src/Node.ts ***! \*********************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ MIDIDebugNode: () => (/* binding */ MIDIDebugNode)\n/* harmony export */ });\n/* harmony import */ var _webaudiomodules_sdk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @webaudiomodules/sdk */ \"../../../node_modules/@webaudiomodules/sdk/dist/index.js\");\n/* harmony import */ var _MIDIDebugProcessor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./MIDIDebugProcessor */ \"./src/MIDIDebugProcessor.ts\");\n/* harmony import */ var _MIDIRecording__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./MIDIRecording */ \"./src/MIDIRecording.ts\");\n\n\n\nclass MIDIDebugNode extends _webaudiomodules_sdk__WEBPACK_IMPORTED_MODULE_0__.WamNode {\n constructor(module, options) {\n super(module, {\n ...options, processorOptions: {\n numberOfInputs: 1,\n numberOfOutputs: 1,\n outputChannelCount: [2],\n }\n });\n this.destroyed = false;\n this.recording = new _MIDIRecording__WEBPACK_IMPORTED_MODULE_2__.MIDIRecording();\n this._supportedEventTypes = new Set(['wam-automation', 'wam-midi', 'wam-sysex']);\n }\n static async addModules(audioContext, moduleId) {\n const { audioWorklet } = audioContext;\n await super.addModules(audioContext, moduleId);\n await (0,_webaudiomodules_sdk__WEBPACK_IMPORTED_MODULE_0__.addFunctionModule)(audioWorklet, _MIDIDebugProcessor__WEBPACK_IMPORTED_MODULE_1__[\"default\"], moduleId);\n }\n async getState() {\n return {\n recordings: [this.recording.getState()]\n };\n }\n async setState(state) {\n if (!state.recordings || state.recordings.length < 1) {\n return;\n }\n this.recording.setState(state.recordings[0]);\n if (this.callback) {\n this.callback();\n }\n }\n _onMessage(message) {\n if (message.data && message.data.source == \"midi\") {\n this.recording.messages.push({ incoming: true, timestamp: message.data.timestamp, bytes: message.data.bytes });\n if (this.callback) {\n this.callback();\n }\n }\n else if (message.data && message.data.source == \"sysex\") {\n let data = [];\n for (let b of message.data.bytes) {\n data.push(b);\n }\n this.recording.messages.push({ incoming: true, timestamp: message.data.timestamp, bytes: data });\n if (this.callback) {\n this.callback();\n }\n }\n else {\n super._onMessage(message);\n }\n }\n emitMIDI(bytes) {\n this.port.postMessage({\n source: 'midi',\n bytes\n });\n this.recording.messages.push({ incoming: false, timestamp: this.context.currentTime, bytes });\n }\n}\n\n\n//# sourceURL=webpack://midi_debug/./src/Node.ts?"); /***/ }), /***/ "./src/index.tsx": /*!***********************!*\ !*** ./src/index.tsx ***! \***********************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ MIDIDebugModule)\n/* harmony export */ });\n/* harmony import */ var _webaudiomodules_sdk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @webaudiomodules/sdk */ \"../../../node_modules/@webaudiomodules/sdk/dist/index.js\");\n/* harmony import */ var preact__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! preact */ \"./node_modules/preact/dist/preact.module.js\");\n/* harmony import */ var _shared_getBaseUrl__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../shared/getBaseUrl */ \"../shared/getBaseUrl.tsx\");\n/* harmony import */ var _MIDIDebugView__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./MIDIDebugView */ \"./src/MIDIDebugView.tsx\");\n/* harmony import */ var _Node__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Node */ \"./src/Node.ts\");\n/* harmony import */ var _MIDIDebugView_scss__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./MIDIDebugView.scss */ \"./src/MIDIDebugView.scss\");\n/* harmony import */ var _shared_insertStyle__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../shared/insertStyle */ \"../shared/insertStyle.ts\");\n\n\n\n\n\n\n\nclass MIDIDebugModule extends _webaudiomodules_sdk__WEBPACK_IMPORTED_MODULE_0__.WebAudioModule {\n constructor() {\n super(...arguments);\n this._baseURL = (0,_shared_getBaseUrl__WEBPACK_IMPORTED_MODULE_2__.getBaseUrl)(new URL('.', __webpack_require__.p));\n this._descriptorUrl = `${this._baseURL}/descriptor.json`;\n this.midiInitialized = false;\n }\n async _loadDescriptor() {\n const url = this._descriptorUrl;\n if (!url)\n throw new TypeError('Descriptor not found');\n const response = await fetch(url);\n const descriptor = await response.json();\n Object.assign(this._descriptor, descriptor);\n return descriptor;\n }\n async initialize(state) {\n await this._loadDescriptor();\n return super.initialize(state);\n }\n async createAudioNode(initialState) {\n await _Node__WEBPACK_IMPORTED_MODULE_4__.MIDIDebugNode.addModules(this.audioContext, this.moduleId);\n const node = new _Node__WEBPACK_IMPORTED_MODULE_4__.MIDIDebugNode(this, {});\n await node._initialize();\n this.audioNode = node;\n if (initialState)\n node.setState(initialState);\n return node;\n }\n async createGui() {\n const div = document.createElement('div');\n (0,preact__WEBPACK_IMPORTED_MODULE_1__.h)(\"div\", {});\n div.setAttribute(\"style\", \"display: flex; height: 100%; width: 100%; flex: 1;\");\n div.setAttribute(\"width\", \"800\");\n div.setAttribute(\"height\", \"500\");\n var shadow = div.attachShadow({ mode: 'open' });\n (0,_shared_insertStyle__WEBPACK_IMPORTED_MODULE_6__.insertStyle)(shadow, _MIDIDebugView_scss__WEBPACK_IMPORTED_MODULE_5__[\"default\"].toString());\n (0,preact__WEBPACK_IMPORTED_MODULE_1__.render)((0,preact__WEBPACK_IMPORTED_MODULE_1__.h)(_MIDIDebugView__WEBPACK_IMPORTED_MODULE_3__.MIDIDebugView, { plugin: this.audioNode }), shadow);\n return div;\n }\n destroyGui(el) {\n (0,preact__WEBPACK_IMPORTED_MODULE_1__.render)(null, el.shadowRoot);\n }\n}\n\n\n//# sourceURL=webpack://midi_debug/./src/index.tsx?"); /***/ }), /***/ "../shared/getBaseUrl.tsx": /*!********************************!*\ !*** ../shared/getBaseUrl.tsx ***! \********************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getBaseUrl: () => (/* binding */ getBaseUrl)\n/* harmony export */ });\nconst getBaseUrl = (relativeURL) => {\n const baseURL = relativeURL.href.substring(0, relativeURL.href.lastIndexOf('/'));\n return baseURL;\n};\n\n\n//# sourceURL=webpack://midi_debug/../shared/getBaseUrl.tsx?"); /***/ }), /***/ "../shared/insertStyle.ts": /*!********************************!*\ !*** ../shared/insertStyle.ts ***! \********************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ insertStyle: () => (/* binding */ insertStyle)\n/* harmony export */ });\nfunction insertStyle(shadow, style) {\n const el = document.createElement('style');\n el.textContent = style;\n shadow.appendChild(el);\n}\n\n\n//# sourceURL=webpack://midi_debug/../shared/insertStyle.ts?"); /***/ }), /***/ "../../../node_modules/@webaudiomodules/sdk/dist/index.js": /*!****************************************************************!*\ !*** ../../../node_modules/@webaudiomodules/sdk/dist/index.js ***! \****************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ WamNode: () => (/* binding */ WamNode),\n/* harmony export */ WebAudioModule: () => (/* binding */ WebAudioModule_default),\n/* harmony export */ addFunctionModule: () => (/* binding */ addFunctionModule_default),\n/* harmony export */ apiVersion: () => (/* binding */ apiVersion_default),\n/* harmony export */ getRingBuffer: () => (/* binding */ RingBuffer_default),\n/* harmony export */ getWamArrayRingBuffer: () => (/* binding */ WamArrayRingBuffer_default),\n/* harmony export */ getWamEventRingBuffer: () => (/* binding */ WamEventRingBuffer_default),\n/* harmony export */ getWamParameter: () => (/* binding */ WamParameter_default),\n/* harmony export */ getWamParameterInfo: () => (/* binding */ WamParameterInfo_default),\n/* harmony export */ getWamParameterInterpolator: () => (/* binding */ WamParameterInterpolator_default),\n/* harmony export */ getWamProcessor: () => (/* binding */ WamProcessor_default),\n/* harmony export */ initializeWamEnv: () => (/* binding */ WamEnv_default),\n/* harmony export */ initializeWamGroup: () => (/* binding */ WamGroup_default),\n/* harmony export */ initializeWamHost: () => (/* binding */ initializeWamHost_default)\n/* harmony export */ });\n// src/WebAudioModule.js\nvar WebAudioModule = class {\n static get isWebAudioModuleConstructor() {\n return true;\n }\n static createInstance(groupId, audioContext, initialState) {\n return new this(groupId, audioContext).initialize(initialState);\n }\n constructor(groupId, audioContext) {\n this._groupId = groupId;\n this._audioContext = audioContext;\n this._initialized = false;\n this._audioNode = void 0;\n this._timestamp = performance.now();\n this._guiModuleUrl = void 0;\n this._descriptorUrl = \"./descriptor.json\";\n this._descriptor = {\n identifier: `com.webaudiomodule.default`,\n name: `WebAudioModule_${this.constructor.name}`,\n vendor: \"WebAudioModuleVendor\",\n description: \"\",\n version: \"0.0.0\",\n apiVersion: \"2.0.0\",\n thumbnail: \"\",\n keywords: [],\n isInstrument: false,\n website: \"\",\n hasAudioInput: true,\n hasAudioOutput: true,\n hasAutomationInput: true,\n hasAutomationOutput: true,\n hasMidiInput: true,\n hasMidiOutput: true,\n hasMpeInput: true,\n hasMpeOutput: true,\n hasOscInput: true,\n hasOscOutput: true,\n hasSysexInput: true,\n hasSysexOutput: true\n };\n }\n get isWebAudioModule() {\n return true;\n }\n get groupId() {\n return this._groupId;\n }\n get moduleId() {\n return this.descriptor.identifier;\n }\n get instanceId() {\n return this.moduleId + this._timestamp;\n }\n get descriptor() {\n return this._descriptor;\n }\n get identifier() {\n return this.descriptor.identifier;\n }\n get name() {\n return this.descriptor.name;\n }\n get vendor() {\n return this.descriptor.vendor;\n }\n get audioContext() {\n return this._audioContext;\n }\n get audioNode() {\n if (!this.initialized)\n console.warn(\"WAM should be initialized before getting the audioNode\");\n return this._audioNode;\n }\n set audioNode(node) {\n this._audioNode = node;\n }\n get initialized() {\n return this._initialized;\n }\n set initialized(value) {\n this._initialized = value;\n }\n async createAudioNode(initialState) {\n throw new TypeError(\"createAudioNode() not provided\");\n }\n async initialize(state) {\n if (!this._audioNode)\n this.audioNode = await this.createAudioNode();\n this.initialized = true;\n return this;\n }\n async _loadGui() {\n const url = this._guiModuleUrl;\n if (!url)\n throw new TypeError(\"Gui module not found\");\n return import(\n /* webpackIgnore: true */\n url\n );\n }\n async _loadDescriptor() {\n const url = this._descriptorUrl;\n if (!url)\n throw new TypeError(\"Descriptor not found\");\n const response = await fetch(url);\n const descriptor = await response.json();\n Object.assign(this._descriptor, descriptor);\n return this._descriptor;\n }\n async createGui() {\n if (!this.initialized)\n console.warn(\"Plugin should be initialized before getting the gui\");\n if (!this._guiModuleUrl)\n return void 0;\n const { createElement } = await this._loadGui();\n return createElement(this);\n }\n destroyGui() {\n }\n};\nvar WebAudioModule_default = WebAudioModule;\n\n// src/RingBuffer.js\nvar getRingBuffer = (moduleId) => {\n const audioWorkletGlobalScope = globalThis;\n class RingBuffer2 {\n static getStorageForCapacity(capacity, Type) {\n if (!Type.BYTES_PER_ELEMENT) {\n throw new Error(\"Pass in a ArrayBuffer subclass\");\n }\n const bytes = 8 + (capacity + 1) * Type.BYTES_PER_ELEMENT;\n return new SharedArrayBuffer(bytes);\n }\n constructor(sab, Type) {\n if (!Type.BYTES_PER_ELEMENT) {\n throw new Error(\"Pass a concrete typed array class as second argument\");\n }\n this._Type = Type;\n this._capacity = (sab.byteLength - 8) / Type.BYTES_PER_ELEMENT;\n this.buf = sab;\n this.write_ptr = new Uint32Array(this.buf, 0, 1);\n this.read_ptr = new Uint32Array(this.buf, 4, 1);\n this.storage = new Type(this.buf, 8, this._capacity);\n }\n get type() {\n return this._Type.name;\n }\n push(elements) {\n const rd = Atomics.load(this.read_ptr, 0);\n const wr = Atomics.load(this.write_ptr, 0);\n if ((wr + 1) % this._storageCapacity() === rd) {\n return 0;\n }\n const toWrite = Math.min(this._availableWrite(rd, wr), elements.length);\n const firstPart = Math.min(this._storageCapacity() - wr, toWrite);\n const secondPart = toWrite - firstPart;\n this._copy(elements, 0, this.storage, wr, firstPart);\n this._copy(elements, firstPart, this.storage, 0, secondPart);\n Atomics.store(this.write_ptr, 0, (wr + toWrite) % this._storageCapacity());\n return toWrite;\n }\n pop(elements) {\n const rd = Atomics.load(this.read_ptr, 0);\n const wr = Atomics.load(this.write_ptr, 0);\n if (wr === rd) {\n return 0;\n }\n const isArray = !Number.isInteger(elements);\n const toRead = Math.min(this._availableRead(rd, wr), isArray ? elements.length : elements);\n if (isArray) {\n const firstPart = Math.min(this._storageCapacity() - rd, toRead);\n const secondPart = toRead - firstPart;\n this._copy(this.storage, rd, elements, 0, firstPart);\n this._copy(this.storage, 0, elements, firstPart, secondPart);\n }\n Atomics.store(this.read_ptr, 0, (rd + toRead) % this._storageCapacity());\n return toRead;\n }\n get empty() {\n const rd = Atomics.load(this.read_ptr, 0);\n const wr = Atomics.load(this.write_ptr, 0);\n return wr === rd;\n }\n get full() {\n const rd = Atomics.load(this.read_ptr, 0);\n const wr = Atomics.load(this.write_ptr, 0);\n return (wr + 1) % this._capacity !== rd;\n }\n get capacity() {\n return this._capacity - 1;\n }\n get availableRead() {\n const rd = Atomics.load(this.read_ptr, 0);\n const wr = Atomics.load(this.write_ptr, 0);\n return this._availableRead(rd, wr);\n }\n get availableWrite() {\n const rd = Atomics.load(this.read_ptr, 0);\n const wr = Atomics.load(this.write_ptr, 0);\n return this._availableWrite(rd, wr);\n }\n _availableRead(rd, wr) {\n if (wr > rd) {\n return wr - rd;\n }\n return wr + this._storageCapacity() - rd;\n }\n _availableWrite(rd, wr) {\n let rv = rd - wr - 1;\n if (wr >= rd) {\n rv += this._storageCapacity();\n }\n return rv;\n }\n _storageCapacity() {\n return this._capacity;\n }\n _copy(input, offsetInput, output, offsetOutput, size) {\n for (let i = 0; i < size; i++) {\n output[offsetOutput + i] = input[offsetInput + i];\n }\n }\n }\n if (audioWorkletGlobalScope.AudioWorkletProcessor) {\n const ModuleScope = audioWorkletGlobalScope.webAudioModules.getModuleScope(moduleId);\n if (!ModuleScope.RingBuffer)\n ModuleScope.RingBuffer = RingBuffer2;\n }\n return RingBuffer2;\n};\nvar RingBuffer_default = getRingBuffer;\n\n// src/WamArrayRingBuf