143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
|
var s, s2, p_voice, v, time, w, wmin, ir,
prev, fl, new_sy,
nv = voice_tb.length,
vtb = [],
vn = [], // voice indexed by range
sy = cur_sy
for (v = 0; v < nv; v++)
vtb.push(voice_tb[v].sym)
// set the first symbol
for (v = 0; v < nv; v++) {
if (!sy.voices[v])
continue
vn[sy.voices[v].range] = v
}
v = vn[0]
tsfirst = prev = vtb[v]
if (!tsfirst)
return // no music
vtb[v] = tsfirst.next
prev.seqst = true
fl = !w_tb[prev.type] || tsfirst.type == tsfirst.next
// loop on the symbols of all voices
while (1) {
if (new_sy) {
sy = new_sy;
new_sy = null;
vn = []
|
>
|
|
>
>
>
|
<
<
>
<
<
|
<
<
|
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
|
var s, s2, p_voice, v, time, w, wmin, ir,
prev, fl, new_sy,
nv = voice_tb.length,
vtb = [],
vn = [], // voice indexed by range
sy = cur_sy
// set the first symbol of each voice
for (v = 0; v < nv; v++) {
s = voice_tb[v].sym
if (s.type == C.STAVES) { // first symbol by time
tsfirst = prev = s
s = s.next
}
vtb.push(s)
if (!sy.voices[v])
continue
vn[sy.voices[v].range] = v
}
if (!prev)
return // no music
prev.seqst = true
// loop on the symbols of all voices
while (1) {
if (new_sy) {
sy = new_sy;
new_sy = null;
vn = []
|
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
|
}
break
case "text":
action = get_textopt(opt);
if (!action)
action = cfmt.textoption
set_font("text")
if (parse.state >= 2) {
s = new_block(type);
s.text = text
s.opt = action
s.font = cfmt.textfont
break
}
write_text(text, action)
|
|
|
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
|
}
break
case "text":
action = get_textopt(opt);
if (!action)
action = cfmt.textoption
set_font("text")
if (parse.state > 1) {
s = new_block(type);
s.text = text
s.opt = action
s.font = cfmt.textfont
break
}
write_text(text, action)
|
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
|
p_voice.pos.stm &= ~0x07
p_voice.pos.stm |= C.SL_BELOW
}
}
// initialize the voices when no %%staves/score
if (staves_found < 0) {
nstaff = voice_tb.length - 1
for (v = 0; v <= nstaff; v++) {
p_voice = voice_tb[v];
delete p_voice.new; // old voice
p_voice.st = p_voice.cst = v;
par_sy.voices[v] = {
st: v,
range: v
}
par_sy.staves[v] = {
stafflines: p_voice.stafflines || "|||||",
staffscale: 1
}
}
par_sy.nstaff = nstaff
}
// link the first %%score in the top voice
p_voice = curvoice;
curvoice = voice_tb[par_sy.top_voice];
sym_link(s)
curvoice = p_voice
}
|
|
|
>
<
<
|
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
|
p_voice.pos.stm &= ~0x07
p_voice.pos.stm |= C.SL_BELOW
}
}
// initialize the voices when no %%staves/score
if (staves_found < 0) {
v = voice_tb.length
nstaff = v - 1
while (--v >= 0) {
p_voice = voice_tb[v];
delete p_voice.new; // old voice
p_voice.st = p_voice.cst = v;
par_sy.voices[v] = {
st: v,
range: v
}
par_sy.staves[v] = {
stafflines: p_voice.stafflines || "|||||",
staffscale: 1
}
}
par_sy.nstaff = nstaff
}
// link the first %%score in the top voice
curvoice = voice_tb[par_sy.top_voice];
sym_link(s)
}
|