text: !function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(n.Tonal={})}(this,function(n){"use strict";function t(n){"string"!=typeof n&&(n="");var t=I.exec(n);return[t[1].toUpperCase(),t[2].replace(/x/g,"##"),t[3],t[4]]}function r(n,t){return void 0===t&&(t=!1),n=Math.round(n),(!0===t?F:G)[n%12]+(Math.floor(n/12)-1)}function e(n,t){for(var r=[];t--;r[t]=t+n);return r}function m(n,t){for(var r=[];t--;r[t]=n-t);return r}function i(n,t){return null===n||null===t?[]:n<t?e(n,t-n+1):m(n,n-t+1)}function u(n,t){var r=t.length,e=(n%r+r)%r;return t.slice(e,r).concat(t.slice(0,e))}function o(n){return an(n.map(Q)).sort(function(n,t){return ln(n)>ln(t)})}function P(n){return o(n).filter(function(n,t,r){return 0===t||n!==r[t-1]})}function M(n){return"string"!=typeof n?gn:qn[n]||(qn[n]=_n(n))}function a(n){var t=(n+1)%7;return t<0?7+t:t}function l(n,t){if(1===arguments.length)return function(t){return l(n,t)};var r=Kn(n),e=Vn(t);if(null===r||null===e)return null;var m=1===r.length?[r[0]+e[0]]:[r[0]+e[0],r[1]+e[1]];return un(Un(m[0],m[1]))}function c(n,t){if(1===arguments.length)return function(t){return c(n,t)};var r=Kn(n);return null===r?null:un(Un(r[0]+t))}function s(n,t){if(1===arguments.length)return function(t){return s(n,t)};var r=Kn(n),e=Kn(t);return null===e||null===r?null:e[0]-r[0]}function f(n,t){return 1===arguments.length?function(t){return l(t,n)}:l(t,n)}function d(n,t,r){var e=Vn(n),m=Vn(t);if(null===e||null===m)return null;var i=[e[0]+r*m[0],e[1]+r*m[1]];return En(Xn(i))}function p(n,t){return 1===arguments.length?function(t){return p(n,t)}:d(n,t,1)}function b(n,t){return 1===arguments.length?function(t){return p(n,t)}:d(n,t,-1)}function h(n,t){if(1===arguments.length)return function(t){return h(n,t)};var r=Kn(n),e=Kn(t);if(null===r||null===e||r.length!==e.length)return null;var m=1===r.length?[e[0]-r[0],-Math.floor(7*(e[0]-r[0])/12)]:[e[0]-r[0],e[1]-r[1]];return En(Xn(m))}function v(n,t){if(1===arguments.length)return function(t){return v(n,t)};var r=L(n),e=L(t);return null!==r.midi&&null!==e.midi?e.midi-r.midi:null!==r.chroma&&null!==e.chroma?(e.chroma-r.chroma+12)%12:null}function A(n){if(j(n))return n;if(!Array.isArray(n))return"";var t=[0,0,0,0,0,0,0,0,0,0,0,0];return n.map(tt).forEach(function(n){t[n]=1}),t.join("")}function g(n){return mt=mt||i(2048,4095).map(function(n){return n.toString(2)}),"number"==typeof n?mt.filter(function(t){return et(t)===n}):mt.slice()}function y(n,t){t=!1!==t;var r=A(n).split("");return an(r.map(function(n,e){var m=u(e,r);return t&&"0"===m[0]?null:m.join("")}))}function j(n){return it.test(n)}function O(n){return j(n)?an(n.split("").map(function(n,t){return"1"===n?ut[t]:null})):[]}function x(n,t){return 1===arguments.length?function(t){return x(n,t)}:A(n)===A(t)}function _(n,t){return arguments.length>1?_(n)(t):(n=rt(n),function(t){return(t=rt(t))!==n&&(t&n)===t})}function q(n,t){return arguments.length>1?q(n)(t):(n=rt(n),function(t){return(t=rt(t))!==n&&(t|n)===t})}function z(n,t){return arguments.length>1?z(n)(t):(n=A(n),function(t){return"1"===n[tt(t)]})}function k(n,t){return 1===arguments.length?function(t){return k(n,t)}:t.filter(z(n))}function w(n,t){var r=D(n);return t=t||r[1],bt(t).map(l(r[0]))}function S(n){var t=D(n);return void 0!==at(t[1])}function D(n){if("string"!=typeof n)return["",""];var t=n.indexOf(" "),r=Q(n.substring(0,t))||Q(n)||"",e=""!==r?n.substring(r.length+1):n;return[r,e.length?e:""]}function E(n,t){if(t)return _t(t).intervals.map(l(n));var r=C(n),e=r[0],m=r[1];return _t(m).intervals.map(l(e))}function C(n){var r=t(n);return""===r[0]?["",n]:"A"===r[0]&&"ug"===r[3]?["","aug"]:St.test(r[2])?[r[0]+r[1],r[2]+r[3]]:[r[0]+r[1]+r[2],r[3]]}var T="C C# Db D D# Eb E F F# Gb G G# Ab A A# Bb B".split(" "),$=function(n){return"string"!=typeof n?T.slice():T.filter(function(t){var r=t[1]||" ";return-1!==n.indexOf(r)})},F=$(" #"),G=$(" b"),I=/^([a-gA-G]?)(#{1,}|b{1,}|x{1,}|)(-?\d*)\s*(.*)$/,B=Object.freeze({pc:null,name:null,step:null,alt:null,oct:null,octStr:null,chroma:null,midi:null,freq:null}),N=[0,2,4,5,7,9,11],L=function(n,t){return void 0===t&&(t={}),function(r){return t[r]||(t[r]=n(r))}}(function(n){var r=t(n);if(""===r[0]||""!==r[3])return B;var e=r[0],m=r[1],i=r[2],u={letter:e,acc:m,octStr:i,pc:e+m,name:e+m+i,step:(e.charCodeAt(0)+3)%7,alt:"b"===m[0]?-m.length:m.length,oct:i.length?+i:null,chroma:0,midi:null,freq:null};return u.chroma=(N[u.step]+u.alt+120)%12,u.midi=null!==u.oct?N[u.step]+u.alt+12*(u.oct+1):null,u.freq=J(u.midi),Object.freeze(u)}),Q=function(n){return L(n).name},R=function(n){return L(n).pc},U=function(n){return n>=0&&n<=127},H=function(n){if("number"!=typeof n&&"string"!=typeof n)return null;var t=L(n).midi,r=t||0===t?t:+n;return U(r)?r:null},J=function(n,t){return void 0===t&&(t=440),"number"==typeof n?Math.pow(2,(n-69)/12)*t:null},K=function(n){return L(n).freq||J(n)},V=Math.log(2),W=Math.log(440),X=function(n){var t=12*(Math.log(n)-W)/V+69;return Math.round(100*t)/100},Y=function(n){return L(n).chroma},Z=function(n){return L(n).oct},nn=function(n){return"CDEFGAB"[n]},tn=function(n,t){return Array(t+1).join(n)},rn=function(n,t){return"number"!=typeof n?"":t(n)},en=function(n){return rn(n,function(n){return n<0?tn("b",-n):tn("#",n)})},mn=function(n,t){void 0===n&&(n={}),void 0===t&&(t=null);var r=t?Object.assign({},L(t),n):n,e=r.step,m=r.alt,i=r.oct;if("number"!=typeof e)return null;var u=nn(e);if(!u)return null;var o=u+en(m);return i||0===i?o+i:o},un=mn,on=function(n,t){void 0===t&&(t=!0);var e=L(n),m=e.alt,i=e.chroma,u=e.midi;if(null===i)return null;var o=m,P=!1===t?o<0:o>0;return null===u?R(r(i,P)):r(u,P)},Pn=function(n){return on(n,!1)},Mn=Object.freeze({names:$,tokenize:t,props:L,name:Q,pc:R,midi:H,midiToFreq:J,freq:K,freqToMidi:X,chroma:Y,oct:Z,stepToLetter:nn,altToAcc:en,from:mn,build:un,fromMidi:r,simplify:on,enharmonic:Pn}),an=function(n){return n.filter(function(n){return 0===n||n})},ln=function(n){var t=L(n).midi;return null!==t?t:L(n+"-100").midi},cn=function(n,t){void 0===t&&(t=Math.random);for(var r,e,m=n.length;m;)r=t()*m--|0,e=n[m],n[m]=n[r],n[r]=e;return n},sn=function(n){return 0===n.length?[[]]:sn(n.slice(1)).reduce(function(t,r){return t.concat(n.map(function(t,e){var m=r.slice();return m.splice(e,0,n[0]),m}))},[])},fn=Object.freeze({range:i,rotate:u,compact:an,sort:o,unique:P,shuffle:cn,permutations:sn}),dn=new RegExp("^([-+]?\\d+)(d{1,4}|m|M|P|A{1,4})|(AA|A|P|M|m|d|dd)([-+]?\\d+)$"),pn=[0,2,4,5,7,9,11],bn=[0,1,2,3,4,5,6,5,4,3,2,1],hn="1P 2m 2M 3m 3M 4P 5P 6m 6M 7m 7M 8P".split(" "),vn=function(n){return"string"!=typeof n?hn.slice():hn.filter(function(t){return-1!==n.indexOf(t[1])})},An=function(n){var t=dn.exec(""+n);return null===t?null:t[1]?[t[1],t[2]]:[t[4],t[3]]},gn=Object.freeze({name:null,num:null,q:null,step:null,alt:null,dir:null,type:null,simple:null,semitones:null,chroma:null,oct:null}),yn=function(n,t){return Array(Math.abs(t)+1).join(n)},jn=function(n,t){return"M"===t&&"M"===n?0:"P"===t&&"P"===n?0:"m"===t&&"M"===n?-1:/^A+$/.test(t)?t.length:/^d+$/.test(t)?"P"===n?-t.length:-t.length-1:null},On=function(n,t){return 0===t?"M"===n?"M":"P":-1===t&&"M"===n?"m":t>0?yn("A",t):t<0?yn("d","P"===n?t:t+1):null},xn=function(n){return(Math.abs(n)-1)%7},_n=function(n){var t=An(n);if(null===t)return gn;var r={num:0,q:"d",name:"",type:"M",step:0,dir:-1,simple:1,alt:0,oct:0,semitones:0,chroma:0,ic:0};return r.num=+t[0],r.q=t[1],r.step=xn(r.num),r.type="PMMPPMM"[r.step],"M"===r.type&&"P"===r.q?gn:(r.name=""+r.num+r.q,r.dir=r.num<0?-1:1,r.simple=8===r.num||-8===r.num?r.num:r.dir*(r.step+1),r.alt=jn(r.type,r.q),r.oct=Math.floor((Math.abs(r.num)-1)/7),r.semitones=r.dir*(pn[r.step]+r.alt+12*r.oct),r.chroma=(r.dir*(pn[r.step]+r.alt)%12+12)%12,Object.freeze(r))},qn={},zn=function(n){return M(n).num},kn=function(n){return M(n).name},wn=function(n){return M(n).semitones},Sn=function(n){return M(n).chroma},Dn=function(n){return"string"==typeof n&&(n=M(n).chroma),"number"==typeof n?bn[n%12]:null},En=function(n){var t=void 0===n?{}:n,r=t.num,e=t.step,m=t.alt,i=t.oct,u=void 0===i?1:i,o=t.dir;if(void 0!==e&&(r=e+1+7*u),void 0===r)return null;if("number"!=typeof m)return null;var P="number"!=typeof o?"":o<0?"-":"",M="PMMPPMM"[xn(r)];return P+r+On(M,m)},Cn=function(n){var t=M(n);if(t===gn)return null;var r=t;return r.simple+r.q},Tn=function(n){var t=M(n);if(t===gn)return null;var r=t,e=(7-r.step)%7,m="P"===r.type?-r.alt:-(r.alt+1);return En({step:e,alt:m,oct:r.oct,dir:r.dir})},$n=[1,2,2,3,3,4,5,5,6,6,7,7],Fn="P m M m M P d P m M m M".split(" "),Gn=function(n){var t=n<0?-1:1,r=Math.abs(n),e=r%12,m=Math.floor(r/12);return t*($n[e]+7*m)+Fn[e]},In=Object.freeze({names:vn,tokenize:An,qToAlt:jn,altToQ:On,props:M,num:zn,name:kn,semitones:wn,chroma:Sn,ic:Dn,build:En,simplify:Cn,invert:Tn,fromSemitones:Gn}),Bn=[0,2,4,-1,1,3,5],Nn=function(n){return Math.floor(7*n/12)},Ln=Bn.map(Nn),Qn=function(n){var t=n.step,r=n.alt,e=n.oct,m=n.dir;void 0===m&&(m=1);var i=Bn[t]+7*r;return null===e?[m*i]:[m*i,m*(e-Ln[t]-4*r)]},Rn=[3,0,4,1,5,2,6],Un=function(n,t,r){var e=Rn[a(n)],m=Math.floor((n+1)/7);return void 0===t?{step:e,alt:m,dir:r}:{step:e,alt:m,oct:t+4*m+Ln[e],dir:r}},Hn=function(n,t){return void 0===t&&(t={}),function(r){return t[r]||(t[r]=n(r))}},Jn=function(n){return Hn(function(t){var r=n(t);return null===r.name?null:Qn(r)})},Kn=Jn(L),Vn=Jn(M),Wn=function(n){return 7*n[0]+12*n[1]<0},Xn=function(n){return Wn(n)?Un(-n[0],-n[1],-1):Un(n[0],n[1],1)},Yn=Object.freeze({transpose:l,trFifths:c,fifths:s,transposeBy:f,addIntervals:d,add:p,subtract:b,interval:h,semitones:v}),Zn={chromatic:["1P 2m 2M 3m 3M 4P 4A 5P 6m 6M 7m 7M"],lydian:["1P 2M 3M 4A 5P 6M 7M"],major:["1P 2M 3M 4P 5P 6M 7M",["ionian"]],mixolydian:["1P 2M 3M 4P 5P 6M 7m",["dominant"]],dorian:["1P 2M 3m 4P 5P 6M 7m"],aeolian:["1P 2M 3m 4P 5P 6m 7m",["minor"]],phrygian:["1P 2m 3m 4P 5P 6m 7m"],locrian:["1P 2m 3m 4P 5d 6m 7m"],"melodic minor":["1P 2M 3m 4P 5P 6M 7M"],"melodic minor second mode":["1P 2m 3m 4P 5P 6M 7m"],"lydian augmented":["1P 2M 3M 4A 5A 6M 7M"],"lydian dominant":["1P 2M 3M 4A 5P 6M 7m",["lydian b7"]],"melodic minor fifth mode":["1P 2M 3M 4P 5P 6m 7m",["hindu","mixolydian b6M"]],"locrian #2":["1P 2M 3m 4P 5d 6m 7m",["half-diminished"]],altered:["1P 2m 3m 3M 5d 6m 7m",["super locrian","diminished whole tone","pomeroy"]],"harmonic minor":["1P 2M 3m 4P 5P 6m 7M"],"phrygian dominant":["1P 2m 3M 4P 5P 6m 7m",["spanish","phrygian major"]],"half-whole diminished":["1P 2m 3m 3M 4A 5P 6M 7m",["dominant diminished"]],diminished:["1P 2M 3m 4P 5d 6m 6M 7M",["whole-half diminished"]],"major pentatonic":["1P 2M 3M 5P 6M",["pentatonic"]],"lydian pentatonic":["1P 3M 4A 5P 7M",["chinese"]],"mixolydian pentatonic":["1P 3M 4P 5P 7m",["indian"]],"locrian pentatonic":["1P 3m 4P 5d 7m",["minor seven flat five pentatonic"]],"minor pentatonic":["1P 3m 4P 5P 7m"],"minor six pentatonic":["1P 3m 4P 5P 6M"],"minor hexatonic":["1P 2M 3m 4P 5P 7M"],"flat three pentatonic":["1P 2M 3m 5P 6M",["kumoi"]],"flat six pentatonic":["1P 2M 3M 5P 6m"],"major flat two pentatonic":["1P 2m 3M 5P 6M"],"whole tone pentatonic":["1P 3M 5d 6m 7m"],"ionian pentatonic":["1P 3M 4P 5P 7M"],"lydian #5P pentatonic":["1P 3M 4A 5A 7M"],"lydian dominant pentatonic":["1P 3M 4A 5P 7m"],"minor #7M pentatonic":["1P 3m 4P 5P 7M"],"super locrian pentatonic":["1P 3m 4d 5d 7m"],"in-sen":["1P 2m 4P 5P 7m"],iwato:["1P 2m 4P 5d 7m"],hirajoshi:["1P 2M 3m 5P 6m"],kumoijoshi:["1P 2m 4P 5P 6m"],pelog:["1P 2m 3m 5P 6m"],"vietnamese 1":["1P 3m 4P 5P 6m"],"vietnamese 2":["1P 3m 4P 5P 7m"],prometheus:["1P 2M 3M 4A 6M 7m"],"prometheus neopolitan":["1P 2m 3M 4A 6M 7m"],ritusen:["1P 2M 4P 5P 6M"],scriabin:["1P 2m 3M 5P 6M"],piongio:["1P 2M 4P 5P 6M 7m"],"major blues":["1P 2M 3m 3M 5P 6M"],"minor blues":["1P 3m 4P 5d 5P 7m",["blues"]],"composite blues":["1P 2M 3m 3M 4P 5d 5P 6M 7m"],augmented:["1P 2A 3M 5P 5A 7M"],"augmented heptatonic":["1P 2A 3M 4P 5P 5A 7M"],"dorian #4":["1P 2M 3m 4A 5P 6M 7m"],"lydian diminished":["1P 2M 3m 4A 5P 6M 7M"],"whole tone":["1P 2M 3M 4A 5A 7m"],"leading whole tone":["1P 2M 3M 4A 5A 7m 7M"],"lydian minor":["1P 2M 3M 4A 5P 6m 7m"],"locrian major":["1P 2M 3M 4P 5d 6m 7m",["arabian"]],neopolitan:["1P 2m 3m 4P 5P 6m 7M"],"neopolitan minor":["1P 2m 3m 4P 5P 6m 7M"],"neopolitan major":["1P 2m 3m 4P 5P 6M 7M",["dorian b2"]],"neopolitan major pentatonic":["1P 3M 4P 5d 7m"],"romanian minor":["1P 2M 3m 5d 5P 6M 7m"],"double harmonic lydian":["1P 2m 3M 4A 5P 6m 7M"],"harmonic major":["1P 2M 3M 4P 5P 6m 7M"],"double harmonic major":["1P 2m 3M 4P 5P 6m 7M",["gypsy"]],egyptian:["1P 2M 4P 5P 7m"],"hungarian minor":["1P 2M 3m 4A 5P 6m 7M"],"hungarian major":["1P 2A 3M 4A 5P 6M 7m"],oriental:["1P 2m 3M 4P 5d 6M 7m"],"spanish heptatonic":["1P 2m 3m 3M 4P 5P 6m 7m"],flamenco:["1P 2m 3m 3M 4A 5P 7m"],balinese:["1P 2m 3m 4P 5P 6m 7M"],"todi raga":["1P 2m 3m 4A 5P 6m 7M"],"malkos raga":["1P 3m 4P 6m 7m"],"kafi raga":["1P 3m 3M 4P 5P 6M 7m 7M"],"purvi raga":["1P 2m 3M 4P 4A 5P 6m 7M"],persian:["1P 2m 3M 4P 5d 6m 7M"],bebop:["1P 2M 3M 4P 5P 6M 7m 7M"],"bebop dominant":["1P 2M 3M 4P 5P 6M 7m 7M"],"bebop minor":["1P 2M 3m 3M 4P 5P 6M 7m"],"bebop major":["1P 2M 3M 4P 5P 5A 6M 7M"],"bebop locrian":["1P 2m 3m 4P 5d 5P 6m 7m"],"minor bebop":["1P 2M 3m 4P 5P 6m 7m 7M"],"mystery #1":["1P 2m 3M 5d 6m 7m"],enigmatic:["1P 2m 3M 5d 6m 7m 7M"],"minor six diminished":["1P 2M 3m 4P 5P 6m 6M 7M"],"ionian augmented":["1P 2M 3M 4P 5A 6M 7M"],"lydian #9":["1P 2m 3M 4A 5P 6M 7M"],ichikosucho:["1P 2M 3M 4P 5d 5P 6M 7M"],"six tone symmetric":["1P 2m 3M 4P 5A 6M"]},nt={4:["1P 4P 7m 10m",["quartal"]],5:["1P 5P"],7:["1P 3M 5P 7m",["Dominant","Dom"]],9:["1P 3M 5P 7m 9M",["79"]],11:["1P 5P 7m 9M 11P"],13:["1P 3M 5P 7m 9M 13M",["13_"]],64:["5P 8P 10M"],M:["1P 3M 5P",["Major",""]],"M#5":["1P 3M 5A",["augmented","maj#5","Maj#5","+","aug"]],"M#5add9":["1P 3M 5A 9M",["+add9"]],M13:["1P 3M 5P 7M 9M 13M",["maj13","Maj13"]],"M13#11":["1P 3M 5P 7M 9M 11A 13M",["maj13#11","Maj13#11","M13+4","M13#4"]],M6:["1P 3M 5P 13M",["6"]],"M6#11":["1P 3M 5P 6M 11A",["M6b5","6#11","6b5"]],M69:["1P 3M 5P 6M 9M",["69"]],"M69#11":["1P 3M 5P 6M 9M 11A"],"M7#11":["1P 3M 5P 7M 11A",["maj7#11","Maj7#11","M7+4","M7#4"]],"M7#5":["1P 3M 5A 7M",["maj7#5","Maj7#5","maj9#5","M7+"]],"M7#5sus4":["1P 4P 5A 7M"],"M7#9#11":["1P 3M 5P 7M 9A 11A"],M7add13:["1P 3M 5P 6M 7M 9M"],M7b5:["1P 3M 5d 7M"],M7b6:["1P 3M 6m 7M"],M7b9:["1P 3M 5P 7M 9m"],M7sus4:["1P 4P 5P 7M"],M9:["1P 3M 5P 7M 9M",["maj9","Maj9"]],"M9#11":["1P 3M 5P 7M 9M 11A",["maj9#11","Maj9#11","M9+4","M9#4"]],"M9#5":["1P 3M 5A 7M 9M",["Maj9#5"]],"M9#5sus4":["1P 4P 5A 7M 9M"],M9b5:["1P 3M 5d 7M 9M"],M9sus4:["1P 4P 5P 7M 9M"],Madd9:["1P 3M 5P 9M",["2","add9","add2"]],Maj7:["1P 3M 5P 7M",["maj7","M7"]],Mb5:["1P 3M 5d"],Mb6:["1P 3M 13m"],Msus2:["1P 2M 5P",["add9no3","sus2"]],Msus4:["1P 4P 5P",["sus","sus4"]],Maddb9:["1P 3M 5P 9m"],"11b9":["1P 5P 7m 9m 11P"],"13#11":["1P 3M 5P 7m 9M 11A 13M",["13+4","13#4"]],"13#9":["1P 3M 5P 7m 9A 13M",["13#9_"]],"13#9#11":["1P 3M 5P 7m 9A 11A 13M"],"13b5":["1P 3M 5d 6M 7m 9M"],"13b9":["1P 3M 5P 7m 9m 13M"],"13b9#11":["1P 3M 5P 7m 9m 11A 13M"],"13no5":["1P 3M 7m 9M 13M"],"13sus4":["1P 4P 5P 7m 9M 13M",["13sus"]],"69#11":["1P 3M 5P 6M 9M 11A"],"7#11":["1P 3M 5P 7m 11A",["7+4","7#4","7#11_","7#4_"]],"7#11b13":["1P 3M 5P 7m 11A 13m",["7b5b13"]],"7#5":["1P 3M 5A 7m",["+7","7aug","aug7"]],"7#5#9":["1P 3M 5A 7m 9A",["7alt","7#5#9_","7#9b13_"]],"7#5b9":["1P 3M 5A 7m 9m"],"7#5b9#11":["1P 3M 5A 7m 9m 11A"],"7#5sus4":["1P 4P 5A 7m"],"7#9":["1P 3M 5P 7m 9A",["7#9_"]],"7#9#11":["1P 3M 5P 7m 9A 11A",["7b5#9"]],"7#9#11b13":["1P 3M 5P 7m 9A 11A 13m"],"7#9b13":["1P 3M 5P 7m 9A 13m"],"7add6":["1P 3M 5P 7m 13M",["67","7add13"]],"7b13":["1P 3M 7m 13m"],"7b5":["1P 3M 5d 7m"],"7b6":["1P 3M 5P 6m 7m"],"7b9":["1P 3M 5P 7m 9m"],"7b9#11":["1P 3M 5P 7m 9m 11A",["7b5b9"]],"7b9#9":["1P 3M 5P 7m 9m 9A"],"7b9b13":["1P 3M 5P 7m 9m 13m"],"7b9b13#11":["1P 3M 5P 7m 9m 11A 13m",["7b9#11b13","7b5b9b13"]],"7no5":["1P 3M 7m"],"7sus4":["1P 4P 5P 7m",["7sus"]],"7sus4b9":["1P 4P 5P 7m 9m",["susb9","7susb9","7b9sus","7b9sus4","phryg"]],"7sus4b9b13":["1P 4P 5P 7m 9m 13m",["7b9b13sus4"]],"9#11":["1P 3M 5P 7m 9M 11A",["9+4","9#4","9#11_","9#4_"]],"9#11b13":["1P 3M 5P 7m 9M 11A 13m",["9b5b13"]],"9#5":["1P 3M 5A 7m 9M",["9+"]],"9#5#11":["1P 3M 5A 7m 9M 11A"],"9b13":["1P 3M 7m 9M 13m"],"9b5":["1P 3M 5d 7m 9M"],"9no5":["1P 3M 7m 9M"],"9sus4":["1P 4P 5P 7m 9M",["9sus"]],m:["1P 3m 5P"],"m#5":["1P 3m 5A",["m+","mb6"]],m11:["1P 3m 5P 7m 9M 11P",["_11"]],"m11A 5":["1P 3m 6m 7m 9M 11P"],m11b5:["1P 3m 7m 12d 2M 4P",["h11","_11b5"]],m13:["1P 3m 5P 7m 9M 11P 13M",["_13"]],m6:["1P 3m 4P 5P 13M",["_6"]],m69:["1P 3m 5P 6M 9M",["_69"]],m7:["1P 3m 5P 7m",["minor7","_","_7"]],"m7#5":["1P 3m 6m 7m"],m7add11:["1P 3m 5P 7m 11P",["m7add4"]],m7b5:["1P 3m 5d 7m",["half-diminished","h7","_7b5"]],m9:["1P 3m 5P 7m 9M",["_9"]],"m9#5":["1P 3m 6m 7m 9M"],m9b5:["1P 3m 7m 12d 2M",["h9","-9b5"]],mMaj7:["1P 3m 5P 7M",["mM7","_M7"]],mMaj7b6:["1P 3m 5P 6m 7M",["mM7b6"]],mM9:["1P 3m 5P 7M 9M",["mMaj9","-M9"]],mM9b6:["1P 3m 5P 6m 7M 9M",["mMaj9b6"]],mb6M7:["1P 3m 6m 7M"],mb6b9:["1P 3m 6m 9m"],o:["1P 3m 5d",["mb5","dim"]],o7:["1P 3m 5d 13M",["diminished","m6b5","dim7"]],o7M7:["1P 3m 5d 6M 7M"],oM7:["1P 3m 5d 7M"],sus24:["1P 2M 4P 5P",["sus4add9"]],"+add#9":["1P 3M 5A 9A"],madd4:["1P 3m 4P 5P"],madd9:["1P 3m 5P 9M"]},tt=function(n){return Y(n)||Sn(n)||0},rt=function(n){return parseInt(A(n),2)},et=function(n){return n.replace(/0/g,"").length},mt=null,it=/^[01]{12}$/,ut="1P 2m 2M 3m 3M 4P 5d 5P 6m 6M 7m 7M".split(" "),ot=Object.freeze({chroma:A,chromas:g,modes:y,isChroma:j,intervals:O,isEqual:x,isSubsetOf:_,isSupersetOf:q,includes:z,filter:k}),Pt=function(n){var t=Object.keys(n).sort(),r=[],e=[],m=function(n,t,m){r[n]=t,e[m]=e[m]||[],e[m].push(n)};t.forEach(function(t){var r=n[t][0].split(" "),e=n[t][1],i=A(r);m(t,r,i),e&&e.forEach(function(n){return m(n,r,i)})});var i=Object.keys(r).sort(),u=function(n){return r[n]};return u.names=function(n){return"string"==typeof n?(e[n]||[]).slice():(!0===n?i:t).slice()},u},Mt=function(n,t){var r=function(r){return n(r)||t(r)};return r.names=function(r){return n.names(r).concat(t.names(r))},r},at=Pt(Zn),lt=Pt(nt),ct=Mt(at,lt),st=Object.freeze({dictionary:Pt,combine:Mt,scale:at,chord:lt,pcset:ct}),ft=Object.freeze({name:null,intervals:[],names:[],chroma:null,setnum:null}),dt=function(n,t){return function(r){return t[r]||(t[r]=n(r))}}(function(n){var t=at(n);if(!t)return ft;var r={intervals:t,name:n};return r.chroma=A(t),r.setnum=parseInt(r.chroma,2),r.names=at.names(r.chroma),Object.freeze(r)},{}),pt=at.names,bt=function(n){var t=D(n);return dt(t[1]).intervals},ht=function(n){var t=bt(n),r=w(n);return y(t).map(function(n,e){var m=at.names(n)[0];if(m)return[r[e]||t[e],m]}).filter(function(n){return n})},vt=function(n){var t=_(bt(n));return lt.names().filter(function(n){return t(lt(n))})},At=function(n){var t=an(n.map(R));if(!t.length)return t;var r=t[0],e=P(t);return u(e.indexOf(r),e)},gt=function(n){if(!bt(n).length)return[];var t=q(bt(n));return at.names().filter(function(n){return t(at(n))})},yt=function(n){var t=_(bt(n));return at.names().filter(function(n){return t(at(n))})},jt=Object.freeze({props:dt,names:pt,intervals:bt,notes:w,exists:S,tokenize:D,modeNames:ht,chords:vt,toScale:At,supersets:gt,subsets:yt}),Ot=lt.names,xt=Object.freeze({name:null,names:[],intervals:[],chroma:null,setnum:null}),_t=function(n,t){return void 0===t&&(t={}),function(r){return t[r]||(t[r]=n(r))}}(function(n){var t=lt(n);if(!t)return xt;var r={intervals:t,name:n};return r.chroma=A(t),r.setnum=parseInt(r.chroma,2),r.names=lt.names(r.chroma),r}),qt=function(n){return _t(C(n)[1]).intervals},zt=function(n){return void 0!==lt(C(n)[1])},kt=function(n){if(!qt(n).length)return[];var t=q(qt(n));return lt.names().filter(function(n){return t(lt(n))})},wt=function(n){var t=_(qt(n));return lt.names().filter(function(n){return t(lt(n))})},St=/^(6|64|7|9|11|13)$/,Dt=Object.freeze({names:Ot,props:_t,intervals:qt,notes:E,exists:zt,supersets:kt,subsets:wt,tokenize:C}),Et=l,Ct=h,Tt=L,$t=H,Ft=K,Gt=lt,It=at;n.Array=fn,n.Note=Mn,n.Interval=In,n.Distance=Yn,n.Scale=jt,n.Chord=Dt,n.PcSet=ot,n.Dictionary=st,n.transpose=Et,n.interval=Ct,n.note=Tt,n.midi=$t,n.freq=Ft,n.chord=Gt,n.scale=It,Object.defineProperty(n,"__esModule",{value:!0})});
  //# sourceMappingURL=tonal.min.js.map
  