mercury-engine
Version:
The mercury engine generates web audio output from mercury code input
1 lines • 2.73 MB
JavaScript
"use strict";var _excluded=["offset"],_excluded2=["curve","oversample"],_excluded3=["coneInnerAngle","coneOuterAngle","coneOuterGain","distanceModel","maxDistance","orientationX","orientationY","orientationZ","panningModel","positionX","positionY","positionZ","refDistance","rolloffFactor"],_excluded4=["channelCount","channelCountMode","pan"];function _get(){if(typeof Reflect!=="undefined"&&Reflect.get){_get=Reflect.get.bind();}else{_get=function _get(target,property,receiver){var base=_superPropBase(target,property);if(!base)return;var desc=Object.getOwnPropertyDescriptor(base,property);if(desc.get){return desc.get.call(arguments.length<3?target:receiver);}return desc.value;};}return _get.apply(this,arguments);}function _superPropBase(object,property){while(!Object.prototype.hasOwnProperty.call(object,property)){object=_getPrototypeOf(object);if(object===null)break;}return object;}function _objectWithoutProperties(source,excluded){if(source==null)return{};var target=_objectWithoutPropertiesLoose(source,excluded);var key,i;if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++){key=sourceSymbolKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key];}}return target;}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;target[key]=source[key];}return target;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});Object.defineProperty(subClass,"prototype",{writable:false});if(superClass)_setPrototypeOf(subClass,superClass);}function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _possibleConstructorReturn(self,call){if(call&&(_typeof(call)==="object"||typeof call==="function")){return call;}else if(call!==void 0){throw new TypeError("Derived constructors may only return object or undefined");}return _assertThisInitialized(self);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e;};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value;},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e];}try{define({},"");}catch(t){define=function define(t,e,r){return t[e]=r;};}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a;}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)};}catch(t){return{type:"throw",arg:t};}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,function(){return this;});var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach(function(e){define(t,e,function(t){return this._invoke(e,t);});});}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then(function(t){invoke("next",t,i,a);},function(t){invoke("throw",t,i,a);}):e.resolve(h).then(function(t){u.value=t,i(u);},function(t){return invoke("throw",t,i,a);});}a(c.arg);}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e(function(e,r){invoke(t,n,e,r);});}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg();}});}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw new Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0};}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u;}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg);}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done};}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg);}};}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y);}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e);}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e;}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0);}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next;};return i.next=i;}}throw new TypeError(_typeof(e)+" is not iterable");}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name));},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t;},e.awrap=function(t){return{__await:t};},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,function(){return this;}),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next();});},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,function(){return this;}),define(g,"toString",function(){return"[object Generator]";}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next;}return next.done=!0,next;};},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t);},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval;},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o;}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break;}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a);},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y;},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y;}},"catch":function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r);}return o;}}throw new Error("illegal catch attempt");},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y;}},e;}function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,_toPropertyKey(descriptor.key),descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor;}function _createForOfIteratorHelper(o,allowArrayLike){var it=typeof Symbol!=="undefined"&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=_unsupportedIterableToArray(o))||allowArrayLike&&o&&typeof o.length==="number"){if(it)o=it;var i=0;var F=function F(){};return{s:F,n:function n(){if(i>=o.length)return{done:true};return{done:false,value:o[i++]};},e:function e(_e223){throw _e223;},f:F};}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var normalCompletion=true,didErr=false,err;return{s:function s(){it=it.call(o);},n:function n(){var step=it.next();normalCompletion=step.done;return step;},e:function e(_e224){didErr=true;err=_e224;},f:function f(){try{if(!normalCompletion&&it["return"]!=null)it["return"]();}finally{if(didErr)throw err;}}};}function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1;}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r;}finally{try{if(!f&&null!=t["return"]&&(u=t["return"](),Object(u)!==u))return;}finally{if(o)throw n;}}return a;}}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr;}function _construct(Parent,args,Class){if(_isNativeReflectConstruct()){_construct=Reflect.construct.bind();}else{_construct=function _construct(Parent,args,Class){var a=[null];a.push.apply(a,args);var Constructor=Function.bind.apply(Parent,a);var instance=new Constructor();if(Class)_setPrototypeOf(instance,Class.prototype);return instance;};}return _construct.apply(null,arguments);}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_unsupportedIterableToArray(arr)||_nonIterableSpread();}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen);}function _iterableToArray(iter){if(typeof Symbol!=="undefined"&&iter[Symbol.iterator]!=null||iter["@@iterator"]!=null)return Array.from(iter);}function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr);}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2;}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable;})),t.push.apply(t,o);}return t;}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));});}return e;}function _defineProperty(obj,key,value){key=_toPropertyKey(key);if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function _toPropertyKey(arg){var key=_toPrimitive(arg,"string");return _typeof(key)==="symbol"?key:String(key);}function _toPrimitive(input,hint){if(_typeof(input)!=="object"||input===null)return input;var prim=input[Symbol.toPrimitive];if(prim!==undefined){var res=prim.call(input,hint||"default");if(_typeof(res)!=="object")return res;throw new TypeError("@@toPrimitive must return a primitive value.");}return(hint==="string"?String:Number)(input);}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}!function(e){if("object"==(typeof exports==="undefined"?"undefined":_typeof(exports))&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).MercuryEngine=e();}}(function(){var define,module,exports;return function e(t,n,i){function s(a,o){if(!n[a]){if(!t[a]){var c="function"==typeof require&&require;if(!o&&c)return c(a,!0);if(r)return r(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u;}var l=n[a]={exports:{}};t[a][0].call(l.exports,function(e){return s(t[a][1][e]||e);},l,l.exports,e,t,n,i);}return n[a].exports;}for(var r="function"==typeof require&&require,a=0;a<i.length;a++)s(i[a]);return s;}({1:[function(e,t,n){!function(i,s){"object"==_typeof(n)&&void 0!==t?s(n,e("@tonaljs/core")):"function"==typeof define&&define.amd?define(["exports","@tonaljs/core"],s):s((i=i||self).AbcNotation={},i.core);}(this,function(e,t){"use strict";var n=function n(e,t){return Array(t+1).join(e);},i=/^(_{1,}|=|\^{1,}|)([abcdefgABCDEFG])([,']*)$/;function s(e){var t=i.exec(e);return t?[t[1],t[2],t[3]]:["","",""];}function r(e){var t=s(e),n=t[0],i=t[1],r=t[2];if(""===i)return"";for(var a=4,o=0;o<r.length;o++)a+=","===r.charAt(o)?-1:1;var c="_"===n[0]?n.replace(/_/g,"b"):"^"===n[0]?n.replace(/\^/g,"#"):"";return i.charCodeAt(0)>96?i.toUpperCase()+c+(a+1):i+c+a;}function a(e){var i=t.note(e);if(i.empty||!i.oct)return"";var s=i.letter,r=i.acc,a=i.oct;return("b"===r[0]?r.replace(/b/g,"_"):r.replace(/#/g,"^"))+(a>4?s.toLowerCase():s)+(5===a?"":a>4?n("'",a-5):n(",",4-a));}function o(e,n){return a(t.transpose(r(e),n));}function c(e,n){return t.distance(r(e),r(n));}var u={abcToScientificNotation:r,scientificToAbcNotation:a,tokenize:s,transpose:o,distance:c};e.abcToScientificNotation=r,e["default"]=u,e.distance=c,e.scientificToAbcNotation=a,e.tokenize=s,e.transpose=o,Object.defineProperty(e,"__esModule",{value:!0});});},{"@tonaljs/core":7}],2:[function(e,t,n){!function(i,s){"object"==_typeof(n)&&void 0!==t?s(n,e("@tonaljs/core")):"function"==typeof define&&define.amd?define(["exports","@tonaljs/core"],s):s((i=i||self).Array={},i.core);}(this,function(e,t){"use strict";function n(e){return e.map(function(e){return t.note(e);}).filter(function(e){return!e.empty;}).sort(function(e,t){return e.height-t.height;}).map(function(e){return e.name;});}e.compact=function(e){return e.filter(function(e){return 0===e||e;});},e.permutations=function e(t){return 0===t.length?[[]]:e(t.slice(1)).reduce(function(e,n){return e.concat(t.map(function(e,i){var s=n.slice();return s.splice(i,0,t[0]),s;}));},[]);},e.range=function(e,t){return e<t?function(e,t){for(var n=[];t--;n[t]=t+e);return n;}(e,t-e+1):function(e,t){for(var n=[];t--;n[t]=e-t);return n;}(e,e-t+1);},e.rotate=function(e,t){var n=t.length,i=(e%n+n)%n;return t.slice(i,n).concat(t.slice(0,i));},e.shuffle=function(e,t){var n,i;void 0===t&&(t=Math.random);for(var s=e.length;s;)n=Math.floor(t()*s--),i=e[s],e[s]=e[n],e[n]=i;return e;},e.sortedNoteNames=n,e.sortedUniqNoteNames=function(e){return n(e).filter(function(e,t,n){return 0===t||e!==n[t-1];});},Object.defineProperty(e,"__esModule",{value:!0});});},{"@tonaljs/core":7}],3:[function(e,t,n){!function(i,s){"object"==_typeof(n)&&void 0!==t?s(n,e("@tonaljs/chord-type"),e("@tonaljs/core"),e("@tonaljs/pcset")):"function"==typeof define&&define.amd?define(["exports","@tonaljs/chord-type","@tonaljs/core","@tonaljs/pcset"],s):s((i="undefined"!=typeof globalThis?globalThis:i||self).ChordDetect={},i.chordType,i.core,i.pcset);}(this,function(e,t,n,i){"use strict";var s=function s(e){var t=e.reduce(function(e,t){var i=n.note(t).chroma;return void 0!==i&&(e[i]=e[i]||n.note(t).name),e;},{});return function(e){return t[e];};};function r(e){var r=e.map(function(e){return n.note(e).pc;}).filter(function(e){return e;});if(0===n.note.length)return[];var a=function(e,r){var a=e[0],o=n.note(a).chroma,c=s(e),u=i.modes(e,!1),l=[];return u.forEach(function(e,n){t.all().filter(function(t){return t.chroma===e;}).forEach(function(e){var t=e.aliases[0],i=c(n);n!==o?l.push({weight:.5*r,name:""+i+t+"/"+a}):l.push({weight:1*r,name:""+i+t});});}),l;}(r,1);return a.filter(function(e){return e.weight;}).sort(function(e,t){return t.weight-e.weight;}).map(function(e){return e.name;});}var a={detect:r};e["default"]=a,e.detect=r,Object.defineProperty(e,"__esModule",{value:!0});});},{"@tonaljs/chord-type":4,"@tonaljs/core":7,"@tonaljs/pcset":14}],4:[function(e,t,n){!function(i,s){"object"==_typeof(n)&&void 0!==t?s(n,e("@tonaljs/core"),e("@tonaljs/pcset")):"function"==typeof define&&define.amd?define(["exports","@tonaljs/core","@tonaljs/pcset"],s):s((i="undefined"!=typeof globalThis?globalThis:i||self).ChordType={},i.core,i.pcset);}(this,function(e,t,n){"use strict";var _i2=function i(){return _i2=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var s in t=arguments[n])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e;},_i2.apply(this,arguments);},s=_i2(_i2({},n.EmptyPcset),{name:"",quality:"Unknown",intervals:[],aliases:[]}),r=[],a={};function o(e){return a[e]||s;}var c=t.deprecate("ChordType.chordType","ChordType.get",o);function u(){return r.map(function(e){return e.name;}).filter(function(e){return e;});}function l(){return r.map(function(e){return e.aliases[0];}).filter(function(e){return e;});}function d(){return Object.keys(a);}function h(){return r.slice();}var p=t.deprecate("ChordType.entries","ChordType.all",h);function m(){r=[],a={};}function g(e,t,s){var o=function(e){var t=function t(_t2){return-1!==e.indexOf(_t2);};return t("5A")?"Augmented":t("3M")?"Major":t("5d")?"Diminished":t("3m")?"Minor":"Unknown";}(e),c=_i2(_i2({},n.get(e)),{name:s||"",quality:o,intervals:e,aliases:t});r.push(c),c.name&&(a[c.name]=c),a[c.setNum]=c,a[c.chroma]=c,c.aliases.forEach(function(e){return f(c,e);});}function f(e,t){a[t]=e;}[["1P 3M 5P","major","M ^ "],["1P 3M 5P 7M","major seventh","maj7 Δ ma7 M7 Maj7 ^7"],["1P 3M 5P 7M 9M","major ninth","maj9 Δ9 ^9"],["1P 3M 5P 7M 9M 13M","major thirteenth","maj13 Maj13 ^13"],["1P 3M 5P 6M","sixth","6 add6 add13 M6"],["1P 3M 5P 6M 9M","sixth/ninth","6/9 69 M69"],["1P 3M 6m 7M","major seventh flat sixth","M7b6 ^7b6"],["1P 3M 5P 7M 11A","major seventh sharp eleventh","maj#4 Δ#4 Δ#11 M7#11 ^7#11 maj7#11"],["1P 3m 5P","minor","m min -"],["1P 3m 5P 7m","minor seventh","m7 min7 mi7 -7"],["1P 3m 5P 7M","minor/major seventh","m/ma7 m/maj7 mM7 mMaj7 m/M7 -Δ7 mΔ -^7"],["1P 3m 5P 6M","minor sixth","m6 -6"],["1P 3m 5P 7m 9M","minor ninth","m9 -9"],["1P 3m 5P 7M 9M","minor/major ninth","mM9 mMaj9 -^9"],["1P 3m 5P 7m 9M 11P","minor eleventh","m11 -11"],["1P 3m 5P 7m 9M 13M","minor thirteenth","m13 -13"],["1P 3m 5d","diminished","dim ° o"],["1P 3m 5d 7d","diminished seventh","dim7 °7 o7"],["1P 3m 5d 7m","half-diminished","m7b5 ø -7b5 h7 h"],["1P 3M 5P 7m","dominant seventh","7 dom"],["1P 3M 5P 7m 9M","dominant ninth","9"],["1P 3M 5P 7m 9M 13M","dominant thirteenth","13"],["1P 3M 5P 7m 11A","lydian dominant seventh","7#11 7#4"],["1P 3M 5P 7m 9m","dominant flat ninth","7b9"],["1P 3M 5P 7m 9A","dominant sharp ninth","7#9"],["1P 3M 7m 9m","altered","alt7"],["1P 4P 5P","suspended fourth","sus4 sus"],["1P 2M 5P","suspended second","sus2"],["1P 4P 5P 7m","suspended fourth seventh","7sus4 7sus"],["1P 5P 7m 9M 11P","eleventh","11"],["1P 4P 5P 7m 9m","suspended fourth flat ninth","b9sus phryg 7b9sus 7b9sus4"],["1P 5P","fifth","5"],["1P 3M 5A","augmented","aug + +5 ^#5"],["1P 3m 5A","minor augmented","m#5 -#5 m+"],["1P 3M 5A 7M","augmented seventh","maj7#5 maj7+5 +maj7 ^7#5"],["1P 3M 5P 7M 9M 11A","major sharp eleventh (lydian)","maj9#11 Δ9#11 ^9#11"],["1P 2M 4P 5P","","sus24 sus4add9"],["1P 3M 5A 7M 9M","","maj9#5 Maj9#5"],["1P 3M 5A 7m","","7#5 +7 7+ 7aug aug7"],["1P 3M 5A 7m 9A","","7#5#9 7#9#5 7alt"],["1P 3M 5A 7m 9M","","9#5 9+"],["1P 3M 5A 7m 9M 11A","","9#5#11"],["1P 3M 5A 7m 9m","","7#5b9 7b9#5"],["1P 3M 5A 7m 9m 11A","","7#5b9#11"],["1P 3M 5A 9A","","+add#9"],["1P 3M 5A 9M","","M#5add9 +add9"],["1P 3M 5P 6M 11A","","M6#11 M6b5 6#11 6b5"],["1P 3M 5P 6M 7M 9M","","M7add13"],["1P 3M 5P 6M 9M 11A","","69#11"],["1P 3m 5P 6M 9M","","m69 -69"],["1P 3M 5P 6m 7m","","7b6"],["1P 3M 5P 7M 9A 11A","","maj7#9#11"],["1P 3M 5P 7M 9M 11A 13M","","M13#11 maj13#11 M13+4 M13#4"],["1P 3M 5P 7M 9m","","M7b9"],["1P 3M 5P 7m 11A 13m","","7#11b13 7b5b13"],["1P 3M 5P 7m 13M","","7add6 67 7add13"],["1P 3M 5P 7m 9A 11A","","7#9#11 7b5#9 7#9b5"],["1P 3M 5P 7m 9A 11A 13M","","13#9#11"],["1P 3M 5P 7m 9A 11A 13m","","7#9#11b13"],["1P 3M 5P 7m 9A 13M","","13#9"],["1P 3M 5P 7m 9A 13m","","7#9b13"],["1P 3M 5P 7m 9M 11A","","9#11 9+4 9#4"],["1P 3M 5P 7m 9M 11A 13M","","13#11 13+4 13#4"],["1P 3M 5P 7m 9M 11A 13m","","9#11b13 9b5b13"],["1P 3M 5P 7m 9m 11A","","7b9#11 7b5b9 7b9b5"],["1P 3M 5P 7m 9m 11A 13M","","13b9#11"],["1P 3M 5P 7m 9m 11A 13m","","7b9b13#11 7b9#11b13 7b5b9b13"],["1P 3M 5P 7m 9m 13M","","13b9"],["1P 3M 5P 7m 9m 13m","","7b9b13"],["1P 3M 5P 7m 9m 9A","","7b9#9"],["1P 3M 5P 9M","","Madd9 2 add9 add2"],["1P 3M 5P 9m","","Maddb9"],["1P 3M 5d","","Mb5"],["1P 3M 5d 6M 7m 9M","","13b5"],["1P 3M 5d 7M","","M7b5"],["1P 3M 5d 7M 9M","","M9b5"],["1P 3M 5d 7m","","7b5"],["1P 3M 5d 7m 9M","","9b5"],["1P 3M 7m","","7no5"],["1P 3M 7m 13m","","7b13"],["1P 3M 7m 9M","","9no5"],["1P 3M 7m 9M 13M","","13no5"],["1P 3M 7m 9M 13m","","9b13"],["1P 3m 4P 5P","","madd4"],["1P 3m 5P 6m 7M","","mMaj7b6"],["1P 3m 5P 6m 7M 9M","","mMaj9b6"],["1P 3m 5P 7m 11P","","m7add11 m7add4"],["1P 3m 5P 9M","","madd9"],["1P 3m 5d 6M 7M","","o7M7"],["1P 3m 5d 7M","","oM7"],["1P 3m 6m 7M","","mb6M7"],["1P 3m 6m 7m","","m7#5"],["1P 3m 6m 7m 9M","","m9#5"],["1P 3m 5A 7m 9M 11P","","m11A"],["1P 3m 6m 9m","","mb6b9"],["1P 2M 3m 5d 7m","","m9b5"],["1P 4P 5A 7M","","M7#5sus4"],["1P 4P 5A 7M 9M","","M9#5sus4"],["1P 4P 5A 7m","","7#5sus4"],["1P 4P 5P 7M","","M7sus4"],["1P 4P 5P 7M 9M","","M9sus4"],["1P 4P 5P 7m 9M","","9sus4 9sus"],["1P 4P 5P 7m 9M 13M","","13sus4 13sus"],["1P 4P 5P 7m 9m 13m","","7sus4b9b13 7b9b13sus4"],["1P 4P 7m 10m","","4 quartal"],["1P 5P 7m 9m 11P","","11b9"]].forEach(function(e){var t=e[0],n=e[1],i=e[2];return g(t.split(" "),i.split(" "),n);}),r.sort(function(e,t){return e.setNum-t.setNum;});var _={names:u,symbols:l,get:o,all:h,add:g,removeAll:m,keys:d,entries:p,chordType:c};e.add=g,e.addAlias=f,e.all=h,e.chordType=c,e["default"]=_,e.entries=p,e.get=o,e.keys=d,e.names=u,e.removeAll=m,e.symbols=l,Object.defineProperty(e,"__esModule",{value:!0});});},{"@tonaljs/core":7,"@tonaljs/pcset":14}],5:[function(e,t,n){!function(i,s){"object"==_typeof(n)&&void 0!==t?s(n,e("@tonaljs/chord-detect"),e("@tonaljs/chord-type"),e("@tonaljs/core"),e("@tonaljs/pcset"),e("@tonaljs/scale-type")):"function"==typeof define&&define.amd?define(["exports","@tonaljs/chord-detect","@tonaljs/chord-type","@tonaljs/core","@tonaljs/pcset","@tonaljs/scale-type"],s):s((i="undefined"!=typeof globalThis?globalThis:i||self).Chord={},i.chordDetect,i.chordType,i.core,i.pcset,i.scaleType);}(this,function(e,t,n,i,s,r){"use strict";var _a2=function a(){return _a2=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var s in t=arguments[n])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e;},_a2.apply(this,arguments);},o={empty:!0,name:"",symbol:"",root:"",rootDegree:0,type:"",tonic:null,setNum:NaN,quality:"Unknown",chroma:"",normalized:"",aliases:[],notes:[],intervals:[]},c=/^(6|64|7|9|11|13)$/;function u(e){var t=i.tokenizeNote(e),n=t[0],s=t[1],r=t[2],a=t[3];return""===n?["",e]:"A"===n&&"ug"===a?["","aug"]:a||"4"!==r&&"5"!==r?c.test(r)?[n+s,r+a]:[n+s+r,a]:[n+s,r];}function l(e){if(""===e)return o;if(Array.isArray(e)&&2===e.length)return d(e[1],e[0]);var t=u(e),n=t[0],i=d(t[1],n);return i.empty?d(e):i;}function d(e,t,s){var r=n.get(e),c=i.note(t||""),u=i.note(s||"");if(r.empty||t&&c.empty||s&&u.empty)return o;var l=i.distance(c.pc,u.pc),d=r.intervals.indexOf(l)+1;if(!u.empty&&!d)return o;for(var h=Array.from(r.intervals),p=1;p<d;p++){var m=h[0][0],g=h[0][1],f=parseInt(m,10)+7;h.push(""+f+g),h.shift();}var _=c.empty?[]:h.map(function(e){return i.transpose(c,e);});e=-1!==r.aliases.indexOf(e)?e:r.aliases[0];var y=""+(c.empty?"":c.pc)+e+(u.empty||d<=1?"":"/"+u.pc),b=(t?c.pc+" ":"")+r.name+(d>1&&s?" over "+u.pc:"");return _a2(_a2({},r),{name:b,symbol:y,type:r.name,root:u.name,intervals:h,rootDegree:d,tonic:c.name,notes:_});}var h=i.deprecate("Chord.chord","Chord.get",l);function p(e,t){var n=u(e),s=n[0],r=n[1];return s?i.transpose(s,t)+r:e;}function m(e){var t=l(e),n=s.isSupersetOf(t.chroma);return r.all().filter(function(e){return n(e.chroma);}).map(function(e){return e.name;});}function g(e){var t=l(e),i=s.isSupersetOf(t.chroma);return n.all().filter(function(e){return i(e.chroma);}).map(function(e){return t.tonic+e.aliases[0];});}function f(e){var t=l(e),i=s.isSubsetOf(t.chroma);return n.all().filter(function(e){return i(e.chroma);}).map(function(e){return t.tonic+e.aliases[0];});}var _={getChord:d,get:l,detect:t.detect,chordScales:m,extended:g,reduced:f,tokenize:u,transpose:p,chord:h};Object.defineProperty(e,"detect",{enumerable:!0,get:function get(){return t.detect;}}),e.chord=h,e.chordScales=m,e["default"]=_,e.extended=g,e.get=l,e.getChord=d,e.reduced=f,e.tokenize=u,e.transpose=p,Object.defineProperty(e,"__esModule",{value:!0});});},{"@tonaljs/chord-detect":3,"@tonaljs/chord-type":4,"@tonaljs/core":7,"@tonaljs/pcset":14,"@tonaljs/scale-type":18}],6:[function(e,t,n){!function(e,i){"object"==_typeof(n)&&void 0!==t?i(n):"function"==typeof define&&define.amd?define(["exports"],i):i((e=e||self).Collection={});}(this,function(e){"use strict";function t(e,t){return e<t?function(e,t){for(var n=[];t--;n[t]=t+e);return n;}(e,t-e+1):function(e,t){for(var n=[];t--;n[t]=e-t);return n;}(e,e-t+1);}function n(e,t){var n=t.length,i=(e%n+n)%n;return t.slice(i,n).concat(t.slice(0,i));}function i(e){return e.filter(function(e){return 0===e||e;});}function s(e,t){var n,i;void 0===t&&(t=Math.random);for(var s=e.length;s;)n=Math.floor(t()*s--),i=e[s],e[s]=e[n],e[n]=i;return e;}function r(e){return 0===e.length?[[]]:r(e.slice(1)).reduce(function(t,n){return t.concat(e.map(function(t,i){var s=n.slice();return s.splice(i,0,e[0]),s;}));},[]);}var a={compact:i,permutations:r,range:t,rotate:n,shuffle:s};e.compact=i,e["default"]=a,e.permutations=r,e.range=t,e.rotate=n,e.shuffle=s,Object.defineProperty(e,"__esModule",{value:!0});});},{}],7:[function(e,t,n){!function(e,i){"object"==_typeof(n)&&void 0!==t?i(n):"function"==typeof define&&define.amd?define(["exports"],i):i((e=e||self).Core={});}(this,function(e){"use strict";var t=function t(e,_t3){return Array(Math.abs(_t3)+1).join(e);};function n(e){return null!==e&&"object"==_typeof(e)&&"string"==typeof e.name;}function i(e){return null!==e&&"object"==_typeof(e)&&"number"==typeof e.step&&"number"==typeof e.alt;}var s=[0,2,4,-1,1,3,5],r=s.map(function(e){return Math.floor(7*e/12);});function a(e){var t=e.step,n=e.alt,i=e.oct,a=e.dir,o=void 0===a?1:a,c=s[t]+7*n;return void 0===i?[o*c]:[o*c,o*(i-r[t]-4*n)];}var o=[3,0,4,1,5,2,6];function c(e){var t=e[0],n=e[1],i=e[2],s=o[function(e){var t=(e+1)%7;return t<0?7+t:t;}(t)],a=Math.floor((t+1)/7);return void 0===n?{step:s,alt:a,dir:i}:{step:s,alt:a,oct:n+4*a+r[s],dir:i};}var u={empty:!0,name:"",pc:"",acc:""},l=new Map(),d=function d(e){return"CDEFGAB".charAt(e);},h=function h(e){return e<0?t("b",-e):t("#",e);},p=function p(e){return"b"===e[0]?-e.length:e.length;};function m(e){var t=l.get(e);if(t)return t;var s="string"==typeof e?function(e){var t=f(e);if(""===t[0]||""!==t[3])return u;var n=t[0],i=t[1],s=t[2],r=(n.charCodeAt(0)+3)%7,o=p(i),c=s.length?+s:void 0,l=a({step:r,alt:o,oct:c}),d=n+i+s,h=n+i,m=(b[r]+o+120)%12,g=void 0===c?y(b[r]+o,12)-1188:b[r]+o+12*(c+1),_=g>=0&&g<=127?g:null,z=void 0===c?null:440*Math.pow(2,(g-69)/12);return{empty:!1,acc:i,alt:o,chroma:m,coord:l,freq:z,height:g,letter:n,midi:_,name:d,oct:c,pc:h,step:r};}(e):i(e)?m(function(e){var t=e.step,n=e.alt,i=e.oct,s=d(t);if(!s)return"";var r=s+h(n);return i||0===i?r+i:r;}(e)):n(e)?m(e.name):u;return l.set(e,s),s;}var g=/^([a-gA-G]?)(#{1,}|b{1,}|x{1,}|)(-?\d*)\s*(.*)$/;function f(e){var t=g.exec(e);return[t[1].toUpperCase(),t[2].replace(/x/g,"##"),t[3],t[4]];}function _(e){return m(c(e));}var y=function y(e,t){return(e%t+t)%t;},b=[0,2,4,5,7,9,11];var z={empty:!0,name:"",acc:""},v=new RegExp("^([-+]?\\d+)(d{1,4}|m|M|P|A{1,4})|(AA|A|P|M|m|d|dd)([-+]?\\d+)$");function w(e){var t=v.exec(""+e);return null===t?["",""]:t[1]?[t[1],t[2]]:[t[4],t[3]];}var x={};function T(e){return"string"==typeof e?x[e]||(x[e]=function(e){var t=w(e);if(""===t[0])return z;var n=+t[0],i=t[1],s=(Math.abs(n)-1)%7,r=S[s];if("M"===r&&"P"===i)return z;var o="M"===r?"majorable":"perfectable",c=""+n+i,u=n<0?-1:1,l=8===n||-8===n?n:u*(s+1),d=function(e,t){return"M"===t&&"majorable"===e||"P"===t&&"perfectable"===e?0:"m"===t&&"majorable"===e?-1:/^A+$/.test(t)?t.length:/^d+$/.test(t)?-1*("perfectable"===e?t.length:t.length+1):0;}(o,i),h=Math.floor((Math.abs(n)-1)/7),p=u*(k[s]+d+12*h),m=(u*(k[s]+d)%12+12)%12,g=a({step:s,alt:d,oct:h,dir:u});return{empty:!1,name:c,num:n,q:i,step:s,alt:d,dir:u,type:o,simple:l,semitones:p,chroma:m,coord:g,oct:h};}(e)):i(e)?T(function(e){var n=e.step,i=e.alt,s=e.oct,r=void 0===s?0:s,a=e.dir;if(!a)return"";var o=n+1+7*r,c=a<0?"-":"",u="M"===S[n]?"majorable":"perfectable";return c+o+function(e,n){return 0===n?"majorable"===e?"M":"P":-1===n&&"majorable"===e?"m":n>0?t("A",n):t("d","perfectable"===e?n:n+1);}(u,i);}(e)):n(e)?T(e.name):z;}var k=[0,2,4,5,7,9,11],S="PMMPPMM";function M(e){var t=e[0],n=e[1],i=void 0===n?0:n;return T(c(7*t+12*i<0?[-t,-i,-1]:[t,i,1]));}e.accToAlt=p,e.altToAcc=h,e.coordToInterval=M,e.coordToNote=_,e.decode=c,e.deprecate=function(e,t,n){return function(){for(var i=[],s=0;s<arguments.length;s++)i[s]=arguments[s];return console.warn(e+" is deprecated. Use "+t+"."),n.apply(this,i);};},e.distance=function(e,t){var n=m(e),i=m(t);if(n.empty||i.empty)return"";var s=n.coord,r=i.coord,a=r[0]-s[0];return M([a,2===s.length&&2===r.length?r[1]-s[1]:-Math.floor(7*a/12)]).name;},e.encode=a,e.fillStr=t,e.interval=T,e.isNamed=n,e.isPitch=i,e.note=m,e.stepToLetter=d,e.tokenizeInterval=w,e.tokenizeNote=f,e.transpose=function(e,t){var n=m(e),i=T(t);if(n.empty||i.empty)return"";var s=n.coord,r=i.coord;return _(1===s.length?[s[0]+r[0]]:[s[0]+r[0],s[1]+r[1]]).name;},Object.defineProperty(e,"__esModule",{value:!0});});},{}],8:[function(e,t,n){!function(e,i){"object"==_typeof(n)&&void 0!==t?i(n):"function"==typeof define&&define.amd?define(["exports"],i):i((e=e||self).DurationValue={});}(this,function(e){"use strict";var _t4=function t(){return _t4=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var s in t=arguments[n])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e;},_t4.apply(this,arguments);},n=[];[[.125,"dl",["large","duplex longa","maxima","octuple","octuple whole"]],[.25,"l",["long","longa"]],[.5,"d",["double whole","double","breve"]],[1,"w",["whole","semibreve"]],[2,"h",["half","minim"]],[4,"q",["quarter","crotchet"]],[8,"e",["eighth","quaver"]],[16,"s",["sixteenth","semiquaver"]],[32,"t",["thirty-second","demisemiquaver"]],[64,"sf",["sixty-fourth","hemidemisemiquaver"]],[128,"h",["hundred twenty-eighth"]],[256,"th",["two hundred fifty-sixth"]]].forEach(function(e){return function(e,t,i){n.push({empty:!1,dots:"",name:"",value:1/e,fraction:e<1?[1/e,1]:[1,e],shorthand:t,names:i});}(e[0],e[1],e[2]);});var i={empty:!0,name:"",value:0,fraction:[0,0],shorthand:"",dots:"",names:[]};function s(){return n.reduce(function(e,t){return t.names.forEach(function(t){return e.push(t);}),e;},[]);}function r(){return n.map(function(e){return e.shorthand;});}var a=/^([^.]+)(\.*)$/;function o(e){var s=a.exec(e)||[],r=(s[0],s[1]),o=s[2],c=n.find(function(e){return e.shorthand===r||e.names.includes(r);});if(!c)return i;var u=function(e,t){for(var n=Math.pow(2,t),i=e[0]*n,s=e[1]*n,r=i,a=0;a<t;a++)i+=r/Math.pow(2,a+1);for(;i%2==0&&s%2==0;)i/=2,s/=2;return[i,s];}(c.fraction,o.length),l=u[0]/u[1];return _t4(_t4({},c),{name:e,dots:o,value:l,fraction:u});}var c=function c(e){return o(e).value;},u=function u(e){return o(e).fraction;},l={names:s,shorthands:r,get:o,value:c,fraction:u};e["default"]=l,e.fraction=u,e.get=o,e.names=s,e.shorthands=r,e.value=c,Object.defineProperty(e,"__esModule",{value:!0});});},{}],9:[function(e,t,n){!function(i,s){"object"==_typeof(n)&&void 0!==t?s(n,e("@tonaljs/core")):"function"==typeof define&&define.amd?define(["exports","@tonaljs/core"],s):s((i=i||self).Interval={},i.core);}(this,function(e,t){"use strict";function n(){return"1P 2M 3M 4P 5P 6m 7m".split(" ");}var i=t.interval,s=function s(e){return t.interval(e).name;},r=function r(e){return t.interval(e).semitones;},a=function a(e){return t.interval(e).q;},o=function o(e){return t.interval(e).num;};function c(e){var n=t.interval(e);return n.empty?"":n.simple+n.q;}function u(e){var n=t.interval(e);if(n.empty)return"";var i=(7-n.step)%7,s="perfectable"===n.type?-n.alt:-(n.alt+1);return t.interval({step:i,alt:s,oct:n.oct,dir:n.dir}).name;}var l=[1,2,2,3,3,4,5,5,6,6,7,7],d="P m M m M P d P m M m M".split(" ");function h(e){var t=e<0?-1:1,n=Math.abs(e),i=n%12,s=Math.floor(n/12);return t*(l[i]+7*s)+d[i];}var p=t.distance,m=y(function(e,t){return[e[0]+t[0],e[1]+t[1]];}),g=function g(e){return function(t){return m(e,t);};},f=y(function(e,t){return[e[0]-t[0],e[1]-t[1]];}),_={names:n,get:i,name:s,num:o,semitones:r,quality:a,fromSemitones:h,distance:p,invert:u,simplify:c,add:m,addTo:g,substract:f};function y(e){return function(n,i){var s=t.interval(n).coord,r=t.interval(i).coord;if(s&&r){var a=e(s,r);return t.coordToInterval(a).name;}};}e.add=m,e.addTo=g,e["default"]=_,e.distance=p,e.fromSemitones=h,e.get=i,e.invert=u,e.name=s,e.names=n,e.num=o,e.quality=a,e.semitones=r,e.simplify=c,e.substract=f,Object.defineProperty(e,"__esModule",{value:!0});});},{"@tonaljs/core":7}],10:[function(e,t,n){!function(i,s){"object"==_typeof(n)&&void 0!==t?s(n,e("@tonaljs/core"),e("@tonaljs/note"),e("@tonaljs/roman-numeral")):"function"==typeof define&&define.amd?define(["exports","@tonaljs/core","@tonaljs/note","@tonaljs/roman-numeral"],s):s((i=i||self).Key={},i.core,i.note,i.romanNumeral);}(this,function(e,t,n,i){"use strict";var _s2=function s(){return _s2=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var s in t=arguments[n])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e;},_s2.apply(this,arguments);},r=function r(e){return function(t,n){return void 0===n&&(n=""),t.map(function(t,i){return"-"!==t?e[i]+n+t:"";});};};function a(e,n,s,a){return function(o){var c=e.split(" "),u=c.map(function(e){return i.get(e).interval||"";}),l=u.map(function(e){return t.transpose(o,e);}),d=r(l);return{tonic:o,grades:c,intervals:u,scale:l,chords:d(n.split(" ")),chordsHarmonicFunction:s.split(" "),chordScales:d(a.split(",")," ")};};}var o=function o(e,n){var i=t.note(e),s=t.note(n);return i.empty||s.empty?0:s.coord[0]-i.coord[0];},c=a("I II III IV V VI VII","maj7 m7 m7 maj7 7 m7 m7b5","T SD T SD D T D","major,dorian,phrygian,lydian,mixolydian,minor,locrian"),u=a("I II bIII IV V bVI bVII","m7 m7b5 maj7 m7 m7 maj7 7","T SD T SD D SD SD","minor,locrian,major,dorian,phrygian,lydian,mixolydian"),l=a("I II bIII IV V bVI VII","mmaj7 m7b5 +maj7 m7 7 maj7 mo7","T SD T SD D SD D","harmonic minor,locrian 6,major augmented,lydian diminished,phrygian dominant,lydian #9,ultralocrian"),d=a("I II bIII IV V VI VII","m6 m7 +maj7 7 7 m7b5 m7b5","T SD T SD D - -","melodic minor,dorian b2,lydian augmented,lydian dominant,mixolydian b6,locrian #2,altered");function h(e){var n=c(e),i=o("C",e),a=r(n.scale);return _s2(_s2({},n),{type:"major",minorRelative:t.transpose(e,"-3m"),alteration:i,keySignature:t.altToAcc(i),secondaryDominants:a("- VI7 VII7 I7 II7 III7 -".split(" ")),secondaryDominantsMinorRelative:a("- IIIm7b5 IV#m7 Vm7 VIm7 VIIm7b5 -".split(" ")),substituteDominants:a("- bIII7 IV7 bV7 bVI7 bVII7 -".split(" ")),substituteDominantsMinorRelative:a("- IIIm7 Im7 IIbm7 VIm7 IVm7 -".split(" "))});}function p(e){var n=o("C",e)-3;return{type:"minor",tonic:e,relativeMajor:t.transpose(e,"3m"),alteration:n,keySignature:t.altToAcc(n),natural:u(e),harmonic:l(e),melodic:d(e)};}function m(e){return"number"==typeof e?n.transposeFifths("C",e):"string"==typeof e&&/^b+|#+$/.test(e)?n.transposeFifths("C",t.accToAlt(e)):null;}var g={majorKey:h,majorTonicFromKeySignature:m,minorKey:p};e["default"]=g,e.majorKey=h,e.majorTonicFromKeySignature=m,e.minorKey=p,Object.defineProperty(e,"__esModule",{value:!0});});},{"@tonaljs/core":7,"@tonaljs/note":13,"@tonaljs/roman-numeral":17}],11:[function(e,t,n){!function(i,s){"object"==_typeof(n)&&void 0!==t?s(n,e("@tonaljs/core")):"function"==typeof define&&define.amd?define(["exports","@tonaljs/core"],s):s((i=i||self).Midi={},i.core);}(this,function(e,t){"use strict";function n(e){return+e>=0&&+e<=127;}function i(e){if(n(e))return+e;var i=t.note(e);return i.empty?null:i.midi;}function s(e,t){return void 0===t&&(t=440),Math.pow(2,(e-69)/12)*t;}var r=Math.log(2),a=Math.log(440);function o(e){var t=12*(Math.log(e)-a)/r+69;return Math.round(100*t)/100;}var c="C C# D D# E F F# G G# A A# B".split(" "),u="C Db D Eb E F Gb G Ab A Bb B".split(" ");function l(e,t){if(void 0===t&&(t={}),isNaN(e)||e===-1/0||e===1/0)return"";e=Math.round(e);var n=(!0===t.sharps?c:u)[e%12];return t.pitchClass?n:n+(Math.floor(e/12)-1);}var d={isMidi:n,toMidi:i,midiToFreq:s,midiToNoteName:l,freqToMidi:o};e["default"]=d,e.freqToMidi=o,e.isMidi=n,e.midiToFreq=s,e.midiToNoteName=l,e.toMidi=i,Object.defineProperty(e,"__esModule",{value:!0});});},{"@tonaljs/core":7}],12:[function(e,t,n){!function(i,s){"object"==_typeof(n)&&void 0!==t?s(n,e("@tonaljs/core"),e("@tonaljs/pcset")):"function"==typeof define&&define.amd?define(["exports","@tonaljs/core","@tonaljs/pcset"],s):s((i=i||self).Mode={},i.core,i.pcset);}(this,function(e,t,n){"use strict";var _i3=function i(){return _i3=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var s in t=arguments[n])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e;},_i3.apply(this,arguments);},s=_i3(_i3({},n.EmptyPcset),{name:"",alt:0,modeNum:NaN,triad:"",seventh:"",aliases:[]}),r=[[0,2773,0,"ionian","","Maj7","major"],[1,2902,2,"dorian","m","m7"],[2,3418,4,"phrygian","m","m7"],[3,2741,-1,"lydian","","Maj7"],[4,2774,1,"mixolydian","","7"],[5,2906,3,"aeolian","m","m7","minor"],[6,3434,5,"locrian","dim","m7b5"]].map(function(e){var t=e[0],i=e[1],s=e[2],r=e[3],a=e[4],o=e[5],c=e[6],u=c?[c]:[],l=Number(i).toString(2);return{empty:!1,intervals:n.chromaToIntervals(l),modeNum:t,chroma:l,normalized:l,name:r,setNum:i,alt:s,triad:a,seventh:o,aliases:u};}),a={};function o(e){return"string"==typeof e?a[e.toLowerCase()]||s:e&&e.name?o(e.name):s;}r.forEach(function(e){a[e.name]=e,e.aliases.forEach(function(t){a[t]=e;});});var c=t.deprecate("Mode.mode","Mode.get",o);function u(){return r.slice();}var l=t.deprecate("Mode.mode","Mode.all",u);function d(){return r.map(function(e){return e.name;});}var h={get:o,names:d,all:u,entries:l,mode:c};e.all=u,e["default"]=h,e.entries=l,e.get=o,e.mode=c,e.names=d,Object.defineProperty(e,"__esModule",{value:!0});});},{"@tonaljs/core":7,"@tonaljs/pcset":14}],13:[function(e,t,n){!function(i,s){"object"==_typeof(n)&&void 0!==t?s(n,e("@tonaljs/core"),e("@tonaljs/midi")):"function"==typeof define&&define.amd?define(["exports","@tonaljs/core","@tonaljs/midi"],s):s((i=i||self).Note={},i.core,i.midi$1);}(this,function(e,t,n){"use strict";var i=["C","D","E","F","G","A","B"],s=function s(e){return e.name;},r=function r(e){return e.map(t.note).filter(function(e){return!e.empty;});};function a(e){return void 0===e?i.slice():Array.isArray(e)?r(e).map(s):[];}var o=t.note,c=function c(e){return o(e).name;},u=function u(e){return o(e).pc;},l=function l(e){return o(e).acc;},d=function d(e){return o(e).oct;},h=function h(e){return o(e).midi;},p=function p(e){return o(e).freq;},m=function m(e){return o(e).chroma;};function g(e){return n.midiToNoteName(e);}function f(e){return n.midiToNoteName(n.freqToMidi(e));}function _(e){return n.midiToNoteName(n.freqToMidi(e),{sharps:!0});}function y(e){return n.midiToNoteName(e,{sharps:!0});}var b=t.transpose,z=t.transpose,v=function v(e){return function(t){return b(t,e);};},w=v,x=function x(e){return function(t){return b(e,t);};},T=x;function k(e,n){var i=o(e);if(i.empty)return"";var s=i.coord,r=s[0],a=s[1];return(void 0===a?t.coordToNote([r+n]):t.coordToNote([r+n,a])).name;}var S=k,M=function M(e,t){return e.height-t.height;},E=function E(e,t){return t.height-e.height;};function A(e,t){return t=t||M,r(e).sort(t).map(s);}function C(e){return A(e,M).filter(function(e,t,n){return 0===t||e!==n[t-1];});}var P=O(!0),D=O(!1);function O(e){return function(t){var i=o(t);if(i.empty)return"";var s=e?i.alt>0:i.alt<0,r=null===i.midi;return n.midiToNoteName(i.midi||i.chroma,{sharps:s,pitchClass:r});};}var j={names:a,get:o,name:c,pitchClass:u,accidentals:l,octave:d,midi:h,ascending:M,descending:E,sortedNames:A,sortedUniqNames:C,fromMidi:g,fromMidiSharps:y,freq:p,fromFreq:f,fromFreqSharps:_,chroma:m,transpose:b,tr:z,transposeBy:v,trBy:w,transposeFrom:x,trFrom:T,transposeFifths:k,trFifths:S,simplify:P,enharmonic:D};e.accidentals=l,e.ascending=M,e.chroma=m,e["default"]=j,e.descending=E,e.enharmonic=D,e.freq=p,e.fromFreq=f,e.fromFreqSharps=_,e.fromMidi=g,e.fromMidiSharps=y,e.get=o,e.midi=h,e.name=c,e.names=a,e.octave=d,e.pitchClass=u,e.simplify=P,e.sortedNames=A,e.sortedUniqNames=C,e.tr=z,e.trBy=w,e.trFifths=S,e.trFrom=T,e.transpose=b,e.transposeBy=v,e.transposeFifths=k,e.transposeFrom=x,Object.defineProperty(e,"__esModule",{value:!0});});},{"@tonaljs/core":7,"@tonaljs/midi":11}],14:[function(e,t,n){!function(i,s){"object"==_typeof(n)&&void 0!==t?s(n,e("@tonaljs/collection"),e("@tonaljs/core")):"function"==typeof define&&define.amd?define(["exports","@tonaljs/collection","@tonaljs/core"],s):s((i=i||self).Pcset={},i.collection,i.core);}(this,function(e,t,n){"use strict";var i,s={empty:!0,name:"",setNum:0,chroma:"000000000000",normalized:"000000000000",intervals:[]},r=function r(e){return Number(e).toString(2);},a=function a(e){return parseInt(e,2);},o=/^[01]{12}$/;function c(e){return o.test(e);}var u=function u(e){return"number"==typeof e&&e>=0&&e<=4095;},l=function l(e){return e&&c(e.chroma);},d=((i={})[s.chroma]=s,i);function h(e){var i=c(e)?e:u(e)?r(e):Array.isArray(e)?function(e){if(0===e.length)return s.chroma;for(var t,i=[0,0,0,0,0,0,0,0,0,0,0,0],r=0;r<e.length;r++)(t=n.note(e[r])).empty&&(t=n.interval(e[r])),t.empty||(i[t.chroma]=1);return i.join("");}(e):l(e)?e.chroma:s.chroma;return d[i]=d[i]||function(e){var n=a(e),i=function(e){var n=e.split("");return n.map(function(e,i){return t.rotate(i,n).join("");});}(e).map(a).filter(function(e){return e>=2048;}).sort()[0],s=r(i),o=g(e);return{empty:!1,name:"",setNum:n,chroma:e,normalized:s,intervals:o};}(i);}var p=n.deprecate("Pcset.pcset","Pcset.get",h),m=["1P","2m","2M","3m","3M","4P","5d","5P","6m","6M","7m","7M"];function g(e){for(var t=[],n=0;n<12;n++)"1"===e.charAt(n)&&t.push(m[n]);return t;}function f(){return t.range(2048,4095).map(r);}function _(e,n){void 0===n&&(n=!0);var i=h(e).chroma.split("");return t.compact(i.map(function(e,s){var r=t.rotate(s,i);return n&&"0"===r[0]?null:r.join("");}));}function y(e,t){return h(e).setNum===h(t).setNum;}function b(e){var t=h(e).setNum;return function(e){var n=h(e).setNum;return t&&t!==n&&(n&t)===n;};}function z(e){var t=h(e).setNum;return function(e){var n=h(e).setNum;return t&&t!==n&&(n|t)===n;};}function v(e){var t=h(e);return function(e){var i=n.note(e);return t&&!i.empty&&"1"===t.chroma.charAt(i.chroma);};}var w=v;function x(e){var t=v(e);return function(e){return e.filter(t);};}var T={get:h,chroma:function chroma(e){return h(e).chroma;},num:function num(e){return h(e).setNum;},intervals:function intervals(e){return h(e).intervals;},chromas:f,isSupersetOf:z,isSubsetOf:b,isNoteIncludedIn:v,isEqual:y,filter:x,modes:_,pcset:p};e.EmptyPcset=s,e.chromaToIntervals=g,e.chromas=f,e["default"]=T,e.filter=x,e.get=h,e.includes=w,e.isEqual=y,e.isNoteIncludedIn=v,e.isSubsetOf=b,e.isSupersetOf=z,e.modes=_,e.pcset=p,Object.defineProperty(e,"__esModule",{value:!0});});},{"@tonaljs/collection":6,"@tonaljs/core":7}],15:[function(e,t,n){!function(i,s){"object"==_typeof(n)&&void 0!==t?s(n,e("@tonaljs/chord"),e("@tonaljs/core"),e("@tonaljs/roman-numeral")):"function"==typeof define&&define.amd?define(["exports","@tonaljs/chord","@tonaljs/core","@tonaljs/roman-numeral"],s):s((i="undefined"!=typeof globalThis?globalThis:i