| ︙ | | | ︙ | |
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
|
}
if (wmin) // if some width
fl = 1 //true // start a new sequence
}
}
// adjust some voice elements
function voice_adj(sys_chg) {
var p_voice, s, s2, v, sl
// insert the delayed P: and Q: in the top_voice
function ins_pq() {
var s, s2,
p_v = voice_tb[par_sy.top_voice]
|
>
|
|
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
|
}
if (wmin) // if some width
fl = 1 //true // start a new sequence
}
}
// adjust some voice elements
// (possible hook)
Abc.prototype.voice_adj = function (sys_chg) {
var p_voice, s, s2, v, sl
// insert the delayed P: and Q: in the top_voice
function ins_pq() {
var s, s2,
p_v = voice_tb[par_sy.top_voice]
|
| ︙ | | | ︙ | |
428
429
430
431
432
433
434
435
436
437
438
439
440
441
|
s.p_v = p_v
s.st = s2.st
break
}
}
}
} // ins_pq()
// set the duration of the notes under a feathered beam
function set_feathered_beam(s1) {
var s, s2, t, d, b, i, a,
d = s1.dur,
n = 1
|
>
>
>
>
>
>
>
>
>
>
|
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
|
s.p_v = p_v
s.st = s2.st
break
}
}
}
} // ins_pq()
// do the note mapping stuff
function do_map(s) {
var m, nt
for (m = 0; m <= s.nhd; m++) {
nt = s.notes[m]
set_map(s.p_v, nt, nt.acc, 1) // transpose done
}
} // do_map()
// set the duration of the notes under a feathered beam
function set_feathered_beam(s1) {
var s, s2, t, d, b, i, a,
d = s1.dur,
n = 1
|
| ︙ | | | ︙ | |
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
|
s.a_ly = s2.a_ly;
s2.a_ly = null
break
}
break
}
continue
}
if (s.feathered_beam)
set_feathered_beam(s)
}
}
}
/* -- create a new staff system -- */
function new_syst(init) {
var st, v, sy_staff, p_voice,
|
<
|
|
|
>
>
>
>
>
|
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
|
s.a_ly = s2.a_ly;
s2.a_ly = null
break
}
break
}
continue
case C.NOTE:
if (s.feathered_beam)
set_feathered_beam(s)
if (p_voice.map
&& maps[p_voice.map])
do_map(s)
break
}
}
}
}
/* -- create a new staff system -- */
function new_syst(init) {
var st, v, sy_staff, p_voice,
|
| ︙ | | | ︙ | |
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
|
}
if (vover) {
syntax(1, "No end of voice overlay");
get_vover(vover.bar ? '|' : ')')
}
voice_adj();
sort_all() /* define the time / vertical sequences */
if (tsfirst) {
for (v = 0; v < voice_tb.length; v++) {
if (!voice_tb[v].key)
voice_tb[v].key = parse.ckey // set the starting key
}
|
|
|
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
|
}
if (vover) {
syntax(1, "No end of voice overlay");
get_vover(vover.bar ? '|' : ')')
}
self.voice_adj()
sort_all() /* define the time / vertical sequences */
if (tsfirst) {
for (v = 0; v < voice_tb.length; v++) {
if (!voice_tb[v].key)
voice_tb[v].key = parse.ckey // set the starting key
}
|
| ︙ | | | ︙ | |
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
|
maxtime = p_voice.time
}
if (!maxtime) { // if first %%staves
par_sy.staves = []
par_sy.voices = []
} else {
// if (nv) // if many voices
voice_adj(true)
/*
* create a new staff system and
* link the 'staves' symbol in a voice which is seen from
* the previous system - see sort_all
*/
for (v = 0; v < par_sy.voices.length; v++) {
if (par_sy.voices[v]) {
|
|
|
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
|
maxtime = p_voice.time
}
if (!maxtime) { // if first %%staves
par_sy.staves = []
par_sy.voices = []
} else {
// if (nv) // if many voices
self.voice_adj(1)
/*
* create a new staff system and
* link the 'staves' symbol in a voice which is seen from
* the previous system - see sort_all
*/
for (v = 0; v < par_sy.voices.length; v++) {
if (par_sy.voices[v]) {
|
| ︙ | | | ︙ | |
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
|
par_sy.voices[v].second = p_voice.second;
st = p_voice.st
if (st > 0 && p_voice.norepbra == undefined
&& !(par_sy.staves[st - 1].flags & STOP_BAR))
p_voice.norepbra = true
}
//--fixme: is this useful?
// if (!maxtime && nv) // if first staff system and many voices
// voice_adj(true)
curvoice = parse.state >= 2 ? voice_tb[par_sy.top_voice] : null
}
// get a voice or create a clone of the current voice
function clone_voice(id) {
var v, p_voice
|
<
<
<
|
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
|
par_sy.voices[v].second = p_voice.second;
st = p_voice.st
if (st > 0 && p_voice.norepbra == undefined
&& !(par_sy.staves[st - 1].flags & STOP_BAR))
p_voice.norepbra = true
}
curvoice = parse.state >= 2 ? voice_tb[par_sy.top_voice] : null
}
// get a voice or create a clone of the current voice
function clone_voice(id) {
var v, p_voice
|
| ︙ | | | ︙ | |