1var Kt=Object.defineProperty;var Ut=(M,c,u)=>c in M?Kt(M,c,{enumerable:!0,configurable:!0,writable:!0,value:u}):M[c]=u;var r=(M,c,u)=>Ut(M,typeof c!="symbol"?c+"":c,u);(function(){"use strict";var M=(t=>(t.StartControlMessage="START_CONTROL_MESSAGE",t.StopControlMessage="STOP_CONTROL_MESSAGE",t.StartControlConfirmedMessage="START_CONTROL_CONFIRMED_MESSAGE",t.StopRequestMessage="STOP_REQUEST_MESSAGE",t.WindowRequestMessage="WINDOW_REQUEST_MESSAGE",t.WindowResponseMessage="WINDOW_RESPONSE_MESSAGE",t))(M||{}),c=(t=>(t.MidiPlaybackEvent="MIDI_PLAYBACK_EVENT",t.AudioFilePlaybackEvent="AUDIO_FILE_PLAYBACK_EVENT",t.StopPlaybackEvent="STOP_PLAYBACK_EVENT",t))(c||{});const S=class S{constructor(e,n,a,s,o,m,i){r(this,"trackIndex");r(this,"audioFileId");r(this,"volume");r(this,"durationInSamples");r(this,"startSample");r(this,"audioFileStartSample");r(this,"playbackRate");this.trackIndex=e,this.audioFileId=n,this.volume=a,this.durationInSamples=s,this.startSample=o,this.audioFileStartSample=m,this.playbackRate=i}static writeToBuffer(e,n){const a=n.length;e[0]=a;for(let s=0;s<a;s++){const o=n[s],m=1+s*S.MESSAGE_SIZE;e[m]=o.trackIndex,e[m+1]=o.audioFileId,e[m+2]=o.volume,e[m+3]=o.durationInSamples,e[m+4]=o.startSample,e[m+5]=o.audioFileStartSample,e[m+6]=o.playbackRate}}static readFromBuffer(e){const n=e[0],a=[];for(let s=0;s<n;s++){const o=s*S.MESSAGE_SIZE+1,m={trackIndex:e[o],audioFileId:e[o+1],volume:e[o+2],durationInSamples:e[o+3],startSample:e[o+4],audioFileStartSample:e[o+5],playbackRate:e[o+6]};a.push(m)}return a}static clearBuffer(e){e[0]=0}};r(S,"MESSAGE_SIZE",7),r(S,"BYTES_PER_ELEMENT",Float64Array.BYTES_PER_ELEMENT);let u=S;function x(t){return t!==null&&typeof t=="object"&&"name"in t&&typeof t.name=="string"}function B(t){return t!==null&&typeof t=="object"&&"step"in t&&typeof t.step=="number"&&"alt"in t&&typeof t.alt=="number"&&!isNaN(t.step)&&!isNaN(t.alt)}var _=[0,2,4,-1,1,3,5],O=_.map(t=>Math.floor(t*7/12));function C(t){const{step:e,alt:n,oct:a,dir:s=1}=t,o=_[e]+7*n;if(a===void 0)return[s*o];const m=a-O[e]-4*n;return[s*o,s*m]}var nt=[3,0,4,1,5,2,6];function at(t){const[e,n,a]=t,s=nt[ot(e)],o=Math.floor((e+1)/7);if(n===void 0)return{step:s,alt:o,dir:a};const m=n+4*o+O[s];return{step:s,alt:o,oct:m,dir:a}}function ot(t){const e=(t+1)%7;return e<0?7+e:e}var F=(t,e)=>Array(Math.abs(e)+1).join(t),g=Object.freeze({empty:!0,name:"",num:NaN,q:"",type:"",step:NaN,alt:NaN,dir:NaN,simple:NaN,semitones:NaN,chroma:NaN,coord:[],oct:NaN}),st="([-+]?\\d+)(d{1,4}|m|M|P|A{1,4})",mt="(AA|A|P|M|m|d|dd)([-+]?\\d+)",it=new RegExp("^"+st+"|"+mt+"$");function rt(t){const e=it.exec(`${t}`);return e===null?["",""]:e[1]?[e[1],e[2]]:[e[4],e[3]]}var W={};function I(t){return typeof t=="string"?W[t]||(W[t]=Pt(t)):B(t)?I(Mt(t)):x(t)?I(t.name):g}var L=[0,2,4,5,7,9,11],$="PMMPPMM";function Pt(t){const e=rt(t);if(e[0]==="")return g;const n=+e[0],a=e[1],s=(Math.abs(n)-1)%7,o=$[s];if(o==="M"&&a==="P")return g;const m=o==="M"?"majorable":"perfectable",i=""+n+a,d=n<0?-1:1,P=n===8||n===-8?n:d*(s+1),l=dt(m,a),v=Math.floor((Math.abs(n)-1)/7),p=d*(L[s]+l+12*v),j=(d*(L[s]+l)%12+12)%12,R=C({step:s,alt:l,oct:v,dir:d});return{empty:!1,name:i,num:n,q:a,step:s,alt:l,dir:d,type:m,simple:P,semitones:p,chroma:j,coord:R,oct:v}}function dt(t,e){return e==="M"&&t==="majorable"||e==="P"&&t==="perfectable"?0:e==="m"&&t==="majorable"?-1:/^A+$/.test(e)?e.length:/^d+$/.test(e)?-1*(t==="perfectable"?e.length:e.length+1):0}function Mt(t){const{step:e,alt:n,oct:a=0,dir:s}=t;if(!s)return"";const o=e+1+7*a,m=o===0?e+1:o,i=s<0?"-":"",d=$[e]==="M"?"majorable":"perfectable";return i+m+ct(d,n)}function ct(t,e){return e===0?t==="majorable"?"M":"P":e===-1&&t==="majorable"?"m":e>0?F("A",e):F("d",t==="perfectable"?e:e+1)}var q=(t,e)=>Array(Math.abs(e)+1).join(t),G=Object.freeze({empty:!0,name:"",letter:"",acc:"",pc:"",step:NaN,alt:NaN,chroma:NaN,height:NaN,coord:[],midi:null,freq:null}),D=new Map,lt=t=>"CDEFGAB".charAt(t),ut=t=>t<0?q("b",-t):q("#",t),ht=t=>t[0]==="b"?-t.length:t.length;function A(t){const e=JSON.stringify(t),n=D.get(e);if(n)return n;const a=typeof t=="string"?bt(t):B(t)?A(Et(t)):x(t)?A(t.name):G;return D.set(e,a),a}var pt=/^([a-gA-G]?)(#{1,}|b{1,}|x{1,}|)(-?\d*)\s*(.*)$/;function St(t){const e=pt.exec(t);return e?[e[1].toUpperCase(),e[2].replace(/x/g,"##"),e[3],e[4]]:["","","",""]}function ft(t){return A(at(t))}var At=(t,e)=>(t%e+e)%e,T=[0,2,4,5,7,9,11];function bt(t){const e=St(t);if(e[0]===""||e[3]!=="")return G;const n=e[0],a=e[1],s=e[2],o=(n.charCodeAt(0)+3)%7,m=ht(a),i=s.length?+s:void 0,d=C({step:o,alt:m,oct:i}),P=n+a+s,l=n+a,v=(T[o]+m+120)%12,p=i===void 0?At(T[o]+m,12)-12*99:T[o]+m+12*(i+1),j=p>=0&&p<=127?p:null,R=i===void 0?null:Math.pow(2,(p-69)/12)*440;return{empty:!1,acc:a,alt:m,chroma:v,coord:d,freq:R,height:p,letter:n,midi:j,name:P,oct:i,pc:l,step:o}}function Et(t){const{step:e,alt:n,oct:a}=t,s=lt(e);if(!s)return"";const o=s+ut(n);return a||a===0?o+a:o}function vt(t,e){const n=A(t),a=Array.isArray(e)?e:I(e).coord;if(n.empty||!a||a.length<2)return"";const s=n.coord,o=s.length===1?[s[0]+a[0]]:[s[0]+a[0],s[1]+a[1]];
1return ft(o).name}function Z(t,e){const n=e.length,a=(t%n+n)%n;return e.slice(a,n).concat(e.slice(0,a))}var h={empty:!0,name:"",setNum:0,chroma:"000000000000",normalized:"000000000000",intervals:[]},z=t=>Number(t).toString(2).padStart(12,"0"),V=t=>parseInt(t,2),It=/^[01]{12}$/;function Y(t){return It.test(t)}var yt=t=>typeof t=="number"&&t>=0&&t<=4095,gt=t=>t&&Y(t.chroma),H={[h.chroma]:h};function K(t){const e=Y(t)?t:yt(t)?z(t):Array.isArray(t)?jt(t):gt(t)?t.chroma:h.chroma;return H[e]=H[e]||kt(e)}var Tt=["1P","2m","2M","3m","3M","4P","5d","5P","6m","6M","7m","7M"];function Nt(t){const e=[];for(let n=0;n<12;n++)t.charAt(n)==="1"&&e.push(Tt[n]);return e}function wt(t){const e=t.split("");return e.map((n,a)=>Z(a,e).join(""))}function kt(t){const e=V(t),n=wt(t).map(V).filter(o=>o>=2048).sort()[0],a=z(n),s=Nt(t);return{empty:!1,name:"",setNum:e,chroma:t,normalized:a,intervals:s}}function jt(t){if(t.length===0)return h.chroma;let e;const n=[0,0,0,0,0,0,0,0,0,0,0,0];for(let a=0;a<t.length;a++)e=A(t[a]),e.empty&&(e=I(t[a
1])),e.empty||(n[e.chroma]=1);return n.join("")}var Rt=[["1P 3M 5P","major","M ^ maj"],["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 added ninth","6add9 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 -maj7"],["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"]],xt=Rt;({...h});var U=[],y={};function Bt(t,e,n){const a=Ot(t),s={...K(t),name:n||"",quality:a,intervals:t,aliases:e};U.push(s),s.name&&(y[s.name]=s),y[s.setNum]=s,y[s.chroma]=s,s.aliases.forEac
1h(o=>_t(s,o))}function _t(t,e){y[e]=t}function Ot(t){const e=n=>t.indexOf(n)!==-1;return e("5A")?"Augmented":e("3M")?"Major":e("5d")?"Diminished":e("3m")?"Minor":"Unknown"}xt.forEach(([t,e,n])=>Bt(t.split(" "),n.split(" "),e)),U.sort((t,e)=>t.setNum-e.setNum);var Ct=[["1P 2M 3M 5P 6M","major pentatonic","pentatonic"],["1P 2M 3M 4P 5P 6M 7M","major","ionian"],["1P 2M 3m 4P 5P 6m 7m","minor","aeolian"],["1P 2M 3m 3M 5P 6M","major blues"],["1P 3m 4P 5d 5P 7m","minor blues","blues"],["1P 2M 3m 4P 5P 6M 7M","melodic minor"],["1P 2M 3m 4P 5P 6m 7M","harmonic minor"],["1P 2M 3M 4P 5P 6M 7m 7M","bebop"],["1P 2M 3m 4P 5d 6m 6M 7M","diminished","whole-half diminished"],["1P 2M 3m 4P 5P 6M 7m","dorian"],["1P 2M 3M 4A 5P 6M 7M","lydian"],["1P 2M 3M 4P 5P 6M 7m","mixolydian","dominant"],["1P 2m 3m 4P 5P 6m 7m","phrygian"],["1P 2m 3m 4P 5d 6m 7m","locrian"],["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 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 6A","whole tone","messiaen's mode #1"],["1P 2m 4P 4A 5P 7M","messiaen's mode #5"],["1P 2M 3M 4P 5d 6m 7m","locrian major","arabian"],["1P 2m 3M 4A 5P 6m 7M","double harmonic lydian"],["1P 2m 2A 3M 4A 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 5A 6M 7M","lydian augmented"],["1P 2m 3m 4P 5P 6M 7m","dorian b2","phrygian #6","melodic minor second mode"],["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 4A 5P 6M 7m","dorian #4","ukrainian dorian","romanian minor","altered dorian"],["1P 2M 3m 4A 5P 6M 7M","lydian diminished"],["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","harmonic major"],["1P 2m 3M 4P 5P 6m 7M","double harmonic major","gypsy"],["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 5d 6m 7M","persian"],["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 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 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"]],Ft=Ct,Wt={...h,intervals:[],aliases:[]},b={};function Lt(t){return b[t]||Wt}function $t(t,e,n=[]){const a={...K(t),name:e,intervals:t,aliases:n};
1return b[a.name]=a,b[a.setNum]=a,b[a.chroma]=a,a.aliases.forEach(s=>qt(a,s)),a}function qt(t,e){b[e]=t}Ft.forEach(([t,e,...n])=>$t(t.split(" "),e,n));var Gt=[[.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"]]],Dt=Gt;Dt.forEach(([t,e,n])=>void 0);function Xt(t,e,n){}var N=[[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"]],X={...h,name:"",alt:0,modeNum:NaN,triad:"",seventh:"",aliases:[]},Zt=N.map(zt),w={};Zt.forEach(t=>{w[t.name]=t,t.aliases.forEach(e=>{w[e]=t})});function Q(t){return typeof t=="string"?w[t.toLowerCase()]||X:t&&t.name?Q(t.name):X}function zt(t){const[e,n,a,s,o,m,i]=t,d=i?[i]:[],P=Number(n).toString(2);return{empty:!1,intervals:Lt(s).intervals,modeNum:e,chroma:P,normalized:P,name:s,setNum:n,alt:a,triad:o,seventh:m,aliases:d}}function J(t){return(e,n)=>{const a=Q(e);if(a.empty)return[];const s=Z(a.modeNum,t),o=a.intervals.map(m=>vt(n,m));return s.map((m,i)=>o[i]+m)}}J(N.map(t=>t[4])),J(N.map(t=>t[5]));const tt=128,Vt=t=>t*t/16129,f=class f{constructor(e,n,a,s,o,m,i,d,P){r(this,"bloobId");r(this,"noteId");r(this,"trackIndex");r(this,"instrumentType");r(this,"instrumentId");r(this,"pitchInt");r(this,"volume");r(this,"durationInSamples");r(this,"startSample");this.bloobId=e,this.noteId=n,this.trackIndex=a,this.instrumentType=s,this.instrumentId=o,this.pitchInt=m,this.volume=i,this.durationInSamples=d,this.startSample=P}static writeToBuffer(e,n){const a=n.length;e[0]=a;for(let s=0;s<a;s++){const o=n[s],m=1+s*f.MESSAGE_SIZE;e[m]=o.bloobId||-1,e[m+1]=o.noteId||-1,e[m+2]=o.trackIndex,e[m+3]=o.instrumentType,e[m+4]=o.instrumentId,e[m+5]=o.pitchInt,e[m+6]=o.volume,e[m+7]=o.durationInSamples,e[m+8]=o.startSample}}static readFromBuffer(e){const n=e[0],a=[];for(let s=0;s<n;s++){const o=s*f.MESSAGE_SIZE+1,m=e[o],i=e[o+1],d={bloobId:m===-1?void 0:m,noteId:i===-1?void 0:i,trackIndex:e[o+2],instrumentType:e[o+3],instrumentId:e[o+4],pitchInt:e[o+5],volume:e[o+6],durationInSamples:e[o+7],startSample:e[o+8]};a.push(d)}return a}static clearBuffer(e){e[0]=0}};r(f,"MESSAGE_SIZE",9),r(f,"BYTES_PER_ELEMENT",Float32Array.BYTES_PER_ELEMENT);let E=f;const Yt=3,k=.1,et=1e-10;class Ht extends AudioWorkletProcessor{constructor(n){super();r(this,"nextBlockStartTimeInSeconds");r(this,"startTimeInSeconds",null);r(this,"playbackEvents");r(this,"windowsRequested",0);r(this,"lastWindowOffsetInSecondsReceived",null);r(this,"audioFilePlaybackMessageBuffer");r(this,"instrumentPlaybackMessageBuffer");r(this,"stopPlaybackMessageBuffer");this.audioFilePlaybackMessageBuffer=new Float64Array(n.processorOptions.audioFilePlaybackMessageBuffer),this.instrumentPlaybackMessageBuffer=new Float32Array(n.processorOptions.instrumentPlaybackMessageBuffer),this.stopPlaybackMessageBuffer=new Int32Array(n.processorOptions.stopPlaybackMessageBuffer),this.port.onmessage=a=>{switch(a.data.type){case M.StartControlMessage:{this.handleStartControlMessage(a.data);break}case M.StopControlMessage:{this.handleStopControlMessage();break}case M.WindowResponseMessage:{this.handleWindowResponse(a.data);break}}}}handleStartControlMessage(n){this.startTimeInSeconds=this.nextBlockStartTimeInSeconds,this.playbackEvents=n.startPlaybackEvents.map(a=>({...a,startTimeInSeconds:a.startTimeInSeconds+this.startTimeInSeconds})),this.windowsRequested=1,this.lastWindowOffsetInSecondsReceived=0,this.port.postMessage({type:M.StartControlConfirmedMessage,schedulerStartTimeInSeconds:this.startTimeInSeconds})}handleStopControlMessage(){const n={type:c.StopPlaybackEvent,startTimeInSeconds:this.nextBlockStartTimeInSeconds};this.playbackEvents=[n]}stopScheduling(){this.startTimeInSeconds=null,this.windowsRequested=0,this.lastWindowOffsetInSecondsReceived=null,this.playbackEvents=[]}handleWindowResponse(n){if(!this.startTimeInSeconds||this.lastWindowOffsetInSecondsReceived!==null&&this.lastWindowOffsetInSecondsReceived>n.windowOffsetInSeconds)return;const a=this.startTimeInSeconds+n.windowOffsetInSeconds,s=this.playbackEvents.filter(i=>i.startTimeInSeconds<a-et),o=this.nextBlockStartTimeInSeconds-.5/sampleRate,m=n.playbackEvents.filter(i=>i.startTimeInSeconds>=o);this.playbackEvents=[...s,...m],this.lastWindowOffsetInSecondsReceived=n.windowOffsetInSeconds}process(){if(this.stopPlaybackMessageBuffer[0]=-1,this.nextBlockStartTimeInSeconds=currentTime+tt/sampleRate,u.clearBuffer(this.audioFilePlaybackMessageBuffer),E.clearBuffer(this.instrumentPlaybackMessageBuffer),!this.startTimeInSeconds)return!0;const n=this.startTimeInSeconds+(this.windowsRequested-2)*k;return this.nextBlockStartTimeInSeconds-n>=k&&this.requestNextWindow(),this.scheduleBlockEvents(),!0}scheduleBlockEvents(){const n=[],a=[],s=this.nextBlockStartTimeInSeconds-.5/sampleRate;
1this.playbackEvents.forEach(i=>{i.startTimeInSeconds<s?n.push(i):a.push(i)}),n.sort((i,d)=>i.startTimeInSeconds-d.startTimeInSeconds);const o=[],m=[];for(let i=0;i<tt;i++){const d=currentTime+(i+.5)/sampleRate;for(;n.length>0&&n[0].startTimeInSeconds<d;){const P=n.shift();switch(P.type){case c.AudioFilePlaybackEvent:{const l=new u(P.trackIndex,P.audioFileId,P.volume,Math.round(P.durationInSeconds*sampleRate),i,Math.round(P.audioFileStartTimeInSeconds*sampleRate),P.playbackRate);o.push(l);break}case c.MidiPlaybackEvent:{const l=new E(P.bloobId,P.noteId,P.trackIndex,P.instrumentType,P.instrumentId,P.pitchInt,Vt(P.velocity)*P.volume,Math.round(P.durationInSeconds*sampleRate),i);m.push(l);break}case c.StopPlaybackEvent:{this.stopScheduling(),this.stopPlaybackMessageBuffer[0]=i,this.port.postMessage({type:M.StopRequestMessage});break}}}}u.writeToBuffer(this.audioFilePlaybackMessageBuffer,o),E.writeToBuffer(this.instrumentPlaybackMessageBuffer,m),this.playbackEvents=a}requestNextWindow(){this.port.postMessage({type:M.WindowRequestMessage,schedulerStartTimeInSeconds:this.startTimeInSeconds,windowOffsetInSeconds:this.windowsRequested*k-et,windowSizeInSeconds:Yt}),this.windowsRequested++}}registerProcessor("song-scheduler",Ht)})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.