Lines Matching defs:s2
6 function may_combine(s){var nhd2,s2=s.ts_next
7 if(!s2||(s2.type!=C.NOTE&&s2.type!=C.REST))
9 if(s2.v==s.v||s2.st!=s.st||s2.time!=s.time||s2.dur!=s.dur)
11 if(s.combine<=0&&s2.type!=s.type)
13 if(s.a_gch&&s2.a_gch)
15 if(s.type==C.REST){if(s.type==s2.type&&s.invis&&!s2.invis)
18 if(s2.a_ly)
20 if(s2.beam_st!=s.beam_st||s2.beam_end!=s.beam_end)
21 return false;nhd2=s2.nhd
22 if(s.combine<=1&&s.notes[0].pit<=s2.notes[nhd2].pit+1)
25 function combine_notes(s,s2){var nhd,type,m;for(m=0;m<=s2.nhd;m++)
26 s2.notes[m].s=s
27 Array.prototype.push.apply(s.notes,s2.notes);s.nhd=nhd=s.notes.length-1;s.notes.sort(abc2svg.pitcmp)
36 function do_combine(s){var s2,nhd,nhd2,type
37 while(1){nhd=s.nhd;s2=s.ts_next;nhd2=s2.nhd
38 if(s.type!=s2.type){if(s2.type!=C.REST){s2=s;s=s2.ts_next}}else if(s.type==C.REST){if(s.invis&&!s2.invis)
39 delete s.invis}else{combine_notes.call(this,s,s2)
40 if(s2.tie_s)
41 s.tie_s=s2.tie_s}
42 if(s2.sls){if(s.sls)
43 Array.prototype.push.apply(s.sls,s2.sls)
45 s.sls=s2.sls}
46 if(s2.sl1)
48 if(s2.a_gch)
49 s.a_gch=s2.a_gch
50 if(s2.a_dd){if(!s.a_dd)
51 s.a_dd=s2.a_dd
53 Array.prototype.push.apply(s.a_dd,s2.a_dd)}
54 delsym.push({s:s2,r:s});this.unlksym(s2)
60 var s,s2,g,i,r
75 s2=s
76 while(1){if(!may_combine.call(this,s2)){s2=null
78 if(s2.beam_end)
80 do{s2=s2.next}while(s2.type!=C.NOTE&&s2.type!=C.REST)}
81 if(!s2)
83 s2=s
84 while(1){do_combine.call(this,s2)
85 if(s2.beam_end)
87 do{s2=s2.next}while(s2.type!=C.NOTE&&s2.type!=C.REST)}}