/*

 VexFlow Engraver 1.0-pre2
 Copyright 2010 Mohit Muthanna Cheppudira <mohit@muthanna.com>

 A library for rendering musical notation and guitar tablature in HTML5.

 This library is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 FITNESS FOR A PARTICULAR PURPOSE.

 This library must only be used in its original form. No tampering,
 modification, distribution, or repackaging is allowed without the
 explicit permission of the copyright holder.

 This library makes use of Simon Tatham's awesome font, Gonville.

 Build ID: prod-2@8bd8967caa4a2b4780ab04e84c38e0703c40e589
 Build date: 2010-08-03 18:09:12.032249

*/
var a;function Vex(){}Vex.Debug=false;Vex.LogLevels={DEBUG:5,INFO:4,WARN:3,ERROR:2,FATAL:1};Vex.LogLevel=4;Vex.LogMessage=function(b,c){if(b<=Vex.LogLevel&&window.console){var d=c;d=typeof c=="object"?{level:b,message:c}:"VexLog: ["+b+"] "+d;window.console.log(d)}};Vex.LogDebug=function(b){Vex.LogMessage(Vex.LogLevels.DEBUG,b)};Vex.LogInfo=function(b){Vex.LogMessage(Vex.LogLevels.INFO,b)};Vex.LogWarn=function(b){Vex.LogMessage(Vex.LogLevels.WARN,b)};
Vex.LogError=function(b){Vex.LogMessage(Vex.LogLevels.ERROR,b)};Vex.LogFatal=function(b,c){Vex.LogMessage(Vex.LogLevels.FATAL,b);if(c)throw c;else throw"VexFatalError";};Vex.Log=Vex.LogDebug;Vex.L=Vex.LogDebug;Vex.AssertException=function(b){this.message=b};Vex.AssertException.prototype.toString=function(){return"AssertException: "+this.message};Vex.Assert=function(b,c){if(Vex.Debug&&!b){c||(c="Assertion failed.");throw new Vex.AssertException(c);}};
Vex.RuntimeError=function(b,c){this.code=b;this.message=c};Vex.RuntimeError.prototype.toString=function(){return"RuntimeError: "+this.message};Vex.RERR=Vex.RuntimeError;Vex.Merge=function(b,c){for(var d in c)b[d]=c[d];return b};Vex.SortAndUnique=function(b,c){if(b.length>1){var d=[],e;b.sort(c);for(c=0;c<b.length;++c){if(c==0||b[c]!=e)d.push(b[c]);e=b[c]}return d}else return b};
Vex.getCanvasContext=function(b){if(!b)throw new Vex.RERR("BadArgument","Invalid canvas selector: "+b);b=document.getElementById(b);if(!(b&&b.getContext))throw new Vex.RERR("UnsupportedBrowserError","This browser does not support HTML5 Canvas");return b.getContext("2d")};Vex.drawDot=function(b,c,d,e){e=e||"#f55";b.save();b.fillStyle=e;b.beginPath();b.arc(c,d,3,0,Math.PI*2,true);b.closePath();b.fill();b.restore()};
Vex.BM=function(b,c){var d=(new Date).getTime();c();c=(new Date).getTime()-d;Vex.L(b+c+"ms")};function glyph_load(b,c){var d=new Array(2),e=new Array(4),f="",g;b=escape(b);for(g=0;g<4;g++)e[g]=Str4ToLong(c.slice(g*4,(g+1)*4));for(g=0;g<b.length;g+=8){d[0]=Str4ToLong(b.slice(g,g+4));d[1]=Str4ToLong(b.slice(g+4,g+8));code(d,e);f+=LongToStr4(d[0])+LongToStr4(d[1])}return escCtrlCh(f)}
function glyph_save(b,c){var d=new Array(2),e=new Array(4),f="",g;for(g=0;g<4;g++)e[g]=Str4ToLong(c.slice(g*4,(g+1)*4));b=unescCtrlCh(b);for(g=0;g<b.length;g+=8){d[0]=Str4ToLong(b.slice(g,g+4));d[1]=Str4ToLong(b.slice(g+4,g+8));decode(d,e);f+=LongToStr4(d[0])+LongToStr4(d[1])}f=f.replace(/\0+$/,"");return unescape(f)}function code(b,c){for(var d=b[0],e=b[1],f=0;f!=84941944608;){d+=(e<<4^e>>>5)+e^f+c[f&3];f+=2654435769;e+=(d<<4^d>>>5)+d^f+c[f>>>11&3]}b[0]=d;b[1]=e}
function decode(b,c){for(var d=b[0],e=b[1],f=84941944608;f!=0;){e-=(d<<4^d>>>5)+d^f+c[f>>>11&3];f-=2654435769;d-=(e<<4^e>>>5)+e^f+c[f&3]}b[0]=d;b[1]=e}function Str4ToLong(b){for(var c=0,d=0;d<4;d++)c|=b.charCodeAt(d)<<d*8;return isNaN(c)?0:c}function LongToStr4(b){return String.fromCharCode(b&255,b>>8&255,b>>16&255,b>>24&255)}function escCtrlCh(b){return b.replace(/[\0\t\n\v\f\r\xa0'"!]/g,function(c){return"!"+c.charCodeAt(0)+"!"})}
function unescCtrlCh(b){return b.replace(/!\d\d?\d?!/g,function(c){return String.fromCharCode(c.slice(1,-1))})};Vex.Kern=function(b,c){return glyph_load(b,c)};Vex.Unkern=function(b,c){return glyph_save(b,c)};Vex.Flow={};Vex.Flow.RESOLUTION=16384;Vex.Flow.IsKerned=true;Vex.Flow.KerningParameters=Vex.Flow.IsKerned?"YP%2113%21%7E%90%2C%A5%D67%1C%9F%94%A8%C0%B0%F0":null;Vex.Flow.setupCanvasArray=function(){return Vex.Flow.KerningParameters?Vex.Unkern(unescape(Vex.Flow.KerningParameters),"UnsupportedBrowserError"):null};Vex.Flow.keyProperties=function(b){var c=b.split("/");if(c.length!=2)throw new Vex.RERR("BadArguments","Key must have note + octave: "+b);var d=c[0].toUpperCase();b=Vex.Flow.keyProperties.note_values[d];if(!b)throw new Vex.RERR("BadArguments","Invalid key name: "+d);if(b.octave)c[1]=b.octave;c=c[1];d=(c*7-28+b.index)/2;var e=0;if(d<=0&&d*2%2==0)e=1;if(d>=6&&d*2%2==0)e=-1;var f=null;if(b.int_val)f=c*12+b.int_val;return{line:d,octave:c,int_value:f,accidental:b.accidental,code:b.code,stroke:e,shift_right:b.shift_right}};
Vex.Flow.keyProperties.note_values={C:{index:0,int_val:0,accidental:null},CN:{index:0,int_val:0,accidental:"n"},"C#":{index:0,int_val:1,accidental:"#"},"C##":{index:0,int_val:2,accidental:"##"},CB:{index:0,int_val:-1,accidental:"b"},CBB:{index:0,int_val:-2,accidental:"bb"},D:{index:1,int_val:2,accidental:null},DN:{index:1,int_val:2,accidental:"n"},"D#":{index:1,int_val:3,accidental:"#"},"D##":{index:1,int_val:4,accidental:"##"},DB:{index:1,int_val:1,accidental:"b"},DBB:{index:1,int_val:0,accidental:"bb"},
E:{index:2,int_val:4,accidental:null},EN:{index:2,int_val:4,accidental:"n"},"E#":{index:2,int_val:5,accidental:"#"},"E##":{index:2,int_val:6,accidental:"##"},EB:{index:2,int_val:3,accidental:"b"},EBB:{index:2,int_val:2,accidental:"bb"},F:{index:3,int_val:5,accidental:null},FN:{index:3,int_val:5,accidental:"n"},"F#":{index:3,int_val:6,accidental:"#"},"F##":{index:3,int_val:7,accidental:"##"},FB:{index:3,int_val:4,accidental:"b"},FBB:{index:3,int_val:3,accidental:"bb"},G:{index:4,int_val:7,accidental:null},
GN:{index:4,int_val:7,accidental:"n"},"G#":{index:4,int_val:8,accidental:"#"},"G##":{index:4,int_val:9,accidental:"##"},GB:{index:4,int_val:6,accidental:"b"},GBB:{index:4,int_val:5,accidental:"bb"},A:{index:5,int_val:9,accidental:null},AN:{index:5,int_val:9,accidental:"n"},"A#":{index:5,int_val:10,accidental:"#"},"A##":{index:5,int_val:11,accidental:"##"},AB:{index:5,int_val:8,accidental:"b"},ABB:{index:5,int_val:7,accidental:"bb"},B:{index:6,int_val:11,accidental:null},BN:{index:6,int_val:11,accidental:"n"},
"B#":{index:6,int_val:12,accidental:"#"},"B##":{index:6,int_val:13,accidental:"##"},BB:{index:6,int_val:10,accidental:"b"},BBB:{index:6,int_val:9,accidental:"bb"},X:{index:6,accidental:"",octave:4,code:"v3e",shift_right:5.5}};
Vex.Flow.integerToNote=function(b){if(typeof b=="undefined")throw new Vex.RERR("BadArguments","Undefined integer for integerToNote");if(b<-2)throw new Vex.RERR("BadArguments","integerToNote requires integer > -2: "+b);var c=Vex.Flow.integerToNote.table[b];if(!c)throw new Vex.RERR("BadArguments","Unkown note value for integer: "+b);return c};Vex.Flow.integerToNote.table={0:"C",1:"C#",2:"D",3:"D#",4:"E",5:"F",6:"F#",7:"G",8:"G#",9:"A",10:"A#",11:"B"};
Vex.Flow.tabToGlyph=function(b){var c=null,d=0,e=0;if(b.toString().toUpperCase()=="X"){c="v7f";d=7;e=-4.5}else d=5*b.toString().length;return{text:b,code:c,width:d,shift_y:e}};Vex.Flow.textWidth=function(b){return 5*b.toString().length};Vex.Flow.accidentalCodes=function(b){return Vex.Flow.accidentalCodes.accidentals[b]};
Vex.Flow.accidentalCodes.accidentals={"#":{code:"v18",width:10,shift_right:0,shift_down:0},"##":{code:"v7f",width:13,shift_right:-1,shift_down:0},b:{code:"v44",width:8,shift_right:0,shift_down:0},bb:{code:"v26",width:14,shift_right:-3,shift_down:0},n:{code:"v4e",width:8,shift_right:0,shift_down:0}};
Vex.Flow.durationToTicks={w:Vex.Flow.RESOLUTION/1,wr:Vex.Flow.RESOLUTION/1,h:Vex.Flow.RESOLUTION/2,hr:Vex.Flow.RESOLUTION/2,hd:Vex.Flow.RESOLUTION/2+Vex.Flow.RESOLUTION/4,q:Vex.Flow.RESOLUTION/4,qr:Vex.Flow.RESOLUTION/4,qd:Vex.Flow.RESOLUTION/4+Vex.Flow.RESOLUTION/8,"8":Vex.Flow.RESOLUTION/8,"8r":Vex.Flow.RESOLUTION/8,"8d":Vex.Flow.RESOLUTION/8+Vex.Flow.RESOLUTION/16,"16":Vex.Flow.RESOLUTION/16,"16r":Vex.Flow.RESOLUTION/16,"16d":Vex.Flow.RESOLUTION/16+Vex.Flow.RESOLUTION/32,"32":Vex.Flow.RESOLUTION/
32,"32d":Vex.Flow.RESOLUTION/32+Vex.Flow.RESOLUTION/64,"32r":Vex.Flow.RESOLUTION/32,b:Vex.Flow.RESOLUTION/32};Vex.Flow.durationToGlyph=function(b){return Vex.Flow.durationToGlyph.duration_codes[b]};
Vex.Flow.durationToGlyph.duration_codes={w:{code_head:"v1d",head_width:16.5,stem:false,flag:false},wr:{code_head:"v5c",head_width:10.5,stem:false,flag:false,rest:true,position:"D/5"},h:{code_head:"v81",head_width:10.5,stem:true,flag:false},hr:{code_head:"vc",head_width:10.5,stem:false,flag:false,rest:true,position:"B/4"},hd:{code_head:"v81",head_width:10.5,stem:true,flag:false,dot:true},q:{code_head:"vb",head_width:10.5,stem:true,flag:false},qr:{code_head:"v7c",head_width:10.5,rest:true,position:"B/4",
stem:false,flag:false},qd:{code_head:"vb",head_width:10.5,stem:true,flag:false,dot:true},"8":{code_head:"vb",head_width:10.5,stem:true,flag:true,beam_count:1,code_flag_upstem:"v54",code_flag_downstem:"v9a"},"8r":{code_head:"va5",head_width:10.5,stem:false,flag:false,rest:true,beam_count:1,position:"B/4"},"8d":{code_head:"vb",head_width:10.5,stem:true,flag:true,beam_count:1,code_flag_upstem:"v54",code_flag_downstem:"v9a",dot:true},"16":{beam_count:2,code_head:"vb",head_width:10.5,stem:true,flag:true,
code_flag_upstem:"v3f",code_flag_downstem:"v8f"},"16r":{beam_count:2,code_head:"v3c",head_width:10.5,stem:false,flag:false,rest:true,position:"B/4"},"16d":{beam_count:2,code_head:"vb",head_width:10.5,stem:true,flag:true,code_flag_upstem:"v3f",code_flag_downstem:"v8f",dot:true},"32":{beam_count:3,code_head:"vb",head_width:10.5,stem:true,flag:true,code_flag_upstem:"v47",code_flag_downstem:"v2a"},"32d":{beam_count:3,code_head:"vb",head_width:10.5,dot:true,flag:true,code_flag_upstem:"v47",code_flag_downstem:"v2a",
stem:true},"32r":{beam_count:3,code_head:"v55",head_width:10.5,stem:false,flag:false,rest:true,position:"B/4"}};Vex.Flow.TIME4_4={num_beats:4,beat_value:4,resolution:Vex.Flow.RESOLUTION};Vex.Flow.Font={glyphs:{vb:{x_min:0,x_max:428.75,ha:438,o:"m 262 186 b 273 186 266 186 272 186 b 274 186 273 186 274 186 b 285 186 274 186 280 186 b 428 48 375 181 428 122 b 386 -68 428 12 416 -29 b 155 -187 329 -145 236 -187 b 12 -111 92 -187 38 -162 b 0 -51 4 -91 0 -72 b 262 186 0 58 122 179 "},vc:{x_min:0,x_max:447.8125,ha:457,o:"m 0 86 l 0 173 l 223 173 l 447 173 l 447 86 l 447 0 l 223 0 l 0 0 l 0 86 "},v18:{x_min:0,x_max:323.9375,ha:331,o:"m 217 535 b 225 537 220 537 221 537 b 245 524 235 537 242 533 l 246 521 l 247 390 l 247 258 l 273 265 b 306 270 288 269 299 270 b 322 259 315 270 319 267 b 323 208 323 256 323 233 b 322 158 323 184 323 159 b 288 140 318 148 315 147 b 247 130 254 131 247 130 b 247 65 247 130 247 104 b 247 20 247 51 247 36 l 247 -88 l 273 -81 b 306 -76 289 -77 299 -76 b 318 -81 311 -76 315 -77 b 323 -123 323 -87 323 -86 l 323 -138 l 323 -154 b 318 -195 323 -191 323 -190 b 269 -210 314 -199 315 -199 b 249 -216 259 -213 250 -216 l 247 -216 l 247 -349 l 246 -483 l 245 -487 b 225 -499 242 -495 234 -499 b 206 -487 219 -499 210 -495 l 205 -483 l 205 -355 l 205 -227 l 204 -227 l 181 -233 l 138 -244 b 117 -249 127 -247 117 -249 b 115 -385 115 -249 115 -256 l 115 -523 l 114 -526 b 95 -538 110 -534 102 -538 b 74 -526 87 -538 78 -534 l 73 -523 l 73 -391 b 72 -260 73 -269 73 -260 b 72 -260 72 -260 72 -260 b 19 -273 61 -263 23 -273 b 0 -260 10 -273 4 -267 b 0 -209 0 -256 0 -256 l 0 -162 l 1 -158 b 61 -134 5 -148 5 -148 l 73 -131 l 73 -22 b 72 86 73 79 73 86 b 72 86 72 86 72 86 b 19 74 61 83 23 74 b 0 86 10 74 4 79 b 0 137 0 90 0 90 l 0 184 l 1 188 b 61 212 5 198 5 198 l 73 215 l 73 348 l 73 481 l 74 485 b 95 498 78 492 87 498 b 103 495 98 498 100 496 b 114 485 107 494 111 489 l 115 481 l 115 353 l 115 226 l 121 226 b 159 235 123 227 141 231 l 198 247 l 205 248 l 205 384 l 205 521 l 206 524 b 217 535 209 528 212 533 m 205 9 b 205 119 205 70 205 119 l 205 119 b 182 113 204 119 194 116 l 138 102 b 117 97 127 99 117 97 b 115 -12 115 97 115 91 l 115 -122 l 121 -120 b 159 -111 123 -119 141 -115 l 198 -101 l 205 -98 l 205 9 "},
v1d:{x_min:0,x_max:619.3125,ha:632,o:"m 274 184 b 307 186 285 186 296 186 b 616 22 465 186 597 116 b 619 -1 617 13 619 5 b 308 -187 619 -104 483 -187 b 0 -1 133 -187 0 -102 b 5 36 0 11 1 23 b 274 184 29 115 141 176 m 289 161 b 272 162 284 162 277 162 b 171 41 209 162 171 108 b 205 -73 171 5 182 -34 b 345 -163 243 -133 298 -163 b 436 -98 385 -163 420 -142 b 446 -43 443 -80 446 -62 b 289 161 446 47 377 147 "},v26:{x_min:-21.78125,x_max:483.1875,ha:493,o:"m -8 631 b -1 632 -6 632 -4 632 b 19 620 8 632 16 628 b 20 383 20 616 20 616 l 20 148 l 21 151 b 140 199 59 183 102 199 b 206 179 164 199 187 192 l 210 176 l 210 396 l 210 617 l 212 621 b 231 632 216 628 223 632 b 250 620 239 632 247 628 b 251 383 251 616 251 616 l 251 148 l 254 151 b 370 199 291 183 332 199 b 415 191 385 199 400 197 b 483 84 458 176 483 134 b 461 0 483 58 476 29 b 332 -142 439 -40 411 -72 l 255 -215 b 231 -229 240 -229 239 -229 b 216 -223 224 -229 220 -227 b 210 -158 210 -217 210 -223 b 210 -120 210 -148 210 -136 l 210 -29 l 205 -34 b 100 -142 182 -65 159 -88 l 23 -215 b -1 -229 9 -229 6 -229 b -20 -216 -9 -229 -17 -224 l -21 -212 l -21 201 l -21 616 l -20 620 b -8 631 -17 624 -13 630 m 110 131 b 96 133 106 133 100 133 b 89 133 93 133 91 133 b 24 87 63 129 40 113 l 20 80 l 20 -37 l 20 -156 l 23 -152 b 144 81 96 -72 144 20 l 144 83 b 110 131 144 113 134 126 m 341 131 b 328 133 337 133 332 133 b 322 133 326 133 323 133 b 257 87 296 129 273 113 l 251 80 l 251 -37 l 251 -156 l 255 -152 b 375 81 328 -72 375 20 l 375 83 b 341 131 375 113 367 126 "},
v2a:{x_min:-21.78125,x_max:366.140625,ha:374,o:"m 276 1378 b 284 1379 279 1379 281 1379 b 306 1360 292 1379 298 1374 b 352 1247 326 1326 343 1286 b 366 1139 362 1213 366 1175 b 347 1009 366 1093 359 1049 l 344 1002 l 347 992 b 352 971 348 986 351 977 b 366 863 362 936 366 899 b 347 732 366 818 359 773 l 344 725 l 347 716 b 352 695 348 710 351 700 b 366 588 362 659 366 623 b 223 262 366 464 314 345 b 189 233 212 252 212 252 b 35 76 126 183 73 129 b -1 16 20 56 2 27 b -19 4 -4 9 -12 4 l -21 4 l -21 137 l -21 270 l -17 270 b 186 344 59 281 134 308 b 319 606 270 399 319 499 b 317 650 319 620 319 635 l 315 659 l 314 655 b 223 537 288 607 258 570 b 189 509 212 528 212 528 b 35 352 126 459 73 405 b -1 292 20 333 2 303 b -19 280 -4 285 -12 280 l -21 280 l -21 413 l -21 546 l -17 546 b 186 620 59 557 134 584 b 319 882 270 675 319 775 b 317 925 319 896 319 911 l 315 935 l 314 931 b 223 813 288 884 258 846 b 189 785 212 805 212 805 b 35 628 126 735 73 681 b -1 569 20 609 2 580 b -19 556 -4 562 -12 556 l -21 556 l -21 689 l -21 823 l -17 823 b 202 907 68 835 152 867 b 319 1157 280 968 319 1061 b 270 1338 319 1218 303 1281 b 262 1358 264 1349 262 1353 b 262 1364 262 1360 262 1363 b 276 1378 265 1371 269 1376 "},
v2f:{x_min:-1.359375,x_max:680.5625,ha:694,o:"m 597 1042 b 604 1042 600 1042 602 1042 b 642 1002 627 1042 642 1022 b 619 966 642 988 635 974 b 439 927 574 942 503 927 l 426 927 l 426 921 b 430 838 428 893 430 866 b 345 480 430 696 398 560 b 179 391 307 423 249 391 b 156 392 171 391 164 392 b 138 394 149 394 142 394 b 103 434 115 396 103 416 b 129 471 103 451 111 466 b 141 474 133 473 137 474 b 172 459 153 474 164 469 b 181 455 175 456 176 455 b 187 456 182 455 185 455 b 253 520 212 460 234 483 b 315 836 294 605 315 714 b 311 928 315 867 314 898 b 302 945 310 943 311 942 b 245 953 283 950 262 953 b 130 891 193 953 149 931 b 84 860 119 870 102 860 b 36 905 61 860 39 877 b 36 910 36 907 36 909 b 80 970 36 931 50 949 b 249 1017 125 1000 187 1017 b 322 1009 273 1017 299 1014 l 341 1003 b 436 991 372 995 406 991 b 577 1031 495 991 545 1004 b 597 1042 583 1038 590 1041 m 416 360 b 424 360 419 360 421 360 b 481 309 454 360 479 338 b 503 145 484 280 495 199 b 585 -185 525 16 555 -106 b 630 -245 596 -213 613 -237 l 634 -247 l 638 -245 b 647 -244 641 -245 645 -244 b 680 -278 666 -244 680 -262 b 664 -308 680 -290 675 -301 b 638 -312 658 -310 650 -312 b 613 -309 631 -312 623 -310 b 477 -201 555 -303 502 -260 b 417 -2 460 -159 434 -72 b 416 5 417 1 416 5 b 416 5 416 5 416 5 b 411 -5 415 5 413 0 b 359 -97 397 -33 377 -70 b 353 -106 355 -102 353 -105 b 359 -112 353 -108 355 -109 b 409 -130 375 -123 390 -129 b 426 -134 420 -130 421 -131 b 431 -147 428 -137 431 -141 b 420 -162 431 -152 427 -159 b 382 -169 409 -166 396 -169 b 323 -155 363 -169 341 -165 l 317 -152 l 314 -155 b 62 -303 240 -240 148 -295 b 36 -305 55 -305 44 -305 b 23 -303 29 -305 24 -305 b -1 -273 6 -299 -1 -287 b 31 -240 -1 -256 10 -240 b 36 -240 32 -240 34 -240 b 42 -241 38 -241 39 -241 b 134 -204 63 -241 99 -226 b 367 288 265 -115 357 81 b 375 330 368 313 370 320 b 416 360 383 347 400 358 m 360 -359 b 379 -359 363 -359 371 -359 b 424 -360 396 -359 416 -359 b 646 -502 536 -373 624 -430 b 649 -527 649 -510 649 -519 b 530 -673 649 -578 604 -635 l 521 -677 l 529 -681 b 653 -811 592 -714 637 -762 b 660 -853 658 -827 660 -839 b 645 -911 660 -873 656 -892 b 426 -1021 608 -981 519 -1021 b 283 -989 377 -1021 328 -1011 b 235 -949 249 -972 239 -964 b 234 -936 234 -946 234 -941 b 234 -928 234 -934 234 -931 l 235 -925 l 234 -927 l 225 -934 b 87 -982 186 -966 138 -982 b 80 -982 85 -982 83 -982 b 55 -981 70 -981 58 -981 b 17 -943 32 -981 17 -964 b 54 -904 17 -921 35 -904 b 78 -914 62 -904 72 -909 l 83 -918 l 88 -918 b 190 -831 122 -918 166 -881 b 269 -506 242 -727 269 -612 b 268 -462 269 -492 269 -477 b 266 -449 266 -458 266 -452 b 265 -444 266 -445 266 -444 b 257 -446 264 -444 261 -445 b 132 -545 196 -470 152 -505 b 88 -573 122 -563 104 -573 b 39 -523 63 -573 39 -553 b 63 -476 39 -505 44 -494 b 360 -359 136 -408 235 -369 m 419 -424 b 393 -423 411 -423 406 -423 l 375 -423 l 377 -426 b 379 -439 377 -427 378 -434 b 383 -510 382 -463 383 -487 b 314 -811 383 -609 360 -710 b 266 -893 296 -850 285 -870 b 264 -898 265 -896 264 -898 l 264 -898 b 264 -898 264 -898 264 -898 b 268 -898 264 -898 266 -898 b 273 -898 270 -898 272 -898 b 300 -909 283 -898 291 -900 b 426 -957 340 -941 385 -957 b 476 -949 443 -957 460 -954 b 547 -853 522 -931 547 -893 b 485 -745 547 -816 526 -775 b 397 -707 460 -727 432 -714 b 366 -675 375 -703 366 -692 b 396 -642 366 -657 377 -645 b 530 -557 455 -637 511 -601 b 536 -527 534 -548 536 -537 b 419 -424 536 -480 490 -437 "},
v3c:{x_min:0,x_max:450.53125,ha:460,o:"m 189 302 b 204 303 193 302 198 303 b 303 224 250 303 292 270 b 306 199 304 216 306 208 b 279 129 306 173 296 147 l 276 126 l 281 127 b 408 249 337 142 385 190 b 412 259 409 254 412 258 b 430 267 417 265 423 267 b 450 247 441 267 450 259 b 200 -605 450 242 204 -599 b 182 -616 197 -612 190 -616 b 163 -602 174 -616 166 -610 b 161 -598 161 -601 161 -601 b 217 -402 161 -589 170 -562 b 272 -213 247 -298 272 -213 b 272 -213 272 -213 272 -213 b 264 -219 272 -213 268 -216 b 140 -262 227 -247 182 -262 b 36 -226 102 -262 65 -249 b 0 -145 12 -206 0 -176 b 17 -84 0 -124 5 -104 b 103 -38 38 -54 70 -38 b 191 -91 137 -38 172 -56 b 205 -141 201 -106 205 -124 b 178 -212 205 -167 196 -194 l 175 -215 l 182 -213 b 307 -93 236 -198 284 -151 b 372 129 308 -88 372 127 b 372 129 372 129 372 129 b 364 122 372 129 368 126 b 240 80 328 94 283 80 b 137 115 202 80 166 91 b 99 194 111 136 99 165 b 189 302 99 244 133 292 "},
v3e:{x_min:0,x_max:406.96875,ha:415,o:"m 21 183 b 28 183 24 183 25 183 b 42 181 34 183 39 183 b 127 108 47 179 47 179 b 202 41 168 72 202 41 b 279 108 204 41 238 72 b 357 177 321 145 356 176 b 375 183 363 181 370 183 b 406 151 392 183 406 169 b 404 137 406 147 405 141 b 322 62 401 131 398 129 b 251 0 284 27 251 0 b 322 -63 251 -1 284 -29 b 404 -138 398 -130 401 -133 b 406 -152 405 -142 406 -148 b 375 -184 406 -170 392 -184 b 357 -179 370 -184 363 -183 b 279 -109 356 -177 321 -147 b 202 -43 238 -73 204 -43 b 127 -109 202 -43 168 -73 b 49 -179 85 -147 50 -177 b 31 -184 43 -183 36 -184 b 0 -152 13 -184 0 -170 b 2 -138 0 -148 0 -142 b 83 -63 5 -133 8 -130 b 155 0 122 -29 155 -1 b 83 62 155 0 122 27 b 8 129 43 97 10 127 b 0 151 2 136 0 144 b 21 183 0 165 8 177 "},
v3f:{x_min:-24.5,x_max:317.140625,ha:324,o:"m -24 -147 l -24 -5 l -20 -5 b -1 -19 -12 -5 -4 -11 b 58 -123 6 -43 31 -86 b 196 -278 93 -173 134 -219 b 317 -570 274 -356 317 -460 b 294 -713 317 -617 308 -666 l 289 -724 l 294 -735 b 317 -873 308 -780 317 -827 b 235 -1132 317 -963 288 -1054 b 209 -1165 228 -1140 224 -1146 b 189 -1177 204 -1172 196 -1177 b 171 -1164 182 -1177 175 -1172 b 168 -1154 170 -1161 168 -1159 b 181 -1132 168 -1149 172 -1142 b 269 -891 238 -1064 269 -975 b 269 -881 269 -886 269 -884 b 262 -814 269 -857 265 -827 b 258 -800 261 -811 259 -806 b 142 -628 240 -731 198 -667 b -8 -589 112 -606 47 -589 b -20 -589 -13 -589 -19 -589 l -24 -589 l -24 -449 l -24 -308 l -20 -308 b -1 -322 -12 -308 -4 -313 b 58 -424 6 -345 31 -388 b 194 -580 93 -476 136 -523 b 259 -660 221 -606 245 -635 b 261 -663 259 -662 261 -663 b 264 -656 262 -663 262 -660 b 269 -587 268 -632 269 -610 b 264 -521 269 -566 268 -544 b 262 -512 264 -517 262 -513 b 258 -498 261 -509 259 -503 b 142 -326 240 -428 198 -365 b -8 -287 112 -303 47 -288 b -20 -287 -13 -287 -19 -287 l -24 -287 l -24 -147 "},
v44:{x_min:-21.78125,x_max:251.8125,ha:257,o:"m -8 631 b -1 632 -6 632 -4 632 b 19 620 8 632 16 628 b 20 383 20 616 20 616 l 20 148 l 21 151 b 137 199 59 183 99 199 b 182 191 152 199 167 197 b 251 84 227 176 251 134 b 228 0 251 58 243 29 b 100 -142 206 -40 178 -72 l 23 -215 b 0 -229 9 -229 6 -229 b -20 -216 -9 -229 -17 -224 l -21 -212 l -21 201 l -21 616 l -20 620 b -8 631 -17 624 -13 630 m 110 131 b 96 133 106 133 100 133 b 89 133 93 133 91 133 b 24 87 63 129 40 113 l 20 80 l 20 -37 l 20 -156 l 23 -152 b 144 81 96 -72 144 20 l 144 83 b 110 131 144 113 134 126 "},
v47:{x_min:-24.5,x_max:315.78125,ha:322,o:"m -24 -145 l -24 -5 l -20 -5 b 1 -26 -10 -5 -6 -9 b 175 -241 31 -86 96 -166 b 314 -548 259 -323 304 -420 b 315 -589 315 -555 315 -571 b 314 -630 315 -606 315 -623 b 298 -730 311 -664 306 -699 l 295 -742 l 296 -748 b 314 -850 304 -778 311 -813 b 315 -892 315 -857 315 -874 b 314 -932 315 -909 315 -925 b 298 -1032 311 -967 306 -1002 l 295 -1045 l 296 -1050 b 314 -1153 304 -1081 311 -1115 b 315 -1193 315 -1160 315 -1177 b 314 -1235 315 -1211 315 -1228 b 217 -1526 306 -1338 270 -1444 b 201 -1533 213 -1532 208 -1533 b 182 -1522 193 -1533 185 -1529 b 179 -1514 181 -1518 179 -1517 b 189 -1489 179 -1508 182 -1501 b 266 -1217 240 -1403 266 -1308 b 262 -1156 266 -1196 265 -1177 b 110 -907 247 -1043 190 -950 b 0 -889 87 -895 50 -889 l -1 -889 l -24 -889 l -24 -749 l -24 -610 l -20 -610 b 1 -631 -10 -610 -6 -614 b 175 -846 31 -691 96 -771 b 259 -956 213 -884 236 -914 b 265 -966 262 -961 264 -966 b 265 -966 265 -966 265 -966 b 265 -953 265 -964 265 -959 b 266 -920 266 -943 266 -932 b 262 -853 266 -898 265 -873 b 110 -605 247 -741 190 -648 b 0 -587 87 -592 50 -587 l -1 -587 l -24 -587 l -24 -448 l -24 -308 l -20 -308 b 1 -328 -10 -308 -6 -312 b 175 -544 31 -388 96 -469 b 259 -655 213 -581 236 -612 b 265 -663 262 -659 264 -663 b 265 -663 265 -663 265 -663 b 265 -650 265 -663 265 -657 b 266 -617 266 -641 266 -630 b 262 -551 266 -595 265 -570 b 110 -303 247 -438 190 -345 b 0 -284 87 -290 50 -284 l -1 -284 l -24 -284 l -24 -145 "},
v4e:{x_min:0,x_max:239.5625,ha:244,o:"m 10 460 b 20 462 13 462 14 462 b 39 449 28 462 35 458 l 40 446 l 40 326 b 40 205 40 259 40 205 b 127 227 40 205 80 215 b 220 249 196 244 213 249 b 227 247 224 249 225 248 b 238 237 231 245 235 241 l 239 233 l 239 -106 l 239 -448 l 238 -451 b 219 -463 234 -459 225 -463 b 198 -451 210 -463 202 -459 l 197 -448 l 197 -324 b 197 -201 197 -248 197 -201 b 110 -223 196 -201 157 -210 b 17 -245 42 -240 24 -245 b 10 -242 13 -245 13 -244 b 0 -233 6 -241 2 -237 l 0 -230 l 0 108 l 0 446 l 0 449 b 10 460 2 453 6 458 m 197 22 b 197 70 197 41 197 58 b 196 116 197 113 197 116 l 196 116 b 118 97 196 116 160 106 l 40 77 l 40 -18 b 40 -112 40 -69 40 -112 l 119 -93 l 197 -73 l 197 22 "},
v54:{x_min:-24.5,x_max:317.140625,ha:324,o:"m -24 -161 l -24 -5 l -20 -5 b 0 -24 -9 -5 -2 -12 b 171 -315 21 -124 84 -233 b 317 -660 268 -406 317 -531 b 187 -1014 317 -782 274 -909 b 161 -1034 172 -1034 171 -1034 b 141 -1013 149 -1034 141 -1025 b 152 -991 141 -1004 142 -1002 b 266 -682 228 -899 266 -788 b 174 -430 266 -588 236 -498 b -23 -317 136 -388 66 -348 b -24 -161 -23 -316 -24 -285 "},v55:{x_min:0,x_max:551.25,ha:563,o:"m 289 644 b 304 645 294 645 299 645 b 404 566 349 645 392 613 b 406 541 405 557 406 549 b 379 471 406 514 397 489 l 377 467 l 382 470 b 509 591 438 485 485 531 b 513 601 510 595 513 599 b 530 609 518 607 524 609 b 551 588 540 609 551 602 b 200 -605 551 584 204 -599 b 182 -616 197 -612 190 -616 b 163 -602 174 -616 166 -610 b 161 -598 161 -601 161 -601 b 217 -402 161 -589 170 -562 b 272 -213 247 -298 272 -213 b 272 -213 272 -213 272 -213 b 264 -219 272 -213 268 -216 b 140 -262 227 -247 182 -262 b 36 -226 102 -262 65 -249 b 0 -145 12 -206 0 -176 b 17 -84 0 -124 5 -104 b 103 -38 38 -54 70 -38 b 191 -91 137 -38 172 -56 b 205 -141 201 -106 205 -124 b 178 -212 205 -167 196 -194 l 175 -215 l 182 -213 b 307 -93 236 -198 284 -151 b 372 129 308 -88 372 127 b 372 129 372 129 372 129 b 364 122 372 129 368 126 b 240 80 328 94 283 80 b 137 115 202 80 166 91 b 99 195 112 136 99 165 b 118 256 99 217 106 238 b 204 303 138 287 171 303 b 292 249 238 303 273 285 b 306 199 302 234 306 217 b 279 129 306 173 296 148 l 276 126 l 281 127 b 408 248 336 142 385 190 b 473 470 409 254 473 469 b 473 470 473 470 473 470 b 465 464 473 470 469 467 b 341 421 428 435 383 421 b 236 458 303 421 266 433 b 200 537 212 478 200 508 b 289 644 200 585 234 635 "},
v5c:{x_min:0,x_max:447.8125,ha:457,o:"m 0 -87 l 0 0 l 223 0 l 447 0 l 447 -87 l 447 -174 l 223 -174 l 0 -174 l 0 -87 "},v7c:{x_min:0,x_max:300.8125,ha:307,o:"m 49 505 b 53 506 50 505 51 506 b 70 496 58 506 62 503 b 81 485 73 492 78 488 l 96 473 l 111 459 l 122 449 l 134 438 l 182 396 l 255 330 b 292 291 292 298 292 298 l 292 290 l 292 284 l 283 270 b 209 36 234 197 209 113 b 288 -170 209 -44 235 -119 b 299 -184 295 -179 299 -181 b 300 -191 300 -187 300 -188 b 285 -206 300 -199 294 -206 b 280 -206 283 -206 281 -206 b 247 -201 270 -202 259 -201 b 176 -222 223 -201 197 -208 b 114 -340 136 -249 114 -292 b 172 -471 114 -384 134 -433 b 185 -492 182 -481 185 -487 b 181 -502 185 -496 183 -499 b 171 -508 176 -505 174 -508 b 152 -498 166 -508 160 -503 b 0 -284 65 -428 12 -352 b 0 -260 0 -278 0 -270 b 1 -238 0 -252 0 -242 b 148 -140 16 -177 73 -140 b 209 -148 167 -140 189 -142 b 215 -149 212 -148 215 -149 b 215 -149 215 -149 215 -149 l 215 -149 b 201 -136 215 -148 209 -142 l 157 -97 l 96 -41 b 17 34 21 24 17 29 b 17 37 17 36 17 36 b 17 38 17 37 17 38 b 25 56 17 44 17 44 b 110 298 81 131 110 219 b 46 474 110 367 88 431 b 38 491 40 480 38 487 b 49 505 38 498 42 502 "},
v7f:{x_min:0,x_max:367.5,ha:375,o:"m 0 124 l 0 187 l 61 187 l 122 187 l 122 138 l 122 91 l 153 61 l 183 30 l 213 61 l 243 91 l 243 138 l 243 187 l 306 187 l 367 187 l 367 124 l 367 61 l 321 61 l 274 61 l 243 30 l 213 0 l 243 -31 l 274 -62 l 321 -62 l 367 -62 l 367 -124 l 367 -188 l 306 -188 l 243 -188 l 243 -140 l 243 -93 l 213 -62 l 183 -31 l 153 -62 l 122 -93 l 122 -140 l 122 -188 l 61 -188 l 0 -188 l 0 -124 l 0 -62 l 46 -62 l 92 -62 l 123 -31 l 153 0 l 123 30 l 92 61 l 46 61 l 0 61 l 0 124 "},
v81:{x_min:0,x_max:428.75,ha:438,o:"m 262 186 b 273 186 266 186 272 186 b 274 186 273 186 274 186 b 285 186 274 186 280 186 b 428 48 375 181 428 122 b 386 -68 428 12 416 -29 b 155 -187 329 -145 236 -187 b 12 -111 92 -187 38 -162 b 0 -51 4 -91 0 -72 b 262 186 0 58 122 179 m 366 131 b 352 134 362 133 357 134 b 219 81 321 134 269 115 b 47 -111 126 23 50 -62 b 47 -112 47 -111 47 -112 b 77 -136 47 -129 58 -136 b 264 -45 118 -136 194 -101 b 382 109 336 12 382 76 b 366 131 382 120 377 129 "},v83:{x_min:-1.359375,
x_max:847.96875,ha:865,o:"m 488 1499 b 495 1500 490 1500 492 1500 b 541 1465 507 1500 521 1490 b 679 1078 622 1372 679 1210 b 677 1050 679 1068 677 1060 b 477 642 668 893 604 764 l 443 609 l 431 596 l 431 592 l 438 562 l 449 508 l 460 458 b 481 355 475 390 481 355 b 481 355 481 355 481 355 b 490 356 481 355 485 355 b 528 358 495 356 511 358 b 558 356 540 358 552 356 b 839 95 699 338 808 237 b 847 22 845 72 847 47 b 631 -303 847 -113 766 -242 b 620 -309 623 -308 620 -309 l 620 -310 b 631 -359 620 -310 626 -333 l 646 -435 l 660 -496 b 672 -588 668 -535 672 -563 b 664 -653 672 -610 669 -630 b 383 -875 630 -792 509 -875 b 201 -810 321 -875 257 -855 b 129 -680 151 -768 129 -730 b 274 -530 129 -592 200 -530 b 351 -553 300 -530 326 -538 b 412 -669 393 -582 412 -626 b 287 -805 412 -735 366 -800 l 279 -805 l 285 -809 b 383 -830 318 -823 351 -830 b 586 -718 464 -830 540 -789 b 626 -584 612 -678 626 -631 b 619 -528 626 -566 623 -548 b 612 -495 619 -526 616 -510 b 577 -324 590 -387 577 -324 b 577 -324 577 -324 577 -324 b 568 -326 575 -324 571 -324 b 528 -334 558 -328 537 -333 b 465 -338 506 -337 485 -338 b 24 -11 269 -338 87 -206 b -1 145 8 41 -1 93 b 96 442 -1 249 32 351 b 322 714 166 541 236 626 l 352 745 l 345 782 l 332 843 l 315 921 b 303 984 310 950 304 978 b 295 1082 298 1017 295 1049 b 413 1426 295 1208 336 1329 b 488 1499 436 1456 477 1496 m 549 1301 b 541 1301 547 1301 544 1301 b 411 1207 500 1301 447 1263 b 355 1004 374 1152 355 1079 b 359 942 355 984 356 963 b 371 881 362 927 363 917 l 385 818 b 392 782 389 799 392 784 l 392 782 b 434 828 393 782 424 816 b 607 1165 534 941 594 1060 b 608 1193 608 1175 608 1183 b 597 1270 608 1224 604 1254 b 549 1301 589 1286 571 1299 m 398 528 b 393 555 396 542 393 553 b 392 555 393 555 393 555 b 317 470 390 555 347 505 b 190 298 266 408 212 334 b 127 70 148 227 127 148 b 155 -77 127 19 137 -30 b 468 -303 209 -216 333 -303 b 519 -299 484 -303 502 -302 b 568 -284 541 -295 568 -287 l 568 -284 b 563 -263 568 -284 566 -274 l 534 -120 l 511 -13 l 496 61 l 480 133 b 469 187 472 176 469 187 b 468 188 469 187 469 188 b 416 162 462 188 430 172 b 337 13 364 126 337 69 b 413 -124 337 -40 363 -93 b 428 -144 424 -131 428 -137 b 428 -149 428 -145 428 -148 b 409 -166 426 -161 419 -166 b 394 -162 405 -166 400 -165 b 240 77 302 -122 240 -27 l 240 77 b 430 342 240 197 315 301 l 436 344 l 426 394 l 398 528 m 548 194 b 526 195 540 195 532 195 b 519 195 524 195 521 195 l 514 195 l 518 177 l 539 79 l 552 15 l 566 -48 l 594 -187 l 605 -240 b 612 -266 609 -254 611 -266 b 612 -266 612 -266 612 -266 b 641 -248 613 -266 630 -256 b 744 -98 692 -212 730 -156 b 751 -40 749 -79 751 -59 b 548 194 751 76 665 181 "},
v8f:{x_min:-21.78125,x_max:362.0625,ha:369,o:"m 302 1031 b 308 1032 304 1032 307 1032 b 330 1016 318 1032 325 1027 b 362 867 351 970 362 920 b 340 738 362 824 353 780 l 336 727 l 340 717 b 362 591 355 677 362 634 b 257 323 362 496 325 401 b 204 272 243 306 227 290 b 20 56 129 206 66 133 b -1 18 12 44 0 22 b -19 4 -4 9 -12 4 l -21 4 l -21 140 l -21 276 l -12 277 b 167 333 61 288 127 309 b 319 598 262 388 319 491 b 311 664 319 620 317 642 l 310 673 l 304 664 b 204 548 279 620 250 587 b 20 333 129 483 66 409 b -1 292 12 320 0 298 b -19 280 -4 285 -12 280 l -21 280 l -21 416 l -21 552 l -12 553 b 167 609 61 564 127 585 b 319 874 264 666 319 770 b 294 992 319 914 311 954 b 288 1011 288 1004 288 1007 b 302 1031 288 1021 294 1028 "},
v9a:{x_min:-21.78125,x_max:367.5,ha:375,o:"m 230 1031 b 238 1032 232 1032 235 1032 b 259 1014 245 1032 251 1027 b 367 662 330 906 367 782 b 364 602 367 641 367 621 b 232 317 352 488 304 384 b 57 120 155 245 103 187 b -1 18 31 84 6 40 b -19 4 -4 11 -12 4 l -21 4 l -21 159 l -21 315 l -16 315 b 96 335 10 315 62 324 b 315 695 227 380 315 527 b 313 738 315 709 314 724 b 224 991 304 825 273 916 b 216 1013 219 999 216 1007 b 230 1031 216 1021 220 1028 "},va5:{x_min:0,x_max:349.8125,ha:357,o:"m 88 302 b 103 303 93 302 98 303 b 202 224 149 303 191 270 b 205 199 204 216 205 208 b 178 129 205 173 196 147 l 175 126 l 182 127 b 307 249 236 142 284 190 b 313 259 308 254 311 258 b 329 267 317 265 323 267 b 349 247 340 267 349 259 b 201 -263 349 242 204 -258 b 182 -273 197 -270 190 -273 b 163 -260 174 -273 166 -269 b 161 -256 161 -259 161 -258 b 217 -59 161 -248 170 -220 b 272 129 247 43 272 127 b 272 129 272 129 272 129 b 264 122 272 129 268 126 b 140 80 227 94 183 80 b 36 115 102 80 65 91 b 0 194 10 136 0 165 b 88 302 0 244 32 292 "}},
cssFontWeight:"normal",ascender:1903,underlinePosition:-125,cssFontStyle:"normal",boundingBox:{yMin:-2065.375,xMin:-695.53125,yMax:1901.578125,xMax:1159.671875},resolution:1E3,descender:-2066,familyName:"VexNotation-18",lineHeight:4093,underlineThickness:50};Vex.Flow.renderGlyph=function(b,c,d,e,f,g){e=e*72/(Vex.Flow.Font.resolution*100);f=Vex.Flow.Glyph.loadMetrics(Vex.Flow.Font,f,!g);Vex.Flow.Glyph.renderOutline(b,f.outline,e,c,d)};Vex.Flow.Glyph=function(b,c,d){this.code=b;this.point=c;this.context=null;this.options={cache:true,font:Vex.Flow.Font};this.metrics=this.width=null;this.y_shift=this.x_shift=0;d?this.setOptions(d):this.reset()};a=Vex.Flow.Glyph.prototype;a.setOptions=function(b){Vex.Merge(this.options,b);this.reset()};
a.setStave=function(b){this.stave=b;return this};a.setXShift=function(b){this.x_shift=b;return this};a.setYShift=function(b){this.y_shift=b;return this};a.setContext=function(b){this.context=b;return this};a.getContext=function(){return this.context};a.reset=function(){this.metrics=Vex.Flow.Glyph.loadMetrics(this.options.font,this.code,this.options.cache);this.scale=this.point*72/(this.options.font.resolution*100)};
a.getMetrics=function(){if(!this.metrics)throw new Vex.RuntimeError("BadGlyph","Glyph "+this.code+" is not initialized.");return{x_min:this.metrics.x_min*this.scale,x_max:this.metrics.x_max*this.scale,width:(this.metrics.x_max-this.metrics.x_min)*this.scale}};a.render=function(b,c,d){if(!this.metrics)throw new Vex.RuntimeError("BadGlyph","Glyph "+this.code+" is not initialized.");Vex.Flow.Glyph.renderOutline(b,this.metrics.outline,this.scale,c,d)};
a.renderToStave=function(b){if(!this.metrics)throw new Vex.RuntimeError("BadGlyph","Glyph "+this.code+" is not initialized.");if(!this.stave)throw new Vex.RuntimeError("GlyphError","No valid stave");if(!this.context)throw new Vex.RERR("GlyphError","No valid context");Vex.Flow.Glyph.renderOutline(this.context,this.metrics.outline,this.scale,b+this.x_shift,this.stave.getYForGlyphs()+this.y_shift)};
Vex.Flow.Glyph.loadMetrics=function(b,c,d){b=b.glyphs[c];if(!b)throw new Vex.RuntimeError("BadGlyph","Glyph "+c+" does not exist in font.");c=b.x_min;var e=b.x_max;if(b.o){if(d)if(b.cached_outline)d=b.cached_outline;else{d=b.o.split(" ");b.cached_outline=d}else{b.cached_outline&&delete b.cached_outline;d=b.o.split(" ")}return{x_min:c,x_max:e,outline:d}}else throw new Vex.RuntimeError("BadGlyph","Glyph "+this.code+" has no outline defined.");};
Vex.Flow.Glyph.renderOutline=function(b,c,d,e,f){var g=c.length;b.beginPath();b.moveTo(e,f);for(var h=0;h<g;)switch(c[h++]){case "m":b.moveTo(e+c[h++]*d,f+c[h++]*-d);break;case "l":b.lineTo(e+c[h++]*d,f+c[h++]*-d);break;case "q":var k=e+c[h++]*d,i=f+c[h++]*-d;b.quadraticCurveTo(e+c[h++]*d,f+c[h++]*-d,k,i);break;case "b":k=e+c[h++]*d;i=f+c[h++]*-d;b.bezierCurveTo(e+c[h++]*d,f+c[h++]*-d,e+c[h++]*d,f+c[h++]*-d,k,i);break}b.fill()};Vex.Flow.Stave=function(b,c,d,e){arguments.length>0&&this.init(b,c,d,e)};a=Vex.Flow.Stave.prototype;
a.init=function(b,c,d,e){this.x=b;this.y=c;this.width=d;this.glyph_start_x=b+5;this.start_x=this.glyph_start_x+5;this.context=null;this.glyphs=[];this.options={vertical_bar_width:10,glyph_spacing_px:10,num_lines:5,spacing_between_lines_px:10,space_above_staff_ln:4,space_below_staff_ln:4,top_text_position:1};this.height=(this.options.num_lines+this.options.space_above_staff_ln)*this.options.spacing_between_lines_px;Vex.Merge(this.options,e)};a.setNoteStartX=function(b){this.start_x=b;return this};
a.getNoteStartX=function(){return this.start_x};a.getTieStartX=function(){return this.start_x};a.getTieEndX=function(){return this.x+this.width};a.setContext=function(b){this.context=b;return this};a.setY=function(b){this.y=b;return this};a.setWidth=function(b){this.width=b;return this};a.getHeight=function(){return this.height};a.getBottomY=function(){var b=this.options,c=b.spacing_between_lines_px;return this.getYForLine(b.num_lines)+b.space_below_staff_ln*c};
a.getYForLine=function(b){var c=this.options,d=c.spacing_between_lines_px;return this.y+(b*d+c.space_above_staff_ln*d)};a.getYForTopText=function(b){return this.getYForLine(-(b||0)-this.options.top_text_position)};a.getYForNote=function(b){var c=this.options,d=c.spacing_between_lines_px;return this.y+c.space_above_staff_ln*d+5*d-b*d};a.getYForGlyphs=function(){return this.getYForLine(3)};a.addGlyph=function(b){b.setStave(this);this.glyphs.push(b);this.start_x+=b.getMetrics().width;return this};
a.addTrebleGlyph=function(){this.addGlyph(new Vex.Flow.Glyph("v83",40));return this};
a.draw=function(){if(!this.context)throw new Vex.RERR("NoCanvasContext","Can't draw stave without canvas context.");var b=this.options.num_lines,c=this.width,d=this.x;this.drawVerticalBar(0);for(var e=0;e<b;e++){var f=this.getYForLine(e);this.context.fillRect(d,f,c,1)}d=this.glyph_start_x;for(b=0;b<this.glyphs.length;++b){c=this.glyphs[b];c.getContext()||c.setContext(this.context);c.renderToStave(d);d+=c.getMetrics().width}this.drawVerticalBar(this.width);return this};
a.drawVerticalBar=function(b){this.drawVerticalBarFixed(this.x+b)};a.drawVerticalBarFixed=function(b){if(!this.context)throw new Vex.RERR("NoCanvasContext","Can't draw stave without canvas context.");var c=this.getYForLine(0),d=this.getYForLine(this.options.num_lines-1);this.context.fillRect(b,c,1,d-c+1)};Vex.Flow.TabStave=function(b,c,d,e){arguments.length>0&&this.init(b,c,d,e)};Vex.Flow.TabStave.prototype=new Vex.Flow.Stave;Vex.Flow.TabStave.prototype.constructor=Vex.Flow.TabStave;Vex.Flow.TabStave.superclass=Vex.Flow.Stave.prototype;Vex.Flow.TabStave.prototype.init=function(b,c,d,e){var f=Vex.Flow.TabStave.superclass,g={spacing_between_lines_px:10,num_lines:6,top_text_position:1};Vex.Merge(g,e);f.init.call(this,b,c,d,g)};Vex.Flow.TabStave.prototype.getYForGlyphs=function(){return this.getYForLine(2.5)};
Vex.Flow.TabStave.prototype.addTabGlyph=function(){this.addGlyph(new Vex.Flow.Glyph("v2f",30));return this};Vex.Flow.TickContext=function(){this.init()};a=Vex.Flow.TickContext.prototype;a.init=function(){this.maxTicks=this.currentTick=0;this.minTicks=null;this.width=0;this.padding=3;this.x=this.pixelsUsed=0;this.tickables=[];this.ignore_ticks=true;this.preFormatted=false};a.setCurrentTick=function(b){this.currentTick=b;this.preFormatted=false};a.getCurrentTick=function(){return this.currentTick};a.shouldIgnoreTicks=function(){return this.ignore_ticks};
a.getWidth=function(){return this.width+this.padding*2};a.getX=function(){return this.x};a.setX=function(b){this.x=b;return this};a.getPixelsUsed=function(){return this.pixelsUsed};a.setPixelsUsed=function(b){this.pixelsUsed=b;return this};a.setPadding=function(b){this.padding=b;return this};a.getMaxTicks=function(){return this.maxTicks};a.getMinTicks=function(){return this.minTicks};a.getTickables=function(){return this.tickables};
a.addTickable=function(b){if(!b)throw new Vex.RERR("BadArgument","Invalid tickable added.");var c=b.getTicks();if(!b.shouldIgnoreTicks()){this.ignore_ticks=false;if(c>this.maxTicks)this.maxTicks=c;if(this.minTicks==null)this.minTicks=c;if(c<this.minTicks)this.minTicks=c}b.setTickContext(this);this.tickables.push(b);this.preFormatted=false;return this};
a.preFormat=function(){if(!this.preFormatted){for(var b=0;b<this.tickables.length;++b){var c=this.tickables[b];c.preFormat();c=c.getWidth();if(c>this.width)this.width=c}return this}};Vex.Flow.Tickable=function(){this.init()};a=Vex.Flow.Tickable.prototype;a.init=function(){this.x_shift=this.width=this.ticks=0;this.modifierContext=this.tickContext=this.voice=null;this.modifiers=[];this.ignore_ticks=this.preFormatted=false};a.addToModifierContext=function(){this.modifierContext=modifierContext;this.preFormatted=false};a.addModifier=function(){this.modifiers.push(mc);this.preFormatted=false};a.setTickContext=function(b){this.tickContext=b;this.preFormatted=false};
a.preFormat=function(){if(!preFormatted){this.width=0;if(this.modifierContext){this.modifierContext.preFormat();this.width+=this.modifierContext.getWidth()}}};a.getTicks=function(){return this.ticks};a.shouldIgnoreTicks=function(){return this.ignore_ticks};a.getWidth=function(){return this.width};a.setXShift=function(b){this.x_shift=b};a.getVoice=function(){if(!this.voice)throw new Vex.RERR("NoVoice","Tickable has no voice.");return this.voice};a.setVoice=function(b){this.voice=b};Vex.Flow.Note=function(b){arguments.length>0&&this.init(b)};Vex.Flow.Note.prototype=new Vex.Flow.Tickable;Vex.Flow.Note.superclass=Vex.Flow.Tickable.prototype;Vex.Flow.Note.constructor=Vex.Flow.Note;a=Vex.Flow.Note.prototype;
a.init=function(b){Vex.Flow.Note.superclass.init.call(this);this.duration=b;if(!this.duration)throw new Vex.RuntimeError("BadArguments","Note must have duration.");if(this.positions&&(typeof this.positions!="object"||!this.positions.length))throw new Vex.RuntimeError("BadArguments","Note keys must be array type.");this.ticks=Vex.Flow.durationToTicks[this.duration];if(!this.ticks)throw new Vex.RuntimeError("BadArguments","Invalid duration string (No ticks found): "+this.duration);this.modifierContext=
this.tickContext=null;this.x_shift=this.extraRightPx=this.extraLeftPx=this.width=0;this.voice=null;this.preFormatted=false;this.ys=[];this.stave=this.context=null};a.setYs=function(b){this.ys=b;return this};a.getStave=function(){return this.stave};a.setStave=function(b){this.stave=b;return this};a.setContext=function(b){this.context=b;return this};a.getTicks=function(){return this.ticks};a.getExtraLeftPx=function(){return this.extraLeftPx};a.getExtraRightPx=function(){return this.extraRightPx};
a.setExtraLeftPx=function(b){this.extraLeftPx=b;return this};a.setExtraRightPx=function(b){this.extraRightPx=b;return this};a.getYs=function(){if(this.ys.length==0)throw new Vex.RERR("NoYValues","No Y-values calculated for this note.");return this.ys};a.getVoice=function(){if(!this.voice)throw new Vex.RERR("NoVoice","Note has no voice.");return this.voice};a.setVoice=function(b){this.voice=b;this.preFormatted=false;return this};a.getTickContext=function(){return this.tickContext};
a.setTickContext=function(b){this.tickContext=b;this.preFormatted=false;return this};a.getDuration=function(){return this.duration};a.setModifierContext=function(b){this.modifierContext=b;return this};a.getWidth=function(){if(!this.preFormatted)throw new Vex.RERR("UnformattedNote","Can't call GetWidth on an unformatted note.");return this.width+this.x_shift+(this.modifierContext?this.modifierContext.getWidth():0)};a.setWidth=function(b){this.width=b};a.setXShift=function(b){this.x_shift=b;return this};
a.getX=function(){if(!this.tickContext)throw new Vex.RERR("NoTickContext","Note needs a TickContext assigned for an X-Value");return this.tickContext.getX()+this.x_shift};
a.getAbsoluteX=function(b){if(!this.tickContext)throw new Vex.RERR("NoTickContext","Note needs a TickContext assigned for an X-Value");b=this.tickContext.getX()+this.tickContext.getPixelsUsed()/2+this.extraLeftPx/2-this.extraRightPx/2;if(this.modifierContext)b+=this.modifierContext.getExtraLeftPx()/2-this.modifierContext.getExtraRightPx()/2;if(this.stave)b+=this.stave.getNoteStartX();return b};a.setPreFormatted=function(b){this.preFormatted=b};Vex.Flow.BarNote=function(){this.init()};Vex.Flow.BarNote.prototype=new Vex.Flow.Note;Vex.Flow.BarNote.superclass=Vex.Flow.Note.prototype;Vex.Flow.BarNote.constructor=Vex.Flow.BarNote;a=Vex.Flow.BarNote.prototype;a.init=function(){Vex.Flow.BarNote.superclass.init.call(this,"b");this.setWidth(8);this.ignore_ticks=true};a.setStave=function(b){Vex.Flow.BarNote.superclass.setStave.call(this,b)};a.addToModifierContext=function(){return this};a.preFormat=function(){this.setPreFormatted(true);return this};
a.draw=function(){if(!this.stave)throw new Vex.RERR("NoStave","Can't draw without a stave.");this.stave.drawVerticalBarFixed(this.getAbsoluteX()+this.x_shift)};Vex.Flow.GhostNote=function(b){arguments.length>0&&this.init(b)};Vex.Flow.GhostNote.prototype=new Vex.Flow.Note;Vex.Flow.GhostNote.superclass=Vex.Flow.Note.prototype;Vex.Flow.GhostNote.constructor=Vex.Flow.GhostNote;a=Vex.Flow.GhostNote.prototype;a.init=function(b){Vex.Flow.GhostNote.superclass.init.call(this,b);this.setWidth(0)};a.setStave=function(b){Vex.Flow.GhostNote.superclass.setStave.call(this,b)};a.addToModifierContext=function(){return this};
a.preFormat=function(){this.setPreFormatted(true);return this};a.draw=function(){if(!this.stave)throw new Vex.RERR("NoStave","Can't draw without a stave.");};Vex.Flow.StaveNote=function(b){arguments.length>0&&this.init(b)};Vex.Flow.StaveNote.prototype=new Vex.Flow.Note;Vex.Flow.StaveNote.superclass=Vex.Flow.Note.prototype;Vex.Flow.StaveNote.constructor=Vex.Flow.StaveNote;Vex.Flow.StaveNote.STEM_UP=1;Vex.Flow.StaveNote.STEM_DOWN=-1;a=Vex.Flow.StaveNote.prototype;a.getCategory=function(){return"stavenotes"};
a.init=function(b){Vex.Flow.StaveNote.superclass.init.call(this,b.duration);this.keys=b.keys;this.glyph=Vex.Flow.durationToGlyph(this.duration);if(!this.glyph)throw new Vex.RuntimeError("BadArguments","Invalid duration string (No glyph found): "+this.duration);this.keyProps=[];this.displaced=false;for(var c=null,d=0;d<this.keys.length;++d){var e=this.keys[d];if(this.glyph.rest)e=this.glyph.position;var f=Vex.Flow.keyProperties(e);if(!f)throw new Vex.RuntimeError("BadArguments","Invalid key for note properties: "+
e);e=f.line;if(c!=null)if(Math.abs(c-e)==0.5)this.displaced=true;c=e;this.keyProps.push(f)}this.modifiers=[];this.render_options={glyph_font_scale:38,stem_height:35,stroke_px:3,stroke_spacing:10};this.setStemDirection(b.stem_direction)};a.setStave=function(b){Vex.Flow.StaveNote.superclass.setStave.call(this,b);b=[];for(var c=0;c<this.keyProps.length;++c)b.push(this.stave.getYForNote(this.keyProps[c].line));return this.setYs(b)};a.getKeyProps=function(){return this.keyProps};a.getStemDirection=function(){return this.stem_direction};
a.getStemX=function(){var b=this.getAbsoluteX()+this.x_shift,c=this.getAbsoluteX()+this.x_shift+this.glyph.head_width;return this.stem_direction==Vex.Flow.StaveNote.STEM_DOWN?b:c};
a.getStemExtents=function(){if(!this.ys||this.ys.length==0)throw new Vex.RERR("NoYValues","Can't get top stem Y when note has no Y values.");for(var b=this.ys[0],c=this.ys[0],d=0;d<this.ys.length;++d){var e=this.ys[d]+this.render_options.stem_height*-this.stem_direction;if(this.stem_direction==Vex.Flow.StaveNote.STEM_DOWN){b=b>e?b:e;c=c<this.ys[d]?c:this.ys[d]}else{b=b<e?b:e;c=c>this.ys[d]?c:this.ys[d]}}return{topY:b,baseY:c}};
a.getTieRightX=function(){var b=this.getAbsoluteX();b+=this.glyph.head_width+this.x_shift+this.extraRightPx;if(this.modifierContext)b+=this.modifierContext.getExtraRightPx();return b};a.getTieLeftX=function(){var b=this.getAbsoluteX();b+=this.x_shift-this.extraLeftPx;return b};
a.getModifierStartXY=function(b,c){if(!this.preFormatted)throw new Vex.RERR("UnformattedNote","Can't call GetModifierStartXY on an unformatted note");if(this.ys.length==0)throw new Vex.RERR("NoYValues","No Y-Values calculated for this note.");var d=0;if(b==Vex.Flow.Modifier.Position.LEFT)d=-2;else if(b==Vex.Flow.Modifier.Position.RIGHT)d=this.glyph.head_width+this.x_shift+2;return{x:this.getAbsoluteX()+d,y:this.ys[c]}};
a.setStemDirection=function(b){if(!b)b=Vex.Flow.StaveNote.STEM_UP;if(b!=Vex.Flow.StaveNote.STEM_UP&&b!=Vex.Flow.StaveNote.STEM_DOWN)throw new Vex.RERR("BadArgument","Invalid stem direction: "+b);this.stem_direction=b;this.beam=null;this.setPreFormatted(false);return this};a.setBeam=function(b){this.beam=b;return this};
a.addToModifierContext=function(b){this.setModifierContext(b);for(b=0;b<this.modifiers.length;++b)this.modifierContext.addModifier(this.modifiers[b]);this.modifierContext.addModifier(this);this.setPreFormatted(false)};a.addAccidental=function(b,c){c.setNote(this);c.setIndex(b);this.modifiers.push(c);this.setPreFormatted(false);return this};a.getAccidentals=function(){return this.modifierContext.getModifiers("accidentals")};
a.getVoiceShiftWidth=function(){return this.glyph.head_width*(this.displaced?2:1)};a.preFormat=function(){if(!this.preFormatted){this.modifierContext&&this.modifierContext.preFormat();this.setExtraLeftPx(this.displaced&&this.stem_direction==-1?this.glyph.head_width:0);this.setExtraRightPx(this.displaced&&this.stem_direction==1?this.glyph.head_width:0);this.setWidth(this.glyph.head_width+this.extraLeftPx+this.extraRightPx);this.setPreFormatted(true)}};
a.draw=function(){if(!this.context)throw new Vex.RERR("NoCanvasContext","Can't draw without a canvas context.");if(!this.stave)throw new Vex.RERR("NoStave","Can't draw without a stave.");if(this.ys.length==0)throw new Vex.RERR("NoYValues","Can't draw note without Y values.");var b=this.context,c=this.getAbsoluteX()+this.x_shift,d=this.ys,e=this.keys,f=this.glyph,g=this.stem_direction,h=this.beam==null,k=this.beam==null,i=c+f.head_width,j=null,l=null,o=null,n=false,p=0,v=e.length,x=1;if(g==Vex.Flow.StaveNote.STEM_DOWN){p=
e.length-1;x=v=-1}e=5;var u=1;for(p=p;p!=v;p+=x){var s=this.keyProps[p],m=s.line;e=m>e?m:e;u=m<u?m:u;if(o==null)o=m;else if(Math.abs(o-m)==0.5)n=!n;o=m;m=d[p];if(j==null||m<j)j=m;if(l==null||m>l)l=m;var t=f.code_head,r=c+(n?f.head_width*g:0);if(s.code){t=s.code;r=c+s.shift_right}Vex.Flow.renderGlyph(b,r,m,this.render_options.glyph_font_scale,t)}if(!f.rest){var w=this;d=function(q){b.fillRect(r-w.render_options.stroke_px,q,r+f.head_width-r+w.render_options.stroke_px*2,1)};for(m=6;m<=e;++m)d(this.stave.getYForNote(m));
for(m=0;m>=u;--m)d(this.stave.getYForNote(m))}d=(l-j)*g+this.render_options.stem_height*g;if(f.stem&&h){if(g==Vex.Flow.StaveNote.STEM_DOWN){h=c;o=j}else{h=i;o=l}b.fillRect(h,o-(d<0?0:d),1,Math.abs(d))}if(f.flag&&k){if(g==Vex.Flow.StaveNote.STEM_DOWN){c=c+1;j=j-d;l=f.code_flag_downstem}else{c=i+1;j=l-d;l=f.code_flag_upstem}Vex.Flow.renderGlyph(b,c,j,this.render_options.glyph_font_scale,l)}for(p=0;p<this.modifiers.length;++p){j=this.modifiers[p];j.setContext(this.context);j.draw()}};Vex.Flow.TabNote=function(b){arguments.length>0&&this.init(b)};Vex.Flow.TabNote.prototype=new Vex.Flow.Note;Vex.Flow.TabNote.superclass=Vex.Flow.Note.prototype;Vex.Flow.TabNote.constructor=Vex.Flow.TabNote;a=Vex.Flow.TabNote.prototype;
a.init=function(b){Vex.Flow.TabNote.superclass.init.call(this,b.duration);this.positions=b.positions;this.modifiers=[];this.render_options={glyph_font_scale:30};this.glyphs=[];for(b=this.width=0;b<this.positions.length;++b){var c=Vex.Flow.tabToGlyph(this.positions[b].fret);this.glyphs.push(c);this.width=c.width>this.width?c.width:this.width}};
a.setStave=function(b){Vex.Flow.TabNote.superclass.setStave.call(this,b);b=[];for(var c=0;c<this.positions.length;++c)b.push(this.stave.getYForLine(this.positions[c].str-1));return this.setYs(b)};a.getPositions=function(){return this.positions};a.addToModifierContext=function(b){this.setModifierContext(b);for(b=0;b<this.modifiers.length;++b)this.modifierContext.addModifier(this.modifiers[b]);this.preFormatted=false;return this};
a.addModifier=function(b,c){b.setNote(this);b.setIndex(c||0);this.modifiers.push(b);this.setPreFormatted(false);return this};a.getTieRightX=function(){var b=this.getAbsoluteX();b+=this.width/2+this.x_shift+this.extraRightPx;if(this.modifierContext)b+=this.modifierContext.getExtraRightPx();return b};a.getTieLeftX=function(){var b=this.getAbsoluteX();b+=this.x_shift-this.extraLeftPx;if(this.modifierContext)b-=this.modifierContext.getExtraLeftPx();return b};
a.getModifierStartXY=function(b,c){if(!this.preFormatted)throw new Vex.RERR("UnformattedNote","Can't call GetModifierStartXY on an unformatted note");if(this.ys.length==0)throw new Vex.RERR("NoYValues","No Y-Values calculated for this note.");var d=0;if(b==Vex.Flow.Modifier.Position.LEFT)d=-2;else if(b==Vex.Flow.Modifier.Position.RIGHT)d=this.width/2+2;return{x:this.getAbsoluteX()+d,y:this.ys[c]}};
a.preFormat=function(){if(!this.preFormatted){this.modifierContext&&this.modifierContext.preFormat();this.setPreFormatted(true)}};
a.draw=function(){if(!this.context)throw new Vex.RERR("NoCanvasContext","Can't draw without a canvas context.");if(!this.stave)throw new Vex.RERR("NoStave","Can't draw without a stave.");if(this.ys.length==0)throw new Vex.RERR("NoYValues","Can't draw note without Y values.");for(var b=this.context,c=this.getAbsoluteX(),d=this.ys,e=0;e<this.positions.length;++e){var f=d[e],g=this.glyphs[e],h=c-g.width/2;if(g.code)Vex.Flow.renderGlyph(b,h,f+5+g.shift_y,this.render_options.glyph_font_scale,g.code);else{g=
g.text.toString();b.fillText(g,h,f+4)}}for(e=0;e<this.modifiers.length;++e){b=this.modifiers[e];b.setContext(this.context);b.draw()}};Vex.Flow.Beam=function(b){arguments.length>0&&this.init(b)};
Vex.Flow.Beam.prototype.init=function(b){if(!b||b==[])throw new Vex.RuntimeError("BadArguments","No notes provided for beam.");if(b.length==1)throw new Vex.RuntimeError("BadArguments","Too few notes for beam.");this.stem_direction=b[0].getStemDirection();this.ticks=b[0].getTicks();if(this.ticks>Vex.Flow.durationToTicks["8d"])throw new Vex.RuntimeError("BadArguments","Beams can be at most dotted eighth notes.");for(var c=1;c<b.length;++c){var d=b[c];if(d.getStemDirection()!=this.stem_direction)throw new Vex.RuntimeError("BadArguments",
"Notes in a beam all have the same stem direction");}for(c=0;c<b.length;++c){d=b[c];d.setBeam(this)}this.notes=b;this.beam_count=Vex.Flow.durationToGlyph(this.notes[0].getDuration()).beam_count;this.render_options={beam_width:5}};Vex.Flow.Beam.prototype.setContext=function(b){this.context=b;return this};Vex.Flow.Beam.prototype.getNotes=function(){return this.notes};
Vex.Flow.Beam.prototype.draw=function(){function b(s){return f+(s-h)*k}function c(s){for(var m=[],t=false,r=0;r<o.notes.length;++r){var w=o.notes[r];if(w.getTicks()<=Vex.Flow.durationToTicks[s])if(t){var q=m[m.length-1];q.end=w.getStemX()}else{m.push({start:w.getStemX(),end:null});t=true}else{if(t){q=m[m.length-1];if(q.end==null)q.end=q.start+10}t=false}}if(t==true){q=m[m.length-1];if(q.end==null)q.end=q.start-10}return m}if(!this.context)throw new Vex.RERR("NoCanvasContext","Can't draw without a canvas context.");
var d=this.notes[0],e=this.notes[this.notes.length-1],f=d.getStemExtents().topY,g=e.getStemExtents().topY,h=d.getStemX();e=e.getStemX();d=this.render_options.beam_width*this.stem_direction;var k=(g-f)/(e-h);e=0;for(var i=1;i<this.notes.length;++i){var j=this.notes[i],l=j.getStemX();j=j.getStemExtents().topY;l=b(l);if((j+e)*this.stem_direction<l*this.stem_direction)e+=Math.abs(j-l)*-this.stem_direction}for(i=0;i<this.notes.length;++i){j=this.notes[i];l=j.getStemX();j=j.getStemExtents().baseY;this.context.fillRect(l,
j,1,Math.abs(j-(b(l)+e))*-this.stem_direction)}var o=this;l=["8d","16d","32d"];for(i=0;i<l.length;++i){j=c(l[i]);for(var n=0;n<j.length;++n){var p=j[n],v=p.start,x=b(v);p=p.end;var u=b(p);this.context.beginPath();this.context.moveTo(v,x+e);this.context.lineTo(v,x+d+e);this.context.lineTo(p+1,u+d+e);this.context.lineTo(p+1,u+e);this.context.closePath();this.context.fill()}f+=d*1.5;g+=d*1.5}return true};Vex.Flow.Voice=function(b){this.init(b)};a=Vex.Flow.Voice.prototype;a.init=function(b){this.time=b;this.totalTicks=this.time.num_beats*(this.time.resolution/this.time.beat_value);this.tickables=[];this.ticksUsed=0;this.smallestTickCount=this.totalTicks;this.largestTickWidth=0;this.strict=true;this.voiceGroup=null};a.getVoiceGroup=function(){if(!this.voiceGroup)throw new Vex.RERR("NoVoiceGroup","No voice group for voice.");return this.voiceGroup};a.setVoiceGroup=function(b){this.voiceGroup=b;return this};
a.setStrict=function(b){this.strict=b;return this};a.isComplete=function(){return this.ticksUsed==this.totalTicks||!this.strict};a.getTotalTicks=function(){return this.totalTicks};a.getTicksUsed=function(){return this.ticksUsed};a.getLargestTickWidth=function(){return this.largestTickWidth};a.getSmallestTickCount=function(){return this.smallestTickCount};a.getTickables=function(){return this.tickables};
a.addTickable=function(b){var c=b.getTicks();this.ticksUsed+=c;if(this.strict&&this.ticksUsed>this.totalTicks){this.totalTicks-=c;throw new Vex.RERR("BadArgument","Too many ticks.");}if(c<this.smallestTickCount)this.smallestTickCount=c;this.tickables.push(b);b.setVoice(this);return this};a.addTickables=function(b){for(var c=0;c<b.length;++c)this.addTickable(b[c]);return this};
a.draw=function(b,c){for(var d=0;d<this.tickables.length;++d){this.tickables[d].setContext(b);this.tickables[d].setStave(c);this.tickables[d].draw()}};Vex.Flow.Modifier=function(){this.init()};Vex.Flow.Modifier.Position={LEFT:1,RIGHT:2,ABOVE:3,BELOW:4};a=Vex.Flow.Modifier.prototype;a.init=function(){this.width=0;this.index=this.note=this.context=null;this.text_line=0;this.position=Vex.Flow.Modifier.Position.LEFT;this.modifier_context=null;this.y_shift=this.x_shift=0};a.getCategory=function(){return"none"};a.getWidth=function(){return this.width};a.setWidth=function(b){this.width=b;return this};a.getNote=function(){return this.note};
a.setNote=function(b){this.note=b;return this};a.getIndex=function(){return this.index};a.setIndex=function(b){this.index=b;return this};a.getContext=function(){return this.context};a.setContext=function(b){this.context=b;return this};a.getModifierContext=function(){return this.modifier_context};a.setModifierContext=function(b){this.modifier_context=b;return this};a.setTextLine=function(b){this.text_line=b;return this};
a.setXShift=function(b){this.x_shift=0;if(this.position==Vex.Flow.Modifier.Position.LEFT)this.x_shift-=b;else this.x_shift+=b};a.draw=function(){if(!this.context)throw new Vex.RERR("NoCanvasContext","Can't draw without a canvas context.");throw new Vex.RERR("MethodNotImplemented","Draw() not implemented for this modifier.");};Vex.Flow.ModifierContext=function(){this.modifiers={};this.preFormatted=false;this.spacing=this.width=0;this.state={left_shift:0,right_shift:0,text_line:0}};a=Vex.Flow.ModifierContext.prototype;a.addModifier=function(b){var c=b.getCategory();this.modifiers[c]||(this.modifiers[c]=[]);this.modifiers[c].push(b);b.setModifierContext(this);this.preFormatted=false;return this};a.getModifiers=function(b){return this.modifiers[b]};a.getWidth=function(){return this.width};a.getExtraLeftPx=function(){return this.state.left_shift};
a.getExtraRightPx=function(){return this.state.right_shift};a.getMetrics=function(){if(!this.formatted)throw new Vex.RERR("UnformattedModifier","Unformatted modifier has no metrics.");return{width:this.state.left_shift+this.state.right_shift+this.spacing,spacing:this.spacing,extra_left_px:this.state.left_shift,extra_right_px:this.state.right_shift}};
a.formatNotes=function(){var b=this.modifiers.stavenotes;if(!b||b.length<2)return this;var c=b[0],d=b[1];if(b[0].getStemDirection()==Vex.Flow.StaveNote.STEM_DOWN){d=b[0];c=b[1]}b=c.getKeyProps();var e=d.getKeyProps(),f=0;if(b[0].line<=e[e.length-1].line+0.5){f=c.getVoiceShiftWidth();d.setXShift(f)}this.state.right_shift+=f;return this};
a.formatAccidentals=function(){var b=this.state.left_shift,c=this.modifiers.accidentals;if(!c||c.length==0)return this;for(var d=[],e=0;e<c.length;++e){var f=c[e],g=f.getNote().getKeyProps()[f.getIndex()].line;d.push({line:g,acc:f})}d.sort(function(i,j){return j.line-i.line});c=b;var h=0,k=d[0].line;for(e=0;e<d.length;++e){f=d[e].acc;g=d[e].line;if(g<k-3){k=g;c=b}f.setXShift(c);c+=f.getWidth()+2;h=c>h?c:h}this.state.left_shift+=h;return this};
a.formatBends=function(){var b=this.modifiers.bends;if(!b||b.length==0)return this;for(var c=0,d=this.state.text_line,e=0;e<b.length;++e){var f=b[e],g=Vex.Flow.textWidth(f.getText());c+=f.render_options.bend_width+g/2;f.setBendWidth(c);c+=f.release_width+g/2;f.setTextLine(d)}this.state.right_shift+=c;this.state.text_line+=1;return this};
a.formatVibratos=function(){var b=this.modifiers.vibratos;if(!b||b.length==0)return this;var c=this.state.text_line,d=0,e=this.state.right_shift-7,f=this.modifiers.bends;f&&f.length>0&&c--;for(f=0;f<b.length;++f){var g=b[f];g.setXShift(e);g.setTextLine(c);d+=g.getWidth();e+=d}this.state.right_shift+=d;this.state.text_line+=1;return this};
a.formatAnnotations=function(){var b=this.modifiers.annotations;if(!b||b.length==0)return this;for(var c=this.state.text_line,d=0;d<b.length;++d){var e=b[d];e.setTextLine(c);e=e.getWidth()>0?e.getWidth():0;c++}this.state.left_shift+=e/2;this.state.right_shift+=e/2;return this};a.preFormat=function(){if(!this.preFormatted){this.formatNotes().formatAccidentals().formatAnnotations().formatBends().formatVibratos();this.width=this.state.left_shift+this.state.right_shift;this.preFormatted=true}};Vex.Flow.Accidental=function(b){arguments.length>0&&this.init(b)};Vex.Flow.Accidental.prototype=new Vex.Flow.Modifier;Vex.Flow.Accidental.prototype.constructor=Vex.Flow.Accidental;Vex.Flow.Accidental.superclass=Vex.Flow.Modifier.prototype;a=Vex.Flow.Accidental.prototype;
a.init=function(b){Vex.Flow.Accidental.superclass.init.call(this);this.index=this.note=null;this.type=b;this.position=Vex.Flow.Modifier.Position.LEFT;this.render_options={font_scale:38,stroke_px:3,stroke_spacing:10};this.accidental=Vex.Flow.accidentalCodes(this.type);this.setWidth(this.accidental.width)};a.getCategory=function(){return"accidentals"};a.getNote=function(){return this.note};a.setNote=function(b){this.note=b;return this};a.getIndex=function(){return this.index};
a.setIndex=function(b){this.index=b;return this};a.draw=function(){if(!this.context)throw new Vex.RERR("NoContext","Can't draw accidental without a context.");if(!(this.note&&this.index!=null))throw new Vex.RERR("NoAttachedNote","Can't draw accidental without a note and index.");var b=this.note.getModifierStartXY(this.position,this.index);Vex.Flow.renderGlyph(this.context,b.x+this.x_shift-this.width,b.y+this.y_shift,this.render_options.font_scale,this.accidental.code)};Vex.Flow.Formatter=function(){this.minTotalWidth=0;this.minTicks=null;this.totalTicks=this.pixelsPerTick=0;this.tContexts=null;this.render_options={perTickableWidth:15,maxExtraWidthPerTickable:40}};Vex.Flow.Formatter.FormatAndDraw=function(b,c,d,e){var f=(new Vex.Flow.Voice(Vex.Flow.TIME4_4)).setStrict(false);f.addTickables(d);(new Vex.Flow.Formatter).joinVoices([f]).format([f],e);f.draw(b,c)};
Vex.Flow.Formatter.FormatAndDrawTab=function(b,c,d,e,f,g){var h=(new Vex.Flow.Voice(Vex.Flow.TIME4_4)).setStrict(false);h.addTickables(e);e=(new Vex.Flow.Voice(Vex.Flow.TIME4_4)).setStrict(false);e.addTickables(f);(new Vex.Flow.Formatter).joinVoices([h]).joinVoices([e]).format([h,e],g);h.draw(b,c);e.draw(b,d)};Vex.Flow.Formatter.prototype.getMinTotalWidth=function(){return this.minTotalWidth};
Vex.Flow.Formatter.createContexts=function(b,c,d){if(!b||!b.length)throw new Vex.RERR("BadArgument","No voices to format");for(var e=b[0].getTotalTicks(),f={},g=[],h=0;h<b.length;++h){var k=b[h];if(k.getTotalTicks()!=e)throw new Vex.RERR("TickMismatch","Voices should have same time signature.");if(!k.isComplete())throw new Vex.RERR("IncompleteVoice","Voice does not have enough notes.");k=k.getTickables();for(var i=0,j=0;j<k.length;++j){var l=k[j];f[i]||(f[i]=new c);d(l,f[i]);g.push(i);i+=l.getTicks()}}return{map:f,
list:Vex.SortAndUnique(g,function(o,n){return o-n})}};a=Vex.Flow.Formatter.prototype;a.createModifierContexts=function(b){return Vex.Flow.Formatter.createContexts(b,Vex.Flow.ModifierContext,function(c,d){c.addToModifierContext(d)})};a.createTickContexts=function(b){var c=Vex.Flow.Formatter.createContexts(b,Vex.Flow.TickContext,function(d,e){e.addTickable(d)});this.totalTicks=b[0].getTicksUsed();return this.tContexts=c};
a.preFormat=function(b){var c=this.tContexts,d=c.list;c=c.map;for(var e=this.minTotalWidth=0;e<d.length;++e){var f=c[d[e]];f.preFormat();this.minTotalWidth+=f.getWidth();var g=f.getMinTicks();if(e==0)this.minTicks=g;if(g<this.minTicks)this.minTicks=g}if(b<this.minTotalWidh)throw new Vex.RERR("NoRoomForNotes","Justification width too small to fit all notes.");var h=false;if(b){this.pixelsPerTick=b/this.totalTicks;h=true}else this.pixelsPerTick=this.render_options.perTickableWidth/this.minTicks;for(e=
b=0;e<d.length;++e){var k=d[e];f=c[k];var i=f.getWidth();g=f.getMinTicks();g=Math.max(i,g*this.pixelsPerTick);g=Math.min(i+20,g);var j=b;if(h){j=k*this.pixelsPerTick;if(j<b)j+=b-j}else{k=i+this.render_options.maxExtraWidthPerTickable;if(g>k)g=k}f.setX(j);f.setPixelsUsed(g);b+=g}};a.joinVoices=function(b){this.createModifierContexts(b);return this};a.format=function(b,c){this.createTickContexts(b);this.preFormat(c);return this};Vex.Flow.StaveTie=function(b,c){arguments.length>0&&this.init(b,c)};a=Vex.Flow.StaveTie.prototype;a.init=function(b,c){this.notes=b;this.context=null;this.text=c;this.render_options={cp1:8,cp2:15,text_shift_x:0,first_x_shift:0,last_x_shift:0,y_shift:3,tie_spacing:0,font:{family:"Arial",size:8,style:"bold"}};this.font=this.render_options.font;this.setNotes(b)};a.setContext=function(b){this.context=b;return this};a.setFont=function(b){this.font=b;return this};
a.setNotes=function(b){if(!b.first_note&&!b.last_note)throw new Vex.RuntimeError("BadArguments","Tie needs to have either first_note or last_note set.");if(!b.first_indices)b.first_indices=[0];if(!b.last_indices)b.last_indices=[0];if(b.first_indices.length!=b.last_indices.length)throw new Vex.RuntimeError("BadArguments","Tied notes must have similar index sizes");this.first_note=b.first_note;this.first_indices=b.first_indices;this.last_note=b.last_note;this.last_indices=b.last_indices;return this};
a.isPartial=function(){return!this.first_note||!this.last_note};
a.renderTie=function(b){if(b.first_ys.length==0||b.last_ys.length==0)throw new Vex.RERR("BadArguments","No Y-values to render");for(var c=this.context,d=this.render_options.cp1,e=this.render_options.cp2,f=this.render_options.first_x_shift,g=this.render_options.last_x_shift,h=this.render_options.y_shift*b.direction,k=0;k<this.first_indices.length;++k){var i=(b.last_x_px+g+(b.first_x_px+f))/2,j=b.first_ys[this.first_indices[k]]+h,l=b.last_ys[this.last_indices[k]]+h;if(isNaN(j)||isNaN(l))throw new Vex.RERR("BadArguments",
"Bad indices for tie rendering.");var o=(j+l)/2+d*b.direction,n=(j+l)/2+e*b.direction;c.beginPath();c.moveTo(b.first_x_px+f,j);c.quadraticCurveTo(i,o,b.last_x_px+g,l);c.quadraticCurveTo(i,n,b.first_x_px+f,j);c.closePath();c.fill()}};
a.renderText=function(b,c){if(this.text){b=(b+c)/2;b-=Vex.Flow.textWidth(this.text)/2;this.context.save();this.context.setFont(this.font.family,this.font.size,this.font.style);this.context.fillText(this.text,b+this.render_options.text_shift_x,(this.first_note||this.last_note).getStave().getYForTopText());this.context.restore()}};
a.draw=function(){if(!this.context)throw new Vex.RERR("NoContext","No context to render tie.");var b=this.first_note,c=this.last_note,d,e,f,g;if(b){d=b.getTieRightX()+this.render_options.tie_spacing;g=b.getStemDirection();f=b.getYs()}else{d=c.getStave().getTieStartX();f=c.getYs();this.first_indices=this.last_indices}if(c){e=c.getTieLeftX()+this.render_options.tie_spacing;g=c.getStemDirection();b=c.getYs()}else{e=b.getStave().getTieEndX();b=b.getYs();this.last_indices=this.first_indices}this.renderTie({first_x_px:d,
last_x_px:e,first_ys:f,last_ys:b,direction:g});this.renderText(d,e);return true};Vex.Flow.TabTie=function(b,c){arguments.length>0&&this.init(b,c)};Vex.Flow.TabTie.prototype=new Vex.Flow.StaveTie;Vex.Flow.TabTie.prototype.constructor=Vex.Flow.TabTie;Vex.Flow.TabTie.superclass=Vex.Flow.StaveTie.prototype;Vex.Flow.TabTie.createHammeron=function(b){return new Vex.Flow.TabTie(b,"H")};Vex.Flow.TabTie.createPulloff=function(b){return new Vex.Flow.TabTie(b,"P")};
Vex.Flow.TabTie.prototype.init=function(b,c){Vex.Flow.TabTie.superclass.init.call(this,b,c);this.render_options.cp1=9;this.render_options.cp2=11;this.render_options.y_shift=3;this.setNotes(b)};
Vex.Flow.TabTie.prototype.draw=function(){if(!this.context)throw new Vex.RERR("NoContext","No context to render tie.");var b=this.first_note,c=this.last_note,d,e,f;if(b){d=b.getTieRightX()+this.render_options.tie_spacing;f=b.getYs()}else{d=c.getStave().getTieStartX();f=c.getYs();this.first_indices=this.last_indices}if(c){e=c.getTieLeftX()+this.render_options.tie_spacing;b=c.getYs()}else{e=b.getStave().getTieEndX();b=b.getYs();this.last_indices=this.first_indices}this.renderTie({first_x_px:d,last_x_px:e,
first_ys:f,last_ys:b,direction:-1});this.renderText(d,e);return true};Vex.Flow.TabSlide=function(b,c){arguments.length>0&&this.init(b,c)};Vex.Flow.TabSlide.prototype=new Vex.Flow.TabTie;Vex.Flow.TabSlide.prototype.constructor=Vex.Flow.TabSlide;Vex.Flow.TabSlide.superclass=Vex.Flow.TabTie.prototype;Vex.Flow.TabSlide.SLIDE_UP=1;Vex.Flow.TabSlide.SLIDE_DOWN=-1;Vex.Flow.TabSlide.createSlideUp=function(b){return new Vex.Flow.TabSlide(b,Vex.Flow.TabSlide.SLIDE_UP)};Vex.Flow.TabSlide.createSlideDown=function(b){return new Vex.Flow.TabSlide(b,Vex.Flow.TabSlide.SLIDE_DOWN)};
Vex.Flow.TabSlide.prototype.init=function(b,c){Vex.Flow.TabSlide.superclass.init.call(this,b,"sl.");if(!c){c=b.first_note.getPositions()[0].fret;var d=b.last_note.getPositions()[0].fret;c=parseInt(c)>parseInt(d)?Vex.Flow.TabSlide.SLIDE_DOWN:Vex.Flow.TabSlide.SLIDE_UP}this.slide_direction=c;this.render_options.cp1=11;this.render_options.cp2=14;this.render_options.y_shift=0.5;this.setFont({font:"Times",size:10,style:"bold italic"});this.setNotes(b)};
Vex.Flow.TabSlide.prototype.renderTie=function(b){if(b.first_ys.length==0||b.last_ys.length==0)throw new Vex.RERR("BadArguments","No Y-values to render");var c=this.context,d=b.first_x_px,e=b.first_ys;b=b.last_x_px;var f=this.slide_direction;if(f!=Vex.Flow.TabSlide.SLIDE_UP&&f!=Vex.Flow.TabSlide.SLIDE_DOWN)throw new Vex.RERR("BadSlide","Invalid slide direction");for(var g=0;g<this.first_indices.length;++g){var h=e[this.first_indices[g]]+this.render_options.y_shift;if(isNaN(h))throw new Vex.RERR("BadArguments",
"Bad indices for slide rendering.");c.beginPath();c.moveTo(d+5,h+3*f);c.lineTo(b-5,h-3*f);c.closePath();c.stroke()}};Vex.Flow.Bend=function(b,c){arguments.length>0&&this.init(b,c)};Vex.Flow.Bend.prototype=new Vex.Flow.Modifier;Vex.Flow.Bend.prototype.constructor=Vex.Flow.Bend;Vex.Flow.Bend.superclass=Vex.Flow.Modifier.prototype;a=Vex.Flow.Bend.prototype;
a.init=function(b,c){Vex.Flow.Bend.superclass.init.call(this);this.text=b;this.release=c||false;this.font="bold 8pt Arial";this.render_options={bend_width:8,release_width:8};this.bend_width=this.render_options.bend_width;this.release_width=this.release?this.render_options.release_width:0;this.updateWidth()};a.getCategory=function(){return"bends"};a.getText=function(){return this.text};a.updateWidth=function(){this.setWidth(this.bend_width+this.release_width+Vex.Flow.textWidth(this.text)/2)};
a.setBendWidth=function(b){this.bend_width=b;this.updateWidth()};a.setReleaseWidth=function(b){this.release_width=b;this.updateWidth()};a.hasRelease=function(){return this.release};a.setFont=function(b){this.font=b;return this};
a.draw=function(){function b(k,i){var j=k+f.bend_width;e.beginPath();e.moveTo(k,i);e.quadraticCurveTo(j,i,k+f.bend_width,g);f.release&&e.quadraticCurveTo(k+f.bend_width+f.release_width+2,g,k+f.bend_width+f.release_width,i);e.stroke()}function c(k,i,j){j=j||1;e.beginPath();e.moveTo(k,i);e.lineTo(k-3,i+3*j);e.lineTo(k+3,i+3*j);e.closePath();e.fill()}if(!this.context)throw new Vex.RERR("NoContext","Can't draw bend without a context.");if(!(this.note&&this.index!=null))throw new Vex.RERR("NoNoteForBend",
"Can't draw bend without a note or index.");var d=this.note.getModifierStartXY(Vex.Flow.Modifier.Position.RIGHT,this.index),e=this.context,f=this,g=this.note.getStave().getYForTopText(this.text_line)+2;b(d.x,d.y+0.5);this.release?c(d.x+this.bend_width+this.release_width,d.y+0.5,-1):c(d.x+this.bend_width,g);var h=this.note.getStave().getYForTopText(this.text_line);d=d.x+this.bend_width-Vex.Flow.textWidth(this.text)/2;e.save();e.font=this.font;e.fillText(this.text,d,h);e.restore()};Vex.Flow.Vibrato=function(){this.init()};Vex.Flow.Vibrato.prototype=new Vex.Flow.Modifier;Vex.Flow.Vibrato.prototype.constructor=Vex.Flow.Vibrato;Vex.Flow.Vibrato.superclass=Vex.Flow.Modifier.prototype;a=Vex.Flow.Vibrato.prototype;a.init=function(){Vex.Flow.Vibrato.superclass.init.call(this);this.harsh=false;this.position=Vex.Flow.Modifier.Position.RIGHT;this.render_options={vibrato_width:20,wave_height:6,wave_width:4,wave_girth:2};this.setVibratoWidth(this.render_options.vibrato_width)};
a.getCategory=function(){return"vibratos"};a.setVibratoWidth=function(b){this.vibrato_width=b;this.setWidth(this.vibrato_width);return this};a.setHarsh=function(b){this.harsh=b;return this};
a.draw=function(){function b(h,k){var i=d.render_options.wave_width,j=d.render_options.wave_girth,l=d.render_options.wave_height,o=e/i;c.beginPath();if(d.harsh){c.moveTo(h,k+j+1);for(var n=0;n<o/2;++n){c.lineTo(h+i,k-l/2);h+=i;c.lineTo(h+i,k+l/2);h+=i}for(n=0;n<o/2;++n){c.lineTo(h-i,k-l/2+j+1);h-=i;c.lineTo(h-i,k+l/2+j+1);h-=i}}else{c.moveTo(h,k+j);for(n=0;n<o/2;++n){c.quadraticCurveTo(h+i/2,k-l/2,h+i,k);h+=i;c.quadraticCurveTo(h+i/2,k+l/2,h+i,k);h+=i}for(n=0;n<o/2;++n){c.quadraticCurveTo(h-i/2,k+
l/2+j,h-i,k+j);h-=i;c.quadraticCurveTo(h-i/2,k-l/2+j,h-i,k+j);h-=i}}c.fill()}if(!this.context)throw new Vex.RERR("NoContext","Can't draw vibrato without a context.");if(!this.note)throw new Vex.RERR("NoNoteForVibrato","Can't draw vibrato without an attached note.");var c=this.context,d=this,e=this.vibrato_width,f=this.note.getModifierStartXY(Vex.Flow.Modifier.Position.RIGHT,this.index).x+this.x_shift,g=this.note.getStave().getYForTopText(this.text_line)+2;b(f,g)};Vex.Flow.Annotation=function(b){arguments.length>0&&this.init(b)};Vex.Flow.Annotation.prototype=new Vex.Flow.Modifier;Vex.Flow.Annotation.prototype.constructor=Vex.Flow.Annotation;Vex.Flow.Annotation.superclass=Vex.Flow.Modifier.prototype;a=Vex.Flow.Annotation.prototype;a.init=function(b){Vex.Flow.Annotation.superclass.init.call(this);this.index=this.note=null;this.text_line=0;this.text=b;this.font={family:"Arial",size:8,weight:"bold"};this.setWidth(Vex.Flow.textWidth(b))};a.getCategory=function(){return"annotations"};
a.setTextLine=function(b){this.text_line=b;return this};a.setFont=function(b,c,d){this.font={family:b,size:c,weight:d};return this};
a.draw=function(){if(!this.context)throw new Vex.RERR("NoContext","Can't draw vibrato without a context.");if(!this.note)throw new Vex.RERR("NoNoteForAnnotation","Can't draw vibrato without an attached note.");var b=this.note.getModifierStartXY(Vex.Flow.Modifier.Position.LEFT,this.index).x-this.getWidth()/2+2,c=this.note.getStave().getYForTopText(this.text_line);this.context.save();this.context.setFont(this.font.family,this.font.size,this.font.weight);this.context.fillText(this.text,b,c);this.context.restore()};Vex.Flow.Tuning=function(b){this.init(b)};a=Vex.Flow.Tuning.prototype;a.init=function(b){this.setTuning(b||"E/5,B/4,G/4,D/4,A/3,E/3")};a.noteToInteger=function(b){return Vex.Flow.keyProperties(b).int_value};a.setTuning=function(b){this.tuningString=b;this.tuningValues=[];this.numStrings=0;var c=b.split(/\s*,\s*/);if(c.length==0)throw new Vex.RERR("BadArguments","Invalid tuning string: "+b);this.numStrings=c.length;for(b=0;b<this.numStrings;++b)this.tuningValues[b]=this.noteToInteger(c[b])};
a.getValueForString=function(b){var c=parseInt(b);if(c<1||c>this.numStrings)throw new Vex.RERR("BadArguments","String number must be between 1 and "+this.numStrings+": "+b);return this.tuningValues[c-1]};a.getValueForFret=function(b,c){c=this.getValueForString(c);var d=parseInt(b);if(d<0)throw new Vex.RERR("BadArguments","Fret number must be 0 or higher: "+b);return c+d};a.getNoteForFret=function(b,c){b=this.getValueForFret(b,c);c=Math.floor(b/12);return Vex.Flow.integerToNote(b%12)+"/"+c};Vex.Flow.Renderer=function(b,c){arguments.length>0&&this.init(b,c)};Vex.Flow.Renderer.Backends={CANVAS:1,RAPHAEL:2,SVG:3,VML:4};Vex.Flow.Renderer.buildContext=function(b,c,d,e){b=new Vex.Flow.Renderer(b,c);d&&e&&b.resize(d,e);return b.getContext()};Vex.Flow.Renderer.getCanvasContext=function(b,c,d){return Vex.Flow.Renderer.buildContext(b,Vex.Flow.Renderer.Backends.CANVAS,c,d)};
Vex.Flow.Renderer.getRaphaelContext=function(b,c,d){return Vex.Flow.Renderer.buildContext(b,Vex.Flow.Renderer.Backends.RAPHAEL,c,d)};Vex.Flow.Renderer.bolsterCanvasContext=function(b){b.clear=function(){b.clearRect(0,0,2E3,2E3)};b.setFont=function(c,d,e){this.font=(e||"")+" "+d+"pt "+c;return this};b.setFillStyle=function(c){this.fillStyle=c;return this};b.setStrokeStyle=function(c){this.strokeStyle=c;return this};return b};
Vex.Flow.Renderer.prototype.init=function(b,c){this.sel=b;if(!this.sel)throw new Vex.RERR("BadArgument","Invalid selector for renderer.");this.element=document.getElementById(b);if(!this.element)this.element=b;this.paper=this.ctx=null;this.backend=c;if(this.backend==Vex.Flow.Renderer.Backends.CANVAS){if(!this.element.getContext)throw new Vex.RERR("BadElement","Can't get canvas context from element: "+b);this.ctx=Vex.Flow.Renderer.bolsterCanvasContext(this.element.getContext("2d"))}else if(this.backend==
Vex.Flow.Renderer.Backends.RAPHAEL)this.ctx=new Vex.Flow.RaphaelContext(this.element);else throw new Vex.RERR("InvalidBackend","No support for backend: "+this.backend);};
Vex.Flow.Renderer.prototype.resize=function(b,c){if(this.backend==Vex.Flow.Renderer.Backends.CANVAS){if(!this.element.getContext)throw new Vex.RERR("BadElement","Can't get canvas context from element: "+sel);this.element.width=b;this.element.height=c;this.ctx=Vex.Flow.Renderer.bolsterCanvasContext(this.element.getContext("2d"))}else this.ctx.resize(b,c);return this};Vex.Flow.Renderer.prototype.getContext=function(){return this.ctx};Vex.Flow.RaphaelContext=function(b){arguments.length>0&&this.init(b)};a=Vex.Flow.RaphaelContext.prototype;a.init=function(b){this.element=b;this.paper=Raphael(b);this.path="";this.state={scale:{x:1,y:1},font_family:"Arial",font_size:8,font_weight:800};this.attributes={"stroke-width":0.3,fill:"black",font:"8pt Arial"};this.state_stack=[]};
a.setFont=function(b,c,d){this.state.font_family=b;this.state.font_size=c;this.state.font_weight=d;this.attributes.font=(this.state.font_weight||"")+" "+this.state.font_size*this.state.scale.x+"pt "+this.state.font_family;return this};a.setFillStyle=function(b){this.attributes.fill=b;return this};a.setStrokeStyle=function(b){this.attributes.stroke=b;return this};
a.scale=function(b,c){this.state.scale={x:b,y:c};this.attributes.scale=b+","+c+",0,0";this.attributes.font=this.state.font_size*this.state.scale.x+"pt "+this.state.font_family;return this};a.clear=function(){this.paper.clear()};a.resize=function(b,c){this.element.style.width=b;this.paper.setSize(b,c);return this};a.fillRect=function(b,c,d,e){if(e<0){c+=e;e=-e}this.paper.rect(b,c,d-0.5,e-0.5).attr(this.attributes);return this};a.beginPath=function(){this.path="";return this};
a.moveTo=function(b,c){this.path+="M"+b+","+c;return this};a.lineTo=function(b,c){this.path+="L"+b+","+c;return this};a.bezierCurveTo=function(b,c,d,e,f,g){this.path+="C"+b+","+c+","+d+","+e+","+f+","+g;return this};a.quadraticCurveTo=function(b,c,d,e){this.path+="Q"+b+","+c+","+d+","+e;return this};a.fill=function(){this.paper.path(this.path).attr(this.attributes).attr("stroke-width",0);return this};
a.stroke=function(){this.paper.path(this.path).attr(this.attributes).attr("fill","none").attr("stroke-width",1);return this};a.closePath=function(){this.path+="Z";return this};a.fillText=function(b,c,d){var e=0;if(this.state.font_size==9)e=1;this.paper.text(c+Vex.Flow.textWidth(b)/2+2,d-this.state.font_size/(3.5*this.state.scale.y)+e,b).attr(this.attributes);return this};a.save=function(){this.state_stack.push({state:{font_family:this.state.font_family},attributes:{font:this.attributes.font}});return this};
a.restore=function(){var b=this.state_stack.pop();this.state.font_family=b.state.font_family;this.attributes.font=b.attributes.font;return this};

