UNPKG

mercury-engine

Version:

The mercury engine generates web audio output from mercury code input

1 lines 2.47 MB
!function(e){if("object"==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(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(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 i=function(){return i=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},i.apply(this,arguments)},s=i(i({},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){return-1!==e.indexOf(t)};return t("5A")?"Augmented":t("3M")?"Major":t("5d")?"Diminished":t("3m")?"Minor":"Unknown"}(e),c=i(i({},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 a=function(){return a=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},a.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 a(a({},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(){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(e,t){return Array(Math.abs(t)+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(e){return"CDEFGAB".charAt(e)},h=function(e){return e<0?t("b",-e):t("#",e)},p=function(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(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 t=function(){return t=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},t.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 t(t({},c),{name:e,dots:o,value:l,fraction:u})}var c=function(e){return o(e).value},u=function(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(e){return t.interval(e).name},r=function(e){return t.interval(e).semitones},a=function(e){return t.interval(e).q},o=function(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(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 s=function(){return s=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},s.apply(this,arguments)},r=function(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(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 s(s({},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 i=function(){return i=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},i.apply(this,arguments)},s=i(i({},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(e){return e.name},r=function(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(e){return o(e).name},u=function(e){return o(e).pc},l=function(e){return o(e).acc},d=function(e){return o(e).oct},h=function(e){return o(e).midi},p=function(e){return o(e).freq},m=function(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(e){return function(t){return b(t,e)}},w=v,x=function(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(e,t){return e.height-t.height},E=function(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(e){return Number(e).toString(2)},a=function(e){return parseInt(e,2)},o=/^[01]{12}$/;function c(e){return o.test(e)}var u=function(e){return"number"==typeof e&&e>=0&&e<=4095},l=function(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(e){return h(e).chroma},num:function(e){return h(e).setNum},intervals:function(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||self).Progression={},i.chord,i.core,i.romanNumeral)}(this,(function(e,t,n,i){"use strict";function s(e,t){return t.map(i.get).map((function(t){return n.transpose(e,n.interval(t))+t.chordType}))}function r(e,s){return s.map((function(s){var r=t.tokenize(s),a=r[0],o=r[1],c=n.distance(e,a);return i.get(n.interval(c)).name+o}))}var a={fromRomanNumerals:s,toRomanNumerals:r};e.default=a,e.fromRomanNumerals=s,e.toRomanNumerals=r,Object.defineProperty(e,"__esModule",{value:!0})}))},{"@tonaljs/chord":5,"@tonaljs/core":7,"@tonaljs/roman-numeral":17}],16:[function(e,t,n){!function(i,s){"object"==typeof n&&void 0!==t?s(n,e("@tonaljs/collection"),e("@tonaljs/midi")):"function"==typeof define&&define.amd?define(["exports","@tonaljs/collection","@tonaljs/midi"],s):s((i="undefined"!=typeof globalThis?globalThis:i||self).Range={},i.collection,i.midi)}(this,(function(e,t,n){"use strict";function i(e){var i=t.compact(e.map(n.toMidi));return e.length&&i.length===e.length?i.reduce((function(e,n){var i=e[e.length-1];return e.concat(t.range(i,n).slice(1))}),[i[0]]):[]}function s(e,t){return i(e).map((function(e){return n.midiToNoteName(e,t)}))}var r={numeric:i,chromatic:s};e.chromatic=s,e.default=r,e.numeric=i,Object.defineProperty(e,"__esModule",{value:!0})}))},{"@tonaljs/collection":6,"@tonaljs/midi":11}],17:[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).RomanNumeral={},i.core)}(this,(function(e,t){"use strict";var n={empty:!0,name:"",chordType:""},i={};function s(e){return"string"==typeof e?i[e]||(i[e]=function(e){var i=c(e),s=i[0],r=i[1],a=i[2],o=i[3];if(!a)return n;var u=a.toUpperCase(),d=l.indexOf(u),h=t.accToAlt(r),p=1;return{empty:!1,name:s,roman:a,interval:t.interval({step:d,alt:h,dir:p}).name,acc:r,chordType:o,alt:h,step:d,major:a===u,oct:0,dir:p}}(e)):"number"==typeof e?s(l[e]||""):t.isPitch(e)?(r=e,s(t.altToAcc(r.alt)+l[r.step])):t.isNamed(e)?s(e.name):n;var r}var r=t.deprecate("RomanNumeral.romanNumeral","RomanNumeral.get",s);function a(e){return void 0===e&&(e=!0),(e?l:d).slice()}var o=/^(#{1,}|b{1,}|x{1,}|)(IV|I{1,3}|VI{0,2}|iv|i{1,3}|vi{0,2})([^IViv]*)$/;function c(e){return o.exec(e)||["","","",""]}var u="I II III IV V VI VII",l=u.split(" "),d=u.toLowerCase().split(" ");var h={names:a,get:s,romanNumeral:r};e.default=h,e.get=s,e.names=a,e.tokenize=c,Object.defineProperty(e,"__esModule",{value:!0})}))},{"@tonaljs/core":7}],18:[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).ScaleType={},i.core,i.pcset)}(this,(function(e,t,n){"use strict";var i=function(){return i=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},i.apply(this,arguments)},s=i(i({},n.EmptyPcset),{intervals:[],aliases:[]}),r=[],a={};function o(){return r.map((function(e){return e.name}))}function c(e){return a[e]||s}var u=t.deprecate("ScaleDictionary.scaleType","ScaleType.get",c);function l(){return r.slice()}var d=t.deprecate("ScaleDictionary.entries","ScaleType.all",l);function h(){return Object.keys(a)}function p(){r=[],a={}}function m(e,t,s){void 0===s&&(s=[]);var o=i(i({},n.get(e)),{name:t,intervals:e,aliases:s});return r.push(o),a[o.name]=o,a[o.setNum]=o,a[o.chroma]=o,o.aliases.forEach((function(e){return g(o,e)})),o}function g(e,t){a[t]=e}[["1P 2M 3M 5P 6M","major pentatonic","pentatonic"],["1P 3M 4P 5P 7M","ionian pentatonic"],["1P 3M 4P 5P 7m","mixolydian pentatonic","indian"],["1P 2M 4P 5P 6M","ritusen"],["1P 2M 4P 5P 7m","egyptian"],["1P 3M 4P 5d 7m","neopolitan major pentatonic"],["1P 3m 4P 5P 6m","vietnamese 1"],["1P 2m 3m 5P 6m","pelog"],["1P 2m 4P 5P 6m","kumoijoshi"],["1P 2M 3m 5P 6m","hirajoshi"],["1P 2m 4P 5d 7m","iwato"],["1P 2m 4P 5P 7m","in-sen"],["1P 3M 4A 5P 7M","lydian pentatonic","chinese"],["1P 3m 4P 6m 7m","malkos raga"],["1P 3m 4P 5d 7m","locrian pentatonic","minor seven flat five pentatonic"],["1P 3m 4P 5P 7m","minor pentatonic","vietnamese 2"],["1P 3m 4P 5P 6M","minor six pentatonic"],["1P 2M 3m 5P 6M","flat three pentatonic","kumoi"],["1P 2M 3M 5P 6m","flat six pentatonic"],["1P 2m 3M 5P 6M","scriabin"],["1P 3M 5d 6m 7m","whole tone pentatonic"],["1P 3M 4A 5A 7M","lydian #5P pentatonic"],["1P 3M 4A 5P 7m","lydian dominant pentatonic"],["1P 3m 4P 5P 7M","minor #7M pentatonic"],["1P 3m 4d 5d 7m","super locrian pentatonic"],["1P 2M 3m 4P 5P 7M","minor hexatonic"],["1P 2A 3M 5P 5A 7M","augmented"],["1P 2M 3m 3M 5P 6M","major blues"],["1P 2M 4P 5P 6M 7m","piongio"],["1P 2m 3M 4A 6M 7m","prometheus neopolitan"],["1P 2M 3M 4A 6M 7m","prometheus"],["1P 2m 3M 5d 6m 7m","mystery #1"],["1P 2m 3M 4P 5A 6M","six tone symmetric"],["1P 2M 3M 4A 5A 7m","whole tone","messiaen's mode #1"],["1P 2m 4P 4A 5P 7M","messiaen's mode #5"],["1P 3m 4P 5d 5P 7m","minor blues","blues"],["1P 2M 3M 4P 5d 6m 7m","locrian major","arabian"],["1P 2m 3M 4A 5P 6m 7M","double harmonic lydian"],["1P 2M 3m 4P 5P 6m 7M","harmonic minor"],["1P 2m 3m 4d 5d 6m 7m","altered","super locrian","diminished whole tone","pomeroy"],["1P 2M 3m 4P 5d 6m 7m","locrian #2","half-diminished","aeolian b5"],["1P 2M 3M 4P 5P 6m 7m","mixolydian b6","melodic minor fifth mode","hindu"],["1P 2M 3M 4A 5P 6M 7m","lydian dominant","lydian b7","overtone"],["1P 2M 3M 4A 5P 6M 7M","lydian"],["1P 2M 3M 4A 5A 6M 7M","lydian augmented"],["1P 2m 3m 4P 5P 6M 7m","dorian b2","phrygian #6","melodic minor second mode"],["1P 2M 3m 4P 5P 6M 7M","melodic minor"],["1P 2m 3m 4P 5d 6m 7m","locrian"],["1P 2m 3m 4d 5d 6m 7d","ultralocrian","superlocrian bb7","·superlocrian diminished"],["1P 2m 3m 4P 5d 6M 7m","locrian 6","locrian natural 6","locrian sharp 6"],["1P 2A 3M 4P 5P 5A 7M","augmented heptatonic"],["1P 2M 3m 5d 5P 6M 7m","romanian minor"],["1P 2M 3m 4A 5P 6M 7m","dorian #4"],["1P 2M 3m 4A 5P 6M 7M","lydian diminished"],["1P 2m 3m 4P 5P 6m 7m","phrygian"],["1P 2M 3M 4A 5A 7m 7M","leading whole tone"],["1P 2M 3M 4A 5P 6m 7m","lydian minor"],["1P 2m 3M 4P 5P 6m 7m","phrygian dominant","spanish","phrygian major"],["1P 2m 3m 4P 5P 6m 7M","balinese"],["1P 2m 3m 4P 5P 6M 7M","neopolitan major"],["1P 2M 3m 4P 5P 6m 7m","aeolian","minor"],["1P 2M 3M 4P 5P 6m 7M","harmonic major"],["1P 2m 3M 4P 5P 6m 7M","double harmonic major","gypsy"],["1P 2M 3m 4P 5P 6M 7m","dorian"],["1P 2M 3m 4A 5P 6m 7M","hungarian minor"],["1P 2A 3M 4A 5P 6M 7m","hungarian major"],["1P 2m 3M 4P 5d 6M 7m","oriental"],["1P 2m 3m 3M 4A 5P 7m","flamenco"],["1P 2m 3m 4A 5P 6m 7M","todi raga"],["1P 2M 3M 4P 5P 6M 7m","mixolydian","dominant"],["1P 2m 3M 4P 5d 6m 7M","persian"],["1P 2M 3M 4P 5P 6M 7M","major","ionian"],["1P 2m 3M 5d 6m 7m 7M","enigmatic"],["1P 2M 3M 4P 5A 6M 7M","major augmented","major #5","ionian augmented","ionian #5"],["1P 2A 3M 4A 5P 6M 7M","lydian #9"],["1P 2m 2M 4P 4A 5P 6m 7M","messiaen's mode #4"],["1P 2m 3M 4P 4A 5P 6m 7M","purvi raga"],["1P 2m 3m 3M 4P 5P 6m 7m","spanish heptatonic"],["1P 2M 3M 4P 5P 6M 7m 7M","bebop"],["1P 2M 3m 3M 4P 5P 6M 7m","bebop minor"],["1P 2M 3M 4P 5P 5A 6M 7M","bebop major"],["1P 2m 3m 4P 5d 5P 6m 7m","bebop locrian"],["1P 2M 3m 4P 5P 6m 7m 7M","minor bebop"],["1P 2M 3m 4P 5d 6m 6M 7M","diminished","whole-half diminished"],["1P 2M 3M 4P 5d 5P 6M 7M","ichikosucho"],["1P 2M 3m 4P 5P 6m 6M 7M","minor six diminished"],["1P 2m 3m 3M 4A 5P 6M 7m","half-whole diminished","dominant diminished","messiaen's mode #2"],["1P 3m 3M 4P 5P 6M 7m 7M","kafi raga"],["1P 2M 3M 4P 4A 5A 6A 7M","messiaen's mode #6"],["1P 2M 3m 3M 4P 5d 5P 6M 7m","composite blues"],["1P 2M 3m 3M 4A 5P 6m 7m 7M","messiaen's mode #3"],["1P 2m 2M 3m 4P 4A 5P 6m 6M 7M","messiaen's mode #7"],["1P 2m 2M 3m 3M 4P 5d 5P 6m 6M 7m 7M","chromatic"]].forEach((function(e){var t=e[0],n=e[1],i=e.slice(2);return m(t.split(" "),n,i)}));var f={names:o,get:c,all:l,add:m,removeAll:p,keys:h,entries:d,scaleType:u};e.NoScaleType=s,e.add=m,e.addAlias=g,e.all=l,e.default=f,e.entries=d,e.get=c,e.keys=h,e.names=o,e.removeAll=p,e.scaleType=u,Object.defineProperty(e,"__esModule",{value:!0})}))},{"@tonaljs/core":7,"@tonaljs/pcset":14}],19:[function(e,t,n){!function(i,s){"object"==typeof n&&void 0!==t?s(n,e("@tonaljs/chord-type"),e("@tonaljs/collection"),e("@tonaljs/core"),e("@tonaljs/note"),e("@tonaljs/pcset"),e("@tonaljs/scale-type")):"function"==typeof define&&define.amd?define(["exports","@tonaljs/chord-type","@tonaljs/collection","@tonaljs/core","@tonaljs/note","@tonaljs/pcset","@tonaljs/scale-type"],s):s((i="undefined"!=typeof globalThis?globalThis:i||self).Scale={},i.chordType,i.collection,i.core,i.note,i.pcset,i.scaleType)}(this,(function(e,t,n,i,s,r,a){"use strict";var o=function(){return o=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},o.apply(this,arguments)},c={empty:!0,name:"",type:"",tonic:null,setNum:NaN,chroma:"",normalized:"",aliases:[],notes:[],intervals:[]};function u(e){if("string"!=typeof e)return["",""];var t=e.indexOf(" "),n=i.note(e.substring(0,t));if(n.empty){var s=i.note(e);return s.empty?["",e]:[s.name,""]}var r=e.substring(n.name.length+1);return[n.name,r.length?r:""]}var l=a.names;function d(e){var t=Array.isArray(e)?e:u(e),n=i.note(t[0]).name,s=a.get(t[1]);if(s.empty)return c;var r=s.name,l=n?s.intervals.map((function(e){return i.transpose(n,e)})):[],d=n?n+" "+r:r;return o(o({},s),{name:d,type:r,tonic:n,notes:l})}var h=i.deprecate("Scale.scale","Scale.get",d);function p(e){var n=d(e),i=r.isSubsetOf(n.chroma);return t.all().filter((function(e){return i(e.chroma)})).map((function(e){return e.aliases[0]}))}function m(e){var t=d(e),n=r.isSupersetOf(t.chroma);return a.all().filter((function(e){return n(e.chroma)})).map((function(e){return e.name}))}function g(e){var t=r.isSubsetOf(d(e).chroma);return a.all().filter((function(e){return t(e.chroma)})).map((function(e){return e.name}))}function f(e){var t=e.map((function(e){return i.note(e).pc})).filter((function(e){return e})),r=t[0],a=s.sortedUniqNames(t);return n.rotate(a.indexOf(r),a)}function _(e){var t=d(e);if(t.empty)return[];var n=t.tonic?t.notes:t.intervals;return r.modes(t.chroma).map((function(e,t){var i=d(e).name;return i?[n[t],i]:["",""]})).filter((function(e){return e[0]}))}function y(e){var t=function(e){var t=Array.isArray(e)?f(e):d(e).notes,n=t.map((function(e){return i.note(e).chroma}));return function(e){var s="number"==typeof e?e:i.note(e).height;if(void 0!==s){var r=s%12,a=Math.floor(s/12)-1,o=n.indexOf(r);if(-1!==o)return t[o]+a}}}(e);return function(e,s){var r=i.note(e).height,a=i.note(s).height;return void 0===r||void 0===a?[]:n.range(r,a).map(t).filter((function(e){return e}))}}var b={get:d,names:l,extended:m,modeNames:_,reduced:g,scaleChords:p,scaleNotes:f,tokenize:u,rangeOf:y,scale:h};e.default=b,e.extended=m,e.get=d,e.modeNames=_,e.names=l,e.rangeOf=y,e.reduced=g,e.scale=h,e.scaleChords=p,e.scaleNotes=f,e.tokenize=u,Object.defineProperty(e,"__esModule",{value:!0})}))},{"@tonaljs/chord-type":4,"@tonaljs/collection":6,"@tonaljs/core":7,"@tonaljs/note":13,"@tonaljs/pcset":14,"@tonaljs/scale-type":18}],20:[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).TimeSignature={})}(this,(function(e){"use strict";var t={empty:!0,name:"",upper:void 0,lower:void 0,type:void 0,additive:[]},n=["4/4","3/4","2/4","2/2","12/8","9/8","6/8","3/8"];function i(){return n.slice()}var s=/^(\d?\d(?:\+\d)*)\/(\d)$/,r=new Map;function a(e){var n=r.get(e);if(n)return n;var i=function(e){var n=e[0],i=e[1],s=Array.isArray(n)?n.reduce((function(e,t){return e+t}),0):n,r=i;if(0===s||0===r)return t;var a=Array.isArray(n)?n.join("+")+"/"+i:n+"/"+i,o=Array.isArray(n)?n:[];return{empty:!1,name:a,type:4===r||2===r?"simple":8===r&&s%3==0?"compound":"irregular",upper:s,lower:r,additive:o}}(o(e));return r.set(e,i),i}function o(e){if("string"==typeof e){var t=s.exec(e)||[];t[0];return o([t[1],t[2]])}var n=e[0],i=+e[1];if("number"==typeof n)return[n,i];var r=n.split("+").map((function(e){return+e}));return 1===r.length?[r[0],i]:[r,i]}var c={names:i,parse:o,get:a};e.default=c,e.get=a,e.names=i,e.parse=o,Object.defineProperty(e,"__esModule",{value:!0})}))},{}],21:[function(e,t,n){!function(i,s){"object"==typeof n&&void 0!==t?s(n,e("@tonaljs/abc-notation"),e("@tonaljs/array"),e("@tonaljs/chord"),e("@tonaljs/chord-type"),e("@tonaljs/collection"),e("@tonaljs/core"),e("@tonaljs/duration-value"),e("@tonaljs/interval"),e("@tonaljs/key"),e("@tonaljs/midi"),e("@tonaljs/mode"),e("@tonaljs/note"),e("@tonaljs/pcset"),e("@tonaljs/progression"),e("@tonaljs/range"),e("@tonaljs/roman-numeral"),e("@tonaljs/scale"),e("@tonaljs/scale-type"),e("@tonaljs/time-signature")):"function"==typeof define&&define.amd?define(["exports","@tonaljs/abc-notation","@tonaljs/array","@tonaljs/chord","@tonaljs/chord-type","@tonaljs/collection","@tonaljs/core","@tonaljs/duration-value","@tonaljs/interval","@tonaljs/key","@tonaljs/midi","@tonaljs/mode","@tonaljs/note","@tonaljs/pcset","@tonaljs/progression","@tonaljs/range","@tonaljs/roman-numeral","@tonaljs/scale","@tonaljs/scale-type","@tonaljs/time-signature"],s):s((i=i||self).Tonal={},i.abcNotation,i.array,i.chord,i.ChordType,i.collection,i.Core,i.durationValue,i.interval,i.key,i.midi,i.mode,i.note,i.Pcset,i.progression,i.range,i.romanNumeral,i.scale,i.ScaleType,i.timeSignature)}(this,(function(e,t,n,i,s,r,a,o,c,u,l,d,h,p,m,g,f,_,y,b){"use strict";t=t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t,i=i&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i,s=s&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s,r=r&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r,o=o&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o,c=c&&Object.prototype.hasOwnProperty.call(c,"default")?c.default:c,u=u&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u,l=l&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l,d=d&&Object.prototype.hasOwnProperty.call(d,"default")?d.default:d,h=h&&Object.prototype.hasOwnProperty.call(h,"default")?h.default:h,p=p&&Object.prototype.hasOwnProperty.call(p,"default")?p.default:p,m=m&&Object.prototype.hasOwnProperty.call(m,"default")?m.default:m,g=g&&Object.prototype.hasOwnProperty.call(g,"default")?g.default:g,f=f&&Object.prototype.hasOwnProperty.call(f,"default")?f.default:f,_=_&&Object.prototype.hasOwnProperty.call(_,"default")?_.default:_,y=y&&Object.prototype.hasOwnProperty.call(y,"default")?y.default:y,b=b&&Object.prototype.hasOwnProperty.call(b,"default")?b.default:b;var z=a,v=p,w=s,x=y;Object.keys(a).forEach((function(t){"default"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return a[t]}})})),e.AbcNotation=t,e.Array=n,e.Chord=i,e.ChordType=s,e.Collection=r,e.Core=a,e.DurationValue=o,e.Interval=c,e.Key=u,e.Midi=l,e.Mode=d,e.Note=h,e.Pcset=p,e.Progression=m,e.Range=g,e.RomanNumeral=f,e.Scale=_,e.ScaleType=y,e.TimeSignature=b,e.ChordDictionary=w,e.PcSet=v,e.ScaleDictionary=x,e.Tonal=z,Object.defineProperty(e,"__esModule",{value:!0})}))},{"@tonaljs/abc-notation":1,"@tonaljs/array":2,"@tonaljs/chord":5,"@tonaljs/chord-type":4,"@tonaljs/collection":6,"@tonaljs/core":7,"@tonaljs/duration-value":8,"@tonaljs/interval":9,"@tonaljs/key":10,"@tonaljs/midi":11,"@tonaljs/mode":12,"@tonaljs/note":13,"@tonaljs/pcset":14,"@tonaljs/progression":15,"@tonaljs/range":16,"@tonaljs/roman-numeral":17,"@tonaljs/scale":19,"@tonaljs/scale-type":18,"@tonaljs/time-signature":20}],22:[function(e,t,n){"use strict";!function(e){function t(t,n){return void 0===n?t:n+t+e.reset}e.black="",e.red="",e.green="",e.yellow="",e.blue="",e.magenta="",e.cyan="",e.lightgray="",e.default="",e.darkgray="",e.lightred="",e.lightgreen="",e.lightyellow="",e.lightblue="",e.lightmagenta="",e.lightcyan="",e.white="",e.reset="",e.colored=t,e.plot=function(e,n=void 0){"number"==typeof e[0]&&(e=[e]);let i=void 0!==(n=void 0!==n?n:{}).min?n.min:e[0][0],s=void 0!==n.max?n.max:e[0][0];for(let t=0;t<e.length;t++)for(let n=0;n<e[t].length;n++)i=Math.min(i,e[t][n]),s=Math.max(s,e[t][n]);let r=Math.abs(s-i),a=void 0!==n.offset?n.offset:3,o=void 0!==n.padding?n.padding:" ",c=void 0!==n.height?n.height:r,u=void 0!==n.colors?n.colors:[],l=0!==r?c/r:1,d=Math.round(i*l),h=Math.round(s*l),p=Math.abs(h-d),m=0;for(let t=0;t<e.length;t++)m=Math.max(m,e[t].length);m+=a;let g=void 0!==n.symbols?n.symbols:["┼","┤","╶","╴","─","╰","╭","╮","╯","│"],f=void 0!==n.format?n.format:function(e){return(o+e.toFixed(2)).slice(-o.length)},_=new Array(p+1);for(let e=0;e<=p;e++){_[e]=new Array(m);for(let t=0;t<m;t++)_[e][t]=" "}for(let e=d;e<=h;++e){let t=f(p>0?s-(e-d)*r/p:e,e-d);_[e-d][Math.max(a-t.length,0)]=t,_[e-d][a-1]=0==e?g[0]:g[1]}for(let n=0;n<e.length;n++){let i=u[n%u.length];_[p-(Math.round(e[n][0]*l)-d)][a-1]=t(g[0],i);for(let s=0;s<e[n].length-1;s++){let r=Math.round(e[n][s+0]*l)-d,o=Math.round(e[n][s+1]*l)-d;if(r==o)_[p-r][s+a]=t(g[4],i);else{_[p-o][s+a]=t(r>o?g[5]:g[6],i),_[p-r][s+a]=t(r>o?g[7]:g[8],i);let e=Math.min(r,o),n=Math.max(r,o);for(let r=e+1;r<n;r++)_[p-r][s+a]=t(g[9],i)}}}return _.map((function(e){return e.join("")})).join("\n")}}(void 0===n?this.asciichart={}:n)},{}],23:[function(e,t,n){!function(e){"use strict";var n,i=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,s=Math.ceil,r=Math.floor,a="[BigNumber Error] ",o=a+"Number primitive has more than 15 significant digits: ",c=1e14,u=14,l=9007199254740991,d=[1,