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(v){var m=this.x;if(this.pitch===undefined){window.console.error("Tempo Element y-coordinate not set.")}var k=v.calcY(this.pitch);var q;if(this.tempo.preString){q=v.renderText(m,k,this.tempo.preString,"tempofont","tempo","start");var B=q.getBBox().width;var g=B/this.tempo.preString.length;m+=B+g}if(this.tempo.duration){var h=0.75;var z=this.pitch-a+1;var b=this.tempo.duration[0];var p=new ABCJS.write.AbsoluteElement(this.tempo,b,1,"tempo");var w=Math.floor(Math.log(b)/Math.log(2));var s=0;for(var o=Math.pow(2,w),l=o/2;o=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("")};