0){g=a;for(var o=0;og){g=this.voices[p].getNextX();d=this.voices[p].getSpacingUnits()}}this.spacingunits+=d;this.w=g;for(p=0;p6){m=0}}}}var g=l.y;for(var d=0;d1){l.printStem(this.startx,0.6,h,c)}l.y=g};if(!window.ABCJS){window.ABCJS={}}if(!window.ABCJS.write){window.ABCJS.write={}}(function(){var a=5;ABCJS.write.TempoElement=function(b){this.tempo=b;this.tempoHeightAbove=a;this.pitch=undefined};ABCJS.write.TempoElement.prototype.setUpperAndLowerElements=function(b){this.pitch=b.tempoHeightAbove
};ABCJS.write.TempoElement.prototype.setX=function(b){this.x=b};ABCJS.write.TempoElement.prototype.draw=function(w){var n=this.x;if(this.pitch===undefined){window.console.error("Tempo Element y-coordinate not set.")}var l=w.calcY(this.pitch);var r;if(this.tempo.preString){r=w.renderText(n,l,this.tempo.preString,"tempofont","tempo","start");var D=r.getBBox().width;var g=D/this.tempo.preString.length;n+=D+g}if(this.tempo.duration){var h=0.75;var B=this.pitch-a+1;var b=this.tempo.duration[0];var q=new ABCJS.write.AbsoluteElement(this.tempo,b,1,"tempo");var z=Math.floor(Math.log(b)/Math.log(2));var t=0;for(var p=Math.pow(2,z),m=p/2;p=this.children.length)};ABCJS.write.VoiceElement.prototype.getDurationIndex=function(){return this.durationindex-(this.children[this.i]&&(this.children[this.i].duration>0)?0:5e-7)
};ABCJS.write.VoiceElement.prototype.getSpacingUnits=function(){return Math.sqrt(this.spacingduration*8)};ABCJS.write.VoiceElement.prototype.getNextX=function(){return Math.max(this.minx,this.nextx)};ABCJS.write.VoiceElement.prototype.beginLayout=function(a){this.i=0;this.durationindex=0;this.startx=a;this.minx=a;this.nextx=a;this.spacingduration=0};ABCJS.write.VoiceElement.prototype.layoutOneItem=function(a,d){var c=this.children[this.i];if(!c){return 0}var b=a-this.minx;if(b0?"+"+e:e);l=d[3]?d[3]=="0"?"0":d[3].charAt(1):" ";b=d[5]-String(e).length;j=d[5]?str_repeat(l,b):"";k.push(d[4]?e+j:j+e)}else{throw ("Huh ?!")}}}h=h.substring(d[0].length)}return k.join("")};