!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.abcjs=t():e.ABCJS=t()}(this,function(){return r={1045:function(e,t,n){var r=n(1185),i=n(6306),a=n(1592),s=n(1028),o=n(5633),c={},r=(c.signature="abcjs-basic v"+r,Object.keys(i).forEach(function(e){c[e]=i[e]}),Object.keys(a).forEach(function(e){c[e]=a[e]}),c.renderAbc=n(6859),c.TimingCallbacks=n(5681),n(6020)),r=(c.setGlyph=r.setSymbol,c.strTranspose=o,n(5594)),o=n(8471),l=n(522),h=n(2029),u=n(6313),d=n(5281),f=n(8702),p=n(5049),m=n(4718),g=n(3450),v=n(562),b=n(9991);c.synth={CreateSynth:r,instrumentIndexToName:o,pitchToNoteName:l,SynthController:g,SynthSequence:h,CreateSynthControl:u,registerAudioContext:d,activeAudioContext:f,supportsAudio:p,playEvent:m,getMidiFile:v,sequence:s,midiRenderer:b},c.Editor=n(5294),c.EditArea=n(2945),e.exports=c},6306:function(e,t,n){var c=n(5681),r={};!function(){"use strict";var s,o;r.startAnimation=function(n,e,r){function i(e){for(var t=0;th.currentEvent&&h.noteTimings[h.currentEvent].millisecondsh.currentLine&&h.lineEndTimings[h.currentLine].milliseconds=h.lastMoment&&(h.eventCallback?(n=h.eventCallback(null),h.shouldStop(n).then(function(e){e&&h.stop()})):h.stop())}},h.shouldStop=function(e){return new Promise(function(t){return e?"continue"===e?t(!1):void(e.then&&e.then(function(e){t("continue"!==e)})):t(!0)})},h.doBeatCallback=function(e){if(h.beatCallback){for(var t,n=h.currentEvent;ne-h.startTime&&(o.left=void 0),{timestamp:e,startTime:h.startTime,ev:l,endMs:t,offMs:r,offPx:s,gapMs:i,gapPx:a}):{timestamp:e,startTime:h.startTime},l=h.startTime;if(h.beatCallback(h.currentBeat/h.beatSubdivisions,h.totalBeats/h.beatSubdivisions,h.lastMoment,o,c),l!==h.startTime)return e-h.startTime;h.currentBeat++}return null},h.animationJogger=function(){h.isRunning&&(h.doTiming(performance.now()),h.joggerTimer=setTimeout(h.animationJogger,60))},h.start=function(e,t){h.isRunning=!0,h.isPaused&&(h.isPaused=!1,void 0===e&&(h.justUnpaused=!0)),e?h.setProgress(e,t):0===e?h.reset():null!==h.pausedPercent&&(t=performance.now(),h.currentTime=h.lastMoment*h.pausedPercent,h.startTime=t-h.currentTime,h.pausedPercent=null,h.reportNext=!0),requestAnimationFrame(h.doTiming),h.joggerTimer=setTimeout(h.animationJogger,60)},h.pause=function(){h.isPaused=!0;var e=performance.now();h.pausedPercent=(e-h.startTime)/h.lastMoment,h.isRunning=!1,h.joggerTimer&&(clearTimeout(h.joggerTimer),h.joggerTimer=null)},h.currentMillisecond=function(){return h.currentTime},h.reset=function(){h.currentBeat=0,h.currentEvent=0,h.currentLine=0,h.startTime=null,h.pausedPercent=null},h.stop=function(){h.pause(),h.reset()},h.setProgress=function(e,t){var n;switch(t){case"seconds":h.currentTime=1e3*e,h.currentTime<0&&(h.currentTime=0),h.currentTime>h.lastMoment&&(h.currentTime=h.lastMoment),n=h.currentTime/h.lastMoment;break;case"beats":h.currentTime=e*h.millisecondsPerBeat*h.beatSubdivisions,h.currentTime<0&&(h.currentTime=0),h.currentTime>h.lastMoment&&(h.currentTime=h.lastMoment),n=h.currentTime/h.lastMoment;break;default:(n=e)<0&&(n=0),h.currentTime=h.lastMoment*(n=1h.currentEvent&&h.noteTimings[h.currentEvent].millisecondsh.currentLine&&h.lineEndTimings[h.currentLine].milliseconds+h.lineEndAnticipation',e.style.overflowX="hidden",e.style.overflowY="auto",e=e.children[0]):e.innerHTML="";var a=new f(e,n);a.engraveABC(t,r,i),t.engraver=a,(n.viewportVertical||n.viewportHorizontal)&&(e.parentNode.style.width=e.style.width)}e.exports=function(e,t,n,r,i){var a,d={};if(n){for(a in n)n.hasOwnProperty(a)&&(d[a]=n[a]);d.warnings_id&&d.tablature&&(d.tablature.warning_id=d.warnings_id)}if(r)for(a in r)r.hasOwnProperty(a)&&("listener"===a?r[a].highlight&&(d.clickListener=r[a].highlight):d[a]=r[a]);if(i)for(a in i)i.hasOwnProperty(a)&&(d[a]=i[a]);return s.renderEngine(function(e,t,n,r){var i,a,s,o,c,l,h,u=!1;return"*"===e&&(u=!0,(e=document.createElement("div")).setAttribute("style","visibility: hidden;"),document.body.appendChild(e)),!u&&d.wrap&&d.staffwidth?(a=t,s=n,o=r,h=new f(i=e,c=d).getMeasureWidths(a),(h=m.calcLineWraps(a,h,c)).reParse&&((l=new p).parse(o,h.revisedParams),a=l.getTune(),(l=l.getWarnings())&&(a.warnings=l)),c.afterParsing&&c.afterParsing(a,s,o),g(i,a,h.revisedParams,s,0),a.explanation=h.explanation,t=a):(d.afterParsing&&d.afterParsing(t,n,r),g(e,t,d,n,0),u&&e.parentNode.removeChild(e),null)},e,t,d)}},9447:function(e,t,n){var r=n(4914).relativeMajor,n={acc:"sharp",note:"f"},i={acc:"sharp",note:"c"},a={acc:"sharp",note:"g"},s={acc:"sharp",note:"d"},o={acc:"sharp",note:"A"},c={acc:"sharp",note:"e"},l={acc:"flat",note:"B"},h={acc:"flat",note:"e"},u={acc:"flat",note:"A"},d={acc:"flat",note:"d"},f={acc:"flat",note:"G"},p={acc:"flat",note:"c"},m={"C#":[n,i,a,s,o,c,{acc:"sharp",note:"B"}],"F#":[n,i,a,s,o,c],B:[n,i,a,s,o],E:[n,i,a,s],A:[n,i,a],D:[n,i],G:[n],C:[],F:[l],Bb:[l,h],Eb:[l,h,u],Cm:[l,h,u],Ab:[l,h,u,d],Db:[l,h,u,d,f],Gb:[l,h,u,d,f,p],Cb:[l,h,u,d,f,p,{acc:"flat",note:"F"}],"A#":[l,h],"B#":[],"D#":[l,h,u],"E#":[l],"G#":[l,h,u,d],none:[]};e.exports=function(e){e=m[r(e)];return e?JSON.parse(JSON.stringify(e)):null}},4914:function(e){var o={C:{modes:["CMaj","Amin","Am","GMix","DDor","EPhr","FLyd","BLoc"],stepsFromC:0},Db:{modes:["DbMaj","Bbmin","Bbm","AbMix","EbDor","FPhr","GbLyd","CLoc"],stepsFromC:1},D:{modes:["DMaj","Bmin","Bm","AMix","EDor","F#Phr","GLyd","C#Loc"],stepsFromC:2},Eb:{modes:["EbMaj","Cmin","Cm","BbMix","FDor","GPhr","AbLyd","DLoc"],stepsFromC:3},E:{modes:["EMaj","C#min","C#m","BMix","F#Dor","G#Phr","ALyd","D#Loc"],stepsFromC:4},F:{modes:["FMaj","Dmin","Dm","CMix","GDor","APhr","BbLyd","ELoc"],stepsFromC:5},Gb:{modes:["GbMaj","Ebmin","Ebm","DbMix","AbDor","BbPhr","CbLyd","FLoc"],stepsFromC:6},G:{modes:["GMaj","Emin","Em","DMix","ADor","BPhr","CLyd","F#Loc"],stepsFromC:7},Ab:{modes:["AbMaj","Fmin","Fm","EbMix","BbDor","CPhr","DbLyd","GLoc"],stepsFromC:8},A:{modes:["AMaj","F#min","F#m","EMix","BDor","C#Phr","DLyd","G#Loc"],stepsFromC:9},Bb:{modes:["BbMaj","Gmin","Gm","FMix","CDor","DPhr","EbLyd","ALoc"],stepsFromC:10},B:{modes:["BMaj","G#min","G#m","F#Mix","C#Dor","D#Phr","ELyd","A#Loc"],stepsFromC:11},"C#":{modes:["C#Maj","A#min","A#m","G#Mix","D#Dor","E#Phr","F#Lyd","B#Loc"],stepsFromC:1},"F#":{modes:["F#Maj","D#min","D#m","C#Mix","G#Dor","A#Phr","BLyd","E#Loc"],stepsFromC:6},Cb:{modes:["CbMaj","Abmin","Abm","GbMix","DbDor","EbPhr","FbLyd","BbLoc"],stepsFromC:11}},c=null;e.exports={relativeMajor:function(e){if(!c){c={};for(var t=Object.keys(o),n=0;ne)return c}}return null},this.addElementToEvents=function(e,t,n,r,i,a,s,o,c,l){if(t.hint)return{isTiedState:void 0,duration:0};var h=t.durationClass||t.duration;if(0<(h=t.abcelem.rest&&"spacer"===t.abcelem.rest.type?0:h)){for(var u=[],d=0;dO.left&&(O.endX=Math.min(O.endX,z)):O.endX=z)}e=P[P.length-1];e.endX=V[e.line].staffGroup.w}return r.push({type:"end",milliseconds:o}),this.addUsefulCallbackInfo(r,p*n),r},this.addUsefulCallbackInfo=function(e,t){for(var n=this.millisecondsPerMeasure(t),r=0;r"):"No errors"),this.updateSelection(),this.bReentry=!1}},r.prototype.paramChanged=function(e){if(e)for(var t in e)e.hasOwnProperty(t)&&(this.abcjsParams[t]=e[t]);this.currentAbc="",this.fireChanged()},r.prototype.synthParamChanged=function(e){if(this.synth){if(this.synth.options={},e)for(var t in e)e.hasOwnProperty(t)&&(this.synth.options[t]=e[t]);this.currentAbc="",this.fireChanged()}},r.prototype.parseABC=function(){var e=this.editarea.getString();return e===this.currentAbc?(this.updateSelection(),!1):(this.currentAbc=e,!0)},r.prototype.updateSelection=function(){var e=this.editarea.getSelection();try{0o&&(u=t.pan[o]),128===h.instrument?(r.setChannel(9,u),r.setInstrument(0)):(r.setChannel(h.channel,u),r.setInstrument(h.instrument));break;case"note":var u=h.gap*s,d=h.start,f=d+h.duration-u;c[d]||(c[d]=[]),c[d].push({pitch:h.pitch,volume:h.volume,cents:h.cents}),c[f]||(c[f]=[]),c[f].push({pitch:h.pitch,volume:0});break;default:console.log("MIDI create Unknown: "+h.cmd)}}T=C=w=k=x=y=b=v=g=m=p=void 0;for(var p=r,m=c,g=1920,v=Object.keys(m),b=0;by&&(w=(v[x]-y)*g,p.addRest(w),y=v[x]);for(var C=0;C/g,">")},k=function(e,t,n){var r=(t=t||" ")[n];" "!==r&&r||(r="SPACE");var r=a(t.substring(n-64,n))+''+r+""+a(t.substring(n+1).substring(0,64));r="Music Line:"+p.lineIndex+":"+(n+1)+": "+e+": "+r,w.warnings||(w.warnings=[]),w.warnings.push(r),r={message:e,line:t,startChar:w.iChar+n,column:n},w.warningObjects||(w.warningObjects=[]),w.warningObjects.push(r)},C=(this.getWarnings=function(){return w.warnings},this.getWarningObjects=function(){return w.warningObjects},function(e,n){if(0<=n.indexOf(""))v+=n;else if(n=v+n,v="",e){"-"!==(n=S.strip(n))[n.length-1]&&(n+=" ");for(var r=[],i=0,a=!1,t=function(e){var t=(t=S.strip(n.substring(i,e))).replace(/\\([-_*|~])/g,"$1");return i=e+1,0=(t+=r)+5&&"["===e[t]&&":"===e[t+2]){var i=e.indexOf("]",t),a=d.iChar+t,s=d.iChar+i+1;switch(e.substring(t,t+3)){case"[I:":var o=p.addDirective(e.substring(t+3,i));return o&&u(o,e,t),[i-t+1+r];case"[M:":var o=this.setMeter(e.substring(t+3,i));return l.hasBeginMusic()&&o?l.appendStartingElement("meter",a,s,o):d.meter=o,[i-t+1+r];case"[K:":o=m.parseKey(e.substring(t+3,i),!0);return o.foundClef&&l.hasBeginMusic()&&l.appendStartingElement("clef",a,s,d.clef),o.foundKey&&l.hasBeginMusic()&&l.appendStartingElement("key",a,s,m.fixKey(d.clef,d.key)),[i-t+1+r];case"[P:":o=p.parseFontChangeLine(e.substring(t+3,i));return n||c.lines.length<=c.lineNum?d.partForNextLine={title:o,startChar:a,endChar:s}:l.appendElement("part",a,s,{title:o}),[i-t+1+r];case"[L:":return this.setDefaultLength(e,t+3,i),[i-t+1+r];case"[Q:":if(0=t+3)switch(e.substring(t,t+2)){case"I:":var n=p.addDirective(e.substring(t+2));return n&&u(n,e,t),[e.length];case"M:":n=this.setMeter(e.substring(t+2));return l.hasBeginMusic()&&n&&l.appendStartingElement("meter",d.iChar+t,d.iChar+e.length,n),[e.length];case"K:":n=m.parseKey(e.substring(t+2),l.hasBeginMusic());return n.foundClef&&l.hasBeginMusic()&&l.appendStartingElement("clef",d.iChar+t,d.iChar+e.length,d.clef),n.foundKey&&l.hasBeginMusic()&&l.appendStartingElement("key",d.iChar+t,d.iChar+e.length,m.fixKey(d.clef,d.key)),[e.length];case"P:":return l.hasBeginMusic()&&l.appendElement("part",d.iChar+t,d.iChar+e.length,{title:e.substring(t+2)}),[e.length];case"L:":return this.setDefaultLength(e,t+2,e.length),[e.length];case"Q:":var n=e.indexOf("",t+2),r=(-1===n&&(n=e.length),this.setTempo(e,t+2,n,d.iChar));return"delaySet"===r.type?l.appendElement("tempo",d.iChar+t,d.iChar+e.length,this.calcTempo(r.tempo)):"immediate"===r.type&&l.appendElement("tempo",d.iChar+t,d.iChar+e.length,r.tempo),[n,e[t],a.strip(e.substring(t+2))];case"V:":return m.parseVoice(e,t+2,e.length),[e.length,e[t],a.strip(e.substring(t+2))]}return[0]},{A:"author",B:"book",C:"composer",D:"discography",F:"url",G:"group",I:"instruction",N:"notes",O:"origin",R:"rhythm",S:"source",W:"unalignedWords",Z:"transcription"});this.parseHeader=function(e){var t=o[e[0]],n=e.length-2,r=h.translateString(h.stripComment(e.substring(2)));if("unalignedWords"===t||"notes"===t)l.addMetaTextArray(t,p.parseFontChangeLine(r),{startChar:d.iChar,endChar:d.iChar+e.length});else if(void 0!==t)l.addMetaText(t,p.parseFontChangeLine(r),{startChar:d.iChar,endChar:d.iChar+e.length});else{var i=d.iChar,a=i+e.length;switch(e[0]){case"H":for(l.addMetaTextArray("history",p.parseFontChangeLine(r),{startChar:d.iChar,endChar:d.iChar+e.length}),e=h.peekLine();e&&":"!==e[1];)h.nextLine(),l.addMetaTextArray("history",p.parseFontChangeLine(h.translateString(h.stripComment(e))),{startChar:d.iChar,endChar:d.iChar+e.length}),e=h.peekLine();break;case"K":this.resolveTempo();var s=m.parseKey(e.substring(2),!1);!d.is_in_header&&l.hasBeginMusic()&&(s.foundClef&&l.appendStartingElement("clef",i,a,d.clef),s.foundKey&&l.appendStartingElement("key",i,a,m.fixKey(d.clef,d.key))),d.is_in_header=!1;break;case"L":this.setDefaultLength(e,2,e.length);break;case"M":d.origMeter=d.meter=this.setMeter(e.substring(2));break;case"P":d.is_in_header?l.addMetaText("partOrder",p.parseFontChangeLine(r),{startChar:d.iChar,endChar:d.iChar+e.length}):d.partForNextLine={title:r,startChar:i,endChar:a};break;case"Q":s=this.setTempo(e,2,e.length,d.iChar);"delaySet"===s.type?d.tempo=s.tempo:"immediate"===s.type&&(c.metaText.tempo?d.tempoForNextLine=["tempo",i,a,s.tempo]:c.metaText.tempo=s.tempo);break;case"T":d.titlecaps&&(r=r.toUpperCase()),this.setTitle(p.parseFontChangeLine(h.theReverser(r)),n);break;case"U":this.addUserDefinition(e,2,e.length);break;case"V":if(m.parseVoice(e,2,e.length),d.is_in_header)break;return{newline:!0};case"s":return{symbols:!0};case"w":return{words:!0};case"X":break;case"E":case"m":u("Ignored header",e,0);break;default:return{regular:!0}}}return{}}}},9708:function(e,t,n){var r=n(5008),C=n(8360),i=n(2821),T={};function _(e,t){return((e=a[e])?e.mid:0)+t}T.initialize=function(e,t,n,r,i){S=e,E=t,M=n,v=i},T.standardKey=function(e,t,n,r){return i.keySignature(M,e,t,n,r)};var S,E,M,v,a={treble:{clef:"treble",pitch:4,mid:0},"treble+8":{clef:"treble+8",pitch:4,mid:0},"treble-8":{clef:"treble-8",pitch:4,mid:0},"treble^8":{clef:"treble+8",pitch:4,mid:0},treble_8:{clef:"treble-8",pitch:4,mid:0},treble1:{clef:"treble",pitch:2,mid:2},treble2:{clef:"treble",pitch:4,mid:0},treble3:{clef:"treble",pitch:6,mid:-2},treble4:{clef:"treble",pitch:8,mid:-4},treble5:{clef:"treble",pitch:10,mid:-6},perc:{clef:"perc",pitch:6,mid:0},none:{clef:"none",mid:0},bass:{clef:"bass",pitch:8,mid:-12},"bass+8":{clef:"bass+8",pitch:8,mid:-12},"bass-8":{clef:"bass-8",pitch:8,mid:-12},"bass^8":{clef:"bass+8",pitch:8,mid:-12},bass_8:{clef:"bass-8",pitch:8,mid:-12},"bass+16":{clef:"bass",pitch:8,mid:-12},"bass-16":{clef:"bass",pitch:8,mid:-12},"bass^16":{clef:"bass",pitch:8,mid:-12},bass_16:{clef:"bass",pitch:8,mid:-12},bass1:{clef:"bass",pitch:2,mid:-6},bass2:{clef:"bass",pitch:4,mid:-8},bass3:{clef:"bass",pitch:6,mid:-10},bass4:{clef:"bass",pitch:8,mid:-12},bass5:{clef:"bass",pitch:10,mid:-14},tenor:{clef:"alto",pitch:8,mid:-8},tenor1:{clef:"alto",pitch:2,mid:-2},tenor2:{clef:"alto",pitch:4,mid:-4},tenor3:{clef:"alto",pitch:6,mid:-6},tenor4:{clef:"alto",pitch:8,mid:-8},tenor5:{clef:"alto",pitch:10,mid:-10},alto:{clef:"alto",pitch:6,mid:-6},alto1:{clef:"alto",pitch:2,mid:-2},alto2:{clef:"alto",pitch:4,mid:-4},alto3:{clef:"alto",pitch:6,mid:-6},alto4:{clef:"alto",pitch:8,mid:-8},alto5:{clef:"alto",pitch:10,mid:-10},"alto+8":{clef:"alto+8",pitch:6,mid:-6},"alto-8":{clef:"alto-8",pitch:6,mid:-6},"alto^8":{clef:"alto+8",pitch:6,mid:-6},alto_8:{clef:"alto-8",pitch:6,mid:-6}},b=(T.fixClef=function(e){var t=a[e.type];t&&(e.clefPos=t.pitch,e.type=t.clef)},T.deepCopyKey=function(e){var t={accidentals:[],root:e.root,acc:e.acc,mode:e.mode};return e.accidentals.forEach(function(e){t.accidentals.push(r.clone(e))}),t},{A:5,B:6,C:0,D:1,E:2,F:3,G:4,a:12,b:13,c:7,d:8,e:9,f:10,g:11});T.addPosToKey=function(e,t){var n=e.verticalPos;t.accidentals.forEach(function(e){var t=b[e.note];e.verticalPos=t-=n}),t.impliedNaturals&&t.impliedNaturals.forEach(function(e){var t=b[e.note];e.verticalPos=t-=n}),n<-10?(t.accidentals.forEach(function(e){e.verticalPos-=7,(11<=e.verticalPos||10===e.verticalPos&&"flat"===e.acc)&&(e.verticalPos-=7),"A"===e.note&&"sharp"===e.acc&&(e.verticalPos-=7),"G"!==e.note&&"F"!==e.note||"flat"!==e.acc||(e.verticalPos-=7)}),t.impliedNaturals&&t.impliedNaturals.forEach(function(e){e.verticalPos-=7,(11<=e.verticalPos||10===e.verticalPos&&"flat"===e.acc)&&(e.verticalPos-=7),"A"===e.note&&"sharp"===e.acc&&(e.verticalPos-=7),"G"!==e.note&&"F"!==e.note||"flat"!==e.acc||(e.verticalPos-=7)})):n<-4?(t.accidentals.forEach(function(e){e.verticalPos-=7,-8!==n||"f"!==e.note&&"g"!==e.note||"sharp"!==e.acc||(e.verticalPos-=7)}),t.impliedNaturals&&t.impliedNaturals.forEach(function(e){e.verticalPos-=7,-8!==n||"f"!==e.note&&"g"!==e.note||"sharp"!==e.acc||(e.verticalPos-=7)})):7<=n&&(t.accidentals.forEach(function(e){e.verticalPos+=7}),t.impliedNaturals&&t.impliedNaturals.forEach(function(e){e.verticalPos+=7}))},T.fixKey=function(e,t){t=r.clone(t);return T.addPosToKey(e,t),t},T.parseKey=function(e,t){0===e.length&&(e="none");var n=S.tokenize(e,0,e.length),r={};if(0===n.length)return E("Must pass in key signature.",e,0),r;switch(n[0].token){case"HP":C.addDirective("bagpipes"),M.key={root:"HP",accidentals:[],acc:"",mode:""},r.foundKey=!0,n.shift();break;case"Hp":C.addDirective("bagpipes"),M.key={root:"Hp",accidentals:[{acc:"natural",note:"g"},{acc:"sharp",note:"f"},{acc:"sharp",note:"c"}],acc:"",mode:""},r.foundKey=!0,n.shift();break;case"none":M.key={root:"none",accidentals:[],acc:"",mode:""},r.foundKey=!0,n.shift();break;default:var i=S.getKeyPitch(n[0].token);if(0":case"<":var x=G(e,t);t+=x[0]-1,S.next_note_duration=x[2],p?p*=x[1]:p=x[1];break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"/":var x=T.getFraction(e,t),p=x.value,w=e[t=x.index];" "===w&&(m=!0),"-"===w||")"===w||" "===w||"<"===w||">"===w?t--:y=!0;break;default:y=!0}y||t++}}else _("Expected ']' to end the chords",e,t);void 0!==P.pitches&&(null!==p&&(P.duration=P.duration*p,m&&V(P)),S.addFormattingOptions(P,E.formatting,"note"),M.appendElement("note",n+o,n+t,P),S.measureNotEmpty=!0,P={}),g=!0}}}else{var l={},k=Y(e,t,l,!0);void 0!==l.endTie&&L(S,s,!0),null!==k&&(void 0!==k.pitch?(P.pitches=[{}],void 0!==k.accidental&&(P.pitches[0].accidental=k.accidental),P.pitches[0].pitch=k.pitch,P.pitches[0].name=k.name,!k.midipitch&&0!==k.midipitch||(P.pitches[0].midipitch=k.midipitch),void 0!==k.endSlur&&(P.pitches[0].endSlur=k.endSlur),void 0!==k.endTie&&(P.pitches[0].endTie=k.endTie),void 0!==k.startSlur&&(P.pitches[0].startSlur=k.startSlur),void 0!==P.startSlur&&(P.pitches[0].startSlur=P.startSlur),void 0!==P.dottedSlur&&(P.pitches[0].dottedSlur=!0),void 0!==k.startTie&&(P.pitches[0].startTie=k.startTie),void 0!==P.startTie&&(P.pitches[0].startTie=P.startTie)):(P.rest=k.rest,void 0!==k.endSlur&&(P.endSlur=k.endSlur),void 0!==k.endTie&&(P.rest.endTie=k.endTie),void 0!==k.startSlur&&(P.startSlur=k.startSlur),void 0!==k.startTie&&(P.rest.startTie=k.startTie),void 0!==P.startTie&&(P.rest.startTie=P.startTie)),void 0!==k.chord&&(P.chord=k.chord),void 0!==k.duration&&(P.duration=k.duration),void 0!==k.decoration&&(P.decoration=k.decoration),void 0!==k.graceNotes&&(P.graceNotes=k.graceNotes),delete P.startSlur,delete P.dottedSlur,C(S,s,P)&&(void 0!==P.pitches?P.pitches[0].endTie=!0:"spacer"!==P.rest.type&&(P.rest.endTie=!0),L(S,s,!1)),(k.startTie||P.startTie)&&L(S,s,!0),t=k.endChar,0"===n[1][0]?(n[1]=n[1].substring(1),n[2]="right"):0"!==e[t])return n;t--,o="broken_rhythm";break;case">":case"<":if(!i(o))return null;if(!r)return n.endChar=t,n;var h=G(e,t);t+=h[0]-1,S.next_note_duration=h[2],n.duration=h[1]*n.duration,o="end_slur";break;default:return i(o)?(n.endChar=t,n):null}if(++t===e.length)return i(o)?(n.endChar=t,n):null}return null},G=function(e,t){switch(e[t]){case">":return t"===e[t+1]&&">"===e[t+2]?[3,1.875,.125]:t"===e[t+1]?[2,1.75,.25]:[1,1.5,.5];case"<":return t","accent"],["tr","trill"],["plus","+"],["emphasis","accent"],["^","umarcato"],["marcato","umarcato"]],e.exports.accentDynamicPseudonyms=[["<(","crescendo("],["<)","crescendo)"],[">(","diminuendo("],[">)","diminuendo)"]],e.exports.nonDecorations="ABCDEFGabcdefgxyzZ[]|^_{",e.exports.durations=[.5,.75,.875,.9375,.96875,.984375,.25,.375,.4375,.46875,.484375,.4921875,.125,.1875,.21875,.234375,.2421875,.24609375,.0625,.09375,.109375,.1171875,.12109375,.123046875,.03125,.046875,.0546875,.05859375,.060546875,.0615234375,.015625,.0234375,.02734375,.029296875,.0302734375,.03076171875],e.exports.pitches={A:5,B:6,C:0,D:1,E:2,F:3,G:4,a:12,b:13,c:7,d:8,e:9,f:10,g:11},e.exports.rests={x:"invisible",X:"invisible-multimeasure",y:"spacer",z:"rest",Z:"multimeasure"},e.exports.accMap={dblflat:"__",flat:"_",natural:"=",sharp:"^",dblsharp:"^^",quarterflat:"_/",quartersharp:"^/"},e.exports.tripletQ={2:3,3:2,4:3,5:2,6:2,7:2,8:3,9:2}},1881:function(e,t,n){function r(e,t){function o(e,t){return t>=e.length}function l(e){return"A"<=e&&e<="Z"||"a"<=e&&e<="z"}function h(e){return"0"<=e&&e<="9"}this.lineIndex=0,this.lines=e,this.multilineVars=t,this.skipWhiteSpace=function(e){for(var t=0;te.length-1?e.length-1:a)-t+1,c(e.substring(t+1,a)),!1]}}var u=n(5008);r.prototype.peekLine=function(){return this.lines[this.lineIndex]},r.prototype.nextLine=function(){var e;return 0=_.lines[m].staff[0].voices.length&&_.lines[m].staff[0].voices.push([{el_type:"note",duration:t[m],rest:{type:"invisible"},startChar:p.startChar,endChar:p.endChar}])}}s[o].hasOverlay&&0===s[o].snip.length&&s[o].snip.push({start:d,len:c.length-d})}for(o=0;o=t&&at;){if(e[t].staff)return e[t];t++}return null}for(_.lineNum=0;_.lineNum<_.lines.length;_.lineNum++){var w=_.lines[_.lineNum].staff;if(w)for(_.staffNum=0;_.staffNumt&&(s=!0),o%n==n-1&&(o!==e.length-1&&r.push(o),i.push(Math.round(a)),a=0);return{failed:s,totals:i,lineBreaks:r}}(d.measureWidths,p,o),f.attempts.push({type:"Fixed Measures Per Line",preferredMeasuresPerLine:o,lineBreaks:u.lineBreaks,failed:u.failed,totals:u.totals}),u.failed||(m=u.lineBreaks)),m||(u=function(e,t){for(var n=[],r=[],i=0,a=0;a\<\-\)]*)/.source+_.source))){for(var c=1+a[1].length,l=0;l\<\-\)\.\s\\]*)/,T=/([_^=]*[A-Ga-g][,']*)?(\d*\/*\d*)?([\>\<\-\)]*)?/,_=/(\s*)$/;function S(e,t,n,r){var t="none"===t?0:p.indexOf(t),e=e.match(l),i=e[2].toUpperCase(),t=p.indexOf(i)-t,a=(t<0&&(t+=7),c.indexOf(e[3])),s=(i===e[2]&&a--,r[i]||n[i]||"=");return{acc:e[1],name:i,pitch:t,oct:a,adj:function(e,t,n){if(!(e=!e&&n?n:e))return 0;switch(t){case void 0:switch(e){case"__":return-2;case"_":return-1;case"=":default:return 0;case"^":return 1;case"^^":return 2}case"_":switch(e){case"__":return-1;case"_":default:return 0;case"=":return 1;case"^":return 2;case"^^":return 3}case"^":switch(e){case"__":return-3;case"_":return-2;case"=":return-1;case"^":default:return 0;case"^^":return 1}}return 0}(e[1],n[i],r[i]),courtesy:e[1]===s}}}(),e.exports=r},9716:function(e,t,n){var r,tt=n(5008),nt=n(5058);!function(){"use strict";var te,ne,re,ie,ae,se,oe,ce,le,he,ue,de,fe,De,pe,me,ge,ve,be,ye,xe,we,ke,Ce=1,Te={num:4,den:4},Fe=0,je=0,_e=128,Se=64,Ee=48,Ie=!1,Me=!1,Ve=!0,Ye=105,Ne=95,Ae=85,Ge=.25,Be=0,Pe={},qe=0;function We(){for(var e=!0,t=0;tt?n.substring(0,t):n,i="",a=0;a>=7;for(var r=n.length-1;0<=r;r--){t<<=8;var i=n[r];0!==r&&(i|=128),t|=i}var a=t.toString(16).length;return s(t,a+=a%2)}e.prototype.setTempo=function(e){0===this.trackcount&&(this.startTrack(),this.track+="%00%FF%51%03"+s(Math.round(6e7/e),6),this.endTrack())},e.prototype.setGlobalInfo=function(e,t,n,r){0===this.trackcount&&(this.startTrack(),e=Math.round(6e7/e),this.track+="%00%FF%51%03"+s(e,6),n&&(this.track+=function(e){if(!e||!e.accidentals)return"";for(var t=0,n=256,r=0;rz;)z++;if(p[O].length>z)for(M=0;M\n',t&&(l+='\n"),i&&(l+='\n"),a&&(l+='\n"),s&&(l+='\n'),c&&(l+='\n'),o&&(l+=' ( '+(e.bpm||"BPM")+")\n"),u.innerHTML=l=l+'
CSS required: load abcjs-audio.css
'+"\n",i=!!(n=h).options.loopHandler,s=!!n.options.restartHandler,t=!!n.options.playHandler||!!n.options.playPromiseHandler,c=!!n.options.progressHandler,o=!!n.options.warpHandler,r=n.parent.querySelector(".abcjs-midi-start"),i&&n.parent.querySelector(".abcjs-midi-loop").addEventListener("click",function(e){x(n.options.loopHandler,e,r,n.options.afterResume)}),s&&n.parent.querySelector(".abcjs-midi-reset").addEventListener("click",function(e){x(n.options.restartHandler,e,r,n.options.afterResume)}),t&&r.addEventListener("click",function(e){x(n.options.playPromiseHandler||n.options.playHandler,e,r,n.options.afterResume,!!n.options.playPromiseHandler)}),c&&n.parent.querySelector(".abcjs-midi-progress-background").addEventListener("click",function(e){x(n.options.progressHandler,e,r,n.options.afterResume)}),o&&n.parent.querySelector(".abcjs-midi-tempo").addEventListener("change",function(e){x(n.options.warpHandler,e,r,n.options.afterResume)}),h.disable=function(e){var t=h.parent.querySelector(".abcjs-inline-audio");e?t.classList.add("abcjs-disabled"):t.classList.remove("abcjs-disabled")},h.setWarp=function(e,t){h.parent.querySelector(".abcjs-midi-tempo").value=Math.round(t),h.setTempo(e)},h.setTempo=function(e){var t=h.parent.querySelector(".abcjs-midi-current-tempo");t&&(t.innerHTML=Math.round(e))},h.resetAll=function(){for(var e=h.parent.querySelectorAll(".abcjs-pushed"),t=0;tt?a[t]:0;e.forEach(function(e){var t=e.instrument+":"+e.pitch+":"+e.volume+":"+Math.round(1e3*(e.end-e.start))/1e3+":"+n+":"+r+":"+(e.cents||0);m.debugCallback&&m.debugCallback("noteMapTrack "+t),s[t]||(s[t]=[]),s[t].push(e.start)})});for(var o=[],c=v().createBuffer(2,n,v().sampleRate),l=0;l',r.preTextDownload&&(s+=r.preTextDownload),o=u.metaText&&u.metaText.title?u.metaText.title:"Untitled",c=r.downloadLabel&&(c=r.downloadLabel)&&"[object Function]"==={}.toString.call(c)?r.downloadLabel(u,a):r.downloadLabel?r.downloadLabel.replace(/%T/,o):'Download MIDI for "'+o+'"',o=o.toLowerCase().replace(/'/g,"").replace(/\W/g,"_").replace(/__/g,"_"),s+=''+c+"",r.postTextDownload&&(s+=r.postTextDownload),s+""}}return m.generateInline=!1,"string"==typeof e?i.renderEngine(r,"*",e,m):r(0,e,0)}},5343:function(e){e.exports='\n\n \n\n'},1225:function(e){e.exports='\n\n\t\n\t\n\t\n\t\n\n'},5075:function(e){e.exports='\n\n \n \n \n \n\n'},9733:function(e){e.exports='\n\n \n \n \n\n'},6987:function(e){e.exports='\n\n \n \n \n \n\n'},8471:function(e){e.exports=["acoustic_grand_piano","bright_acoustic_piano","electric_grand_piano","honkytonk_piano","electric_piano_1","electric_piano_2","harpsichord","clavinet","celesta","glockenspiel","music_box","vibraphone","marimba","xylophone","tubular_bells","dulcimer","drawbar_organ","percussive_organ","rock_organ","church_organ","reed_organ","accordion","harmonica","tango_accordion","acoustic_guitar_nylon","acoustic_guitar_steel","electric_guitar_jazz","electric_guitar_clean","electric_guitar_muted","overdriven_guitar","distortion_guitar","guitar_harmonics","acoustic_bass","electric_bass_finger","electric_bass_pick","fretless_bass","slap_bass_1","slap_bass_2","synth_bass_1","synth_bass_2","violin","viola","cello","contrabass","tremolo_strings","pizzicato_strings","orchestral_harp","timpani","string_ensemble_1","string_ensemble_2","synth_strings_1","synth_strings_2","choir_aahs","voice_oohs","synth_choir","orchestra_hit","trumpet","trombone","tuba","muted_trumpet","french_horn","brass_section","synth_brass_1","synth_brass_2","soprano_sax","alto_sax","tenor_sax","baritone_sax","oboe","english_horn","bassoon","clarinet","piccolo","flute","recorder","pan_flute","blown_bottle","shakuhachi","whistle","ocarina","lead_1_square","lead_2_sawtooth","lead_3_calliope","lead_4_chiff","lead_5_charang","lead_6_voice","lead_7_fifths","lead_8_bass_lead","pad_1_new_age","pad_2_warm","pad_3_polysynth","pad_4_choir","pad_5_bowed","pad_6_metallic","pad_7_halo","pad_8_sweep","fx_1_rain","fx_2_soundtrack","fx_3_crystal","fx_4_atmosphere","fx_5_brightness","fx_6_goblins","fx_7_echoes","fx_8_scifi","sitar","banjo","shamisen","koto","kalimba","bagpipe","fiddle","shanai","tinkle_bell","agogo","steel_drums","woodblock","taiko_drum","melodic_tom","synth_drum","reverse_cymbal","guitar_fret_noise","breath_noise","seashore","bird_tweet","telephone_ring","helicopter","applause","gunshot","percussion"]},2228:function(e,t,n){var r=n(4771);e.exports=function(e,a,s,o){r[a]||(r[a]={});var t=r[a];return t[s]||(t[s]=new Promise(function(t,n){var r=new XMLHttpRequest,i=e+a+"-mp3/"+s+".mp3";r.open("GET",i,!0),r.responseType="arraybuffer",r.onload=function(){var e;200===r.status?(e=o.decodeAudioData(r.response,function(e){t({instrument:a,name:s,status:"loaded",audioBuffer:e})},function(){n(Error("Can't decode sound at "+i))}))&&"function"==typeof e.catch&&e.catch(n):n(Error("Can't load sound at "+i+" status="+r.status))},r.onerror=function(){n(Error("Can't load sound at "+i))},r.send()}).catch(function(e){throw console.error("Didn't load note",a,s,":",e.message),e})),t[s]}},2842:function(e){var n={__:-2,_:-1,"_/":-.5,"=":0,"":0,"^/":.5,"^":1,"^^":2},r=["C","-","D","-","E","F","-","G","-","A","-","B","c","-","d","-","e","f","-","g","-","a","-","b"];e.exports={noteToMidi:function(e){var t,e=e.match(/([_^\/]*)([ABCDEFGabcdefg])(,*)('*)/);return e&&5===e.length?(t=n[e[1]],48+r.indexOf(e[2])+t+12*(e[4].length-e[3].length)):0},midiToNote:function(e){e=parseInt(e,10);var t=Math.floor(e/12),e=e%12,n=r[e];if("-"===n&&(n="^"+r[e-1]),4=e.stringPitches[i])return r=t.pitch+t.pitchAltered-e.stringPitches[i],"^"===t.quarter?r-=.5:"v"===t.quarter&&(r+=.5),{num:Math.round(r),str:e.stringPitches.length-1-i,note:t};return{num:"?",str:e.stringPitches.length-1,note:t}}function u(e,t){e.push({num:"?",str:0,note:t}),e.error=t.emit()+": unexpected note for instrument"}function r(e){var t=e.tuning,n=e.capo,r=e._super.params.highestNote;this.linePitch=e.linePitch,this.highestNote="a'",r&&(this.highestNote=r),this.measureAccidentals={},this.capo=0,n&&(this.capo=parseInt(n,10)),this.transpose=e.transpose||0,this.tuning=t,this.stringPitches=[];for(var i=0;ithis.pitch},r.prototype.checkKeyAccidentals=function(e,t){if(!this.isAltered&&!this.natural)if(t[this.name.toUpperCase()])switch(t[this.name.toUpperCase()]){case"__":return this.acc=-2,void(this.pitchAltered=-2);case"_":return this.acc=-1,void(this.pitchAltered=-1);case"=":return this.acc=0,void(this.pitchAltered=0);case"^":return this.acc=1,void(this.pitchAltered=1);case"^^":return this.acc=2,void(this.pitchAltered=2)}else if(e)for(var n=this.name,r=0;rt&&(t=r.specialY.lyricHeightBelow)}return t}(o[0]),e=this.staffIndex,e=s.staffs[e],t=this.tabSize+3-e.bottom-t,c=(e.isTabStaff&&(t=e.top),{bottom:-1,isTabStaff:!0,specialY:{tempoHeightAbove:0,partHeightAbove:0,volumeHeightAbove:0,dynamicHeightAbove:0,endingHeightAbove:0,chordHeightAbove:0,lyricHeightAbove:0,lyricHeightBelow:0,chordHeightBelow:0,volumeHeightBelow:0,dynamicHeightBelow:0},lines:this.plugin.nbLines,linePitch:this.plugin.linePitch,dy:.15,top:t}),l=function(e,t){for(var n,r,i=e.staffIndex,a=0,s=0,o=0;;){if(!t[a])return-1;if(t[a].isTabStaff||(o=t[a].voices.length),t[a].isTabStaff){if(s++,(r=t)[n=a].isTabStaff&&(n===r.length-1||!r[n+1].isTabStaff)&&st.length)return-1}}(this,s.staffs);if(-1!==l){c.parentIndex=l-1,s.staffs.splice(l,0,c),s.height+=this.tabSize+3;var e=function(e){for(var t=l;0<=t;t--)if(!e[t].isTabStaff)return e[t];return null}(s.staffs),h=1;t=s.staffs,a=e,1===function(e){for(var t=0,n=0;ne.pitches[r+1].pitch&&(t=!1,n=e.pitches[r],e.pitches[r]=e.pitches[r+1],e.pitches[r+1]=n)}while(!t)};function z(e,t){for(var n=0;n",r)),a&&e.addOther(new c(a.start,a.stop,"<",r)),s&&e.addOther(new l(s.start,s.stop))},r.prototype.createDecoration=function(e,t,n,r,i,a,s,o,c,l,h){for(var u=e,d=t,H=i,D=(c=c||{ornamentPosition:"above",volumePosition:l?"above":"below",dynamicPosition:l?"above":"below"}).volumePosition,f=0;f_&&(t=_),t}function M(e,t,n){var r=E(t);w.addFixedX(new q(e,x/2,0,r+2,{type:"decoration",klass:"ornament",thickness:3,anchor:n})),S(t,5)}function N(e,t){var n=x/2,r=("center"!==G.getSymbolAlign(e)&&(n-=G.getSymbolWidth(e)/2),G.symbolHeightInPitches(e)+1),i=E(t),i="above"===t?i+r/2:i-r/2;w.addFixedX(new q(e,n,G.getSymbolWidth(e),i,{klass:"ornament",thickness:G.symbolHeightInPitches(e)})),S(t,r)}for(var A={"+":"scripts.stopped",open:"scripts.open",snap:"scripts.snap",wedge:"scripts.wedge",thumb:"scripts.thumb",shortphrase:"scripts.shortphrase",mediumphrase:"scripts.mediumphrase",longphrase:"scripts.longphrase",trill:"scripts.trill",roll:"scripts.roll",irishroll:"scripts.roll",marcato:"scripts.umarcato",dmarcato:"scripts.dmarcato",umarcato:"scripts.umarcato",turn:"scripts.turn",uppermordent:"scripts.prall",pralltriller:"scripts.prall",mordent:"scripts.mordent",lowermordent:"scripts.mordent",downbow:"scripts.downbow",upbow:"scripts.upbow",fermata:"scripts.ufermata",invertedfermata:"scripts.dfermata",breath:",",coda:"scripts.coda",segno:"scripts.segno"},B=0;Bthis.w&&(this.w=e.dx+e.w),this.right[this.right.length]=e,this._addChild(e)},r.prototype.addFixed=function(e){this._addChild(e)},r.prototype.addFixedX=function(e){this._addChild(e)},r.prototype.addCentered=function(e){var t=e.w/2;-tthis.w&&(this.w=e.dx+t),this.right[this.right.length]=e,this._addChild(e)},r.prototype.setLimit=function(e,t){t[e]&&(this.specialY[e]?this.specialY[e]=Math.max(this.specialY[e],t[e]):this.specialY[e]=t[e])},r.prototype._addChild=function(e){(e.parent=this).children[this.children.length]=e,this.pushTop(e.top),this.pushBottom(e.bottom),this.setLimit("tempoHeightAbove",e),this.setLimit("partHeightAbove",e),this.setLimit("volumeHeightAbove",e),this.setLimit("dynamicHeightAbove",e),this.setLimit("endingHeightAbove",e),this.setLimit("chordHeightAbove",e),this.setLimit("lyricHeightAbove",e),this.setLimit("lyricHeightBelow",e),this.setLimit("chordHeightBelow",e),this.setLimit("volumeHeightBelow",e),this.setLimit("dynamicHeightBelow",e)},r.prototype.pushTop=function(e){void 0!==e&&(void 0===this.top?this.top=e:this.top=Math.max(e,this.top))},r.prototype.pushBottom=function(e){void 0!==e&&(void 0===this.bottom?this.bottom=e:this.bottom=Math.min(e,this.bottom))},r.prototype.setX=function(e){this.x=e;for(var t=0;tthis.max)&&(this.max=e.abcelem.maxpitch))},t.prototype.addBeam=function(e){this.beams.push(e)},t.prototype.setStemDirection=function(){this.average=r(this.total,this.count),this.forceup?this.stemsUp=!0:this.forcedown?this.stemsUp=!1:this.stemsUp=this.average<6,delete this.count,this.total=0},t.prototype.calcDir=function(){this.average=r(this.total,this.elems.length),this.forceup?this.stemsUp=!0:this.forcedown?this.stemsUp=!1:this.stemsUp=this.average<6;for(var e=this.stemsUp?"up":"down",t=0;tthis.top&&(this.top=this.pitch2),this.bottom=r,void 0!==this.pitch2&&this.pitch2e&&(e=this.internalNotes[t].highestVert);e>this.startY&&e>this.endY&&(this.startY=this.endY=e-1)}},e.exports=t},1134:function(e,t,n){var p=n(1716),m=n(6994);e.exports=function(e,t,n,r,i,a,s,o,c,l){this.rows=[],e.header&&a&&(h=l.calc("X","headerfont","abcjs-header abcjs-meta-top").height,p(this.rows,{marginLeft:s,text:e.header.left,font:"headerfont",klass:"header meta-top",marginTop:-h,info:t.header,name:"header"},l),p(this.rows,{marginLeft:s+i/2,text:e.header.center,font:"headerfont",klass:"header meta-top",marginTop:-h,anchor:"middle",info:t.header,name:"header"},l),p(this.rows,{marginLeft:s+i,text:e.header.right,font:"headerfont",klass:"header meta-top",marginTop:-h,anchor:"end",info:t.header,name:"header"},l)),a&&this.rows.push({move:o.top});var h,u=n.titleleft?"start":"middle",d=n.titleleft?s:s+i/2;if(e.title&&m(this.rows,e.title,"titlefont",c?"abcjs-title":"","title",d,{marginTop:o.title,anchor:u,absElemType:"title",info:t.title},l),r.length)for(var f=0;fthis.width+1&&(e.topText=new d(e.metaText,e.metaTextInfo,e.formatting,e.lines,a,this.renderer.isPrint,this.renderer.padding.left,this.renderer.spacing,this.classes.shouldAddClasses,this.getTextSize),e.lines&&0 g"),c=0,l=[],h=0;h=c.offsetX&&o.y<=c.offsetY&&o.y+o.height>=c.offsetY||Math.abs(c.layerY/l-c.offsetY)<3?[c.offsetX,c.offsetY]:[c.layerX,c.layerY])[0],c=o[1]):(i=r=1,a=(t=t).target.closest("svg"),s=0,a&&a.viewBox&&a.viewBox.baseVal&&(0!==a.viewBox.baseVal.width&&(r=a.viewBox.baseVal.width/a.clientWidth),0!==a.viewBox.baseVal.height&&(i=a.viewBox.baseVal.height/a.clientHeight),s=a.viewBox.baseVal.y),a=t.target&&"svg"===t.target.tagName?(n=t.offsetX,t.offsetY):(n=t.layerX,t.layerY),h=function(e,t,n){for(var r=9999999,i=-1,a=0;at&&c.dim.topn?(i=a,r=0):c.dim.topn?(s=Math.min(Math.abs(c.dim.left-t),Math.abs(c.dim.right-t)))t?(s=Math.min(Math.abs(c.dim.top-n),Math.abs(c.dim.bottom-n)))Math.abs(t-c.dim.right)?Math.abs(t-c.dim.right):Math.abs(t-c.dim.left),c=Math.abs(n-c.dim.top)>Math.abs(n-c.dim.bottom)?Math.abs(n-c.dim.bottom):Math.abs(n-c.dim.top),(o=Math.sqrt(o*o+c*c))=p[0]&&(p[0]+=c.w),s[m].split.push(p[0]),s[m].split.push(p[1]))}for(var g,v,b=s.length-1;0<=b;b--)(o===e.length-1||A(e[o+1].abcelem.duration)>-b-4)&&(g=h,v=u+d*(b+1),s[b].single&&(v=L(n.startX,n.startY,n.endX,n.endY,g=0===o?h+5:h-5)+d*(b+1)),g={startX:s[b].x,endX:g,startY:s[b].y,endY:v,dy:i},void 0!==s[b].split&&(v=s[b].split,g.endX<=v[v.length-1]&&(v[v.length-1]-=c.w),v.push(g.endX),g.split=s[b].split),a.push(g),s=s.slice(0,b))}}return a}(e.elems,e.stemsUp,e.beams[0],e.isgrace,t),c=0;cMath.round(o)&&(o=s,i&&(c=-1)));for(c=0;co&&(o=S.getNextX(h[d]),l=S.getSpacingUnits(h[d]),f=h[d].spacingduration);a+=l,s=Math.min(s,l),n&&console.log("currentduration: ",c,a,s);var p=void 0;for(d=0;do&&(o=S.getNextX(r.voices[d]),l=S.getSpacingUnits(r.voices[d]));for(var w=r.voices,k=0,C=0;Ce.startNote||r>e.endNote)&&(e.startNote=r,e.endNote=r),e.flatBeams&&(e.startNote=Math.max(e.startNote,e.endNote),e.endNote=Math.max(e.startNote,e.endNote)),e.yTextPos=e.startNote+(e.endNote-e.startNote)/2,e.xTextPos=e.anchor1.x+(e.anchor2.x+e.anchor2.w-e.anchor1.x)/2,e.top=e.yTextPos+1}}var a,s;delete e.middleElems,delete e.flatBeams}},937:function(e){function t(){}t.beginLayout=function(e,t){t.i=0,t.durationindex=0,t.startx=e,t.minx=e,t.nextx=e,t.spacingduration=0},t.layoutEnded=function(e){return e.i>=e.children.length},t.getNextX=function(e){return Math.max(e.minx,e.nextx)},t.getSpacingUnits=function(e){return Math.sqrt(8*e.spacingduration)},t.layoutOneItem=function(e,t,n,r,i){var a=n.children[n.i];if(!a)return 0;var s=e-n.minx,r=0=i.abcelem.minpitch-1||a.abcelem.minpitch<=i.abcelem.maxpitch+1&&a.abcelem.minpitch>=i.abcelem.minpitch-1);if(o=o&&a.abcelem.minpitch===i.abcelem.minpitch&&a.abcelem.maxpitch===i.abcelem.maxpitch&&i.heads&&0