Lines Matching refs:C

3 // Copyright (C) 2014-2020 Jean-Francois Moine - LGPL3+
6 var abc2svg={};abc2svg.C={BLEN:1536,BAR:0,CLEF:1,CUSTOS:2,GRACE:4,KEY:5,METER:6,MREST:7,NOTE:8,PART:9,REST:10,SPACE:11,STAVES:12,STBRK:13,TEMPO:14,BLOCK:16,REMARK:17,FULL:0,EMPTY:1,OVAL:2,OVALBARS:3,SQUARE:4,SL_ABOVE:0x01,SL_BELOW:0x02,SL_AUTO:0x03,SL_HIDDEN:0x04,SL_DOTTED:0x08};abc2svg.sym_name=['bar','clef','custos','','grace','key','meter','Zrest','note','part','rest','yspace','staves','Break','tempo','','block','remark']
40 abc2svg.Abc=function(user){"use strict";var C=abc2svg.C;var require=empty_function,system=empty_function,write=empty_function,XMLHttpRequest=empty_function;var OPEN_BRACE=0x01,CLOSE_BRACE=0x02,OPEN_BRACKET=0x04,CLOSE_BRACKET=0x08,OPEN_PARENTH=0x10,CLOSE_PARENTH=0x20,STOP_BAR=0x40,FL_VOICE=0x80,OPEN_BRACE2=0x0100,CLOSE_BRACE2=0x0200,OPEN_BRACKET2=0x0400,CLOSE_BRACKET2=0x0800,MASTER_VOICE=0x1000,IN=96,CM=37.8,YSTEP=256
42 var self=this,glovar={meter:{type:C.METER,wmeasure:1,a_meter:[]},},info={},parse={ctx:{},prefix:'%',state:0,ottava:[],line:new scanBuf},tunes=[],psvg
102 var decos={dot:"0 stc 5 1 1",tenuto:"0 emb 5 3 3",slide:"1 sld 3 7 0",arpeggio:"2 arp 12 10 0",roll:"3 roll 7 6 6",fermata:"3 hld 10 7 7",emphasis:"3 accent 7 4 4",lowermordent:"3 lmrd 10 5 5",coda:"3 coda 24 10 10",uppermordent:"3 umrd 10 5 5",segno:"3 sgno 22 8 8",trill:"3 trl 14 5 5",upbow:"3 upb 10 5 5",downbow:"3 dnb 9 5 5",gmark:"3 grm 6 5 5",wedge:"0 wedge 7 3 3",turnx:"3 turnx 10 0 5",breath:"3 brth 0 1 20",longphrase:"3 lphr 0 1 1",mediumphrase:"3 mphr 0 1 1",shortphrase:"3 sphr 0 1 1",invertedfermata:"3 hld 10 7 7",invertedturn:"3 turn 10 0 5",invertedturnx:"3 turnx 10 0 5","0":"3 fng 8 3 3 0","1":"3 fng 8 3 3 1","2":"3 fng 8 3 3 2","3":"3 fng 8 3 3 3","4":"3 fng 8 3 3 4","5":"3 fng 8 3 3 5",plus:"3 dplus 7 3 3","+":"3 dplus 7 3 3",accent:"3 accent 7 4 4",">":"3 accent 7 4 4",marcato:"3 marcato 9 3 3","^":"3 marcato 9 3 3",mordent:"3 lmrd 10 5 5",open:"3 opend 10 3 3",snap:"3 snap 14 3 3",thumb:"3 thumb 14 3 3",dacapo:"3 dacs 16 20 20 Da Capo",dacoda:"3 dacs 16 20 20 Da Coda","D.C.":"3 dcap 16 10 10","D.S.":"3 dsgn 16 10 10","D.C.alcoda":"3 dacs 16 38 38 D.C. al Coda","D.S.alcoda":"3 dacs 16 38 38 D.S. al Coda","D.C.alfine":"3 dacs 16 38 38 D.C. al Fine","D.S.alfine":"3 dacs 16 38 38 D.S. al Fine",fine:"3 dacs 16 10 10 Fine",turn:"3 turn 10 0 5","trill(":"3 ltr 8 4 0","trill)":"3 ltr 8 4 0",f:"6 f 18 1 7",ff:"6 ff 18 2 10",fff:"6 fff 18 4 13",ffff:"6 ffff 18 6 16",mf:"6 mf 18 6 13",mp:"6 mp 18 6 16",p:"6 p 18 2 8",pp:"6 pp 18 5 14",ppp:"6 ppp 18 8 20",pppp:"6 pppp 18 10 25",pralltriller:"3 umrd 10 5 5",sfz:"6 sfz 18 4 10",ped:"4 ped 18 6 10","ped-up":"4 pedoff 12 4 4","ped(":"4 lped 20 5 5","ped)":"4 lped 20 5 5","crescendo(":"6 cresc 18 0 0","crescendo)":"6 cresc 18 0 0","<(":"6 cresc 18 0 0","<)":"6 cresc 18 0 0","diminuendo(":"6 dim 18 0 0","diminuendo)":"6 dim 18 0 0",">(":"6 dim 18 0 0",">)":"6 dim 18 0 0","-(":"8 gliss 0 0 0","-)":"8 gliss 0 0 0","~(":"8 glisq 0 0 0","~)":"8 glisq 0 0 0","8va(":"3 8va 10 0 0","8va)":"3 8va 10 0 0","8vb(":"4 8vb 10 0 0","8vb)":"4 8vb 10 0 0","15ma(":"3 15ma 10 0 0","15ma)":"3 15ma 10 0 0","15mb(":"4 15mb 10 0 0","15mb)":"4 15mb 10 0 0",invisible:"32 0 0 0 0",beamon:"33 0 0 0 0",trem1:"34 0 0 0 0",trem2:"34 0 0 0 0",trem3:"34 0 0 0 0",trem4:"34 0 0 0 0",xstem:"35 0 0 0 0",beambr1:"36 0 0 0 0",beambr2:"36 0 0 0 0",rbstop:"37 0 0 0 0","/":"38 0 0 6 6","//":"38 0 0 6 6","///":"38 0 0 6 6","beam-accel":"39 0 0 0 0","beam-rall":"39 0 0 0 0",stemless:"40 0 0 0 0",rbend:"41 0 0 0 0",editorial:"42 0 0 0 0","sacc-1":"3 sacc-1 6,4 4 4",sacc3:"3 sacc3 6,5 4 4",sacc1:"3 sacc1 6,4 4 4",courtesy:"43 0 0 0 0","cacc-1":"3 cacc-1 0 0 0",cacc3:"3 cacc3 0 0 0",cacc1:"3 cacc1 0 0 0"},f_near=[true,true,true],f_note=[false,false,false,true,true,true,false,false,true],f_staff=[false,false,false,false,false,false,true,true]
124 function up_p(s,pos){switch(pos){case C.SL_ABOVE:return true
125 case C.SL_BELOW:return false}
130 return s.pos.voc!=C.SL_ABOVE}
132 if(s.type==C.NOTE){for(m=0;m<=s.nhd;m++){if(s.notes[m].acc){dx=5+s.notes[m].shac}else{dx=6-s.notes[m].shhd
133 switch(s.head){case C.SQUARE:dx+=3.5
135 case C.OVALBARS:case C.OVAL:dx+=2
179 if(s.type==C.NOTE)
200 switch(s.head){case C.SQUARE:dx+=3.5
202 case C.OVALBARS:case C.OVAL:dx+=2
221 if(s2.type==C.NOTE)
249 if(dd.func==4){up=0}else if(s.pos){switch(s.pos.orn){case C.SL_ABOVE:up=1
251 case C.SL_BELOW:up=0
289 if(isNaN(c_func)){error(1,null,"%%deco: bad C function value '$1'",a[1])
291 if(c_func>10&&(c_func<32||c_func>43)){error(1,null,"%%deco: bad C function index '$1'",c_func)
323 switch(dd.func){case 0:if(s.type==C.BAR&&dd.name=="dot"){s.bar_dotted=true
328 case 8:if(s.type!=C.NOTE){error(1,s,errs.must_note,dd.name)
348 case 33:if(s.type!=C.BAR){error(1,s,"!beamon! must be on a bar")
352 case 34:if(s.type!=C.NOTE||!prev||prev.type!=C.NOTE||s.dur!=prev.dur){error(1,s,"!$1! must be on the last of a couple of notes",dd.name)
358 case 35:if(s.type!=C.NOTE){error(1,s,errs.must_note,dd.name)
361 case 36:if(s.type!=C.NOTE){error(1,s,errs.must_note,dd.name)
370 case 38:if(s.type!=C.NOTE){error(1,s,errs.must_note,dd.name)
374 case 39:if(s.type!=C.NOTE){error(1,s,errs.must_note,dd.name)
417 if(wl!=0&&s.prev&&s.prev.type==C.BAR)
486 if(pos==C.SL_HIDDEN)
489 if(s.type==C.BAR)
545 for(s=tsfirst;s;s=s.ts_next){switch(s.type){case C.CLEF:case C.KEY:case C.METER:continue}
549 for(;s;s=s.ts_next){switch(s.type){case C.BAR:case C.MREST:case C.NOTE:case C.REST:case C.SPACE:break
550 case C.GRACE:for(g=s.extra;g;g=g.next)
562 for(s=p_voice.sym;s;s=s.next){if(s.type!=C.BAR)
601 if(s.type!=C.BAR){w=s.rbstop?0:s.x-realwidth+4}else if((s.bar_type.length>1&&s.bar_type!="[]")||s.bar_type=="]"){if(s1.st>0&&!(cur_sy.staves[s1.st-1].flags&STOP_BAR))
610 if(!s.next&&!s.rbstop&&!p_voice.bar_start){p_voice.bar_start=clone(s);p_voice.bar_start.type=C.BAR;p_voice.bar_start.bar_type=""
660 y=staff_tb[st].topbar+14;xy_str(0,y,bar_num.toString());y_set(st,true,0,20,y+gene.curfont.size+2)}else if(bar_num%cfmt.measurenb==0){for(;;s=s.ts_next){switch(s.type){case C.CLEF:case C.KEY:case C.METER:case C.STBRK:continue}
662 if(s.type!=C.BAR||!s.bar_num){if(s.prev)
675 for(;s;s=s.ts_next){switch(s.type){case C.STAVES:sy=s.sy
681 case C.BAR:if(!s.bar_num||s.bar_num<=1)
697 if(s.next.type==C.NOTE){if(s.next.stem>0){if(y<s.next.ys-gene.curfont.size)
709 for(s=tsfirst;s;s=s.ts_next){if(s.type!=C.TEMPO||s.invis)
724 for(s=some_tempo;s;s=s.ts_next){if(s.type!=C.TEMPO||s.invis)
728 while(s.ts_next&&s.ts_next.type==C.TEMPO)
731 for(s=tsfirst;s;s=s.ts_next){if(s.type!=C.PART||s.invis)
741 for(s=some_part;s;s=s.ts_next){if(s.type!=C.PART||s.invis)
745 while(s.ts_next&&s.ts_next.type==C.PART)
781 for(s2=s1;;s2=s2.next){if(s2.type==C.NOTE){if(s2.nflags>nflags)
791 if(!s2.next){for(;;s2=s2.prev){if(s2.type==C.NOTE)
809 for(s=s1;;s=s.next){if(s.type!=C.NOTE)
835 while(s.ts_prev&&s.ts_prev.type==C.NOTE&&s.ts_prev.time==s.time&&s.ts_prev.x>s1.xs)
837 for(;s&&s.time<=s2.time;s=s.ts_next){if(s.type!=C.NOTE||s.invis||(s.st!=st&&s.v!=v)){continue}
872 for(s=s1.next;;s=s.next){switch(s.type){case C.REST:g=s.ts_next
873 if(!g||g.st!=st||(g.type!=C.NOTE&&g.type!=C.REST))
875 case C.BAR:if(s.invis)
877 case C.CLEF:y=a*s.x+b
888 case C.GRACE:for(g=s.extra;g;g=g.next){y=a*g.x+b
903 for(s=s1;;s=s.next){switch(s.type){case C.NOTE:s.ys=a*s.xs+b-staff_tb[s.st].y
907 case C.REST:y=a*s.x+b-staff_tb[s.st].y
909 +(s.head!=C.FULL?4:9)
919 if(s.head!=C.FULL)
932 if(s.trem2&&n>nflags){if(s.dur>=C.BLEN/2){x1=s.x+6;x2=bm.s2.x-6}else if(s.dur<C.BLEN/4){x1+=5;x2-=6}}
942 for(s=s1;;s=s.next){if(s.type==C.NOTE&&s.stem!=beam_dir)
956 for(s=s1;;s=s.next){if(s.type!=C.NOTE||s.nflags<i){if(s==s2)
959 if(s.trem1&&i>s.nflags-s.ntrem){x1=(s.dur>=C.BLEN/2)?s.x:s.xs;draw_beam(x1-5,x1+5,(shift+2.5)*beam_dir,bh,bm,i)
967 if(k.type==C.NOTE||k.type==C.REST){if(k.trem1){if(k.nflags-k.ntrem<i)
973 while(k2.type!=C.NOTE)
976 while(k.type!=C.NOTE)
979 while(k1.type!=C.NOTE)
1142 if(s.dur_orig==s.p_v.meter.wmeasure||(s.rep_nb&&s.rep_nb>=0)){if(s.dur<C.BLEN*2)
1144 else if(s.dur<C.BLEN*4)
1211 if(s.p_v.ckey.k_bagpipe||!cfmt.graceslurs||slur||s.tie_s||!s.next||s.next.type!=C.NOTE)
1260 p=p.slice(i+1)}}else if(s.type==C.CUSTOS){p="custos"}else{switch(head){case C.OVAL:p="HD"
1262 case C.OVALBARS:if(s.head!=C.SQUARE){p="HDD"
1264 case C.SQUARE:if(nflags>-4){p="breve"}else{p="longa"
1266 if(!tsnext&&s.next&&s.next.type==C.BAR&&!s.next.next)
1270 case C.EMPTY:p="Hd"
1310 if(s.head==C.FULL||s.head==C.EMPTY){x1+=(s.grace?GSTEM_XOFF:3.5)*s.stem
1326 while(s.type!=C.CLEF)
1328 if(s.next&&s.next.type==C.KEY)
1330 if(s.next&&s.next.type==C.METER)
1344 for(s=k1;;s=s.next){if(s.type==C.NOTE){if(!s.stemless){if(s.stem<0)
1386 function draw_slur(path,not1,sl){var i,k,g,x1,y1,x2,y2,height,addy,a,y,z,h,dx,dy,ty=sl.ty,dir=(ty&0x07)==C.SL_ABOVE?1:-1,n=path.length,i1=0,i2=n-1,k1=path[0],k2=path[i2]
1390 if(k.type==C.NOTE||k.type==C.REST){nn++
1401 if(k1.type==C.NOTE){if(dir>0){if(k1.stem>0){x1+=5
1406 if(k2.type==C.NOTE){if(dir>0){if(k2.stem>0){x2+=1
1411 if(k1.type!=C.NOTE){y1=y2+1.2*dir;x1=k1.x+k1.wr*.5
1414 if(k2.type!=C.NOTE){if(k1.type==C.NOTE)
1421 if(k.type!=C.BAR&&k.x<x1+48){if(dir>0){y=k.ymx-2
1427 if(k.type!=C.BAR&&k.x>x2-48){if(dir>0){y=k.ymx-2
1455 switch(k.type){case C.NOTE:case C.REST:if(dir>0){y=3*(k.notes[k.nhd].pit-18)+6
1465 case C.GRACE:for(g=k.extra;g;g=g.next){if(dir>0){y=3*(g.notes[g.nhd].pit-18)+6
1493 height*=cfmt.slurheight;slur_out(x1,y1,x2,y2,dir,height,ty&C.SL_DOTTED);dx=x2-x1;a=(y2-y1)/dx;addy=y1-a*x1
1522 switch(sl.ty&0x07){case C.SL_ABOVE:dir=1;break
1523 case C.SL_BELOW:dir=-1;break
1526 sl.ty|=dir>0?C.SL_ABOVE:C.SL_BELOW
1566 if(s.type==C.GRACE){gr1=s;s=s.extra
1589 for(s2=s1;s2;s2=s2.next){switch(s2.type){case C.GRACE:for(g=s2.extra;g;g=g.next){if(g.sls||g.sl1)
1592 case C.NOTE:case C.REST:break}
1609 while(s3.type!=C.NOTE)
1611 dir=s3.stem>0?C.SL_ABOVE:C.SL_BELOW}
1612 if(s1==s2||tp.f[1]==2){nb_only=true}else if(tp.f[1]==1){nb_only=true;draw_slur([s1,s2],null,{ty:dir})}else{if(tp.f[0]!=2&&s1.type==C.NOTE&&s2.type==C.NOTE){nb_only=true
1613 for(s3=s1;;s3=s3.next){if(s3.type!=C.NOTE&&s3.type!=C.REST){if(s3.type==C.GRACE||s3.type==C.SPACE)
1621 if(nb_only&&!s1.beam_st&&!s1.beam_br1&&!s1.beam_br2){for(s3=s1.prev;s3;s3=s3.prev){if(s3.type==C.NOTE||s3.type==C.REST){if(s3.nflags>=s1.nflags)
1624 if(nb_only&&!s2.beam_end){for(s3=s2.next;s3;s3=s3.next){if(s3.type==C.NOTE||s3.type==C.REST){if(!s3.beam_br1&&!s3.beam_br2&&s3.nflags>=s2.nflags)
1631 if(dir==C.SL_ABOVE)
1646 if(dir==C.SL_ABOVE){ym+=gene.curfont.size
1661 if(dir==C.SL_ABOVE){if(s1.st==s2.st){y1=y2=staff_tb[upstaff].topbar+2}else{y1=s1.ymx;y2=s2.ymx}
1727 if(tp.f[2]==1){out_tubr(x1,y1+4,x2-x1,y2-y1,dir==C.SL_ABOVE);return}
1728 out_tubrn(x1,y1,x2-x1,y2-y1,dir==C.SL_ABOVE,tp.f[2]==0?tp.p.toString():tp.p+':'+tp.q);if(dir==C.SL_ABOVE)
1732 function draw_note_ties(not1,job){var m,x1,x2,s,y,h,time,not2=not1.tie_n,p=job==2?not1.pit:not2.pit,dir=(not1.tie_ty&0x07)==C.SL_ABOVE?1:-1,s1=not1.s,st=s1.st,s2=not2.s,x2=s2.x,sh=not1.shhd
1762 if(s2.type==C.BAR)
1778 slur_out(x1,y,x2,y,dir,h,not1.tie_ty&C.SL_DOTTED)}
1803 while(k3&&k3.time==time){if(k3.type!=C.NOTE||k3.st!=k1.st){k3=k3.ts_next
1821 function draw_ties_g(s1,s2,job){if(s1.type==C.GRACE){for(var g=s1.extra;g;g=g.next){if(g.tie_s)
1861 if(s.type==C.CLEF){clef_chg=true
1869 draw_ties_g(s1,s2,s2.type==C.NOTE?0:2)}}
1886 for(s=p_voice.sym;s;s=s.next){switch(s.type){case C.GRACE:for(g=s.extra;g;g=g.next){if(g.beam_st&&!g.beam_end){self.calculate_beam(bm,g)
1890 case C.NOTE:if((s.beam_st&&!s.beam_end)||(first_note&&!s.beam_st)){first_note=false;self.calculate_beam(bm,s)
1897 switch(s.type){case C.GRACE:for(g=s.extra;g;g=g.next){y_set(s.st,true,g.x-2,4,g.ymx+1);y_set(s.st,false,g.x-2,4,g.ymn-5)}
1899 case C.MREST:y_set(s.st,true,s.x+16,32,s.ymx+2)
1903 case C.NOTE:break}
2077 if(st!=0&&s.ts_prev&&s.ts_prev.type!=C.BAR)
2083 if(s.bar_mrep==1){for(s2=s.prev;s2.type!=C.REST;s2=s2.prev);xygl(s2.x,yb,"mrep")}else{xygl(x,yb,"mrep2")
2121 switch(s.type){case C.STAVES:staves_bar=s.ts_prev.type==C.BAR?s.ts_prev.x:0
2124 switch(s2.type){case C.BAR:case C.CLEF:case C.KEY:case C.METER:staves_bar=s2.x
2142 case C.BAR:if(s.second||s.invis||!s.bar_type)
2146 case C.STBRK:if(cur_sy.voices[s.v]&&cur_sy.voices[s.v].range==0){if(s.xmx>14){var nv=0
2149 for(s2=s.ts_next;s2;s2=s2.ts_next){if(s2.type!=C.STBRK)
2158 x2=s2.type==C.BAR?s2.x:s.x-s.xmx
2172 Abc.prototype.draw_symbols=function(p_voice){var bm={},s,g,x,y,st;for(s=p_voice.sym;s;s=s.next){if(s.invis){switch(s.type){case C.KEY:p_voice.ckey=s
2174 case C.NOTE:break}}
2177 switch(s.type){case C.NOTE:set_scale(s)
2184 case C.REST:if(!staff_tb[st].topbar)
2187 case C.BAR:break
2188 case C.CLEF:if(s.time>=staff_tb[st].clef.time)
2207 case C.METER:p_voice.meter=s
2212 case C.KEY:p_voice.ckey=s
2217 case C.MREST:set_scale(s);x+=32;anno_start(s);xygl(x,staff_tb[s.st].y+12,"mrest");out_XYAB('<text style="font:bold 15px serif"\n\
2220 case C.GRACE:set_scale(s);draw_gracenotes(s)
2222 case C.SPACE:case C.STBRK:break
2223 case C.CUSTOS:set_scale(s);draw_note(s,0)
2225 case C.BLOCK:case C.PART:case C.REMARK:case C.STAVES:case C.TEMPO:break
2268 if(s.multi!=0){dir=s.multi>0?C.SL_ABOVE:C.SL_BELOW
2270 if(!((ty&0x07)==C.SL_AUTO))
2272 s.notes[i].tie_ty=(ty&C.SL_DOTTED)|dir}
2278 if(ntie<=1){dir=s.stem<0?C.SL_ABOVE:C.SL_BELOW
2280 if(ty){if((ty&0x07)==C.SL_AUTO)
2281 s.notes[i].tie_ty=(ty&C.SL_DOTTED)|dir
2284 if(sec==0){if(ntie&1){ntie=(ntie-1)/2;dir=C.SL_BELOW
2289 dir=C.SL_ABOVE}
2290 if((ty&0x07)==C.SL_AUTO)
2291 s.notes[i].tie_ty=(ty&C.SL_DOTTED)|dir
2293 dir=C.SL_ABOVE}
2295 ntie/=2;dir=C.SL_BELOW
2299 if((ty&0x07)==C.SL_AUTO)
2300 s.notes[i].tie_ty=(ty&C.SL_DOTTED)|dir
2302 dir=C.SL_ABOVE}
2308 dir=C.SL_BELOW
2313 dir=C.SL_ABOVE
2314 if((ty&0x07)==C.SL_AUTO)
2315 s.notes[i].tie_ty=(ty&C.SL_DOTTED)|dir}}}
2326 if(s.notes[0].pit<20&&s.notes[0].tie_ty&&(s.notes[0].tie_ty&0x07)==C.SL_BELOW);else if(s.notes[s.nhd].pit>24&&s.notes[s.nhd].tie_ty&&(s.notes[s.nhd].tie_ty&0x07)==C.SL_ABOVE);else
2329 while(s2&&s2.type!=C.NOTE)
2846 var posval={above:C.SL_ABOVE,auto:0,below:C.SL_BELOW,down:C.SL_BELOW,hidden:C.SL_HIDDEN,opposite:C.SL_HIDDEN,under:C.SL_BELOW,up:C.SL_ABOVE}
3381 if((dur+1)&dur){if(s.type!=C.REST||dur_o!=s.p_v.wmeasure)
3386 if(flags>=0){head=C.FULL}else switch(flags){default:error(1,s,"Note too long")
3388 case-4:head=C.SQUARE
3390 case-3:head=cfmt.squarebreve?C.SQUARE:C.OVALBARS
3392 case-2:head=C.OVAL
3394 case-1:head=C.EMPTY
3416 if(d>3||(d>=2&&s.head!=C.SQUARE)){shift=false}else{shift=!shift
3478 while(s){if(s.type!=C.NOTE||s.invis){s=s.ts_next
3481 for(s2=s;s2;s2=s2.ts_next){if(s2.time!=t||s2.type!=C.NOTE||s2.st!=st)
3529 if(s.type==C.BAR&&s.prev&&s.prev.type==C.BAR&&s.prev.bar_type[0]!=':')
3532 p_voice.sym=null;p_voice.time=s.time;new_s=sym_add(p_voice,C.CLEF);new_s.next=s;s.prev=new_s;new_s.clef_type=clef_type;new_s.clef_line=clef_line;new_s.st=st;new_s.clef_small=true
3557 if(s1.type==C.NOTE)
3568 if(s1.type==C.NOTE)
3584 function set_graceoffs(s){var next,m,dx,x,gspleft=cfmt.gracespace[0],gspinside=cfmt.gracespace[1],gspright=cfmt.gracespace[2],g=s.extra;if(s.prev&&s.prev.type==C.BAR)
3604 if(next&&next.type==C.NOTE){if(g.y>=3*(next.notes[next.nhd].pit-18))
3616 if(w0){if(w0>x+ch.x){if(s.prev&&s.prev.type==C.BAR)
3622 if(s0==s||s0.type==C.BAR)
3642 switch(s.type){case C.NOTE:case C.REST:s.wr=wlnote=hw_tb[s.head]
3646 if(s2){switch(s2.type){case C.BAR:case C.CLEF:case C.KEY:case C.METER:wlnote+=3
3656 if(s2){switch(s2.type){case C.BAR:case C.CLEF:case C.KEY:case C.METER:wlnote-=3
3663 switch(s.head){case C.SQUARE:case C.OVALBARS:s.xmx+=3
3665 case C.OVAL:s.xmx+=1
3674 if(s2){switch(s2.type){case C.NOTE:if(s2.stem>0&&s.stem<0){if(wlw<7)
3681 case C.CLEF:if(s2.second||s2.clef_small)
3685 case C.KEY:wlw+=4
3691 if(s2&&s2.type==C.GRACE)
3696 case C.SPACE:xx=s.width/2;s.wr=xx
3702 case C.BAR:bar_type=s.bar_type
3712 if(s.next&&s.next.type!=C.METER)
3716 for(s2=s.prev;s2;s2=s2.prev){if(w_tb[s2.type]!=0){if(s2.type==C.GRACE)
3725 case C.CLEF:if(s.invis){s.wl=s.wr=1
3729 if(s.next&&s.next.type==C.BAR)
3732 case C.KEY:if((!s.k_a_acc&&!s.k_sf&&!s.k_old_sf)||s.k_none||s.k_play){s.wl=s.wr=0
3757 case C.METER:wlw=0;s.x_meter=[]
3759 switch(meter.top[0]){case'C':case'c':case'o':s.x_meter[i]=wlw+6;wlw+=12
3776 case C.MREST:s.wl=6;s.wr=66
3778 case C.GRACE:if(s.invis)
3784 case C.STBRK:s.wl=s.xmx
3785 if(s.next&&s.next.type==C.CLEF){s.wr=2
3788 case C.CUSTOS:s.wl=s.wr=4
3790 case C.TEMPO:tempo_build(s)
3792 case C.BLOCK:case C.PART:case C.REMARK:case C.STAVES:break
3797 if(smallest_duration>=C.BLEN/2){if(smallest_duration>=C.BLEN)
3800 len/=2}else if(!s.next&&len>=C.BLEN){len/=2}
3801 if(len>=C.BLEN/4){if(len<C.BLEN/2)
3803 else if(len<C.BLEN)
3805 else if(len<C.BLEN*2)
3807 else if(len<C.BLEN*4)
3810 i=9}else{if(len>=C.BLEN/8)
3812 else if(len>=C.BLEN/16)
3814 else if(len>=C.BLEN/32)
3816 else if(len>=C.BLEN/64)
3820 l=len-((C.BLEN/16/8)<<i)
3822 if(l){if(l<0){space=space_tb[0]*len/(C.BLEN/16/8)}else{if(i>=9)
3824 space+=(space_tb[i+1]-space_tb[i])*l/((C.BLEN/16/8)<<i)}}
3828 if(!len){switch(s.type){case C.MREST:return s.wl}
3830 if(s.ts_prev.type==C.MREST)
3833 while(!s.dur){switch(s.type){case C.BAR:return space*.9-7
3834 case C.CLEF:return space-s.wl-s.wr
3835 case C.BLOCK:case C.PART:case C.REMARK:case C.STAVES:case C.TEMPO:s=s.ts_next
3840 if(s.dur&&len<=C.BLEN/4){s2=s
3846 if(s.type==C.NOTE&&s.nflags>=-1&&s.stem>0){stemdir=true
3847 for(s2=s.ts_prev;s2&&s2.time==ptime;s2=s2.ts_prev){if(s2.type==C.NOTE&&(s2.nflags<-1||s2.stem>0)){stemdir=false
3849 if(stemdir){for(s2=s.ts_next;s2&&s2.time==s.time;s2=s2.ts_next){if(s2.type==C.NOTE&&(s2.nflags<-1||s2.stem<0)){stemdir=false
3867 function _bar(s){return{type:C.BAR,bar_type:"|",fname:s.fname,istart:s.istart,iend:s.iend,v:s.v,p_v:s.p_v,st:s.st,dur:0,nhd:0,notes:[{pit:s.notes?s.notes[0].pit:22}],prev:s}}
3904 if(!s2.shrink&&!s2.space&&s2.type==C.CLEF){delete s2.seqst;s2.time=tim}
3921 s.type=C.REST
3931 for(s3=s.prev;s3;s3=s3.prev){if(!s3.dur){if(s3.type==C.BAR){error(1,s3,"Bar in repeat sequence")
3939 for(s2=s;s2;s2=s2.next){if(!s2.dur){if(s2.type==C.BAR){error(1,s2,"Bar in repeat sequence")
3946 for(s2=s.prev;s2!=s3;s2=s2.prev){if(s2.type==C.NOTE){s2.beam_end=true
3959 s.head=C.SQUARE;for(s=s2;s;s=s.ts_next){if(s.st==st&&s.v==v&&s.dur)
3963 for(s2=s.prev.prev;s2;s2=s2.prev){if(s2.type==C.BAR||s2.time==tsfirst.time){if(--i<=0)
3972 for(s2=s;s2;s2=s2.next){if(s2.type==C.BAR){if(--i<=0)
3985 if(s2.type==C.BAR){if(s2.v==v)
3996 if(s2.type==C.BAR){if(s2.v==v)
4008 if(s2.type==C.BAR){if(s2.v==v)
4020 while(1){if(s2.type==C.NOTE)
4025 p_voice=s.p_v;p_voice.last_sym=s.prev;p_voice.time=s.time;new_s=sym_add(p_voice,C.CUSTOS);new_s.next=s;s.prev=new_s;lktsym(new_s,s);new_s.shrink=s.shrink
4028 for(i=0;i<s.notes.length;i++){new_s.notes[i]={pit:s2.notes[i].pit,shhd:0,dur:C.BLEN/4}}
4046 case C.KEY:case C.METER:case C.CLEF:continue}
4053 while(1){if(s.type!=C.BAR||s.v>s2.v)
4069 if(s.type!=C.BAR)
4072 for(s2=s;s2;s2=s2.ts_next){switch(s2.type){case C.KEY:if(!cfmt.keywarn||(!s2.k_a_acc&&!s2.k_sf&&!s2.k_old_sf)||s2.k_none||s2.k_play)
4074 for(s1=s.ts_prev;s1;s1=s1.ts_prev){if(s1.type!=C.METER)
4076 case C.METER:if(s2.type==C.METER){if(!cfmt.timewarn)
4079 case C.CLEF:if(!s2.prev)
4081 if(s2.type==C.CLEF){for(s1=s.ts_prev;s1;s1=s1.ts_prev){switch(s1.type){case C.BAR:case C.KEY:case C.METER:continue}
4102 switch(s.ts_prev.type){case C.STAVES:break
4103 case C.GRACE:s=s.next
4108 for(s=s.ts_prev;s;s=s.ts_prev){if(s.seqst&&s.type!=C.CLEF)
4119 switch(s.type){case C.STAVES:if(!s.ts_prev)
4121 if(s.ts_prev.type==C.BAR)
4123 while(s.ts_next){if(w_tb[s.ts_next.type]!=0&&s.ts_next.type!=C.CLEF)
4126 if(!s.ts_next||s.ts_next.type!=C.BAR)
4129 case C.BAR:if(done)
4132 case C.STBRK:if(!s.stbrk_forced)
4137 case C.CLEF:if(done)
4140 default:if(!done||(s.prev&&s.prev.type==C.GRACE))
4165 if(cfmt.keywarn&&next&&next.type==C.KEY&&!last.dur){ws[0]+=next.wr
4177 if(s.type==C.BAR)
4190 if(s.type!=C.BAR)
4208 if((s.time-bar_time)%(C.BLEN/4)==0){s3=s
4250 if(cfmt.barsperstaff){i=cfmt.barsperstaff;for(s2=s;s2;s2=s2.ts_next){if(s2.type!=C.BAR||!s2.bar_num||--i>0)
4252 while(s2.ts_next&&s2.ts_next.type==C.BAR)
4266 function set_yval(s){switch(s.type){case C.CLEF:if(s.second||s.invis){s.ymx=s.ymn=12
4288 case C.KEY:if(s.k_sf>2)
4305 switch(s.type){case C.REST:if(voice_tb.length==1)
4307 case C.NOTE:delta=staff_d[st]
4311 case C.GRACE:for(g=s.extra;g;g=g.next){delta=staff_d[st]
4319 s.type=C.REST
4322 s.head=C.FULL
4338 while(s3&&s3.v<s.v&&s3.type==C.BAR)
4341 if(s3.type==C.BAR)
4376 for(s=tsfirst;s;s=s.ts_next){if(s.type!=C.MREST)
4379 while(!s2.seqst){if(s2.type!=C.MREST||s2.nmes!=s.nmes)
4382 if(!s2.seqst){while(s.type==C.MREST){mexp(s)
4385 for(s=s_start;s;s=s.ts_next){if(s.type==C.STAVES&&s!=s_start)
4389 if(s.type!=C.NOTE){if(s.type==C.CLEF){if(s.clef_type!='a')
4406 for(s=s_start;s!=s_last;s=s.ts_next){if(s.type==C.STAVES&&s!=s_start)
4408 if(s.st!=st||s.type!=C.NOTE)
4415 if(s2&&s2.time==time&&s2.st==st&&s2.type==C.NOTE&&s2.notes[0].pit>=19)
4418 if(s2&&s2.st==st&&s2.time==time&&s2.type==C.NOTE&&s2.notes[0].pit>=19)
4423 if(s2&&s2.time==time&&s2.st==st&&s2.type==C.NOTE&&s2.notes[0].pit<=13)
4426 if(s2&&s2.st==st&&s2.time==time&&s2.type==C.NOTE&&s2.notes[0].pit<=13)
4433 if(s2.type==C.BAR&&s2.v==s.v){s3=s2.bar_type[0]!=':'?s2:s2.next
4435 if(s2.type!=C.NOTE)
4469 switch(s.type){case C.STAVES:sy=s.sy
4505 if(g.type!=C.CLEF){g=insert_clef(g,new_type,new_line)
4512 case C.CLEF:break}
4537 Abc.prototype.set_pitch=function(last_s){var s,s2,g,st,delta,pitch,note,dur=C.BLEN,m=nstaff+1,staff_delta=new Int16Array(new Array(m*2)),sy=cur_sy
4545 switch(s.type){case C.CLEF:staff_delta[st]=delta_tb[s.clef_type]+
4554 case C.GRACE:for(g=s.extra;g;g=g.next){delta=staff_delta[g.st]
4560 case C.KEY:s.k_y_clef=staff_delta[st]
4563 case C.MREST:if(s.invis)
4567 case C.REST:if(voice_tb.length==1){s.y=12;s.ymx=24;s.ymn=0
4569 case C.NOTE:delta=staff_delta[st]
4573 if(s.type==C.REST){s.y=(((s.notes[0].pit-18)/2)|0)*6;s.ymx=s.y+rest_sp[5-s.nflags][0];s.ymn=s.y-rest_sp[5-s.nflags][1]}
4583 for(u=s;u;u=u.ts_next){if(u.type==C.BAR)
4584 break;if(u.type==C.STAVES){if(u!=s)
4591 if((u.type!=C.NOTE&&u.type!=C.REST)||u.invis)
4608 if(u.type!=C.NOTE)
4614 if(u.xstem){if(u.ts_prev.st!=st-1||u.ts_prev.type!=C.NOTE){error(1,s,"Bad !xstem!");u.xstem=false}else{u.ts_prev.multi=1;u.multi=1;u.stemless=true}}}
4618 case C.REST:if((s.combine!=undefined&&s.combine<0)||!s.ts_next||s.ts_next.type!=C.REST||s.ts_next.st!=s.st||s.time!=s.ts_next.time||s.dur!=s.ts_next.dur||(s.a_dd&&s.ts_next.a_dd)||(s.a_gch&&s.ts_next.a_gch)||s.invis)
4626 case C.NOTE:case C.GRACE:break}
4646 while(s&&s.type==C.BAR)
4651 if(s.type==C.STAVES)
4659 if(s.type!=C.REST)
4723 while(s){switch(s.type){case C.CLEF:case C.KEY:case C.METER:switch(s.type){case C.CLEF:staff_tb[s.st].clef=s
4725 case C.KEY:s.p_v.ckey=s
4727 case C.METER:s.p_v.meter=s
4731 case C.PART:case C.TEMPO:case C.BLOCK:case C.REMARK:s=s.ts_next
4751 if(last_s.type==C.CLEF)
4771 if(p_voice.sls.length){s={type:C.BAR,fname:last_s.fname,bar_type:"|",dur:0,multi:0,invis:true,sls:p_voice.sls}
4777 switch(s3.type){case C.PART:case C.TEMPO:continue
4778 case C.BAR:p_voice.last_sym=s3
4786 if(p_voice.last_sym.type==C.BAR){if(!p_voice.last_sym.rbstop)
4808 if(s.type!=C.BAR){s2=_bar(s)
4815 for(s=p_voice.sym;s;s=s.next){if(s.type==C.NOTE){pitch=s.notes[0].pit
4819 switch(s.type){case C.MREST:start_flag=true
4821 case C.BAR:s.bar_type=bar_cnv(s.bar_type)
4824 if(!s.next&&s.prev&&!s.invis&&s.prev.head==C.OVALBARS)
4825 s.prev.head=C.SQUARE
4827 case C.GRACE:for(s2=s.extra;s2;s2=s2.next)
4830 case C.NOTE:case C.REST:res=identify_note(s,s.dur_orig);s.head=res[0];s.dots=res[1];s.nflags=res[2]
4849 if(s.type==C.REST&&s.beam_end&&!s.beam_on){s.beam_end=false;start_flag=true}
4851 if(nflags<=0){s.beam_st=true;s.beam_end=true}else if(s.type==C.NOTE||s.beam_on){s.beam_st=true;start_flag=false}}
4854 if(s.type==C.NOTE||s.beam_on)
4857 if(s.type==C.NOTE){if(s.nhd)
4860 for(s2=s.prev;s2;s2=s2.prev){if(s2.type!=C.REST)
4869 while(s){if(s.type!=C.BAR||!s.rbstart||s.norepbra){s=s.next
4872 for(s=s.next;s;s=s.next){if(s.type!=C.BAR)
4932 for(s=sym;s;s=s.next){if(s.type!=C.NOTE){if(s.type!=C.GRACE)
4943 for(g=s;g;g=g.next){if(g.type!=C.NOTE){continue}
4953 for(g=s.next;g;g=g.next){if(g.type!=C.NOTE){continue}
4982 if((l1=s1.dur)>=C.BLEN)
4984 if((l2=s2.dur)>=C.BLEN)
5018 if(l1<C.BLEN/2){if(s2.dots)
5021 head=1}else if(l2<C.BLEN/4){if(s1.shiftunison&&(s1.shiftunison&2))
5023 head=s2.dur>=C.BLEN/2?2:1}else{return false}}
5068 if(s.head!=C.SQUARE)
5105 if(s.head!=C.SQUARE)
5114 for(s=tsfirst;s;s=s.ts_next){if(s.type!=C.NOTE||s.invis){if(s.type==C.STAVES)
5124 if(s2.type==C.NOTE&&!s2.invis&&s2.st==s.st)
5146 if(s3&&s3.time==s1.time&&s3.st==s1.st&&s3.type==C.NOTE&&!s3.invis){right3=set_right(s3)
5251 for(s=tsfirst;s;s=s.ts_next){if(s.type!=C.NOTE){if(s.type!=C.GRACE)
5268 for(s2=s.next;;s2=s2.next){if(s2.type==C.NOTE){if(s.feathered_beam)
5305 if(s.st==st&&s.type!=C.CLEF){s.st++;s.invis=true}}}
5380 if(tsfirst.type==C.STAVES){s=tsfirst
5392 switch(s.type){case C.STAVES:set_brace();sy.st_print=new Uint8Array(non_empty);sy=s.sy;while(nstaff<sy.nstaff)
5396 case C.BLOCK:if(!s.play){blocks.push(s)
5400 if(st>nstaff){switch(s.type){case C.CLEF:staff_tb[st].clef=s
5402 case C.KEY:s.p_v.ckey=s
5404 case C.METER:s.p_v.meter=s
5411 case C.BAR:if(s.bar_mrep||sy.staves[st].staffnonote>1)
5414 case C.GRACE:break
5415 case C.NOTE:case C.REST:case C.SPACE:case C.MREST:if(sy.staves[st].staffnonote>1)
5419 if(sy.staves[st].staffnonote||s.type==C.NOTE)
5436 for(s=tsfirst;s;s=s.ts_next){if(s.type==C.GRACE&&!some_grace)
5442 ll=!tsnext||(tsnext.type==C.BLOCK&&!tsnext.play)||blocks.length
5461 for(s=some_grace;s;s=s.ts_next){if(s.type!=C.GRACE)
5483 switch(s.type){case C.NOTE:case C.REST:case C.MREST:case C.SPACE:set_page()
5486 case C.STAVES:cur_sy=s.sy
5488 case C.BLOCK:if(s.play)
5541 function new_clef(clef_def){var s={type:C.CLEF,clef_line:2,clef_type:"t",v:curvoice.v,p_v:curvoice,time:curvoice.time,dur:0},i=1
5548 case'C':s.clef_type="c";s.clef_line=3
5637 function new_block(subtype){var s={type:C.BLOCK,subtype:subtype,dur:0}
5780 function new_key(param){var i,clef,key_end,c,tmp,exp,sf="FCGDAEB".indexOf(param[0])-1,mode=0,s={type:C.KEY,dur:0}
5849 function new_meter(p){var s={type:C.METER,dur:0,a_meter:[]},meter={},val,v,m1=0,m2,i=0,j,wmeasure,in_parenth;set_ref(s)
5853 switch(p[i]){case'C':meter.top=p[i++]
5896 m2=parseInt(meter.bot);wmeasure+=m1*C.BLEN/m2}
5904 wmeasure=C.BLEN*val[1]/val[2]}
5909 if(parse.state>=1){if(!glovar.ulen){if(wmeasure<=1||wmeasure>=C.BLEN*3/4)
5910 glovar.ulen=C.BLEN/8
5912 glovar.ulen=C.BLEN/16}
5915 function new_tempo(text){var i,c,d,nd,txt=text,s={type:C.TEMPO,dur:0}
5920 return C.BLEN*n/d}}
5971 d1=C.BLEN/d1
5973 d2=d2?Number(a[3])/d2*C.BLEN:0}else{d2=d1}}else if(text=="auto"){d1=d2=-1}
5988 s={type:C.PART,text:text,dur:0}
6012 s={type:C.REMARK,text:text,dur:0}
6019 return;if(s2.type==C.MREST||s2.type==C.BAR)
6021 while(s2.type!=C.BAR&&s2.prev)
6026 if(s2&&s2.type==C.REST&&s2.invis){time+=s2.dur*fac
6039 if(s2.type!=C.NOTE&&s2.type!=C.REST)
6044 function new_bar(dotted){var s2,c,bar_type,line=parse.line,s={type:C.BAR,fname:parse.fname,istart:parse.bol+line.index,dur:0,multi:0}
6062 if(curvoice.cst!=curvoice.st){s2={type:C.SPACE,fname:parse.fname,istart:parse.bol+line.index,dur:0,multi:0,invis:true,width:1}
6105 if(s2&&s2.time==curvoice.time){if(s2&&s2.type==C.BAR){if(bar_type=="["&&!s2.text&&(curvoice.st==0||(par_sy.staves[curvoice.st-1].flags&STOP_BAR)||s.norepbra)){if(s.text)
6135 if(s.rbstart&&!curvoice.norepbra&&curvoice.st>0&&!(par_sy.staves[curvoice.st-1].flags&STOP_BAR)){s2={type:C.BAR,fname:s.fname,istart:s.istart,iend:s.iend,bar_type:"[",multi:0,invis:true,text:s.text,rbstart:2}
6258 ty=C.SL_DOTTED
6260 return ty+C.SL_ABOVE
6262 return ty+C.SL_BELOW}
6263 return ty+C.SL_AUTO}
6285 for(s=enote.s.prev;s;s=s.prev){if(s.type==C.BAR&&s.bar_type[0]==':'&&s.text){if(!s.sls)
6286 s.sls=[];s.sls.push({note:enote,ty:C.SL_AUTO})
6318 if(tie_s.type!=C.GRACE){for(i=0;i<=tie_s.nhd;i++){if(!tie_s.notes[i].tie_ty)
6332 a_dcn=null;parse.stemless=false;s={type:C.NOTE,fname:parse.fname,stem:0,multi:0,nhd:0,xmx:0}
6343 case'Z':s.type=C.MREST;c=line.next_char()
6347 if(s.nmes==1){s.type=C.REST;s.dur_orig=s.dur;s.notes=[{pit:18,dur:s.dur}]}else{glovar.mrest_p=true}
6349 case'y':s.type=C.SPACE;s.invis=true;s.dur=0;c=line.next_char()
6358 case'z':s.type=C.REST;line.index++;nd=parse_dur(line);s.dur_orig=((curvoice.ulen<0)?C.BLEN:curvoice.ulen)*nd[0]/nd[1];s.dur=s.dur_orig*curvoice.dur_fact;s.notes=[{pit:18,dur:s.dur_orig}]
6384 note=parse_basic_note(line,s.grace?C.BLEN/4:curvoice.ulen<0?C.BLEN:curvoice.ulen)
6440 if(s.grace&&s.type!=C.NOTE){syntax(1,errs.bad_grace)
6442 if(tie_s&&s.type!=C.NOTE){syntax(1,"Bad tie")
6444 if(s.notes){if(!grace){switch(curvoice.pos.stm){case C.SL_ABOVE:s.stem=1;break
6445 case C.SL_BELOW:s.stem=-1;break
6446 case C.SL_HIDDEN:s.stemless=true;break}
6639 if(s){switch(s.type){case C.SPACE:if(!s.notes){s.notes=[]
6641 case C.NOTE:case C.REST:break
6642 case C.GRACE:for(s=s.extra;s.next;s=s.next);break
6718 last_note_sav=curvoice.last_note;curvoice.last_note=null;a_dcn_sav=a_dcn;a_dcn=undefined;grace={type:C.GRACE,fname:parse.fname,istart:parse.bol+line.index,dur:0,multi:0}
6719 switch(curvoice.pos.gst){case C.SL_ABOVE:grace.stem=1;break
6720 case C.SL_BELOW:grace.stem=-1;break
6721 case C.SL_HIDDEN:grace.stem=2;break}
7029 var info_font_init={A:"info",C:"composer",O:"composer",P:"parts",Q:"tempo",R:"info",T:"title",X:"title"}
7030 function write_headform(lwidth){var c,font,font_name,align,x,y,sz,info_val={},info_font=clone(info_font_init),info_sz={A:cfmt.infospace,C:cfmt.composerspace,O:cfmt.composerspace,R:cfmt.infospace},info_nb={}
7133 if(cfmt.writefields.indexOf('C')>=0)
7134 composer=info.C
7261 type=C.GRACE
7271 switch(s.type){case C.CLEF:case C.METER:case C.KEY:case C.REST:if(s.type!=C.REST||s.rep_nb){set_sscale(s.st)
7273 case C.GRACE:case C.NOTE:case C.MREST:set_scale(s)
7469 switch(elts[0]){case C.OVAL:p="\ueca2"
7471 case C.EMPTY:p="\ueca3"
7651 if(s.type==C.STAVES){new_sy=s.sy;for(ir2=0;ir2<nv;ir2++){if(vn[ir2]==undefined)
7675 if(s&&staves_found<=0){v=par_sy.top_voice;p_voice=voice_tb[v];if(p_voice.sym&&p_voice.sym.type!=C.TEMPO&&(!p_voice.sym.next||p_voice.sym.next.type!=C.TEMPO)){s=clone(s);s.v=v;s.p_v=p_voice;s.st=p_voice.st;s.time=0;s.prev=p_voice.sym
7693 for(;s;s=s.next){switch(s.type){case C.GRACE:if(s.next&&s.next.type==C.BAR)
7697 for(s2=s.next;s2;s2=s2.next){switch(s2.type){case C.SPACE:continue
7698 case C.NOTE:if(!s2.a_ly)
7704 case C.MREST:if(s.next&&s.next.type!=C.BAR){syntax(1,"Lack of bar after multi-measure rest")
7706 s2.type=C.BAR
7730 switch(s.type){case C.METER:wmeasure=s.wmeasure
7731 case C.CLEF:case C.KEY:case C.STBRK:continue
7732 case C.BAR:if(s.bar_num)
7736 for(s2=s.ts_next;s2;s2=s2.ts_next){if(s2.type==C.BAR&&s2.time){if(s2.time<wmeasure){s=s2
7741 switch(s.type){case C.METER:bar_num+=(s.time-bar_tim)/wmeasure
7745 case C.BAR:if(s.invis)
7761 if(cfmt.checkbars&&((k&&!s.bar_dotted&&s.next)||(tim>ptim+wmeasure&&s.prev.type!=C.MREST)))
7860 while(1){if(s.type==C.KEY)
7898 while(s){if(!sk){for(;s;s=s.next){if(s.type==C.KEY&&s.k_transp)
7900 for(;s;s=s.next){switch(s.type){case C.GRACE:for(g=s.extra;g;g=g.next){for(i=0;i<=g.nhd;i++)
7903 case C.NOTE:for(i=0;i<=s.nhd;i++)
7906 case C.KEY:if(sk)
7993 if(isNaN(n)||n<1||(curvoice.last_sym.type==C.BAR&&n>2)){syntax(1,"Incorrect 1st value in %%repeat")
7997 parse.repeat_n=curvoice.last_sym.type==C.BAR?n:-n;parse.repeat_k=k
8041 s={type:C.STBRK,dur:0}
8078 for(s=curvoice.last_sym;s;s=s.prev){switch(s.type){case C.NOTE:s=clone(curvoice.okey);s.k_old_sf=curvoice.ckey.k_sf;sym_link(s)
8080 case C.KEY:break
8185 for(s=s.prev;s;s=s.prev){switch(s.type){case C.BAR:if(s.time<time)
8190 if(s.type==C.NOTE){if(s.time+s.dur==time)
8198 case C.NOTE:for(i=0;i<=s.nhd;i++){if(s.notes[i].pit==pit)
8215 curvoice.time=maxtime;s={type:C.STAVES,dur:0}
8317 for(s=curvoice.last_sym;;s=s.prev){if(s.type==C.BAR||s.time<=time)
8323 if(vover.bar){sym_link({type:C.BAR,bar_type:type,dur:0,multi:0})}}
8335 if(s2&&s2.type==C.BAR&&s2.bar_type[0]!=':'){s.next=s2
8352 glovar.ulen=C.BLEN/8;parse.state=2;return
8386 p_voice={v:v,id:id,time:0,new:true,pos:{dyn:0,gch:0,gst:0,orn:0,stm:0,voc:0,vol:0},scale:1,ulen:glovar.ulen,dur_fact:1,key:clone(parse.ckey),ckey:clone(parse.ckey),okey:clone(parse.ckey),meter:clone(glovar.meter),wmeasure:glovar.meter.wmeasure,staffnonote:1,clef:{type:C.CLEF,clef_auto:true,clef_type:"a",time:0},acc:[],sls:[],hy_st:0}
8431 function goto_tune(is_K){var v,p_voice,s={type:C.STAVES,dur:0,sy:par_sy}
8438 if(p_voice.ckey.k_bagpipe&&!p_voice.pos.stm){p_voice.pos=clone(p_voice.pos);p_voice.pos.stm=C.SL_BELOW}}
8460 switch(c){case'|':while(s&&s.type!=C.BAR)
8479 while(s&&(s.type!=C.NOTE||s.grace))
8495 if(curvoice.pos.voc!=C.SL_HIDDEN)
8512 switch(p[i]){case'|':while(s&&s.type!=C.BAR)
8540 while(s&&(s.type!=C.NOTE||s.grace))
8544 if(word&&s.pos.voc!=C.SL_HIDDEN){if(word.match(/^\$\d/)){gene.curfont=word[1]=='0'?dfnt:get_font("u"+word[1])
8559 if(s.type==C.GRACE){shift=s.wl}else if((p[0]>='0'&&p[0]<='9'&&p.length>2)||p[1]==':'||p[0]=='('||p[0]==')'){if(p[0]=='('){sz=cwid('(')*swfac}else{j=p.indexOf(' ');set_font(ly.font)
8574 for(k=s.next;k;k=k.next){switch(k.type){case C.NOTE:case C.REST:if(!k.a_ly||!k.a_ly[i])
8583 case C.CLEF:case C.METER:case C.KEY:xx-=10
8597 if(s.type!=C.CLEF&&s.type!=C.KEY&&s.type!=C.METER)
8604 if(!ly){switch(s.type){case C.REST:case C.MREST:if(lflag){out_wln(lastx+3,y,x0-lastx);lflag=false;lastx=s.x+s.wr}}
8627 for(p_voice.s_next;s;s=s.next){if(s.type==C.NOTE){if(!s.a_ly)
8682 above_tb[v]=p_voice.pos.voc==C.SL_ABOVE
8843 y+=(s.type==C.NOTE?(((s.notes[s.nhd].pit+s.notes[0].pit)>>1)-
8851 case'@':y+=(s.type==C.NOTE?(((s.notes[s.nhd].pit+s.notes[0].pit)>>1)-
8868 function draw_all_chsy(){var s,san1,an,i,y,w,pos=curvoice.pos.gch==C.SL_BELOW?-1:1,n_an=0,minmax=new Array(nstaff+1)
8869 if(curvoice.pos.gch==C.SL_HIDDEN)