@coderline/alphatab 1.8.0-alpha.1640 → 1.8.0-alpha.1645
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/alphaTab.core.min.mjs +2 -2
- package/dist/alphaTab.core.mjs +932 -1577
- package/dist/alphaTab.d.ts +11 -1
- package/dist/alphaTab.js +932 -1577
- package/dist/alphaTab.min.js +2 -2
- package/dist/alphaTab.min.mjs +1 -1
- package/dist/alphaTab.mjs +1 -1
- package/dist/alphaTab.worker.min.mjs +1 -1
- package/dist/alphaTab.worker.mjs +1 -1
- package/dist/alphaTab.worklet.min.mjs +1 -1
- package/dist/alphaTab.worklet.mjs +1 -1
- package/package.json +1 -1
package/dist/alphaTab.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* alphaTab v1.8.0-alpha.
|
|
2
|
+
* alphaTab v1.8.0-alpha.1645 (develop, build 1645)
|
|
3
3
|
*
|
|
4
4
|
* Copyright © 2025, Daniel Kuschny and Contributors, All rights reserved.
|
|
5
5
|
*
|
|
@@ -209,9 +209,9 @@
|
|
|
209
209
|
* @internal
|
|
210
210
|
*/
|
|
211
211
|
class VersionInfo {
|
|
212
|
-
static version = '1.8.0-alpha.
|
|
213
|
-
static date = '2025-12-
|
|
214
|
-
static commit = '
|
|
212
|
+
static version = '1.8.0-alpha.1645';
|
|
213
|
+
static date = '2025-12-15T02:24:53.193Z';
|
|
214
|
+
static commit = '2a0b11cc7b6660842c925dd2623b17a34ab325b7';
|
|
215
215
|
static print(print) {
|
|
216
216
|
print(`alphaTab ${VersionInfo.version}`);
|
|
217
217
|
print(`commit: ${VersionInfo.commit}`);
|
|
@@ -4721,6 +4721,24 @@
|
|
|
4721
4721
|
static toArticulationId(plain) {
|
|
4722
4722
|
return plain.replace(/[^a-zA-Z0-9]/g, '').toLowerCase();
|
|
4723
4723
|
}
|
|
4724
|
+
static minBoundingBox(a, b) {
|
|
4725
|
+
if (Number.isNaN(a)) {
|
|
4726
|
+
return b;
|
|
4727
|
+
}
|
|
4728
|
+
else if (Number.isNaN(b)) {
|
|
4729
|
+
return a;
|
|
4730
|
+
}
|
|
4731
|
+
return a < b ? a : b;
|
|
4732
|
+
}
|
|
4733
|
+
static maxBoundingBox(a, b) {
|
|
4734
|
+
if (Number.isNaN(a)) {
|
|
4735
|
+
return b;
|
|
4736
|
+
}
|
|
4737
|
+
else if (Number.isNaN(b)) {
|
|
4738
|
+
return a;
|
|
4739
|
+
}
|
|
4740
|
+
return a > b ? a : b;
|
|
4741
|
+
}
|
|
4724
4742
|
}
|
|
4725
4743
|
|
|
4726
4744
|
/**
|
|
@@ -8127,6 +8145,11 @@
|
|
|
8127
8145
|
['explicit', 1]
|
|
8128
8146
|
]);
|
|
8129
8147
|
static alphaTexAccidentalModeReversed = AlphaTex1EnumMappings._reverse(AlphaTex1EnumMappings.alphaTexAccidentalMode);
|
|
8148
|
+
static alphaTexVoiceMode = new Map([
|
|
8149
|
+
['staffwise', 0],
|
|
8150
|
+
['barwise', 1]
|
|
8151
|
+
]);
|
|
8152
|
+
static alphaTexVoiceModeReversed = AlphaTex1EnumMappings._reverse(AlphaTex1EnumMappings.alphaTexVoiceMode);
|
|
8130
8153
|
static noteAccidentalMode = new Map([
|
|
8131
8154
|
['default', 0],
|
|
8132
8155
|
['forcenone', 1],
|
|
@@ -8510,513 +8533,138 @@
|
|
|
8510
8533
|
// to reduce code size, the parameter types are specified as number values and then
|
|
8511
8534
|
// translated inside AlphaTex1LanguageDefinitions._signatures during runtime
|
|
8512
8535
|
static scoreMetaDataSignatures = AlphaTex1LanguageDefinitions._signatures([
|
|
8513
|
-
[
|
|
8514
|
-
|
|
8515
|
-
|
|
8516
|
-
|
|
8517
|
-
|
|
8518
|
-
|
|
8519
|
-
|
|
8520
|
-
|
|
8521
|
-
|
|
8522
|
-
],
|
|
8523
|
-
[
|
|
8524
|
-
|
|
8525
|
-
|
|
8526
|
-
|
|
8527
|
-
|
|
8528
|
-
|
|
8529
|
-
|
|
8530
|
-
|
|
8531
|
-
|
|
8532
|
-
],
|
|
8533
|
-
[
|
|
8534
|
-
|
|
8535
|
-
|
|
8536
|
-
|
|
8537
|
-
|
|
8538
|
-
|
|
8539
|
-
[[10, 17], 1, ['left', 'center', 'right']]
|
|
8540
|
-
]
|
|
8541
|
-
]
|
|
8542
|
-
],
|
|
8543
|
-
[
|
|
8544
|
-
'album',
|
|
8545
|
-
[
|
|
8546
|
-
[
|
|
8547
|
-
[[17, 10], 0],
|
|
8548
|
-
[[17], 1],
|
|
8549
|
-
[[10, 17], 1, ['left', 'center', 'right']]
|
|
8550
|
-
]
|
|
8551
|
-
]
|
|
8552
|
-
],
|
|
8553
|
-
[
|
|
8554
|
-
'words',
|
|
8555
|
-
[
|
|
8556
|
-
[
|
|
8557
|
-
[[17, 10], 0],
|
|
8558
|
-
[[17], 1],
|
|
8559
|
-
[[10, 17], 1, ['left', 'center', 'right']]
|
|
8560
|
-
]
|
|
8561
|
-
]
|
|
8562
|
-
],
|
|
8563
|
-
[
|
|
8564
|
-
'music',
|
|
8565
|
-
[
|
|
8566
|
-
[
|
|
8567
|
-
[[17, 10], 0],
|
|
8568
|
-
[[17], 1],
|
|
8569
|
-
[[10, 17], 1, ['left', 'center', 'right']]
|
|
8570
|
-
]
|
|
8571
|
-
]
|
|
8572
|
-
],
|
|
8573
|
-
[
|
|
8574
|
-
'wordsandmusic',
|
|
8575
|
-
[
|
|
8576
|
-
[
|
|
8577
|
-
[[17], 0],
|
|
8578
|
-
[[10, 17], 1, ['left', 'center', 'right']]
|
|
8579
|
-
]
|
|
8580
|
-
]
|
|
8581
|
-
],
|
|
8582
|
-
[
|
|
8583
|
-
'copyright',
|
|
8584
|
-
[
|
|
8585
|
-
[
|
|
8586
|
-
[[17, 10], 0],
|
|
8587
|
-
[[17], 1],
|
|
8588
|
-
[[10, 17], 1, ['left', 'center', 'right']]
|
|
8589
|
-
]
|
|
8590
|
-
]
|
|
8591
|
-
],
|
|
8592
|
-
[
|
|
8593
|
-
'copyright2',
|
|
8594
|
-
[
|
|
8595
|
-
[
|
|
8596
|
-
[[17], 0],
|
|
8597
|
-
[[10, 17], 1, ['left', 'center', 'right']]
|
|
8598
|
-
]
|
|
8599
|
-
]
|
|
8600
|
-
],
|
|
8601
|
-
['instructions', [[[[17, 10], 0]]]],
|
|
8602
|
-
['notices', [[[[17, 10], 0]]]],
|
|
8603
|
-
[
|
|
8604
|
-
'tab',
|
|
8605
|
-
[
|
|
8606
|
-
[
|
|
8607
|
-
[[17, 10], 0],
|
|
8608
|
-
[[17], 1],
|
|
8609
|
-
[[10, 17], 1, ['left', 'center', 'right']]
|
|
8610
|
-
]
|
|
8611
|
-
]
|
|
8612
|
-
],
|
|
8613
|
-
['systemslayout', [[[[16], 5]]]],
|
|
8614
|
-
['defaultsystemslayout', [[[[16], 0]]]],
|
|
8615
|
-
['showdynamics', null],
|
|
8616
|
-
['hidedynamics', null],
|
|
8617
|
-
['usesystemsignseparator', null],
|
|
8618
|
-
['multibarrest', null],
|
|
8619
|
-
['bracketextendmode', [[[[10, 17], 0, ['nobrackets', 'groupstaves', 'groupsimilarinstruments']]]]],
|
|
8620
|
-
['singletracktracknamepolicy', [[[[10, 17], 0, ['hidden', 'firstsystem', 'allsystems']]]]],
|
|
8621
|
-
['multitracktracknamepolicy', [[[[10, 17], 0, ['hidden', 'firstsystem', 'allsystems']]]]],
|
|
8622
|
-
['firstsystemtracknamemode', [[[[10, 17], 0, ['fullname', 'shortname']]]]],
|
|
8623
|
-
['othersystemstracknamemode', [[[[10, 17], 0, ['fullname', 'shortname']]]]],
|
|
8624
|
-
['firstsystemtracknameorientation', [[[[10, 17], 0, ['horizontal', 'vertical']]]]],
|
|
8625
|
-
['othersystemstracknameorientation', [[[[10, 17], 0, ['horizontal', 'vertical']]]]],
|
|
8626
|
-
['extendbarlines', null]
|
|
8536
|
+
["title", [[[[17, 10], 0], [[17], 1], [[10, 17], 1, ["left", "center", "right"]]]]],
|
|
8537
|
+
["subtitle", [[[[17, 10], 0], [[17], 1], [[10, 17], 1, ["left", "center", "right"]]]]],
|
|
8538
|
+
["artist", [[[[17, 10], 0], [[17], 1], [[10, 17], 1, ["left", "center", "right"]]]]],
|
|
8539
|
+
["album", [[[[17, 10], 0], [[17], 1], [[10, 17], 1, ["left", "center", "right"]]]]],
|
|
8540
|
+
["words", [[[[17, 10], 0], [[17], 1], [[10, 17], 1, ["left", "center", "right"]]]]],
|
|
8541
|
+
["music", [[[[17, 10], 0], [[17], 1], [[10, 17], 1, ["left", "center", "right"]]]]],
|
|
8542
|
+
["wordsandmusic", [[[[17], 0], [[10, 17], 1, ["left", "center", "right"]]]]],
|
|
8543
|
+
["copyright", [[[[17, 10], 0], [[17], 1], [[10, 17], 1, ["left", "center", "right"]]]]],
|
|
8544
|
+
["copyright2", [[[[17], 0], [[10, 17], 1, ["left", "center", "right"]]]]],
|
|
8545
|
+
["instructions", [[[[17, 10], 0]]]],
|
|
8546
|
+
["notices", [[[[17, 10], 0]]]],
|
|
8547
|
+
["tab", [[[[17, 10], 0], [[17], 1], [[10, 17], 1, ["left", "center", "right"]]]]],
|
|
8548
|
+
["systemslayout", [[[[16], 5]]]],
|
|
8549
|
+
["defaultsystemslayout", [[[[16], 0]]]],
|
|
8550
|
+
["showdynamics", null],
|
|
8551
|
+
["hidedynamics", null],
|
|
8552
|
+
["usesystemsignseparator", null],
|
|
8553
|
+
["multibarrest", null],
|
|
8554
|
+
["bracketextendmode", [[[[10, 17], 0, ["nobrackets", "groupstaves", "groupsimilarinstruments"]]]]],
|
|
8555
|
+
["singletracktracknamepolicy", [[[[10, 17], 0, ["hidden", "firstsystem", "allsystems"]]]]],
|
|
8556
|
+
["multitracktracknamepolicy", [[[[10, 17], 0, ["hidden", "firstsystem", "allsystems"]]]]],
|
|
8557
|
+
["firstsystemtracknamemode", [[[[10, 17], 0, ["fullname", "shortname"]]]]],
|
|
8558
|
+
["othersystemstracknamemode", [[[[10, 17], 0, ["fullname", "shortname"]]]]],
|
|
8559
|
+
["firstsystemtracknameorientation", [[[[10, 17], 0, ["horizontal", "vertical"]]]]],
|
|
8560
|
+
["othersystemstracknameorientation", [[[[10, 17], 0, ["horizontal", "vertical"]]]]],
|
|
8561
|
+
["extendbarlines", null]
|
|
8627
8562
|
]);
|
|
8628
8563
|
static staffMetaDataSignatures = AlphaTex1LanguageDefinitions._signatures([
|
|
8629
|
-
[
|
|
8630
|
-
[
|
|
8631
|
-
|
|
8632
|
-
|
|
8633
|
-
|
|
8634
|
-
|
|
8635
|
-
|
|
8636
|
-
|
|
8637
|
-
]
|
|
8638
|
-
],
|
|
8639
|
-
['capo', [[[[16], 0]]]],
|
|
8640
|
-
[
|
|
8641
|
-
'lyrics',
|
|
8642
|
-
[
|
|
8643
|
-
[[[17], 0]],
|
|
8644
|
-
[
|
|
8645
|
-
[[16], 0],
|
|
8646
|
-
[[17], 0]
|
|
8647
|
-
]
|
|
8648
|
-
]
|
|
8649
|
-
],
|
|
8650
|
-
[
|
|
8651
|
-
'articulation',
|
|
8652
|
-
[
|
|
8653
|
-
[[[10], 0, ['defaults']]],
|
|
8654
|
-
[
|
|
8655
|
-
[[17, 10], 0],
|
|
8656
|
-
[[16], 0]
|
|
8657
|
-
]
|
|
8658
|
-
]
|
|
8659
|
-
],
|
|
8660
|
-
['displaytranspose', [[[[16], 0]]]],
|
|
8661
|
-
['transpose', [[[[16], 0]]]],
|
|
8662
|
-
['instrument', [[[[16], 0]], [[[17, 10], 0]], [[[10], 0, ['percussion']]]]]
|
|
8564
|
+
["tuning", [[[[10, 17], 0, ["piano", "none", "voice"]]], [[[10, 17], 5]]]],
|
|
8565
|
+
["chord", [[[[17, 10], 0], [[10, 17, 16], 5]]]],
|
|
8566
|
+
["capo", [[[[16], 0]]]],
|
|
8567
|
+
["lyrics", [[[[17], 0]], [[[16], 0], [[17], 0]]]],
|
|
8568
|
+
["articulation", [[[[10], 0, ["defaults"]]], [[[17, 10], 0], [[16], 0]]]],
|
|
8569
|
+
["displaytranspose", [[[[16], 0]]]],
|
|
8570
|
+
["transpose", [[[[16], 0]]]],
|
|
8571
|
+
["instrument", [[[[16], 0]], [[[17, 10], 0]], [[[10], 0, ["percussion"]]]]]
|
|
8663
8572
|
]);
|
|
8664
8573
|
static structuralMetaDataSignatures = AlphaTex1LanguageDefinitions._signatures([
|
|
8665
|
-
[
|
|
8666
|
-
|
|
8667
|
-
|
|
8668
|
-
[
|
|
8669
|
-
[[17], 1],
|
|
8670
|
-
[[17], 1]
|
|
8671
|
-
]
|
|
8672
|
-
]
|
|
8673
|
-
],
|
|
8674
|
-
['staff', null],
|
|
8675
|
-
['voice', null]
|
|
8574
|
+
["track", [[[[17], 1], [[17], 1]]]],
|
|
8575
|
+
["staff", null],
|
|
8576
|
+
["voice", null]
|
|
8676
8577
|
]);
|
|
8677
8578
|
static barMetaDataSignatures = AlphaTex1LanguageDefinitions._signatures([
|
|
8678
|
-
[
|
|
8679
|
-
|
|
8680
|
-
|
|
8681
|
-
|
|
8682
|
-
|
|
8683
|
-
|
|
8684
|
-
|
|
8685
|
-
|
|
8686
|
-
|
|
8687
|
-
],
|
|
8688
|
-
[
|
|
8689
|
-
[
|
|
8690
|
-
[
|
|
8691
|
-
[
|
|
8692
|
-
|
|
8693
|
-
|
|
8694
|
-
|
|
8695
|
-
|
|
8696
|
-
|
|
8697
|
-
|
|
8698
|
-
|
|
8699
|
-
|
|
8700
|
-
|
|
8701
|
-
|
|
8702
|
-
|
|
8703
|
-
'eb',
|
|
8704
|
-
'bb',
|
|
8705
|
-
'f',
|
|
8706
|
-
'c',
|
|
8707
|
-
'g',
|
|
8708
|
-
'd',
|
|
8709
|
-
'a',
|
|
8710
|
-
'e',
|
|
8711
|
-
'b',
|
|
8712
|
-
'f#',
|
|
8713
|
-
'c#',
|
|
8714
|
-
'cbmajor',
|
|
8715
|
-
'abminor',
|
|
8716
|
-
'gbmajor',
|
|
8717
|
-
'ebminor',
|
|
8718
|
-
'dbmajor',
|
|
8719
|
-
'bbminor',
|
|
8720
|
-
'abmajor',
|
|
8721
|
-
'fminor',
|
|
8722
|
-
'ebmajor',
|
|
8723
|
-
'cminor',
|
|
8724
|
-
'bbmajor',
|
|
8725
|
-
'gminor',
|
|
8726
|
-
'fmajor',
|
|
8727
|
-
'dminor',
|
|
8728
|
-
'cmajor',
|
|
8729
|
-
'aminor',
|
|
8730
|
-
'gmajor',
|
|
8731
|
-
'eminor',
|
|
8732
|
-
'dmajor',
|
|
8733
|
-
'bminor',
|
|
8734
|
-
'amajor',
|
|
8735
|
-
'f#minor',
|
|
8736
|
-
'emajor',
|
|
8737
|
-
'c#minor',
|
|
8738
|
-
'bmajor',
|
|
8739
|
-
'g#minor',
|
|
8740
|
-
'f#major',
|
|
8741
|
-
'd#minor',
|
|
8742
|
-
'f#',
|
|
8743
|
-
'c#major',
|
|
8744
|
-
'a#minor',
|
|
8745
|
-
'c#'
|
|
8746
|
-
]
|
|
8747
|
-
]
|
|
8748
|
-
]
|
|
8749
|
-
]
|
|
8750
|
-
],
|
|
8751
|
-
['clef', [[[[10, 16, 17], 0, ['neutral', 'c3', 'c4', 'f4', 'g2', 'n', 'alto', 'tenor', 'bass', 'treble']]]]],
|
|
8752
|
-
['ottava', [[[[10, 17], 0, ['15ma', '8va', 'regular', '8vb', '15mb', '15ma', '8va', '8vb', '15mb']]]]],
|
|
8753
|
-
[
|
|
8754
|
-
'tempo',
|
|
8755
|
-
[
|
|
8756
|
-
[
|
|
8757
|
-
[[16], 2],
|
|
8758
|
-
[[17], 1]
|
|
8759
|
-
],
|
|
8760
|
-
[null, [[16], 2], [[17], 0], [[16], 1], [[10], 1, ['hide']]]
|
|
8761
|
-
]
|
|
8762
|
-
],
|
|
8763
|
-
[
|
|
8764
|
-
'tf',
|
|
8765
|
-
[
|
|
8766
|
-
[
|
|
8767
|
-
[
|
|
8768
|
-
[10, 16, 17],
|
|
8769
|
-
0,
|
|
8770
|
-
[
|
|
8771
|
-
'none',
|
|
8772
|
-
'triplet16th',
|
|
8773
|
-
'triplet8th',
|
|
8774
|
-
'dotted16th',
|
|
8775
|
-
'dotted8th',
|
|
8776
|
-
'scottish16th',
|
|
8777
|
-
'scottish8th',
|
|
8778
|
-
'none',
|
|
8779
|
-
'no',
|
|
8780
|
-
'notripletfeel',
|
|
8781
|
-
't16',
|
|
8782
|
-
'triplet-16th',
|
|
8783
|
-
't8',
|
|
8784
|
-
'triplet-8th',
|
|
8785
|
-
'd16',
|
|
8786
|
-
'dotted-16th',
|
|
8787
|
-
'd8',
|
|
8788
|
-
'dotted-8th',
|
|
8789
|
-
's16',
|
|
8790
|
-
'scottish-16th',
|
|
8791
|
-
's8',
|
|
8792
|
-
'scottish-8th'
|
|
8793
|
-
]
|
|
8794
|
-
]
|
|
8795
|
-
]
|
|
8796
|
-
]
|
|
8797
|
-
],
|
|
8798
|
-
['ac', null],
|
|
8799
|
-
[
|
|
8800
|
-
'section',
|
|
8801
|
-
[
|
|
8802
|
-
[[[17, 10], 0]],
|
|
8803
|
-
[
|
|
8804
|
-
[[17, 10], 0],
|
|
8805
|
-
[[17, 10], 0, null, ['x', '-', 'r']]
|
|
8806
|
-
]
|
|
8807
|
-
]
|
|
8808
|
-
],
|
|
8809
|
-
[
|
|
8810
|
-
'jump',
|
|
8811
|
-
[
|
|
8812
|
-
[
|
|
8813
|
-
[
|
|
8814
|
-
[10, 17],
|
|
8815
|
-
0,
|
|
8816
|
-
[
|
|
8817
|
-
'fine',
|
|
8818
|
-
'segno',
|
|
8819
|
-
'segnosegno',
|
|
8820
|
-
'coda',
|
|
8821
|
-
'doublecoda',
|
|
8822
|
-
'dacapo',
|
|
8823
|
-
'dacapoalcoda',
|
|
8824
|
-
'dacapoaldoublecoda',
|
|
8825
|
-
'dacapoalfine',
|
|
8826
|
-
'dalsegno',
|
|
8827
|
-
'dalsegnoalcoda',
|
|
8828
|
-
'dalsegnoaldoublecoda',
|
|
8829
|
-
'dalsegnoalfine',
|
|
8830
|
-
'dalsegnosegno',
|
|
8831
|
-
'dalsegnosegnoalcoda',
|
|
8832
|
-
'dalsegnosegnoaldoublecoda',
|
|
8833
|
-
'dalsegnosegnoalfine',
|
|
8834
|
-
'dacoda',
|
|
8835
|
-
'dadoublecoda'
|
|
8836
|
-
]
|
|
8837
|
-
]
|
|
8838
|
-
]
|
|
8839
|
-
]
|
|
8840
|
-
],
|
|
8841
|
-
['ft', null],
|
|
8842
|
-
['simile', [[[[10, 17], 0, ['none', 'simple', 'firstofdouble', 'secondofdouble']]]]],
|
|
8843
|
-
[
|
|
8844
|
-
'barlineleft',
|
|
8845
|
-
[
|
|
8846
|
-
[
|
|
8847
|
-
[
|
|
8848
|
-
[10, 17],
|
|
8849
|
-
0,
|
|
8850
|
-
[
|
|
8851
|
-
'automatic',
|
|
8852
|
-
'dashed',
|
|
8853
|
-
'dotted',
|
|
8854
|
-
'heavy',
|
|
8855
|
-
'heavyheavy',
|
|
8856
|
-
'heavylight',
|
|
8857
|
-
'lightheavy',
|
|
8858
|
-
'lightlight',
|
|
8859
|
-
'none',
|
|
8860
|
-
'regular',
|
|
8861
|
-
'short',
|
|
8862
|
-
'tick'
|
|
8863
|
-
]
|
|
8864
|
-
]
|
|
8865
|
-
]
|
|
8866
|
-
]
|
|
8867
|
-
],
|
|
8868
|
-
[
|
|
8869
|
-
'barlineright',
|
|
8870
|
-
[
|
|
8871
|
-
[
|
|
8872
|
-
[
|
|
8873
|
-
[10, 17],
|
|
8874
|
-
0,
|
|
8875
|
-
[
|
|
8876
|
-
'automatic',
|
|
8877
|
-
'dashed',
|
|
8878
|
-
'dotted',
|
|
8879
|
-
'heavy',
|
|
8880
|
-
'heavyheavy',
|
|
8881
|
-
'heavylight',
|
|
8882
|
-
'lightheavy',
|
|
8883
|
-
'lightlight',
|
|
8884
|
-
'none',
|
|
8885
|
-
'regular',
|
|
8886
|
-
'short',
|
|
8887
|
-
'tick'
|
|
8888
|
-
]
|
|
8889
|
-
]
|
|
8890
|
-
]
|
|
8891
|
-
]
|
|
8892
|
-
],
|
|
8893
|
-
['scale', [[[[16], 2]]]],
|
|
8894
|
-
['width', [[[[16], 2]]]],
|
|
8895
|
-
[
|
|
8896
|
-
'sync',
|
|
8897
|
-
[
|
|
8898
|
-
[
|
|
8899
|
-
[[16], 0],
|
|
8900
|
-
[[16], 0],
|
|
8901
|
-
[[16], 0],
|
|
8902
|
-
[[16], 3]
|
|
8903
|
-
]
|
|
8904
|
-
]
|
|
8905
|
-
],
|
|
8906
|
-
['accidentals', [[[[10, 17], 0, ['auto', 'explicit']]]]],
|
|
8907
|
-
['spd', [[[[16], 2]]]],
|
|
8908
|
-
['sph', [[[[16], 2]]]],
|
|
8909
|
-
['spu', [[[[16], 2]]]],
|
|
8910
|
-
['db', null]
|
|
8579
|
+
["ts", [[[[10, 17], 0, ["common"]]], [[[16], 0], [[16], 0]]]],
|
|
8580
|
+
["ro", null],
|
|
8581
|
+
["rc", [[[[16], 0]]]],
|
|
8582
|
+
["ae", [[[[16, 13], 4]]]],
|
|
8583
|
+
["ks", [[[[10, 17], 0, ["cb", "gb", "db", "ab", "eb", "bb", "f", "c", "g", "d", "a", "e", "b", "f#", "c#", "cbmajor", "abminor", "gbmajor", "ebminor", "dbmajor", "bbminor", "abmajor", "fminor", "ebmajor", "cminor", "bbmajor", "gminor", "fmajor", "dminor", "cmajor", "aminor", "gmajor", "eminor", "dmajor", "bminor", "amajor", "f#minor", "emajor", "c#minor", "bmajor", "g#minor", "f#major", "d#minor", "f#", "c#major", "a#minor", "c#"]]]]],
|
|
8584
|
+
["clef", [[[[10, 16, 17], 0, ["neutral", "c3", "c4", "f4", "g2", "n", "alto", "tenor", "bass", "treble"]]]]],
|
|
8585
|
+
["ottava", [[[[10, 17], 0, ["15ma", "8va", "regular", "8vb", "15mb", "15ma", "8va", "8vb", "15mb"]]]]],
|
|
8586
|
+
["tempo", [[[[16], 2], [[17], 1]], [null, [[16], 2], [[17], 0], [[16], 1], [[10], 1, ["hide"]]]]],
|
|
8587
|
+
["tf", [[[[10, 16, 17], 0, ["none", "triplet16th", "triplet8th", "dotted16th", "dotted8th", "scottish16th", "scottish8th", "none", "no", "notripletfeel", "t16", "triplet-16th", "t8", "triplet-8th", "d16", "dotted-16th", "d8", "dotted-8th", "s16", "scottish-16th", "s8", "scottish-8th"]]]]],
|
|
8588
|
+
["ac", null],
|
|
8589
|
+
["section", [[[[17, 10], 0]], [[[17, 10], 0], [[17, 10], 0, null, ["x", "-", "r"]]]]],
|
|
8590
|
+
["jump", [[[[10, 17], 0, ["fine", "segno", "segnosegno", "coda", "doublecoda", "dacapo", "dacapoalcoda", "dacapoaldoublecoda", "dacapoalfine", "dalsegno", "dalsegnoalcoda", "dalsegnoaldoublecoda", "dalsegnoalfine", "dalsegnosegno", "dalsegnosegnoalcoda", "dalsegnosegnoaldoublecoda", "dalsegnosegnoalfine", "dacoda", "dadoublecoda"]]]]],
|
|
8591
|
+
["ft", null],
|
|
8592
|
+
["simile", [[[[10, 17], 0, ["none", "simple", "firstofdouble", "secondofdouble"]]]]],
|
|
8593
|
+
["barlineleft", [[[[10, 17], 0, ["automatic", "dashed", "dotted", "heavy", "heavyheavy", "heavylight", "lightheavy", "lightlight", "none", "regular", "short", "tick"]]]]],
|
|
8594
|
+
["barlineright", [[[[10, 17], 0, ["automatic", "dashed", "dotted", "heavy", "heavyheavy", "heavylight", "lightheavy", "lightlight", "none", "regular", "short", "tick"]]]]],
|
|
8595
|
+
["scale", [[[[16], 2]]]],
|
|
8596
|
+
["width", [[[[16], 2]]]],
|
|
8597
|
+
["sync", [[[[16], 0], [[16], 0], [[16], 0], [[16], 3]]]],
|
|
8598
|
+
["accidentals", [[[[10, 17], 0, ["auto", "explicit"]]]]],
|
|
8599
|
+
["spd", [[[[16], 2]]]],
|
|
8600
|
+
["sph", [[[[16], 2]]]],
|
|
8601
|
+
["spu", [[[[16], 2]]]],
|
|
8602
|
+
["db", null],
|
|
8603
|
+
["voicemode", [[[[10, 17], 0, ["staffwise", "barwise"]]]]]
|
|
8911
8604
|
]);
|
|
8912
8605
|
static metaDataProperties = AlphaTex1LanguageDefinitions._metaProps([
|
|
8913
|
-
[
|
|
8914
|
-
|
|
8915
|
-
|
|
8916
|
-
|
|
8917
|
-
|
|
8918
|
-
|
|
8919
|
-
|
|
8920
|
-
|
|
8921
|
-
|
|
8922
|
-
|
|
8923
|
-
|
|
8924
|
-
|
|
8925
|
-
|
|
8926
|
-
|
|
8927
|
-
],
|
|
8928
|
-
[
|
|
8929
|
-
|
|
8930
|
-
|
|
8931
|
-
|
|
8932
|
-
|
|
8933
|
-
|
|
8934
|
-
|
|
8935
|
-
|
|
8936
|
-
],
|
|
8937
|
-
[
|
|
8938
|
-
[
|
|
8939
|
-
[
|
|
8940
|
-
[
|
|
8941
|
-
[
|
|
8942
|
-
[
|
|
8943
|
-
[
|
|
8944
|
-
[
|
|
8945
|
-
[
|
|
8946
|
-
[
|
|
8947
|
-
[
|
|
8948
|
-
[
|
|
8949
|
-
[
|
|
8950
|
-
[
|
|
8951
|
-
[
|
|
8952
|
-
[
|
|
8953
|
-
[
|
|
8954
|
-
[
|
|
8955
|
-
[
|
|
8956
|
-
[
|
|
8957
|
-
[
|
|
8958
|
-
[
|
|
8959
|
-
[
|
|
8960
|
-
[
|
|
8961
|
-
[
|
|
8962
|
-
[
|
|
8963
|
-
[
|
|
8964
|
-
[
|
|
8965
|
-
|
|
8966
|
-
|
|
8967
|
-
|
|
8968
|
-
|
|
8969
|
-
|
|
8970
|
-
],
|
|
8971
|
-
[
|
|
8972
|
-
|
|
8973
|
-
|
|
8974
|
-
|
|
8975
|
-
['barre', [[[[16], 5]]]],
|
|
8976
|
-
[
|
|
8977
|
-
'showdiagram',
|
|
8978
|
-
[[], [[[17], 0, ['true', 'false']]], [[[10], 0, ['true', 'false']]], [[[16], 0, ['1', '0']]]]
|
|
8979
|
-
],
|
|
8980
|
-
[
|
|
8981
|
-
'showfingering',
|
|
8982
|
-
[[], [[[17], 0, ['true', 'false']]], [[[10], 0, ['true', 'false']]], [[[16], 0, ['1', '0']]]]
|
|
8983
|
-
],
|
|
8984
|
-
[
|
|
8985
|
-
'showname',
|
|
8986
|
-
[[], [[[17], 0, ['true', 'false']]], [[[10], 0, ['true', 'false']]], [[[16], 0, ['1', '0']]]]
|
|
8987
|
-
]
|
|
8988
|
-
]
|
|
8989
|
-
],
|
|
8990
|
-
['capo', null],
|
|
8991
|
-
['lyrics', null],
|
|
8992
|
-
['articulation', null],
|
|
8993
|
-
['displaytranspose', null],
|
|
8994
|
-
['transpose', null],
|
|
8995
|
-
['instrument', null],
|
|
8996
|
-
['ts', null],
|
|
8997
|
-
['ro', null],
|
|
8998
|
-
['rc', null],
|
|
8999
|
-
['ae', null],
|
|
9000
|
-
['ks', null],
|
|
9001
|
-
['clef', null],
|
|
9002
|
-
['ottava', null],
|
|
9003
|
-
['tempo', null],
|
|
9004
|
-
['tf', null],
|
|
9005
|
-
['ac', null],
|
|
9006
|
-
['section', null],
|
|
9007
|
-
['jump', null],
|
|
9008
|
-
['ft', null],
|
|
9009
|
-
['simile', null],
|
|
9010
|
-
['barlineleft', null],
|
|
9011
|
-
['barlineright', null],
|
|
9012
|
-
['scale', null],
|
|
9013
|
-
['width', null],
|
|
9014
|
-
['sync', null],
|
|
9015
|
-
['accidentals', null],
|
|
9016
|
-
['spd', null],
|
|
9017
|
-
['sph', null],
|
|
9018
|
-
['spu', null],
|
|
9019
|
-
['db', null]
|
|
8606
|
+
["track", [["color", [[[[17], 0]]]], ["systemslayout", [[[[16], 5]]]], ["defaultsystemslayout", [[[[16], 0]]]], ["solo", null], ["mute", null], ["volume", [[[[16], 0]]]], ["balance", [[[[16], 0]]]], ["instrument", [[[[16], 0]], [[[17, 10], 0]], [[[10], 0, ["percussion"]]]]], ["bank", [[[[16], 0]]]], ["multibarrest", null]]],
|
|
8607
|
+
["staff", [["score", [[[[16], 1]]]], ["tabs", null], ["slash", null], ["numbered", null]]],
|
|
8608
|
+
["voice", null],
|
|
8609
|
+
["title", null],
|
|
8610
|
+
["subtitle", null],
|
|
8611
|
+
["artist", null],
|
|
8612
|
+
["album", null],
|
|
8613
|
+
["words", null],
|
|
8614
|
+
["music", null],
|
|
8615
|
+
["wordsandmusic", null],
|
|
8616
|
+
["copyright", null],
|
|
8617
|
+
["copyright2", null],
|
|
8618
|
+
["instructions", null],
|
|
8619
|
+
["notices", null],
|
|
8620
|
+
["tab", null],
|
|
8621
|
+
["systemslayout", null],
|
|
8622
|
+
["defaultsystemslayout", null],
|
|
8623
|
+
["showdynamics", null],
|
|
8624
|
+
["hidedynamics", null],
|
|
8625
|
+
["usesystemsignseparator", null],
|
|
8626
|
+
["multibarrest", null],
|
|
8627
|
+
["bracketextendmode", null],
|
|
8628
|
+
["singletracktracknamepolicy", null],
|
|
8629
|
+
["multitracktracknamepolicy", null],
|
|
8630
|
+
["firstsystemtracknamemode", null],
|
|
8631
|
+
["othersystemstracknamemode", null],
|
|
8632
|
+
["firstsystemtracknameorientation", null],
|
|
8633
|
+
["othersystemstracknameorientation", null],
|
|
8634
|
+
["extendbarlines", null],
|
|
8635
|
+
["tuning", [["hide", null], ["label", [[[[17], 0]]]]]],
|
|
8636
|
+
["chord", [["firstfret", [[[[16], 0]]]], ["barre", [[[[16], 5]]]], ["showdiagram", [[], [[[17], 0, ["true", "false"]]], [[[10], 0, ["true", "false"]]], [[[16], 0, ["1", "0"]]]]], ["showfingering", [[], [[[17], 0, ["true", "false"]]], [[[10], 0, ["true", "false"]]], [[[16], 0, ["1", "0"]]]]], ["showname", [[], [[[17], 0, ["true", "false"]]], [[[10], 0, ["true", "false"]]], [[[16], 0, ["1", "0"]]]]]]],
|
|
8637
|
+
["capo", null],
|
|
8638
|
+
["lyrics", null],
|
|
8639
|
+
["articulation", null],
|
|
8640
|
+
["displaytranspose", null],
|
|
8641
|
+
["transpose", null],
|
|
8642
|
+
["instrument", null],
|
|
8643
|
+
["ts", null],
|
|
8644
|
+
["ro", null],
|
|
8645
|
+
["rc", null],
|
|
8646
|
+
["ae", null],
|
|
8647
|
+
["ks", null],
|
|
8648
|
+
["clef", null],
|
|
8649
|
+
["ottava", null],
|
|
8650
|
+
["tempo", null],
|
|
8651
|
+
["tf", null],
|
|
8652
|
+
["ac", null],
|
|
8653
|
+
["section", null],
|
|
8654
|
+
["jump", null],
|
|
8655
|
+
["ft", null],
|
|
8656
|
+
["simile", null],
|
|
8657
|
+
["barlineleft", null],
|
|
8658
|
+
["barlineright", null],
|
|
8659
|
+
["scale", null],
|
|
8660
|
+
["width", null],
|
|
8661
|
+
["sync", null],
|
|
8662
|
+
["accidentals", null],
|
|
8663
|
+
["spd", null],
|
|
8664
|
+
["sph", null],
|
|
8665
|
+
["spu", null],
|
|
8666
|
+
["db", null],
|
|
8667
|
+
["voicemode", null]
|
|
9020
8668
|
]);
|
|
9021
8669
|
static metaDataSignatures = [
|
|
9022
8670
|
AlphaTex1LanguageDefinitions.scoreMetaDataSignatures,
|
|
@@ -9025,348 +8673,101 @@
|
|
|
9025
8673
|
AlphaTex1LanguageDefinitions.barMetaDataSignatures
|
|
9026
8674
|
];
|
|
9027
8675
|
static durationChangeProperties = AlphaTex1LanguageDefinitions._props([
|
|
9028
|
-
[
|
|
9029
|
-
'tu',
|
|
9030
|
-
[
|
|
9031
|
-
[[[16], 0, ['3', '5', '6', '7', '9', '10', '12']]],
|
|
9032
|
-
[
|
|
9033
|
-
[[16], 0],
|
|
9034
|
-
[[16], 0]
|
|
9035
|
-
]
|
|
9036
|
-
]
|
|
9037
|
-
]
|
|
8676
|
+
["tu", [[[[16], 0, ["3", "5", "6", "7", "9", "10", "12"]]], [[[16], 0], [[16], 0]]]]
|
|
9038
8677
|
]);
|
|
9039
8678
|
static beatProperties = AlphaTex1LanguageDefinitions._props([
|
|
9040
|
-
[
|
|
9041
|
-
[
|
|
9042
|
-
[
|
|
9043
|
-
[
|
|
9044
|
-
[
|
|
9045
|
-
[
|
|
9046
|
-
[
|
|
9047
|
-
[
|
|
9048
|
-
[
|
|
9049
|
-
[
|
|
9050
|
-
[
|
|
9051
|
-
[
|
|
9052
|
-
[
|
|
9053
|
-
[
|
|
9054
|
-
[
|
|
9055
|
-
[
|
|
9056
|
-
[
|
|
9057
|
-
[
|
|
9058
|
-
[
|
|
9059
|
-
[
|
|
9060
|
-
[
|
|
9061
|
-
[
|
|
9062
|
-
[
|
|
9063
|
-
[
|
|
9064
|
-
[
|
|
9065
|
-
[
|
|
9066
|
-
[
|
|
9067
|
-
|
|
9068
|
-
|
|
9069
|
-
|
|
9070
|
-
|
|
9071
|
-
|
|
9072
|
-
|
|
9073
|
-
|
|
9074
|
-
|
|
9075
|
-
],
|
|
9076
|
-
[
|
|
9077
|
-
[
|
|
9078
|
-
|
|
9079
|
-
|
|
9080
|
-
|
|
9081
|
-
|
|
9082
|
-
|
|
9083
|
-
|
|
9084
|
-
|
|
9085
|
-
|
|
9086
|
-
],
|
|
9087
|
-
[
|
|
9088
|
-
|
|
9089
|
-
[
|
|
9090
|
-
[[[16], 5]],
|
|
9091
|
-
[
|
|
9092
|
-
[[10, 17], 0, ['custom', 'dive', 'dip', 'hold', 'predive', 'predivedive']],
|
|
9093
|
-
[[16], 5]
|
|
9094
|
-
],
|
|
9095
|
-
[
|
|
9096
|
-
[[10, 17], 0, ['default', 'gradual', 'fast']],
|
|
9097
|
-
[[16], 5]
|
|
9098
|
-
],
|
|
9099
|
-
[
|
|
9100
|
-
[[10, 17], 0, ['custom', 'dive', 'dip', 'hold', 'predive', 'predivedive']],
|
|
9101
|
-
[[10, 17], 0, ['default', 'gradual', 'fast']],
|
|
9102
|
-
[[16], 5]
|
|
9103
|
-
]
|
|
9104
|
-
]
|
|
9105
|
-
],
|
|
9106
|
-
[
|
|
9107
|
-
'tbe',
|
|
9108
|
-
[
|
|
9109
|
-
[[[16], 5]],
|
|
9110
|
-
[
|
|
9111
|
-
[[10, 17], 0, ['custom', 'dive', 'dip', 'hold', 'predive', 'predivedive']],
|
|
9112
|
-
[[16], 5]
|
|
9113
|
-
],
|
|
9114
|
-
[
|
|
9115
|
-
[[10, 17], 0, ['default', 'gradual', 'fast']],
|
|
9116
|
-
[[16], 5]
|
|
9117
|
-
],
|
|
9118
|
-
[
|
|
9119
|
-
[[10, 17], 0, ['custom', 'dive', 'dip', 'hold', 'predive', 'predivedive']],
|
|
9120
|
-
[[10, 17], 0, ['default', 'gradual', 'fast']],
|
|
9121
|
-
[[16], 5]
|
|
9122
|
-
]
|
|
9123
|
-
]
|
|
9124
|
-
],
|
|
9125
|
-
['bu', [[[[16], 1]]]],
|
|
9126
|
-
['bd', [[[[16], 1]]]],
|
|
9127
|
-
['au', [[[[16], 1]]]],
|
|
9128
|
-
['ad', [[[[16], 1]]]],
|
|
9129
|
-
['ch', [[[[17, 10], 0]]]],
|
|
9130
|
-
['gr', [[[[10, 17], 1, ['onbeat', 'beforebeat', 'bendgrace', 'ob', 'bb', 'b']]]]],
|
|
9131
|
-
[
|
|
9132
|
-
'dy',
|
|
9133
|
-
[
|
|
9134
|
-
[
|
|
9135
|
-
[
|
|
9136
|
-
[10, 17],
|
|
9137
|
-
0,
|
|
9138
|
-
[
|
|
9139
|
-
'ppp',
|
|
9140
|
-
'pp',
|
|
9141
|
-
'p',
|
|
9142
|
-
'mp',
|
|
9143
|
-
'mf',
|
|
9144
|
-
'f',
|
|
9145
|
-
'ff',
|
|
9146
|
-
'fff',
|
|
9147
|
-
'pppp',
|
|
9148
|
-
'ppppp',
|
|
9149
|
-
'pppppp',
|
|
9150
|
-
'ffff',
|
|
9151
|
-
'fffff',
|
|
9152
|
-
'ffffff',
|
|
9153
|
-
'sf',
|
|
9154
|
-
'sfp',
|
|
9155
|
-
'sfpp',
|
|
9156
|
-
'fp',
|
|
9157
|
-
'rf',
|
|
9158
|
-
'rfz',
|
|
9159
|
-
'sfz',
|
|
9160
|
-
'sffz',
|
|
9161
|
-
'fz',
|
|
9162
|
-
'n',
|
|
9163
|
-
'pf',
|
|
9164
|
-
'sfzp'
|
|
9165
|
-
]
|
|
9166
|
-
]
|
|
9167
|
-
]
|
|
9168
|
-
]
|
|
9169
|
-
],
|
|
9170
|
-
[
|
|
9171
|
-
'tempo',
|
|
9172
|
-
[
|
|
9173
|
-
[
|
|
9174
|
-
[[16], 0],
|
|
9175
|
-
[[10], 1, ['hide']]
|
|
9176
|
-
],
|
|
9177
|
-
[
|
|
9178
|
-
[[16], 0],
|
|
9179
|
-
[[17], 0],
|
|
9180
|
-
[[10], 1, ['hide']]
|
|
9181
|
-
]
|
|
9182
|
-
]
|
|
9183
|
-
],
|
|
9184
|
-
['volume', [[[[16], 0]]]],
|
|
9185
|
-
['balance', [[[[16], 0]]]],
|
|
9186
|
-
['tp', [[[[16], 0, ['8', '16', '32']]]]],
|
|
9187
|
-
[
|
|
9188
|
-
'barre',
|
|
9189
|
-
[
|
|
9190
|
-
[
|
|
9191
|
-
[[16], 0],
|
|
9192
|
-
[[10, 17], 1, ['full', 'half']]
|
|
9193
|
-
]
|
|
9194
|
-
]
|
|
9195
|
-
],
|
|
9196
|
-
[
|
|
9197
|
-
'rasg',
|
|
9198
|
-
[
|
|
9199
|
-
[
|
|
9200
|
-
[
|
|
9201
|
-
[10, 17],
|
|
9202
|
-
0,
|
|
9203
|
-
[
|
|
9204
|
-
'ii',
|
|
9205
|
-
'mi',
|
|
9206
|
-
'miitriplet',
|
|
9207
|
-
'miianapaest',
|
|
9208
|
-
'pmptriplet',
|
|
9209
|
-
'pmpanapaest',
|
|
9210
|
-
'peitriplet',
|
|
9211
|
-
'peianapaest',
|
|
9212
|
-
'paitriplet',
|
|
9213
|
-
'paianapaest',
|
|
9214
|
-
'amitriplet',
|
|
9215
|
-
'amianapaest',
|
|
9216
|
-
'ppp',
|
|
9217
|
-
'amii',
|
|
9218
|
-
'amip',
|
|
9219
|
-
'eami',
|
|
9220
|
-
'eamii',
|
|
9221
|
-
'peami'
|
|
9222
|
-
]
|
|
9223
|
-
]
|
|
9224
|
-
]
|
|
9225
|
-
]
|
|
9226
|
-
],
|
|
9227
|
-
['ot', [[[[10, 17], 0, ['15ma', '8va', 'regular', '8vb', '15mb', '15ma', '8va', '8vb', '15mb']]]]],
|
|
9228
|
-
['instrument', [[[[16], 0]], [[[17, 10], 0]], [[[10], 0, ['percussion']]]]],
|
|
9229
|
-
['bank', [[[[16], 0]]]],
|
|
9230
|
-
[
|
|
9231
|
-
'fermata',
|
|
9232
|
-
[
|
|
9233
|
-
[
|
|
9234
|
-
[[10, 17], 0, ['short', 'medium', 'long']],
|
|
9235
|
-
[[16], 3]
|
|
9236
|
-
]
|
|
9237
|
-
]
|
|
9238
|
-
],
|
|
9239
|
-
['beam', [[[[10, 17], 0, ['invert', 'up', 'down', 'auto', 'split', 'merge', 'splitsecondary']]]]]
|
|
8679
|
+
["f", null],
|
|
8680
|
+
["fo", null],
|
|
8681
|
+
["vs", null],
|
|
8682
|
+
["v", null],
|
|
8683
|
+
["vw", null],
|
|
8684
|
+
["s", null],
|
|
8685
|
+
["p", null],
|
|
8686
|
+
["tt", null],
|
|
8687
|
+
["d", null],
|
|
8688
|
+
["dd", null],
|
|
8689
|
+
["su", null],
|
|
8690
|
+
["sd", null],
|
|
8691
|
+
["cre", null],
|
|
8692
|
+
["dec", null],
|
|
8693
|
+
["spd", null],
|
|
8694
|
+
["sph", null],
|
|
8695
|
+
["spu", null],
|
|
8696
|
+
["spe", null],
|
|
8697
|
+
["slashed", null],
|
|
8698
|
+
["ds", null],
|
|
8699
|
+
["glpf", null],
|
|
8700
|
+
["glpt", null],
|
|
8701
|
+
["waho", null],
|
|
8702
|
+
["wahc", null],
|
|
8703
|
+
["legatoorigin", null],
|
|
8704
|
+
["timer", null],
|
|
8705
|
+
["tu", [[[[16], 0, ["3", "5", "6", "7", "9", "10", "12"]]], [[[16], 0], [[16], 0]]]],
|
|
8706
|
+
["txt", [[[[17, 10], 0]]]],
|
|
8707
|
+
["lyrics", [[[[17], 0]], [[[16], 0], [[17], 0]]]],
|
|
8708
|
+
["tb", [[[[16], 5]], [[[10, 17], 0, ["custom", "dive", "dip", "hold", "predive", "predivedive"]], [[16], 5]], [[[10, 17], 0, ["default", "gradual", "fast"]], [[16], 5]], [[[10, 17], 0, ["custom", "dive", "dip", "hold", "predive", "predivedive"]], [[10, 17], 0, ["default", "gradual", "fast"]], [[16], 5]]]],
|
|
8709
|
+
["tbe", [[[[16], 5]], [[[10, 17], 0, ["custom", "dive", "dip", "hold", "predive", "predivedive"]], [[16], 5]], [[[10, 17], 0, ["default", "gradual", "fast"]], [[16], 5]], [[[10, 17], 0, ["custom", "dive", "dip", "hold", "predive", "predivedive"]], [[10, 17], 0, ["default", "gradual", "fast"]], [[16], 5]]]],
|
|
8710
|
+
["bu", [[[[16], 1]]]],
|
|
8711
|
+
["bd", [[[[16], 1]]]],
|
|
8712
|
+
["au", [[[[16], 1]]]],
|
|
8713
|
+
["ad", [[[[16], 1]]]],
|
|
8714
|
+
["ch", [[[[17, 10], 0]]]],
|
|
8715
|
+
["gr", [[[[10, 17], 1, ["onbeat", "beforebeat", "bendgrace", "ob", "bb", "b"]]]]],
|
|
8716
|
+
["dy", [[[[10, 17], 0, ["ppp", "pp", "p", "mp", "mf", "f", "ff", "fff", "pppp", "ppppp", "pppppp", "ffff", "fffff", "ffffff", "sf", "sfp", "sfpp", "fp", "rf", "rfz", "sfz", "sffz", "fz", "n", "pf", "sfzp"]]]]],
|
|
8717
|
+
["tempo", [[[[16], 0], [[10], 1, ["hide"]]], [[[16], 0], [[17], 0], [[10], 1, ["hide"]]]]],
|
|
8718
|
+
["volume", [[[[16], 0]]]],
|
|
8719
|
+
["balance", [[[[16], 0]]]],
|
|
8720
|
+
["tp", [[[[16], 0, ["8", "16", "32"]]]]],
|
|
8721
|
+
["barre", [[[[16], 0], [[10, 17], 1, ["full", "half"]]]]],
|
|
8722
|
+
["rasg", [[[[10, 17], 0, ["ii", "mi", "miitriplet", "miianapaest", "pmptriplet", "pmpanapaest", "peitriplet", "peianapaest", "paitriplet", "paianapaest", "amitriplet", "amianapaest", "ppp", "amii", "amip", "eami", "eamii", "peami"]]]]],
|
|
8723
|
+
["ot", [[[[10, 17], 0, ["15ma", "8va", "regular", "8vb", "15mb", "15ma", "8va", "8vb", "15mb"]]]]],
|
|
8724
|
+
["instrument", [[[[16], 0]], [[[17, 10], 0]], [[[10], 0, ["percussion"]]]]],
|
|
8725
|
+
["bank", [[[[16], 0]]]],
|
|
8726
|
+
["fermata", [[[[10, 17], 0, ["short", "medium", "long"]], [[16], 3]]]],
|
|
8727
|
+
["beam", [[[[10, 17], 0, ["invert", "up", "down", "auto", "split", "merge", "splitsecondary"]]]]]
|
|
9240
8728
|
]);
|
|
9241
8729
|
static noteProperties = AlphaTex1LanguageDefinitions._props([
|
|
9242
|
-
[
|
|
9243
|
-
[
|
|
9244
|
-
[
|
|
9245
|
-
[
|
|
9246
|
-
[
|
|
9247
|
-
[
|
|
9248
|
-
[
|
|
9249
|
-
[
|
|
9250
|
-
[
|
|
9251
|
-
[
|
|
9252
|
-
[
|
|
9253
|
-
[
|
|
9254
|
-
[
|
|
9255
|
-
[
|
|
9256
|
-
[
|
|
9257
|
-
[
|
|
9258
|
-
[
|
|
9259
|
-
[
|
|
9260
|
-
[
|
|
9261
|
-
[
|
|
9262
|
-
[
|
|
9263
|
-
[
|
|
9264
|
-
[
|
|
9265
|
-
|
|
9266
|
-
|
|
9267
|
-
|
|
9268
|
-
|
|
9269
|
-
|
|
9270
|
-
|
|
9271
|
-
|
|
9272
|
-
],
|
|
9273
|
-
[
|
|
9274
|
-
[
|
|
9275
|
-
[
|
|
9276
|
-
[
|
|
9277
|
-
[
|
|
9278
|
-
[
|
|
9279
|
-
[
|
|
9280
|
-
[
|
|
9281
|
-
[
|
|
9282
|
-
[
|
|
9283
|
-
['hide', null],
|
|
9284
|
-
[
|
|
9285
|
-
'b',
|
|
9286
|
-
[
|
|
9287
|
-
[[[16], 5]],
|
|
9288
|
-
[
|
|
9289
|
-
[
|
|
9290
|
-
[10, 17],
|
|
9291
|
-
0,
|
|
9292
|
-
['custom', 'bend', 'release', 'bendrelease', 'hold', 'prebend', 'prebendbend', 'prebendrelease']
|
|
9293
|
-
],
|
|
9294
|
-
[[16], 5]
|
|
9295
|
-
],
|
|
9296
|
-
[
|
|
9297
|
-
[[10, 17], 0, ['default', 'gradual', 'fast']],
|
|
9298
|
-
[[16], 5]
|
|
9299
|
-
],
|
|
9300
|
-
[
|
|
9301
|
-
[
|
|
9302
|
-
[10, 17],
|
|
9303
|
-
0,
|
|
9304
|
-
['custom', 'bend', 'release', 'bendrelease', 'hold', 'prebend', 'prebendbend', 'prebendrelease']
|
|
9305
|
-
],
|
|
9306
|
-
[[10, 17], 0, ['default', 'gradual', 'fast']],
|
|
9307
|
-
[[16], 5]
|
|
9308
|
-
]
|
|
9309
|
-
]
|
|
9310
|
-
],
|
|
9311
|
-
[
|
|
9312
|
-
'be',
|
|
9313
|
-
[
|
|
9314
|
-
[[[16], 5]],
|
|
9315
|
-
[
|
|
9316
|
-
[
|
|
9317
|
-
[10, 17],
|
|
9318
|
-
0,
|
|
9319
|
-
['custom', 'bend', 'release', 'bendrelease', 'hold', 'prebend', 'prebendbend', 'prebendrelease']
|
|
9320
|
-
],
|
|
9321
|
-
[[16], 5]
|
|
9322
|
-
],
|
|
9323
|
-
[
|
|
9324
|
-
[[10, 17], 0, ['default', 'gradual', 'fast']],
|
|
9325
|
-
[[16], 5]
|
|
9326
|
-
],
|
|
9327
|
-
[
|
|
9328
|
-
[
|
|
9329
|
-
[10, 17],
|
|
9330
|
-
0,
|
|
9331
|
-
['custom', 'bend', 'release', 'bendrelease', 'hold', 'prebend', 'prebendbend', 'prebendrelease']
|
|
9332
|
-
],
|
|
9333
|
-
[[10, 17], 0, ['default', 'gradual', 'fast']],
|
|
9334
|
-
[[16], 5]
|
|
9335
|
-
]
|
|
9336
|
-
]
|
|
9337
|
-
],
|
|
9338
|
-
['lf', [[[[16], 0, ['1', '2', '3', '4', '5']]]]],
|
|
9339
|
-
['rf', [[[[16], 0, ['1', '2', '3', '4', '5']]]]],
|
|
9340
|
-
[
|
|
9341
|
-
'acc',
|
|
9342
|
-
[
|
|
9343
|
-
[
|
|
9344
|
-
[
|
|
9345
|
-
[10, 17],
|
|
9346
|
-
0,
|
|
9347
|
-
[
|
|
9348
|
-
'default',
|
|
9349
|
-
'forcenone',
|
|
9350
|
-
'forcenatural',
|
|
9351
|
-
'forcesharp',
|
|
9352
|
-
'forcedoublesharp',
|
|
9353
|
-
'forceflat',
|
|
9354
|
-
'forcedoubleflat',
|
|
9355
|
-
'd',
|
|
9356
|
-
'-',
|
|
9357
|
-
'n',
|
|
9358
|
-
'#',
|
|
9359
|
-
'##',
|
|
9360
|
-
'x',
|
|
9361
|
-
'b',
|
|
9362
|
-
'bb'
|
|
9363
|
-
]
|
|
9364
|
-
]
|
|
9365
|
-
]
|
|
9366
|
-
]
|
|
9367
|
-
],
|
|
9368
|
-
['slur', [[[[17], 0]], [[[10], 0]]]],
|
|
9369
|
-
['-', null]
|
|
8730
|
+
["nh", null],
|
|
8731
|
+
["ah", [[[[16], 1]]]],
|
|
8732
|
+
["th", [[[[16], 1]]]],
|
|
8733
|
+
["ph", [[[[16], 1]]]],
|
|
8734
|
+
["sh", [[[[16], 1]]]],
|
|
8735
|
+
["fh", [[[[16], 1]]]],
|
|
8736
|
+
["v", null],
|
|
8737
|
+
["vw", null],
|
|
8738
|
+
["sl", null],
|
|
8739
|
+
["ss", null],
|
|
8740
|
+
["sib", null],
|
|
8741
|
+
["sia", null],
|
|
8742
|
+
["sou", null],
|
|
8743
|
+
["sod", null],
|
|
8744
|
+
["psu", null],
|
|
8745
|
+
["psd", null],
|
|
8746
|
+
["h", null],
|
|
8747
|
+
["lht", null],
|
|
8748
|
+
["g", null],
|
|
8749
|
+
["ac", null],
|
|
8750
|
+
["hac", null],
|
|
8751
|
+
["ten", null],
|
|
8752
|
+
["tr", [[[[16], 0], [[16], 1, ["16", "32", "64"]]]]],
|
|
8753
|
+
["pm", null],
|
|
8754
|
+
["st", null],
|
|
8755
|
+
["lr", null],
|
|
8756
|
+
["x", null],
|
|
8757
|
+
["t", null],
|
|
8758
|
+
["turn", null],
|
|
8759
|
+
["iturn", null],
|
|
8760
|
+
["umordent", null],
|
|
8761
|
+
["lmordent", null],
|
|
8762
|
+
["string", null],
|
|
8763
|
+
["hide", null],
|
|
8764
|
+
["b", [[[[16], 5]], [[[10, 17], 0, ["custom", "bend", "release", "bendrelease", "hold", "prebend", "prebendbend", "prebendrelease"]], [[16], 5]], [[[10, 17], 0, ["default", "gradual", "fast"]], [[16], 5]], [[[10, 17], 0, ["custom", "bend", "release", "bendrelease", "hold", "prebend", "prebendbend", "prebendrelease"]], [[10, 17], 0, ["default", "gradual", "fast"]], [[16], 5]]]],
|
|
8765
|
+
["be", [[[[16], 5]], [[[10, 17], 0, ["custom", "bend", "release", "bendrelease", "hold", "prebend", "prebendbend", "prebendrelease"]], [[16], 5]], [[[10, 17], 0, ["default", "gradual", "fast"]], [[16], 5]], [[[10, 17], 0, ["custom", "bend", "release", "bendrelease", "hold", "prebend", "prebendbend", "prebendrelease"]], [[10, 17], 0, ["default", "gradual", "fast"]], [[16], 5]]]],
|
|
8766
|
+
["lf", [[[[16], 0, ["1", "2", "3", "4", "5"]]]]],
|
|
8767
|
+
["rf", [[[[16], 0, ["1", "2", "3", "4", "5"]]]]],
|
|
8768
|
+
["acc", [[[[10, 17], 0, ["default", "forcenone", "forcenatural", "forcesharp", "forcedoublesharp", "forceflat", "forcedoubleflat", "d", "-", "n", "#", "##", "x", "b", "bb"]]]]],
|
|
8769
|
+
["slur", [[[[17], 0]], [[[10], 0]]]],
|
|
8770
|
+
["-", null]
|
|
9370
8771
|
]);
|
|
9371
8772
|
}
|
|
9372
8773
|
|
|
@@ -9596,6 +8997,14 @@
|
|
|
9596
8997
|
AlphaTexAccidentalMode[AlphaTexAccidentalMode["Auto"] = 0] = "Auto";
|
|
9597
8998
|
AlphaTexAccidentalMode[AlphaTexAccidentalMode["Explicit"] = 1] = "Explicit";
|
|
9598
8999
|
})(AlphaTexAccidentalMode || (AlphaTexAccidentalMode = {}));
|
|
9000
|
+
/**
|
|
9001
|
+
* @public
|
|
9002
|
+
*/
|
|
9003
|
+
var AlphaTexVoiceMode;
|
|
9004
|
+
(function (AlphaTexVoiceMode) {
|
|
9005
|
+
AlphaTexVoiceMode[AlphaTexVoiceMode["StaffWise"] = 0] = "StaffWise";
|
|
9006
|
+
AlphaTexVoiceMode[AlphaTexVoiceMode["BarWise"] = 1] = "BarWise";
|
|
9007
|
+
})(AlphaTexVoiceMode || (AlphaTexVoiceMode = {}));
|
|
9599
9008
|
/**
|
|
9600
9009
|
* Lists the note kinds we can detect
|
|
9601
9010
|
* @public
|
|
@@ -14233,6 +13642,8 @@
|
|
|
14233
13642
|
return ApplyNodeResult.Applied;
|
|
14234
13643
|
case 'accidentals':
|
|
14235
13644
|
return AlphaTex1LanguageHandler._handleAccidentalMode(importer, metaData.arguments);
|
|
13645
|
+
case 'voicemode':
|
|
13646
|
+
return AlphaTex1LanguageHandler._handleVoiceMode(importer, metaData.arguments);
|
|
14236
13647
|
case 'jump':
|
|
14237
13648
|
const direction = AlphaTex1LanguageHandler._parseEnumValue(importer, metaData.arguments, 'direction', AlphaTex1EnumMappings.direction);
|
|
14238
13649
|
if (direction === undefined) {
|
|
@@ -14305,6 +13716,14 @@
|
|
|
14305
13716
|
importer.state.accidentalMode = accidentalMode;
|
|
14306
13717
|
return ApplyNodeResult.Applied;
|
|
14307
13718
|
}
|
|
13719
|
+
static _handleVoiceMode(importer, args) {
|
|
13720
|
+
const voiceMode = AlphaTex1LanguageHandler._parseEnumValue(importer, args, 'voice mode', AlphaTex1EnumMappings.alphaTexVoiceMode);
|
|
13721
|
+
if (voiceMode === undefined) {
|
|
13722
|
+
return ApplyNodeResult.NotAppliedSemanticError;
|
|
13723
|
+
}
|
|
13724
|
+
importer.state.voiceMode = voiceMode;
|
|
13725
|
+
return ApplyNodeResult.Applied;
|
|
13726
|
+
}
|
|
14308
13727
|
static _getChordId(currentStaff, chordName) {
|
|
14309
13728
|
return chordName.toLowerCase() + currentStaff.index + currentStaff.track.index;
|
|
14310
13729
|
}
|
|
@@ -16559,6 +15978,7 @@
|
|
|
16559
15978
|
syncPoints = [];
|
|
16560
15979
|
currentDynamics = DynamicValue.F;
|
|
16561
15980
|
accidentalMode = AlphaTexAccidentalMode.Explicit;
|
|
15981
|
+
voiceMode = AlphaTexVoiceMode.StaffWise;
|
|
16562
15982
|
currentTupletNumerator = -1;
|
|
16563
15983
|
currentTupletDenominator = -1;
|
|
16564
15984
|
scoreNode;
|
|
@@ -16699,18 +16119,37 @@
|
|
|
16699
16119
|
}
|
|
16700
16120
|
_bars(node) {
|
|
16701
16121
|
if (node.bars.length > 0) {
|
|
16122
|
+
let previousBarCompleted = false;
|
|
16702
16123
|
for (const b of node.bars) {
|
|
16703
|
-
this._bar(b);
|
|
16124
|
+
this._bar(b, previousBarCompleted);
|
|
16125
|
+
switch (this.state.voiceMode) {
|
|
16126
|
+
case AlphaTexVoiceMode.StaffWise:
|
|
16127
|
+
// if voices are staff-wise, we definitly have a new bar here
|
|
16128
|
+
this._state.barIndex++;
|
|
16129
|
+
previousBarCompleted = true;
|
|
16130
|
+
break;
|
|
16131
|
+
case AlphaTexVoiceMode.BarWise:
|
|
16132
|
+
// if voices are bar-wise, the next bar might be another voice in the same bar
|
|
16133
|
+
// (barIndex increment is handled inside _barMeta)
|
|
16134
|
+
// if we have an explicit bar end, we can increase already
|
|
16135
|
+
if (b.pipe) {
|
|
16136
|
+
this._state.barIndex++;
|
|
16137
|
+
this._state.voiceIndex = 0;
|
|
16138
|
+
this._state.ignoredInitialVoice = false;
|
|
16139
|
+
previousBarCompleted = true;
|
|
16140
|
+
}
|
|
16141
|
+
break;
|
|
16142
|
+
}
|
|
16704
16143
|
}
|
|
16705
16144
|
}
|
|
16706
16145
|
else {
|
|
16707
|
-
this.
|
|
16146
|
+
this._getBar(this._state.currentStaff);
|
|
16708
16147
|
this._detectTuningForStaff(this._state.currentStaff);
|
|
16709
16148
|
this._handleTransposition(this._state.currentStaff);
|
|
16710
16149
|
}
|
|
16711
16150
|
}
|
|
16712
|
-
_bar(node) {
|
|
16713
|
-
const bar = this._barMeta(node);
|
|
16151
|
+
_bar(node, previousBarCompleted) {
|
|
16152
|
+
const bar = this._barMeta(node, previousBarCompleted);
|
|
16714
16153
|
this._detectTuningForStaff(this._state.currentStaff);
|
|
16715
16154
|
this._handleTransposition(this._state.currentStaff);
|
|
16716
16155
|
if (bar.index === 0 && this._state.staffInitialClef.has(this._state.currentStaff)) {
|
|
@@ -17160,7 +16599,7 @@
|
|
|
17160
16599
|
this._state.staffTuningApplied.add(staff);
|
|
17161
16600
|
}
|
|
17162
16601
|
}
|
|
17163
|
-
_barMeta(node) {
|
|
16602
|
+
_barMeta(node, previousBarCompleted) {
|
|
17164
16603
|
// it might be a bit an edge case but a valid one:
|
|
17165
16604
|
// one might repeat multiple structural metadata
|
|
17166
16605
|
// in one bar starting multiple tracks/staves/voices which are
|
|
@@ -17175,6 +16614,7 @@
|
|
|
17175
16614
|
let previousStaff = this._state.currentStaff;
|
|
17176
16615
|
let hadNewTrack = false;
|
|
17177
16616
|
let hadNewStaff = false;
|
|
16617
|
+
let hadNewVoice = false;
|
|
17178
16618
|
let applyInitialBarMetaToPreviousStaff = false;
|
|
17179
16619
|
const resetInitialBarMeta = () => {
|
|
17180
16620
|
// reset state
|
|
@@ -17185,10 +16625,16 @@
|
|
|
17185
16625
|
previousStaff = this._state.currentStaff;
|
|
17186
16626
|
hadNewTrack = false;
|
|
17187
16627
|
hadNewStaff = false;
|
|
16628
|
+
hadNewVoice = false;
|
|
17188
16629
|
applyInitialBarMetaToPreviousStaff = false;
|
|
17189
16630
|
};
|
|
17190
16631
|
const bar = new Lazy(() => {
|
|
17191
|
-
|
|
16632
|
+
// had a \voice in this bar -> barIndex and voice were updated already
|
|
16633
|
+
// if not, we start a new bar here
|
|
16634
|
+
if (!hadNewVoice && !previousBarCompleted) {
|
|
16635
|
+
this._state.barIndex++;
|
|
16636
|
+
}
|
|
16637
|
+
const b = this._getBar(this._state.currentStaff);
|
|
17192
16638
|
if (initialBarMeta) {
|
|
17193
16639
|
for (const initial of initialBarMeta) {
|
|
17194
16640
|
this._handler.applyBarMetaData(this, b, initial);
|
|
@@ -17230,6 +16676,9 @@
|
|
|
17230
16676
|
// new bar needed on new structural level
|
|
17231
16677
|
bar.reset();
|
|
17232
16678
|
break;
|
|
16679
|
+
case ApplyStructuralMetaDataResult.AppliedNewVoice:
|
|
16680
|
+
hadNewVoice = true;
|
|
16681
|
+
break;
|
|
17233
16682
|
}
|
|
17234
16683
|
if (initialBarMeta) {
|
|
17235
16684
|
if (applyInitialBarMetaToPreviousStaff) {
|
|
@@ -17289,14 +16738,13 @@
|
|
|
17289
16738
|
}
|
|
17290
16739
|
return bar.value;
|
|
17291
16740
|
}
|
|
17292
|
-
|
|
16741
|
+
_getBar(staff) {
|
|
17293
16742
|
// existing bar? -> e.g. in multi-voice setups where we fill empty voices later
|
|
17294
16743
|
if (this._state.barIndex < staff.bars.length) {
|
|
17295
16744
|
const bar = staff.bars[this._state.barIndex];
|
|
17296
|
-
this._state.barIndex++;
|
|
17297
16745
|
return bar;
|
|
17298
16746
|
}
|
|
17299
|
-
const voiceCount = staff.bars.length === 0 ? 1 : staff.bars[0].voices.length;
|
|
16747
|
+
const voiceCount = staff.bars.length === 0 ? this._state.voiceIndex + 1 : staff.bars[0].voices.length;
|
|
17300
16748
|
// need new bar
|
|
17301
16749
|
const newBar = new Bar();
|
|
17302
16750
|
staff.addBar(newBar);
|
|
@@ -17306,7 +16754,7 @@
|
|
|
17306
16754
|
newBar.keySignature = newBar.previousBar.keySignature;
|
|
17307
16755
|
newBar.keySignatureType = newBar.previousBar.keySignatureType;
|
|
17308
16756
|
}
|
|
17309
|
-
this._state.barIndex
|
|
16757
|
+
this._state.barIndex = newBar.index;
|
|
17310
16758
|
if (newBar.index > 0) {
|
|
17311
16759
|
newBar.clef = newBar.previousBar.clef;
|
|
17312
16760
|
}
|
|
@@ -17360,26 +16808,62 @@
|
|
|
17360
16808
|
return this._state.currentTrack;
|
|
17361
16809
|
}
|
|
17362
16810
|
startNewVoice() {
|
|
17363
|
-
if
|
|
17364
|
-
|
|
17365
|
-
|
|
17366
|
-
|
|
17367
|
-
|
|
17368
|
-
|
|
17369
|
-
|
|
16811
|
+
// only if we're on the first voice we might skip the initial \voice meta
|
|
16812
|
+
let shouldIgnoreInitialVoice = this._state.voiceIndex === 0 && !this._state.ignoredInitialVoice;
|
|
16813
|
+
// this logic is expanded for readability
|
|
16814
|
+
if (shouldIgnoreInitialVoice) {
|
|
16815
|
+
// if we have no bars created yet, we stay on the initial voice
|
|
16816
|
+
if (this._state.currentStaff.bars.length === 0) {
|
|
16817
|
+
shouldIgnoreInitialVoice = true;
|
|
16818
|
+
}
|
|
16819
|
+
else {
|
|
16820
|
+
switch (this._state.voiceMode) {
|
|
16821
|
+
case AlphaTexVoiceMode.StaffWise:
|
|
16822
|
+
// on staffwise voices, we can only ignore the "initial" voice if the
|
|
16823
|
+
// first bar we have is completely empty
|
|
16824
|
+
shouldIgnoreInitialVoice =
|
|
16825
|
+
this._state.currentStaff.bars.length === 1 && this._state.currentStaff.bars[0].isEmpty;
|
|
16826
|
+
break;
|
|
16827
|
+
case AlphaTexVoiceMode.BarWise:
|
|
16828
|
+
// on barwise voices, we ignore the bar count but check only the first voice of the current bar
|
|
16829
|
+
// to find out if it is the initial empty one
|
|
16830
|
+
if (this._state.barIndex < this._state.currentStaff.bars.length) {
|
|
16831
|
+
// bar exists -> check if empty
|
|
16832
|
+
const bar = this._state.currentStaff.bars[this._state.barIndex];
|
|
16833
|
+
shouldIgnoreInitialVoice = bar.voices[0].isEmpty;
|
|
16834
|
+
}
|
|
16835
|
+
else {
|
|
16836
|
+
// bar doesn't exist yet
|
|
16837
|
+
shouldIgnoreInitialVoice = true;
|
|
16838
|
+
}
|
|
16839
|
+
break;
|
|
16840
|
+
}
|
|
16841
|
+
}
|
|
16842
|
+
}
|
|
16843
|
+
if (shouldIgnoreInitialVoice) {
|
|
17370
16844
|
this._state.ignoredInitialVoice = true;
|
|
17371
16845
|
return;
|
|
17372
16846
|
}
|
|
17373
|
-
|
|
16847
|
+
switch (this._state.voiceMode) {
|
|
16848
|
+
case AlphaTexVoiceMode.StaffWise:
|
|
16849
|
+
// start using the new voice (see newBar for details on matching)
|
|
16850
|
+
this._state.voiceIndex++;
|
|
16851
|
+
this._state.barIndex = 0;
|
|
16852
|
+
this._state.currentTupletDenominator = -1;
|
|
16853
|
+
this._state.currentTupletNumerator = -1;
|
|
16854
|
+
break;
|
|
16855
|
+
case AlphaTexVoiceMode.BarWise:
|
|
16856
|
+
this._state.voiceIndex++;
|
|
16857
|
+
this._state.currentTupletDenominator = -1;
|
|
16858
|
+
this._state.currentTupletNumerator = -1;
|
|
16859
|
+
break;
|
|
16860
|
+
}
|
|
16861
|
+
// create all missing voices
|
|
17374
16862
|
for (const b of this._state.currentStaff.bars) {
|
|
17375
|
-
|
|
17376
|
-
|
|
16863
|
+
while (b.voices.length <= this._state.voiceIndex) {
|
|
16864
|
+
b.addVoice(new Voice$1());
|
|
16865
|
+
}
|
|
17377
16866
|
}
|
|
17378
|
-
// start using the new voice (see newBar for details on matching)
|
|
17379
|
-
this._state.voiceIndex++;
|
|
17380
|
-
this._state.barIndex = 0;
|
|
17381
|
-
this._state.currentTupletDenominator = -1;
|
|
17382
|
-
this._state.currentTupletNumerator = -1;
|
|
17383
16867
|
}
|
|
17384
16868
|
}
|
|
17385
16869
|
|
|
@@ -48303,6 +47787,39 @@
|
|
|
48303
47787
|
}
|
|
48304
47788
|
}
|
|
48305
47789
|
|
|
47790
|
+
/**
|
|
47791
|
+
* Lists the different position modes for {@link BarRendererBase.getBeatX}
|
|
47792
|
+
* @internal
|
|
47793
|
+
*/
|
|
47794
|
+
var BeatXPosition;
|
|
47795
|
+
(function (BeatXPosition) {
|
|
47796
|
+
/**
|
|
47797
|
+
* Gets the pre-notes position which is located before the accidentals
|
|
47798
|
+
*/
|
|
47799
|
+
BeatXPosition[BeatXPosition["PreNotes"] = 0] = "PreNotes";
|
|
47800
|
+
/**
|
|
47801
|
+
* Gets the on-notes position which is located after the accidentals but before the note heads.
|
|
47802
|
+
*/
|
|
47803
|
+
BeatXPosition[BeatXPosition["OnNotes"] = 1] = "OnNotes";
|
|
47804
|
+
/**
|
|
47805
|
+
* Gets the middle-notes position which is located after in the exact center of the note heads.
|
|
47806
|
+
*/
|
|
47807
|
+
BeatXPosition[BeatXPosition["MiddleNotes"] = 2] = "MiddleNotes";
|
|
47808
|
+
/**
|
|
47809
|
+
* Gets position of the stem for this beat
|
|
47810
|
+
*/
|
|
47811
|
+
BeatXPosition[BeatXPosition["Stem"] = 3] = "Stem";
|
|
47812
|
+
/**
|
|
47813
|
+
* Get the post-notes position which is located at after the note heads.
|
|
47814
|
+
*/
|
|
47815
|
+
BeatXPosition[BeatXPosition["PostNotes"] = 4] = "PostNotes";
|
|
47816
|
+
/**
|
|
47817
|
+
* Get the end-beat position which is located at the end of the beat. This position is almost
|
|
47818
|
+
* equal to the pre-notes position of the next beat.
|
|
47819
|
+
*/
|
|
47820
|
+
BeatXPosition[BeatXPosition["EndBeat"] = 5] = "EndBeat";
|
|
47821
|
+
})(BeatXPosition || (BeatXPosition = {}));
|
|
47822
|
+
|
|
48306
47823
|
/**
|
|
48307
47824
|
* A glyph is a single symbol which can be added to a GlyphBarRenderer for automated
|
|
48308
47825
|
* layouting and drawing of stacked symbols.
|
|
@@ -48330,198 +47847,6 @@
|
|
|
48330
47847
|
}
|
|
48331
47848
|
}
|
|
48332
47849
|
|
|
48333
|
-
/**
|
|
48334
|
-
* Effect-Glyphs implementing this public interface get notified
|
|
48335
|
-
* as they are expanded over multiple beats.
|
|
48336
|
-
* @internal
|
|
48337
|
-
*/
|
|
48338
|
-
class EffectGlyph extends Glyph {
|
|
48339
|
-
/**
|
|
48340
|
-
* Gets or sets the beat where the glyph belongs to.
|
|
48341
|
-
*/
|
|
48342
|
-
beat = null;
|
|
48343
|
-
/**
|
|
48344
|
-
* Gets or sets the next glyph of the same type in case
|
|
48345
|
-
* the effect glyph is expanded when using {@link EffectBarGlyphSizing.groupedOnBeat}.
|
|
48346
|
-
*/
|
|
48347
|
-
nextGlyph = null;
|
|
48348
|
-
/**
|
|
48349
|
-
* Gets or sets the previous glyph of the same type in case
|
|
48350
|
-
* the effect glyph is expanded when using {@link EffectBarGlyphSizing.groupedOnBeat}.
|
|
48351
|
-
*/
|
|
48352
|
-
previousGlyph = null;
|
|
48353
|
-
constructor(x = 0, y = 0) {
|
|
48354
|
-
super(x, y);
|
|
48355
|
-
}
|
|
48356
|
-
}
|
|
48357
|
-
|
|
48358
|
-
/**
|
|
48359
|
-
* @internal
|
|
48360
|
-
*/
|
|
48361
|
-
class MusicFontGlyph extends EffectGlyph {
|
|
48362
|
-
glyphScale = 0;
|
|
48363
|
-
symbol;
|
|
48364
|
-
center = false;
|
|
48365
|
-
colorOverride;
|
|
48366
|
-
offsetX = 0;
|
|
48367
|
-
offsetY = 0;
|
|
48368
|
-
constructor(x, y, glyphScale, symbol) {
|
|
48369
|
-
super(x, y);
|
|
48370
|
-
this.glyphScale = glyphScale;
|
|
48371
|
-
this.symbol = symbol;
|
|
48372
|
-
}
|
|
48373
|
-
getBoundingBoxTop() {
|
|
48374
|
-
const bBoxTop = this.renderer.smuflMetrics.glyphTop.get(this.symbol);
|
|
48375
|
-
return this.y - this.offsetY - bBoxTop;
|
|
48376
|
-
}
|
|
48377
|
-
doLayout() {
|
|
48378
|
-
this.width = this.renderer.smuflMetrics.glyphWidths.get(this.symbol) * this.glyphScale;
|
|
48379
|
-
this.height = this.renderer.smuflMetrics.glyphHeights.get(this.symbol) * this.glyphScale;
|
|
48380
|
-
}
|
|
48381
|
-
paint(cx, cy, canvas) {
|
|
48382
|
-
if (this.width === 0 && this.height === 0) {
|
|
48383
|
-
return;
|
|
48384
|
-
}
|
|
48385
|
-
const c = canvas.color;
|
|
48386
|
-
if (this.colorOverride) {
|
|
48387
|
-
canvas.color = this.colorOverride;
|
|
48388
|
-
}
|
|
48389
|
-
canvas.fillMusicFontSymbol(cx + this.x + this.offsetX, cy + this.y + this.offsetY, this.glyphScale, this.symbol, this.center);
|
|
48390
|
-
canvas.color = c;
|
|
48391
|
-
}
|
|
48392
|
-
}
|
|
48393
|
-
/**
|
|
48394
|
-
* @internal
|
|
48395
|
-
*/
|
|
48396
|
-
class MusicFontTextGlyph extends EffectGlyph {
|
|
48397
|
-
glyphScale = 0;
|
|
48398
|
-
symbols;
|
|
48399
|
-
center = false;
|
|
48400
|
-
colorOverride;
|
|
48401
|
-
offsetX = 0;
|
|
48402
|
-
offsetY = 0;
|
|
48403
|
-
constructor(x, y, glyphScale, symbols) {
|
|
48404
|
-
super(x, y);
|
|
48405
|
-
this.glyphScale = glyphScale;
|
|
48406
|
-
this.symbols = symbols;
|
|
48407
|
-
}
|
|
48408
|
-
getBoundingBoxTop() {
|
|
48409
|
-
let bBoxTop = 0;
|
|
48410
|
-
for (let i = 0; i < this.symbols.length; i++) {
|
|
48411
|
-
const gTop = this.renderer.smuflMetrics.glyphTop.get(this.symbols[i]);
|
|
48412
|
-
if (i === 0 || gTop < bBoxTop) {
|
|
48413
|
-
bBoxTop = gTop;
|
|
48414
|
-
}
|
|
48415
|
-
}
|
|
48416
|
-
return this.y - this.offsetY - bBoxTop;
|
|
48417
|
-
}
|
|
48418
|
-
doLayout() {
|
|
48419
|
-
this.width = 0;
|
|
48420
|
-
this.height = 0;
|
|
48421
|
-
for (let i = 0; i < this.symbols.length; i++) {
|
|
48422
|
-
const gWidth = this.renderer.smuflMetrics.glyphWidths.get(this.symbols[i]) * this.glyphScale;
|
|
48423
|
-
const gHeight = this.renderer.smuflMetrics.glyphHeights.get(this.symbols[i]) * this.glyphScale;
|
|
48424
|
-
if (i === 0 || gWidth > this.width) {
|
|
48425
|
-
this.width = gWidth;
|
|
48426
|
-
}
|
|
48427
|
-
if (i === 0 || gHeight > this.height) {
|
|
48428
|
-
this.height = gHeight;
|
|
48429
|
-
}
|
|
48430
|
-
}
|
|
48431
|
-
}
|
|
48432
|
-
paint(cx, cy, canvas) {
|
|
48433
|
-
if (this.width === 0 && this.height === 0) {
|
|
48434
|
-
return;
|
|
48435
|
-
}
|
|
48436
|
-
const c = canvas.color;
|
|
48437
|
-
if (this.colorOverride) {
|
|
48438
|
-
canvas.color = this.colorOverride;
|
|
48439
|
-
}
|
|
48440
|
-
canvas.fillMusicFontSymbols(cx + this.x + this.offsetX, cy + this.y + this.offsetY, this.glyphScale, this.symbols, this.center);
|
|
48441
|
-
canvas.color = c;
|
|
48442
|
-
}
|
|
48443
|
-
}
|
|
48444
|
-
|
|
48445
|
-
/**
|
|
48446
|
-
* @internal
|
|
48447
|
-
*/
|
|
48448
|
-
class NoteHeadGlyph extends MusicFontGlyph {
|
|
48449
|
-
// TODO: SmuFL
|
|
48450
|
-
static GraceScale = 0.75;
|
|
48451
|
-
centerOnStem = false;
|
|
48452
|
-
constructor(x, y, duration, isGrace) {
|
|
48453
|
-
super(x, y, isGrace ? NoteHeadGlyph.GraceScale : 1, NoteHeadGlyph.getSymbol(duration));
|
|
48454
|
-
}
|
|
48455
|
-
paint(cx, cy, canvas) {
|
|
48456
|
-
if (this.centerOnStem) {
|
|
48457
|
-
this.center = true;
|
|
48458
|
-
}
|
|
48459
|
-
super.paint(cx, cy, canvas);
|
|
48460
|
-
}
|
|
48461
|
-
static getSymbol(duration) {
|
|
48462
|
-
switch (duration) {
|
|
48463
|
-
case Duration.QuadrupleWhole:
|
|
48464
|
-
return MusicFontSymbol.NoteheadDoubleWholeSquare;
|
|
48465
|
-
case Duration.DoubleWhole:
|
|
48466
|
-
return MusicFontSymbol.NoteheadDoubleWhole;
|
|
48467
|
-
case Duration.Whole:
|
|
48468
|
-
return MusicFontSymbol.NoteheadWhole;
|
|
48469
|
-
case Duration.Half:
|
|
48470
|
-
return MusicFontSymbol.NoteheadHalf;
|
|
48471
|
-
default:
|
|
48472
|
-
return MusicFontSymbol.NoteheadBlack;
|
|
48473
|
-
}
|
|
48474
|
-
}
|
|
48475
|
-
}
|
|
48476
|
-
|
|
48477
|
-
/**
|
|
48478
|
-
* @internal
|
|
48479
|
-
*/
|
|
48480
|
-
class FlagGlyph extends MusicFontGlyph {
|
|
48481
|
-
constructor(x, y, duration, direction, isGrace) {
|
|
48482
|
-
super(x, y, isGrace ? NoteHeadGlyph.GraceScale : 1, FlagGlyph.getSymbol(duration, direction, isGrace));
|
|
48483
|
-
}
|
|
48484
|
-
static getSymbol(duration, direction, isGrace) {
|
|
48485
|
-
if (isGrace) {
|
|
48486
|
-
duration = Duration.Eighth;
|
|
48487
|
-
}
|
|
48488
|
-
if (direction === BeamDirection.Up) {
|
|
48489
|
-
switch (duration) {
|
|
48490
|
-
case Duration.Eighth:
|
|
48491
|
-
return MusicFontSymbol.Flag8thUp;
|
|
48492
|
-
case Duration.Sixteenth:
|
|
48493
|
-
return MusicFontSymbol.Flag16thUp;
|
|
48494
|
-
case Duration.ThirtySecond:
|
|
48495
|
-
return MusicFontSymbol.Flag32ndUp;
|
|
48496
|
-
case Duration.SixtyFourth:
|
|
48497
|
-
return MusicFontSymbol.Flag64thUp;
|
|
48498
|
-
case Duration.OneHundredTwentyEighth:
|
|
48499
|
-
return MusicFontSymbol.Flag128thUp;
|
|
48500
|
-
case Duration.TwoHundredFiftySixth:
|
|
48501
|
-
return MusicFontSymbol.Flag256thUp;
|
|
48502
|
-
default:
|
|
48503
|
-
return MusicFontSymbol.Flag8thUp;
|
|
48504
|
-
}
|
|
48505
|
-
}
|
|
48506
|
-
switch (duration) {
|
|
48507
|
-
case Duration.Eighth:
|
|
48508
|
-
return MusicFontSymbol.Flag8thDown;
|
|
48509
|
-
case Duration.Sixteenth:
|
|
48510
|
-
return MusicFontSymbol.Flag16thDown;
|
|
48511
|
-
case Duration.ThirtySecond:
|
|
48512
|
-
return MusicFontSymbol.Flag32ndDown;
|
|
48513
|
-
case Duration.SixtyFourth:
|
|
48514
|
-
return MusicFontSymbol.Flag64thDown;
|
|
48515
|
-
case Duration.OneHundredTwentyEighth:
|
|
48516
|
-
return MusicFontSymbol.Flag128thDown;
|
|
48517
|
-
case Duration.TwoHundredFiftySixth:
|
|
48518
|
-
return MusicFontSymbol.Flag128thDown;
|
|
48519
|
-
default:
|
|
48520
|
-
return MusicFontSymbol.Flag8thDown;
|
|
48521
|
-
}
|
|
48522
|
-
}
|
|
48523
|
-
}
|
|
48524
|
-
|
|
48525
47850
|
/**
|
|
48526
47851
|
* @internal
|
|
48527
47852
|
*/
|
|
@@ -48548,28 +47873,20 @@
|
|
|
48548
47873
|
this.renderer.registerTie(tie);
|
|
48549
47874
|
}
|
|
48550
47875
|
getBoundingBoxTop() {
|
|
48551
|
-
return
|
|
47876
|
+
return ModelUtils.minBoundingBox(this.preNotes.getBoundingBoxTop(), this.onNotes.getBoundingBoxTop());
|
|
48552
47877
|
}
|
|
48553
47878
|
getBoundingBoxBottom() {
|
|
48554
|
-
return
|
|
47879
|
+
return ModelUtils.maxBoundingBox(this.preNotes.getBoundingBoxBottom(), this.onNotes.getBoundingBoxBottom());
|
|
48555
47880
|
}
|
|
48556
47881
|
drawBeamHelperAsFlags(helper) {
|
|
48557
47882
|
return helper.hasFlag(false, undefined);
|
|
48558
47883
|
}
|
|
47884
|
+
get postBeatStretch() {
|
|
47885
|
+
return this.onNotes.computedWidth - this.onNotes.onTimeX;
|
|
47886
|
+
}
|
|
48559
47887
|
registerLayoutingInfo(layoutings) {
|
|
48560
47888
|
const preBeatStretch = this.preNotes.computedWidth + this.onNotes.onTimeX;
|
|
48561
|
-
let postBeatStretch = this.
|
|
48562
|
-
// make space for flag
|
|
48563
|
-
const helper = this.renderer.helpers.getBeamingHelperForBeat(this.beat);
|
|
48564
|
-
if (this.beat.graceType !== GraceType.None) {
|
|
48565
|
-
// always use flag size as spacing on grace notes
|
|
48566
|
-
postBeatStretch +=
|
|
48567
|
-
this.renderer.smuflMetrics.glyphWidths.get(MusicFontSymbol.Flag8thUp) * NoteHeadGlyph.GraceScale;
|
|
48568
|
-
}
|
|
48569
|
-
else if (helper && this.drawBeamHelperAsFlags(helper)) {
|
|
48570
|
-
postBeatStretch +=
|
|
48571
|
-
this.renderer.smuflMetrics.glyphWidths.get(MusicFontSymbol.Flag8thUp) * NoteHeadGlyph.GraceScale;
|
|
48572
|
-
}
|
|
47889
|
+
let postBeatStretch = this.postBeatStretch;
|
|
48573
47890
|
for (const tie of this._ties) {
|
|
48574
47891
|
const tg = tie;
|
|
48575
47892
|
postBeatStretch += tg.width;
|
|
@@ -48584,7 +47901,6 @@
|
|
|
48584
47901
|
});
|
|
48585
47902
|
}
|
|
48586
47903
|
applyLayoutingInfo(_info) {
|
|
48587
|
-
this.onNotes.updateBeamingHelper();
|
|
48588
47904
|
this.updateWidth();
|
|
48589
47905
|
}
|
|
48590
47906
|
doLayout() {
|
|
@@ -48596,7 +47912,6 @@
|
|
|
48596
47912
|
this.onNotes.renderer = this.renderer;
|
|
48597
47913
|
this.onNotes.container = this;
|
|
48598
47914
|
this.onNotes.doLayout();
|
|
48599
|
-
this.onNotes.updateBeamingHelper();
|
|
48600
47915
|
let i = this.beat.notes.length - 1;
|
|
48601
47916
|
while (i >= 0) {
|
|
48602
47917
|
this.createTies(this.beat.notes[i--]);
|
|
@@ -48605,15 +47920,6 @@
|
|
|
48605
47920
|
}
|
|
48606
47921
|
updateWidth() {
|
|
48607
47922
|
this.minWidth = this.preNotes.width + this.onNotes.width;
|
|
48608
|
-
if (!this.beat.isRest) {
|
|
48609
|
-
if (this.onNotes.beamingHelper.beats.length === 1) {
|
|
48610
|
-
// make space for flag
|
|
48611
|
-
if (this.beat.duration >= Duration.Eighth) {
|
|
48612
|
-
const symbol = FlagGlyph.getSymbol(this.beat.duration, this.onNotes.beamingHelper.direction, this.beat.graceType !== GraceType.None);
|
|
48613
|
-
this.minWidth += this.renderer.smuflMetrics.glyphWidths.get(symbol);
|
|
48614
|
-
}
|
|
48615
|
-
}
|
|
48616
|
-
}
|
|
48617
47923
|
let tieWidth = 0;
|
|
48618
47924
|
for (const tie of this._ties) {
|
|
48619
47925
|
const tg = tie;
|
|
@@ -48624,10 +47930,6 @@
|
|
|
48624
47930
|
this.minWidth += tieWidth;
|
|
48625
47931
|
this.width = this.minWidth;
|
|
48626
47932
|
}
|
|
48627
|
-
scaleToWidth(beatWidth) {
|
|
48628
|
-
this.onNotes.updateBeamingHelper();
|
|
48629
|
-
this.width = beatWidth;
|
|
48630
|
-
}
|
|
48631
47933
|
createTies(_n) {
|
|
48632
47934
|
}
|
|
48633
47935
|
static getGroupId(beat) {
|
|
@@ -48637,8 +47939,11 @@
|
|
|
48637
47939
|
// var c = canvas.color;
|
|
48638
47940
|
// canvas.color = Color.random();
|
|
48639
47941
|
// canvas.fillRect(cx + this.x, cy + this.y + this.preNotes.getBoundingBoxTop(), this.width, this.renderer.height);
|
|
48640
|
-
// canvas.color = Color.random();
|
|
48641
47942
|
// canvas.fillRect(cx + this.x, cy + this.y + this.onNotes.getBoundingBoxTop(), this.width, this.renderer.height);
|
|
47943
|
+
// canvas.color = Color.random();
|
|
47944
|
+
// const top = this.getBoundingBoxTop();
|
|
47945
|
+
// const bottom = this.getBoundingBoxBottom();
|
|
47946
|
+
// canvas.fillRect(cx + this.x, cy + this.y + top, this.width, bottom-top);
|
|
48642
47947
|
// canvas.color = c;
|
|
48643
47948
|
// var c = canvas.color;
|
|
48644
47949
|
// var ta = canvas.textAlign;
|
|
@@ -48717,7 +48022,7 @@
|
|
|
48717
48022
|
}
|
|
48718
48023
|
let visualEndX = 0;
|
|
48719
48024
|
if (!this.onNotes.isEmpty) {
|
|
48720
|
-
visualEndX = cx + this.x + this.onNotes.x + this.onNotes.
|
|
48025
|
+
visualEndX = cx + this.x + this.onNotes.x + this.onNotes.onTimeX + this.postBeatStretch;
|
|
48721
48026
|
}
|
|
48722
48027
|
else if (!this.preNotes.isEmpty) {
|
|
48723
48028
|
visualEndX = cx + this.x + this.preNotes.x + this.preNotes.width;
|
|
@@ -48726,12 +48031,6 @@
|
|
|
48726
48031
|
visualEndX = cx + this.x + this.width;
|
|
48727
48032
|
}
|
|
48728
48033
|
beatBoundings.visualBounds.w = visualEndX - beatBoundings.visualBounds.x;
|
|
48729
|
-
const helper = this.renderer.helpers.getBeamingHelperForBeat(this.beat);
|
|
48730
|
-
if ((helper && this.drawBeamHelperAsFlags(helper)) || this.beat.graceType !== GraceType.None) {
|
|
48731
|
-
beatBoundings.visualBounds.w +=
|
|
48732
|
-
this.renderer.smuflMetrics.glyphWidths.get(MusicFontSymbol.Flag8thUp) *
|
|
48733
|
-
(this.beat.graceType !== GraceType.None ? NoteHeadGlyph.GraceScale : 1);
|
|
48734
|
-
}
|
|
48735
48034
|
beatBoundings.visualBounds.y = barBounds.visualBounds.y;
|
|
48736
48035
|
beatBoundings.visualBounds.h = barBounds.visualBounds.h;
|
|
48737
48036
|
beatBoundings.realBounds = new Bounds();
|
|
@@ -48746,6 +48045,26 @@
|
|
|
48746
48045
|
this.onNotes.buildBoundingsLookup(beatBoundings, cx + this.x, cy + this.y);
|
|
48747
48046
|
}
|
|
48748
48047
|
}
|
|
48048
|
+
getBeatX(requestedPosition, useSharedSizes = false) {
|
|
48049
|
+
switch (requestedPosition) {
|
|
48050
|
+
case BeatXPosition.PreNotes:
|
|
48051
|
+
return this.preNotes.x;
|
|
48052
|
+
case BeatXPosition.OnNotes:
|
|
48053
|
+
return this.onNotes.x;
|
|
48054
|
+
case BeatXPosition.MiddleNotes:
|
|
48055
|
+
return this.onNotes.x + this.onNotes.middleX;
|
|
48056
|
+
case BeatXPosition.Stem:
|
|
48057
|
+
return this.onNotes.x + this.onNotes.stemX;
|
|
48058
|
+
case BeatXPosition.PostNotes:
|
|
48059
|
+
const onNoteSize = useSharedSizes
|
|
48060
|
+
? (this.renderer.layoutingInfo.getBeatSizes(this.beat)?.onBeatSize ?? this.onNotes.width)
|
|
48061
|
+
: this.onNotes.width;
|
|
48062
|
+
return this.onNotes.x + onNoteSize;
|
|
48063
|
+
case BeatXPosition.EndBeat:
|
|
48064
|
+
return this.width;
|
|
48065
|
+
}
|
|
48066
|
+
return this.preNotes.x;
|
|
48067
|
+
}
|
|
48749
48068
|
}
|
|
48750
48069
|
|
|
48751
48070
|
/**
|
|
@@ -56504,6 +55823,31 @@
|
|
|
56504
55823
|
EffectBarGlyphSizing[EffectBarGlyphSizing["FullBar"] = 5] = "FullBar";
|
|
56505
55824
|
})(EffectBarGlyphSizing || (EffectBarGlyphSizing = {}));
|
|
56506
55825
|
|
|
55826
|
+
/**
|
|
55827
|
+
* Effect-Glyphs implementing this public interface get notified
|
|
55828
|
+
* as they are expanded over multiple beats.
|
|
55829
|
+
* @internal
|
|
55830
|
+
*/
|
|
55831
|
+
class EffectGlyph extends Glyph {
|
|
55832
|
+
/**
|
|
55833
|
+
* Gets or sets the beat where the glyph belongs to.
|
|
55834
|
+
*/
|
|
55835
|
+
beat = null;
|
|
55836
|
+
/**
|
|
55837
|
+
* Gets or sets the next glyph of the same type in case
|
|
55838
|
+
* the effect glyph is expanded when using {@link EffectBarGlyphSizing.groupedOnBeat}.
|
|
55839
|
+
*/
|
|
55840
|
+
nextGlyph = null;
|
|
55841
|
+
/**
|
|
55842
|
+
* Gets or sets the previous glyph of the same type in case
|
|
55843
|
+
* the effect glyph is expanded when using {@link EffectBarGlyphSizing.groupedOnBeat}.
|
|
55844
|
+
*/
|
|
55845
|
+
previousGlyph = null;
|
|
55846
|
+
constructor(x = 0, y = 0) {
|
|
55847
|
+
super(x, y);
|
|
55848
|
+
}
|
|
55849
|
+
}
|
|
55850
|
+
|
|
56507
55851
|
/**
|
|
56508
55852
|
* @internal
|
|
56509
55853
|
*/
|
|
@@ -56631,39 +55975,6 @@
|
|
|
56631
55975
|
}
|
|
56632
55976
|
}
|
|
56633
55977
|
|
|
56634
|
-
/**
|
|
56635
|
-
* Lists the different position modes for {@link BarRendererBase.getBeatX}
|
|
56636
|
-
* @internal
|
|
56637
|
-
*/
|
|
56638
|
-
var BeatXPosition;
|
|
56639
|
-
(function (BeatXPosition) {
|
|
56640
|
-
/**
|
|
56641
|
-
* Gets the pre-notes position which is located before the accidentals
|
|
56642
|
-
*/
|
|
56643
|
-
BeatXPosition[BeatXPosition["PreNotes"] = 0] = "PreNotes";
|
|
56644
|
-
/**
|
|
56645
|
-
* Gets the on-notes position which is located after the accidentals but before the note heads.
|
|
56646
|
-
*/
|
|
56647
|
-
BeatXPosition[BeatXPosition["OnNotes"] = 1] = "OnNotes";
|
|
56648
|
-
/**
|
|
56649
|
-
* Gets the middle-notes position which is located after in the exact center of the note heads.
|
|
56650
|
-
*/
|
|
56651
|
-
BeatXPosition[BeatXPosition["MiddleNotes"] = 2] = "MiddleNotes";
|
|
56652
|
-
/**
|
|
56653
|
-
* Gets position of the stem for this beat
|
|
56654
|
-
*/
|
|
56655
|
-
BeatXPosition[BeatXPosition["Stem"] = 3] = "Stem";
|
|
56656
|
-
/**
|
|
56657
|
-
* Get the post-notes position which is located at after the note heads.
|
|
56658
|
-
*/
|
|
56659
|
-
BeatXPosition[BeatXPosition["PostNotes"] = 4] = "PostNotes";
|
|
56660
|
-
/**
|
|
56661
|
-
* Get the end-beat position which is located at the end of the beat. This position is almost
|
|
56662
|
-
* equal to the pre-notes position of the next beat.
|
|
56663
|
-
*/
|
|
56664
|
-
BeatXPosition[BeatXPosition["EndBeat"] = 5] = "EndBeat";
|
|
56665
|
-
})(BeatXPosition || (BeatXPosition = {}));
|
|
56666
|
-
|
|
56667
55978
|
/**
|
|
56668
55979
|
* @internal
|
|
56669
55980
|
*/
|
|
@@ -57262,6 +56573,93 @@
|
|
|
57262
56573
|
}
|
|
57263
56574
|
}
|
|
57264
56575
|
|
|
56576
|
+
/**
|
|
56577
|
+
* @internal
|
|
56578
|
+
*/
|
|
56579
|
+
class MusicFontGlyph extends EffectGlyph {
|
|
56580
|
+
glyphScale = 0;
|
|
56581
|
+
symbol;
|
|
56582
|
+
center = false;
|
|
56583
|
+
colorOverride;
|
|
56584
|
+
offsetX = 0;
|
|
56585
|
+
offsetY = 0;
|
|
56586
|
+
constructor(x, y, glyphScale, symbol) {
|
|
56587
|
+
super(x, y);
|
|
56588
|
+
this.glyphScale = glyphScale;
|
|
56589
|
+
this.symbol = symbol;
|
|
56590
|
+
}
|
|
56591
|
+
getBoundingBoxTop() {
|
|
56592
|
+
const bBoxTop = this.renderer.smuflMetrics.glyphTop.get(this.symbol);
|
|
56593
|
+
return this.y - this.offsetY - bBoxTop;
|
|
56594
|
+
}
|
|
56595
|
+
doLayout() {
|
|
56596
|
+
this.width = this.renderer.smuflMetrics.glyphWidths.get(this.symbol) * this.glyphScale;
|
|
56597
|
+
this.height = this.renderer.smuflMetrics.glyphHeights.get(this.symbol) * this.glyphScale;
|
|
56598
|
+
}
|
|
56599
|
+
paint(cx, cy, canvas) {
|
|
56600
|
+
if (this.width === 0 && this.height === 0) {
|
|
56601
|
+
return;
|
|
56602
|
+
}
|
|
56603
|
+
const c = canvas.color;
|
|
56604
|
+
if (this.colorOverride) {
|
|
56605
|
+
canvas.color = this.colorOverride;
|
|
56606
|
+
}
|
|
56607
|
+
canvas.fillMusicFontSymbol(cx + this.x + this.offsetX, cy + this.y + this.offsetY, this.glyphScale, this.symbol, this.center);
|
|
56608
|
+
canvas.color = c;
|
|
56609
|
+
}
|
|
56610
|
+
}
|
|
56611
|
+
/**
|
|
56612
|
+
* @internal
|
|
56613
|
+
*/
|
|
56614
|
+
class MusicFontTextGlyph extends EffectGlyph {
|
|
56615
|
+
glyphScale = 0;
|
|
56616
|
+
symbols;
|
|
56617
|
+
center = false;
|
|
56618
|
+
colorOverride;
|
|
56619
|
+
offsetX = 0;
|
|
56620
|
+
offsetY = 0;
|
|
56621
|
+
constructor(x, y, glyphScale, symbols) {
|
|
56622
|
+
super(x, y);
|
|
56623
|
+
this.glyphScale = glyphScale;
|
|
56624
|
+
this.symbols = symbols;
|
|
56625
|
+
}
|
|
56626
|
+
getBoundingBoxTop() {
|
|
56627
|
+
let bBoxTop = 0;
|
|
56628
|
+
for (let i = 0; i < this.symbols.length; i++) {
|
|
56629
|
+
const gTop = this.renderer.smuflMetrics.glyphTop.get(this.symbols[i]);
|
|
56630
|
+
if (i === 0 || gTop < bBoxTop) {
|
|
56631
|
+
bBoxTop = gTop;
|
|
56632
|
+
}
|
|
56633
|
+
}
|
|
56634
|
+
return this.y - this.offsetY - bBoxTop;
|
|
56635
|
+
}
|
|
56636
|
+
doLayout() {
|
|
56637
|
+
this.width = 0;
|
|
56638
|
+
this.height = 0;
|
|
56639
|
+
for (let i = 0; i < this.symbols.length; i++) {
|
|
56640
|
+
const gWidth = this.renderer.smuflMetrics.glyphWidths.get(this.symbols[i]) * this.glyphScale;
|
|
56641
|
+
const gHeight = this.renderer.smuflMetrics.glyphHeights.get(this.symbols[i]) * this.glyphScale;
|
|
56642
|
+
if (i === 0 || gWidth > this.width) {
|
|
56643
|
+
this.width = gWidth;
|
|
56644
|
+
}
|
|
56645
|
+
if (i === 0 || gHeight > this.height) {
|
|
56646
|
+
this.height = gHeight;
|
|
56647
|
+
}
|
|
56648
|
+
}
|
|
56649
|
+
}
|
|
56650
|
+
paint(cx, cy, canvas) {
|
|
56651
|
+
if (this.width === 0 && this.height === 0) {
|
|
56652
|
+
return;
|
|
56653
|
+
}
|
|
56654
|
+
const c = canvas.color;
|
|
56655
|
+
if (this.colorOverride) {
|
|
56656
|
+
canvas.color = this.colorOverride;
|
|
56657
|
+
}
|
|
56658
|
+
canvas.fillMusicFontSymbols(cx + this.x + this.offsetX, cy + this.y + this.offsetY, this.glyphScale, this.symbols, this.center);
|
|
56659
|
+
canvas.color = c;
|
|
56660
|
+
}
|
|
56661
|
+
}
|
|
56662
|
+
|
|
57265
56663
|
/**
|
|
57266
56664
|
* @internal
|
|
57267
56665
|
*/
|
|
@@ -57500,17 +56898,6 @@
|
|
|
57500
56898
|
}
|
|
57501
56899
|
}
|
|
57502
56900
|
|
|
57503
|
-
/**
|
|
57504
|
-
* This simple glyph allows to put an empty region in to a BarRenderer.
|
|
57505
|
-
* @internal
|
|
57506
|
-
*/
|
|
57507
|
-
class SpacingGlyph extends Glyph {
|
|
57508
|
-
constructor(x, y, width) {
|
|
57509
|
-
super(x, y);
|
|
57510
|
-
this.width = width;
|
|
57511
|
-
}
|
|
57512
|
-
}
|
|
57513
|
-
|
|
57514
56901
|
/**
|
|
57515
56902
|
* This glyph allows to group several other glyphs to be
|
|
57516
56903
|
* drawn at the same x position
|
|
@@ -57526,34 +56913,20 @@
|
|
|
57526
56913
|
const glyphs = this.glyphs;
|
|
57527
56914
|
if (glyphs) {
|
|
57528
56915
|
for (const g of glyphs) {
|
|
57529
|
-
|
|
57530
|
-
if (g instanceof SpacingGlyph) {
|
|
57531
|
-
continue;
|
|
57532
|
-
}
|
|
57533
|
-
const gTop = g.getBoundingBoxTop();
|
|
57534
|
-
if (Number.isNaN(top) || gTop < top) {
|
|
57535
|
-
top = gTop;
|
|
57536
|
-
}
|
|
56916
|
+
top = ModelUtils.minBoundingBox(top, g.getBoundingBoxTop());
|
|
57537
56917
|
}
|
|
57538
56918
|
}
|
|
57539
|
-
return
|
|
56919
|
+
return top;
|
|
57540
56920
|
}
|
|
57541
56921
|
getBoundingBoxBottom() {
|
|
57542
56922
|
let bottom = Number.NaN;
|
|
57543
56923
|
const glyphs = this.glyphs;
|
|
57544
56924
|
if (glyphs) {
|
|
57545
56925
|
for (const g of glyphs) {
|
|
57546
|
-
|
|
57547
|
-
if (g instanceof SpacingGlyph) {
|
|
57548
|
-
continue;
|
|
57549
|
-
}
|
|
57550
|
-
const gBottom = g.getBoundingBoxBottom();
|
|
57551
|
-
if (Number.isNaN(bottom) || gBottom > bottom) {
|
|
57552
|
-
bottom = gBottom;
|
|
57553
|
-
}
|
|
56926
|
+
bottom = ModelUtils.maxBoundingBox(bottom, g.getBoundingBoxBottom());
|
|
57554
56927
|
}
|
|
57555
56928
|
}
|
|
57556
|
-
return
|
|
56929
|
+
return bottom;
|
|
57557
56930
|
}
|
|
57558
56931
|
doLayout() {
|
|
57559
56932
|
if (!this.glyphs || this.glyphs.length === 0) {
|
|
@@ -57969,6 +57342,38 @@
|
|
|
57969
57342
|
}
|
|
57970
57343
|
}
|
|
57971
57344
|
|
|
57345
|
+
/**
|
|
57346
|
+
* @internal
|
|
57347
|
+
*/
|
|
57348
|
+
class NoteHeadGlyph extends MusicFontGlyph {
|
|
57349
|
+
// TODO: SmuFL
|
|
57350
|
+
static GraceScale = 0.75;
|
|
57351
|
+
centerOnStem = false;
|
|
57352
|
+
constructor(x, y, duration, isGrace) {
|
|
57353
|
+
super(x, y, isGrace ? NoteHeadGlyph.GraceScale : 1, NoteHeadGlyph.getSymbol(duration));
|
|
57354
|
+
}
|
|
57355
|
+
paint(cx, cy, canvas) {
|
|
57356
|
+
if (this.centerOnStem) {
|
|
57357
|
+
this.center = true;
|
|
57358
|
+
}
|
|
57359
|
+
super.paint(cx, cy, canvas);
|
|
57360
|
+
}
|
|
57361
|
+
static getSymbol(duration) {
|
|
57362
|
+
switch (duration) {
|
|
57363
|
+
case Duration.QuadrupleWhole:
|
|
57364
|
+
return MusicFontSymbol.NoteheadDoubleWholeSquare;
|
|
57365
|
+
case Duration.DoubleWhole:
|
|
57366
|
+
return MusicFontSymbol.NoteheadDoubleWhole;
|
|
57367
|
+
case Duration.Whole:
|
|
57368
|
+
return MusicFontSymbol.NoteheadWhole;
|
|
57369
|
+
case Duration.Half:
|
|
57370
|
+
return MusicFontSymbol.NoteheadHalf;
|
|
57371
|
+
default:
|
|
57372
|
+
return MusicFontSymbol.NoteheadBlack;
|
|
57373
|
+
}
|
|
57374
|
+
}
|
|
57375
|
+
}
|
|
57376
|
+
|
|
57972
57377
|
/**
|
|
57973
57378
|
* @internal
|
|
57974
57379
|
*/
|
|
@@ -59587,12 +58992,12 @@
|
|
|
59587
58992
|
// of the next glyph
|
|
59588
58993
|
if (i > 0) {
|
|
59589
58994
|
const beatWidth = currentBeatGlyph.x - beatGlyphs[i - 1].x;
|
|
59590
|
-
beatGlyphs[i - 1].
|
|
58995
|
+
beatGlyphs[i - 1].width = beatWidth;
|
|
59591
58996
|
}
|
|
59592
58997
|
// for the last glyph size based on the full width
|
|
59593
58998
|
if (i === j - 1) {
|
|
59594
58999
|
const beatWidth = this.width - beatGlyphs[beatGlyphs.length - 1].x;
|
|
59595
|
-
currentBeatGlyph.
|
|
59000
|
+
currentBeatGlyph.width = beatWidth;
|
|
59596
59001
|
}
|
|
59597
59002
|
}
|
|
59598
59003
|
}
|
|
@@ -61292,7 +60697,7 @@
|
|
|
61292
60697
|
if (!masterBarBoundsLookup.has(renderer.bar.masterBar.index)) {
|
|
61293
60698
|
masterBarBounds = new MasterBarBounds();
|
|
61294
60699
|
masterBarBounds.index = renderer.bar.masterBar.index;
|
|
61295
|
-
masterBarBounds.isFirstOfLine = renderer.
|
|
60700
|
+
masterBarBounds.isFirstOfLine = renderer.isFirstOfStaff;
|
|
61296
60701
|
masterBarBounds.realBounds = new Bounds();
|
|
61297
60702
|
masterBarBounds.realBounds.x = x + renderer.x;
|
|
61298
60703
|
masterBarBounds.realBounds.y = realTop;
|
|
@@ -61824,11 +61229,9 @@
|
|
|
61824
61229
|
* @internal
|
|
61825
61230
|
*/
|
|
61826
61231
|
class BeatOnNoteGlyphBase extends BeatGlyphBase {
|
|
61827
|
-
beamingHelper;
|
|
61828
61232
|
onTimeX = 0;
|
|
61829
61233
|
middleX = 0;
|
|
61830
|
-
|
|
61831
|
-
}
|
|
61234
|
+
stemX = 0;
|
|
61832
61235
|
buildBoundingsLookup(_beatBounds, _cx, _cy) {
|
|
61833
61236
|
}
|
|
61834
61237
|
getNoteX(_note, _requestedPosition) {
|
|
@@ -61970,14 +61373,6 @@
|
|
|
61970
61373
|
}
|
|
61971
61374
|
}
|
|
61972
61375
|
|
|
61973
|
-
/**
|
|
61974
|
-
* @internal
|
|
61975
|
-
*/
|
|
61976
|
-
class BeatLinePositions {
|
|
61977
|
-
staffId = '';
|
|
61978
|
-
up = 0;
|
|
61979
|
-
down = 0;
|
|
61980
|
-
}
|
|
61981
61376
|
/**
|
|
61982
61377
|
* @internal
|
|
61983
61378
|
*/
|
|
@@ -62008,10 +61403,7 @@
|
|
|
62008
61403
|
*/
|
|
62009
61404
|
class BeamingHelper {
|
|
62010
61405
|
_staff;
|
|
62011
|
-
_beatLineXPositions = new Map();
|
|
62012
61406
|
_renderer;
|
|
62013
|
-
_firstNonRestBeat = null;
|
|
62014
|
-
_lastNonRestBeat = null;
|
|
62015
61407
|
voice = null;
|
|
62016
61408
|
beats = [];
|
|
62017
61409
|
shortestDuration = Duration.QuadrupleWhole;
|
|
@@ -62021,6 +61413,7 @@
|
|
|
62021
61413
|
*/
|
|
62022
61414
|
hasTuplet = false;
|
|
62023
61415
|
slashBeats = [];
|
|
61416
|
+
restBeats = [];
|
|
62024
61417
|
lowestNoteInHelper = null;
|
|
62025
61418
|
_lowestNoteCompareValueInHelper = -1;
|
|
62026
61419
|
highestNoteInHelper = null;
|
|
@@ -62028,25 +61421,21 @@
|
|
|
62028
61421
|
invertBeamDirection = false;
|
|
62029
61422
|
preferredBeamDirection = null;
|
|
62030
61423
|
graceType = GraceType.None;
|
|
62031
|
-
minRestSteps = null;
|
|
62032
|
-
beatOfMinRestSteps = null;
|
|
62033
|
-
maxRestSteps = null;
|
|
62034
|
-
beatOfMaxRestSteps = null;
|
|
62035
61424
|
get isRestBeamHelper() {
|
|
62036
61425
|
return this.beats.length === 1 && this.beats[0].isRest;
|
|
62037
61426
|
}
|
|
62038
|
-
|
|
62039
|
-
return ((forceFlagOnSingleBeat && this.
|
|
62040
|
-
(!forceFlagOnSingleBeat && this.beats.length === 1 && this.
|
|
61427
|
+
hasStem(forceFlagOnSingleBeat, beat) {
|
|
61428
|
+
return ((forceFlagOnSingleBeat && this._beatHasStem(beat)) ||
|
|
61429
|
+
(!forceFlagOnSingleBeat && this.beats.length === 1 && this._beatHasStem(beat)));
|
|
62041
61430
|
}
|
|
62042
|
-
|
|
61431
|
+
_beatHasStem(beat) {
|
|
62043
61432
|
return beat.duration > Duration.Whole;
|
|
62044
61433
|
}
|
|
62045
61434
|
hasFlag(forceFlagOnSingleBeat, beat) {
|
|
62046
|
-
return ((forceFlagOnSingleBeat &&
|
|
62047
|
-
(!forceFlagOnSingleBeat && this.beats.length === 1 &&
|
|
61435
|
+
return ((forceFlagOnSingleBeat && BeamingHelper.beatHasFlag(beat)) ||
|
|
61436
|
+
(!forceFlagOnSingleBeat && this.beats.length === 1 && BeamingHelper.beatHasFlag(this.beats[0])));
|
|
62048
61437
|
}
|
|
62049
|
-
|
|
61438
|
+
static beatHasFlag(beat) {
|
|
62050
61439
|
return (!beat.deadSlapped && !beat.isRest && (beat.duration > Duration.Quarter || beat.graceType !== GraceType.None));
|
|
62051
61440
|
}
|
|
62052
61441
|
constructor(staff, renderer) {
|
|
@@ -62054,38 +61443,12 @@
|
|
|
62054
61443
|
this._renderer = renderer;
|
|
62055
61444
|
this.beats = [];
|
|
62056
61445
|
}
|
|
62057
|
-
|
|
62058
|
-
direction = direction ?? this.direction;
|
|
62059
|
-
if (this.hasBeatLineX(beat)) {
|
|
62060
|
-
if (direction === BeamDirection.Up) {
|
|
62061
|
-
return this._beatLineXPositions.get(beat.index).up;
|
|
62062
|
-
}
|
|
62063
|
-
return this._beatLineXPositions.get(beat.index).down;
|
|
62064
|
-
}
|
|
62065
|
-
return 0;
|
|
62066
|
-
}
|
|
62067
|
-
hasBeatLineX(beat) {
|
|
62068
|
-
return this._beatLineXPositions.has(beat.index);
|
|
62069
|
-
}
|
|
62070
|
-
registerBeatLineX(staffId, beat, up, down) {
|
|
62071
|
-
const positions = this._getOrCreateBeatPositions(beat);
|
|
62072
|
-
positions.staffId = staffId;
|
|
62073
|
-
positions.up = up;
|
|
62074
|
-
positions.down = down;
|
|
61446
|
+
alignWithBeats() {
|
|
62075
61447
|
for (const v of this.drawingInfos.values()) {
|
|
62076
|
-
|
|
62077
|
-
|
|
62078
|
-
|
|
62079
|
-
else if (v.endBeat === beat) {
|
|
62080
|
-
v.endX = this.getBeatLineX(beat);
|
|
62081
|
-
}
|
|
62082
|
-
}
|
|
62083
|
-
}
|
|
62084
|
-
_getOrCreateBeatPositions(beat) {
|
|
62085
|
-
if (!this._beatLineXPositions.has(beat.index)) {
|
|
62086
|
-
this._beatLineXPositions.set(beat.index, new BeatLinePositions());
|
|
61448
|
+
v.startX = this._renderer.getBeatX(v.startBeat, BeatXPosition.Stem);
|
|
61449
|
+
v.endX = this._renderer.getBeatX(v.endBeat, BeatXPosition.Stem);
|
|
61450
|
+
this.drawingInfos.clear();
|
|
62087
61451
|
}
|
|
62088
|
-
return this._beatLineXPositions.get(beat.index);
|
|
62089
61452
|
}
|
|
62090
61453
|
direction = BeamDirection.Up;
|
|
62091
61454
|
finish() {
|
|
@@ -62151,36 +61514,6 @@
|
|
|
62151
61514
|
}
|
|
62152
61515
|
return [0, 0];
|
|
62153
61516
|
}
|
|
62154
|
-
/**
|
|
62155
|
-
* Registers a rest beat within the accidental helper so the rest
|
|
62156
|
-
* symbol is considered properly during beaming.
|
|
62157
|
-
* @param beat The rest beat.
|
|
62158
|
-
* @param steps The steps on which the rest symbol is placed
|
|
62159
|
-
*/
|
|
62160
|
-
applyRest(beat, steps) {
|
|
62161
|
-
// do not accept rests after the last beat which has notes
|
|
62162
|
-
if ((this._lastNonRestBeat && beat.index >= this._lastNonRestBeat.index) ||
|
|
62163
|
-
(this._firstNonRestBeat && beat.index <= this._firstNonRestBeat.index)) {
|
|
62164
|
-
return;
|
|
62165
|
-
}
|
|
62166
|
-
// correct the line of the glyph to a note which would
|
|
62167
|
-
// be placed at the upper / lower end of the glyph.
|
|
62168
|
-
let aboveRest = steps;
|
|
62169
|
-
let belowRest = steps;
|
|
62170
|
-
const offsets = BeamingHelper.computeLineHeightsForRest(beat.duration);
|
|
62171
|
-
aboveRest -= offsets[0];
|
|
62172
|
-
belowRest += offsets[1];
|
|
62173
|
-
const minRestSteps = this.minRestSteps;
|
|
62174
|
-
const maxRestSteps = this.maxRestSteps;
|
|
62175
|
-
if (minRestSteps === null || minRestSteps > aboveRest) {
|
|
62176
|
-
this.minRestSteps = aboveRest;
|
|
62177
|
-
this.beatOfMinRestSteps = beat;
|
|
62178
|
-
}
|
|
62179
|
-
if (maxRestSteps === null || maxRestSteps < belowRest) {
|
|
62180
|
-
this.maxRestSteps = belowRest;
|
|
62181
|
-
this.beatOfMaxRestSteps = beat;
|
|
62182
|
-
}
|
|
62183
|
-
}
|
|
62184
61517
|
_invert(direction) {
|
|
62185
61518
|
if (!this.invertBeamDirection) {
|
|
62186
61519
|
return direction;
|
|
@@ -62244,14 +61577,13 @@
|
|
|
62244
61577
|
if (this.shortestDuration < beat.duration) {
|
|
62245
61578
|
this.shortestDuration = beat.duration;
|
|
62246
61579
|
}
|
|
62247
|
-
if (!this._firstNonRestBeat) {
|
|
62248
|
-
this._firstNonRestBeat = beat;
|
|
62249
|
-
}
|
|
62250
|
-
this._lastNonRestBeat = beat;
|
|
62251
61580
|
}
|
|
62252
61581
|
else if (this.beats.length === 0) {
|
|
62253
61582
|
this.beats.push(beat);
|
|
62254
61583
|
}
|
|
61584
|
+
else {
|
|
61585
|
+
this.restBeats.push(beat);
|
|
61586
|
+
}
|
|
62255
61587
|
if (beat.slashed) {
|
|
62256
61588
|
this.slashBeats.push(beat);
|
|
62257
61589
|
}
|
|
@@ -62360,19 +61692,6 @@
|
|
|
62360
61692
|
get beatOfHighestNote() {
|
|
62361
61693
|
return this.highestNoteInHelper.beat;
|
|
62362
61694
|
}
|
|
62363
|
-
/**
|
|
62364
|
-
* Returns whether the the position of the given beat, was registered by the staff of the given ID
|
|
62365
|
-
* @param staffId
|
|
62366
|
-
* @param beat
|
|
62367
|
-
* @returns
|
|
62368
|
-
*/
|
|
62369
|
-
isPositionFrom(staffId, beat) {
|
|
62370
|
-
if (!this._beatLineXPositions.has(beat.index)) {
|
|
62371
|
-
return true;
|
|
62372
|
-
}
|
|
62373
|
-
return (this._beatLineXPositions.get(beat.index).staffId === staffId ||
|
|
62374
|
-
!this._beatLineXPositions.get(beat.index).staffId);
|
|
62375
|
-
}
|
|
62376
61695
|
drawingInfos = new Map();
|
|
62377
61696
|
}
|
|
62378
61697
|
|
|
@@ -62524,8 +61843,8 @@
|
|
|
62524
61843
|
*/
|
|
62525
61844
|
class BarHelpers {
|
|
62526
61845
|
_renderer;
|
|
61846
|
+
_beamHelperLookup = new Map();
|
|
62527
61847
|
beamHelpers = [];
|
|
62528
|
-
beamHelperLookup = [];
|
|
62529
61848
|
collisionHelper;
|
|
62530
61849
|
preferredBeamDirection = null;
|
|
62531
61850
|
constructor(renderer) {
|
|
@@ -62540,7 +61859,6 @@
|
|
|
62540
61859
|
for (let i = 0, j = bar.voices.length; i < j; i++) {
|
|
62541
61860
|
const v = bar.voices[i];
|
|
62542
61861
|
this.beamHelpers.push([]);
|
|
62543
|
-
this.beamHelperLookup.push(new Map());
|
|
62544
61862
|
for (let k = 0, l = v.beats.length; k < l; k++) {
|
|
62545
61863
|
const b = v.beats[k];
|
|
62546
61864
|
let helperForBeat;
|
|
@@ -62549,6 +61867,9 @@
|
|
|
62549
61867
|
}
|
|
62550
61868
|
else {
|
|
62551
61869
|
helperForBeat = currentBeamHelper;
|
|
61870
|
+
if (currentGraceBeamHelper) {
|
|
61871
|
+
currentGraceBeamHelper.finish();
|
|
61872
|
+
}
|
|
62552
61873
|
currentGraceBeamHelper = null;
|
|
62553
61874
|
}
|
|
62554
61875
|
// if a new beaming helper was started, we close our tuplet grouping as well
|
|
@@ -62569,7 +61890,7 @@
|
|
|
62569
61890
|
}
|
|
62570
61891
|
this.beamHelpers[v.index].push(helperForBeat);
|
|
62571
61892
|
}
|
|
62572
|
-
this.
|
|
61893
|
+
this._beamHelperLookup.set(b.id, helperForBeat);
|
|
62573
61894
|
}
|
|
62574
61895
|
if (currentBeamHelper) {
|
|
62575
61896
|
currentBeamHelper.finish();
|
|
@@ -62582,7 +61903,7 @@
|
|
|
62582
61903
|
}
|
|
62583
61904
|
}
|
|
62584
61905
|
getBeamingHelperForBeat(beat) {
|
|
62585
|
-
return this.
|
|
61906
|
+
return this._beamHelperLookup.has(beat.id) ? this._beamHelperLookup.get(beat.id) : undefined;
|
|
62586
61907
|
}
|
|
62587
61908
|
}
|
|
62588
61909
|
|
|
@@ -62692,6 +62013,9 @@
|
|
|
62692
62013
|
return this._contentBottomOverflow + this.bottomEffects.height;
|
|
62693
62014
|
}
|
|
62694
62015
|
helpers;
|
|
62016
|
+
get collisionHelper() {
|
|
62017
|
+
return this.helpers.collisionHelper;
|
|
62018
|
+
}
|
|
62695
62019
|
/**
|
|
62696
62020
|
* Gets or sets whether this renderer is linked to the next one
|
|
62697
62021
|
* by some glyphs like a vibrato effect
|
|
@@ -62751,6 +62075,11 @@
|
|
|
62751
62075
|
for (const container of this._voiceContainers.values()) {
|
|
62752
62076
|
container.scaleToWidth(containerWidth);
|
|
62753
62077
|
}
|
|
62078
|
+
for (const v of this.helpers.beamHelpers) {
|
|
62079
|
+
for (const h of v) {
|
|
62080
|
+
h.alignWithBeats();
|
|
62081
|
+
}
|
|
62082
|
+
}
|
|
62754
62083
|
this._postBeatGlyphs.x = this._preBeatGlyphs.x + this._preBeatGlyphs.width + containerWidth;
|
|
62755
62084
|
this.width = width;
|
|
62756
62085
|
this.topEffects.alignGlyphs();
|
|
@@ -62779,10 +62108,13 @@
|
|
|
62779
62108
|
get barDisplayWidth() {
|
|
62780
62109
|
return this.staff.system.staves.length > 1 ? this.bar.masterBar.displayWidth : this.bar.displayWidth;
|
|
62781
62110
|
}
|
|
62782
|
-
|
|
62783
|
-
get
|
|
62111
|
+
wasFirstOfStaff = false;
|
|
62112
|
+
get isFirstOfStaff() {
|
|
62784
62113
|
return this.index === 0;
|
|
62785
62114
|
}
|
|
62115
|
+
get isLastOfStaff() {
|
|
62116
|
+
return this.index === this.staff.barRenderers.length - 1;
|
|
62117
|
+
}
|
|
62786
62118
|
get isLast() {
|
|
62787
62119
|
return !this.bar || this.bar.index === this.scoreRenderer.layout.lastBarIndex;
|
|
62788
62120
|
}
|
|
@@ -62997,6 +62329,18 @@
|
|
|
62997
62329
|
}
|
|
62998
62330
|
}
|
|
62999
62331
|
}
|
|
62332
|
+
for (const v of this._voiceContainers.values()) {
|
|
62333
|
+
for (const b of v.beatGlyphs) {
|
|
62334
|
+
const topY = b.getBoundingBoxTop();
|
|
62335
|
+
if (topY < 0) {
|
|
62336
|
+
this.registerOverflowTop(topY * -1);
|
|
62337
|
+
}
|
|
62338
|
+
const bottomY = b.getBoundingBoxBottom();
|
|
62339
|
+
if (bottomY > rendererBottom) {
|
|
62340
|
+
this.registerOverflowBottom(bottomY - rendererBottom);
|
|
62341
|
+
}
|
|
62342
|
+
}
|
|
62343
|
+
}
|
|
63000
62344
|
const beatEffectsMinY = this.beatEffectsMinY;
|
|
63001
62345
|
if (!Number.isNaN(beatEffectsMinY)) {
|
|
63002
62346
|
const beatEffectTopOverflow = -beatEffectsMinY;
|
|
@@ -63050,7 +62394,6 @@
|
|
|
63050
62394
|
g.renderer = this;
|
|
63051
62395
|
g.preNotes.renderer = this;
|
|
63052
62396
|
g.onNotes.renderer = this;
|
|
63053
|
-
g.onNotes.beamingHelper = this.helpers.beamHelperLookup[g.beat.voice.index].get(g.beat.index);
|
|
63054
62397
|
this.getVoiceContainer(g.beat.voice).addGlyph(g);
|
|
63055
62398
|
}
|
|
63056
62399
|
getVoiceContainer(voice) {
|
|
@@ -63129,7 +62472,7 @@
|
|
|
63129
62472
|
this._postBeatGlyphs.addGlyph(g);
|
|
63130
62473
|
}
|
|
63131
62474
|
createPreBeatGlyphs() {
|
|
63132
|
-
this.
|
|
62475
|
+
this.wasFirstOfStaff = this.isFirstOfStaff;
|
|
63133
62476
|
}
|
|
63134
62477
|
createBeatGlyphs() {
|
|
63135
62478
|
for (const voice of this.bar.voices) {
|
|
@@ -63156,26 +62499,7 @@
|
|
|
63156
62499
|
getBeatX(beat, requestedPosition = BeatXPosition.PreNotes, useSharedSizes = false) {
|
|
63157
62500
|
const container = this.getBeatContainer(beat);
|
|
63158
62501
|
if (container) {
|
|
63159
|
-
|
|
63160
|
-
case BeatXPosition.PreNotes:
|
|
63161
|
-
return container.voiceContainer.x + container.x;
|
|
63162
|
-
case BeatXPosition.OnNotes:
|
|
63163
|
-
return container.voiceContainer.x + container.x + container.onNotes.x;
|
|
63164
|
-
case BeatXPosition.MiddleNotes:
|
|
63165
|
-
return container.voiceContainer.x + container.x + container.onNotes.x + container.onNotes.middleX;
|
|
63166
|
-
case BeatXPosition.Stem:
|
|
63167
|
-
const offset = container.onNotes.beamingHelper
|
|
63168
|
-
? container.onNotes.beamingHelper.getBeatLineX(beat)
|
|
63169
|
-
: container.onNotes.x + container.onNotes.width / 2;
|
|
63170
|
-
return container.voiceContainer.x + offset;
|
|
63171
|
-
case BeatXPosition.PostNotes:
|
|
63172
|
-
const onNoteSize = useSharedSizes
|
|
63173
|
-
? (this.layoutingInfo.getBeatSizes(beat)?.onBeatSize ?? container.onNotes.width)
|
|
63174
|
-
: container.onNotes.width;
|
|
63175
|
-
return container.voiceContainer.x + container.x + container.onNotes.x + onNoteSize;
|
|
63176
|
-
case BeatXPosition.EndBeat:
|
|
63177
|
-
return container.voiceContainer.x + container.x + container.width;
|
|
63178
|
-
}
|
|
62502
|
+
return container.voiceContainer.x + container.x + container.getBeatX(requestedPosition, useSharedSizes);
|
|
63179
62503
|
}
|
|
63180
62504
|
return 0;
|
|
63181
62505
|
}
|
|
@@ -63210,7 +62534,7 @@
|
|
|
63210
62534
|
this.updateSizes();
|
|
63211
62535
|
// there are some glyphs which are shown only for renderers at the line start, so we simply recreate them
|
|
63212
62536
|
// but we only need to recreate them for the renderers that were the first of the line or are now the first of the line
|
|
63213
|
-
if ((this.
|
|
62537
|
+
if ((this.wasFirstOfStaff && !this.isFirstOfStaff) || (!this.wasFirstOfStaff && this.isFirstOfStaff)) {
|
|
63214
62538
|
this.recreatePreBeatGlyphs();
|
|
63215
62539
|
this._postBeatGlyphs.doLayout();
|
|
63216
62540
|
}
|
|
@@ -63247,7 +62571,7 @@
|
|
|
63247
62571
|
completeBeamingHelper(_helper) {
|
|
63248
62572
|
}
|
|
63249
62573
|
getBeatDirection(beat) {
|
|
63250
|
-
return this.helpers.getBeamingHelperForBeat(beat).
|
|
62574
|
+
return this.helpers.getBeamingHelperForBeat(beat)?.direction ?? BeamDirection.Up;
|
|
63251
62575
|
}
|
|
63252
62576
|
}
|
|
63253
62577
|
|
|
@@ -65614,8 +64938,18 @@
|
|
|
65614
64938
|
}
|
|
65615
64939
|
const lineRenderer = this.renderer;
|
|
65616
64940
|
const lineYOffset = lineRenderer.smuflMetrics.staffLineThickness;
|
|
65617
|
-
|
|
65618
|
-
|
|
64941
|
+
let top = this.y;
|
|
64942
|
+
let bottom = this.y;
|
|
64943
|
+
if (lineRenderer.drawnLineCount < 2 ||
|
|
64944
|
+
(!this._isRight && lineRenderer.isFirstOfStaff) ||
|
|
64945
|
+
(this._isRight && lineRenderer.isLastOfStaff)) {
|
|
64946
|
+
top -= lineYOffset;
|
|
64947
|
+
bottom += lineRenderer.height;
|
|
64948
|
+
}
|
|
64949
|
+
else {
|
|
64950
|
+
top += lineRenderer.getLineY(0);
|
|
64951
|
+
bottom += lineRenderer.getLineY(lineRenderer.drawnLineCount - 1);
|
|
64952
|
+
}
|
|
65619
64953
|
const h = bottom - top;
|
|
65620
64954
|
// round up to have pixel-aligned bar lines, x-shift will be used during rendering
|
|
65621
64955
|
// to avoid shifting again all glyphs
|
|
@@ -65701,6 +65035,54 @@
|
|
|
65701
65035
|
}
|
|
65702
65036
|
}
|
|
65703
65037
|
|
|
65038
|
+
/**
|
|
65039
|
+
* @internal
|
|
65040
|
+
*/
|
|
65041
|
+
class FlagGlyph extends MusicFontGlyph {
|
|
65042
|
+
constructor(x, y, duration, direction, isGrace) {
|
|
65043
|
+
super(x, y, isGrace ? NoteHeadGlyph.GraceScale : 1, FlagGlyph.getSymbol(duration, direction, isGrace));
|
|
65044
|
+
}
|
|
65045
|
+
static getSymbol(duration, direction, isGrace) {
|
|
65046
|
+
if (isGrace) {
|
|
65047
|
+
duration = Duration.Eighth;
|
|
65048
|
+
}
|
|
65049
|
+
if (direction === BeamDirection.Up) {
|
|
65050
|
+
switch (duration) {
|
|
65051
|
+
case Duration.Eighth:
|
|
65052
|
+
return MusicFontSymbol.Flag8thUp;
|
|
65053
|
+
case Duration.Sixteenth:
|
|
65054
|
+
return MusicFontSymbol.Flag16thUp;
|
|
65055
|
+
case Duration.ThirtySecond:
|
|
65056
|
+
return MusicFontSymbol.Flag32ndUp;
|
|
65057
|
+
case Duration.SixtyFourth:
|
|
65058
|
+
return MusicFontSymbol.Flag64thUp;
|
|
65059
|
+
case Duration.OneHundredTwentyEighth:
|
|
65060
|
+
return MusicFontSymbol.Flag128thUp;
|
|
65061
|
+
case Duration.TwoHundredFiftySixth:
|
|
65062
|
+
return MusicFontSymbol.Flag256thUp;
|
|
65063
|
+
default:
|
|
65064
|
+
return MusicFontSymbol.Flag8thUp;
|
|
65065
|
+
}
|
|
65066
|
+
}
|
|
65067
|
+
switch (duration) {
|
|
65068
|
+
case Duration.Eighth:
|
|
65069
|
+
return MusicFontSymbol.Flag8thDown;
|
|
65070
|
+
case Duration.Sixteenth:
|
|
65071
|
+
return MusicFontSymbol.Flag16thDown;
|
|
65072
|
+
case Duration.ThirtySecond:
|
|
65073
|
+
return MusicFontSymbol.Flag32ndDown;
|
|
65074
|
+
case Duration.SixtyFourth:
|
|
65075
|
+
return MusicFontSymbol.Flag64thDown;
|
|
65076
|
+
case Duration.OneHundredTwentyEighth:
|
|
65077
|
+
return MusicFontSymbol.Flag128thDown;
|
|
65078
|
+
case Duration.TwoHundredFiftySixth:
|
|
65079
|
+
return MusicFontSymbol.Flag128thDown;
|
|
65080
|
+
default:
|
|
65081
|
+
return MusicFontSymbol.Flag8thDown;
|
|
65082
|
+
}
|
|
65083
|
+
}
|
|
65084
|
+
}
|
|
65085
|
+
|
|
65704
65086
|
/**
|
|
65705
65087
|
* @internal
|
|
65706
65088
|
*/
|
|
@@ -65736,6 +65118,23 @@
|
|
|
65736
65118
|
}
|
|
65737
65119
|
}
|
|
65738
65120
|
|
|
65121
|
+
/**
|
|
65122
|
+
* This simple glyph allows to put an empty region in to a BarRenderer.
|
|
65123
|
+
* @internal
|
|
65124
|
+
*/
|
|
65125
|
+
class SpacingGlyph extends Glyph {
|
|
65126
|
+
constructor(x, y, width) {
|
|
65127
|
+
super(x, y);
|
|
65128
|
+
this.width = width;
|
|
65129
|
+
}
|
|
65130
|
+
getBoundingBoxTop() {
|
|
65131
|
+
return Number.NaN;
|
|
65132
|
+
}
|
|
65133
|
+
getBoundingBoxBottom() {
|
|
65134
|
+
return Number.NaN;
|
|
65135
|
+
}
|
|
65136
|
+
}
|
|
65137
|
+
|
|
65739
65138
|
/**
|
|
65740
65139
|
* This is a base class for any bar renderer which renders music notation on a staff
|
|
65741
65140
|
* with lines like Standard Notation, Guitar Tablatures and Slash Notation.
|
|
@@ -65859,7 +65258,7 @@
|
|
|
65859
65258
|
if (this.hasVoiceContainer(voice)) {
|
|
65860
65259
|
const container = this.getVoiceContainer(voice);
|
|
65861
65260
|
for (const tupletGroup of container.tupletGroups) {
|
|
65862
|
-
this._paintTupletHelper(cx
|
|
65261
|
+
this._paintTupletHelper(cx, cy, canvas, tupletGroup, beatElement, bracketsAsArcs);
|
|
65863
65262
|
}
|
|
65864
65263
|
}
|
|
65865
65264
|
}
|
|
@@ -65933,26 +65332,27 @@
|
|
|
65933
65332
|
// check if we need to paint simple footer
|
|
65934
65333
|
const offset = this.tupletOffset;
|
|
65935
65334
|
const size = this.tupletSize;
|
|
65335
|
+
const shift = offset + size * 0.5;
|
|
65936
65336
|
const _ = ElementStyleHelper.beat(canvas, beatElement, h.beats[0]);
|
|
65937
65337
|
try {
|
|
65938
65338
|
const l = canvas.lineWidth;
|
|
65939
65339
|
canvas.lineWidth = this.smuflMetrics.tupletBracketThickness;
|
|
65940
65340
|
if (h.beats.length === 1 || !h.isFull) {
|
|
65941
65341
|
for (const beat of h.beats) {
|
|
65942
|
-
const beamingHelper = this.helpers.
|
|
65342
|
+
const beamingHelper = this.helpers.getBeamingHelperForBeat(beat);
|
|
65943
65343
|
if (!beamingHelper) {
|
|
65944
65344
|
continue;
|
|
65945
65345
|
}
|
|
65946
65346
|
const direction = this.getTupletBeamDirection(beamingHelper);
|
|
65947
|
-
const tupletX =
|
|
65347
|
+
const tupletX = this.getBeatX(beat, BeatXPosition.Stem);
|
|
65948
65348
|
let tupletY = this.calculateBeamYWithDirection(beamingHelper, tupletX, direction);
|
|
65949
65349
|
if (direction === BeamDirection.Down) {
|
|
65950
|
-
tupletY +=
|
|
65350
|
+
tupletY += shift;
|
|
65951
65351
|
}
|
|
65952
65352
|
else {
|
|
65953
|
-
tupletY -=
|
|
65353
|
+
tupletY -= shift;
|
|
65954
65354
|
}
|
|
65955
|
-
canvas.fillMusicFontSymbols(cx + this.x + tupletX, cy + this.y + tupletY, 1, s, true);
|
|
65355
|
+
canvas.fillMusicFontSymbols(cx + this.x + tupletX, cy + this.y + tupletY + size * 0.5, 1, s, true);
|
|
65956
65356
|
}
|
|
65957
65357
|
}
|
|
65958
65358
|
else {
|
|
@@ -65982,12 +65382,12 @@
|
|
|
65982
65382
|
}
|
|
65983
65383
|
//
|
|
65984
65384
|
// Calculate the overall area of the tuplet bracket
|
|
65985
|
-
const startX = this.getBeatX(firstBeat, BeatXPosition.OnNotes)
|
|
65986
|
-
const endX = this.getBeatX(lastBeat, BeatXPosition.PostNotes)
|
|
65385
|
+
const startX = this.getBeatX(firstBeat, BeatXPosition.OnNotes);
|
|
65386
|
+
const endX = this.getBeatX(lastBeat, BeatXPosition.PostNotes);
|
|
65987
65387
|
//
|
|
65988
65388
|
// calculate the y positions for our bracket
|
|
65989
|
-
const firstNonRestBeamingHelper = this.helpers.
|
|
65990
|
-
const lastNonRestBeamingHelper = this.helpers.
|
|
65389
|
+
const firstNonRestBeamingHelper = this.helpers.getBeamingHelperForBeat(firstNonRestBeat);
|
|
65390
|
+
const lastNonRestBeamingHelper = this.helpers.getBeamingHelperForBeat(lastNonRestBeat);
|
|
65991
65391
|
const direction = this.getTupletBeamDirection(firstNonRestBeamingHelper);
|
|
65992
65392
|
let startY = this.calculateBeamYWithDirection(firstNonRestBeamingHelper, startX, direction);
|
|
65993
65393
|
let endY = this.calculateBeamYWithDirection(lastNonRestBeamingHelper, endX, direction);
|
|
@@ -65996,7 +65396,6 @@
|
|
|
65996
65396
|
endY = startY;
|
|
65997
65397
|
}
|
|
65998
65398
|
// align line centered in available space
|
|
65999
|
-
const shift = offset + size * 0.5;
|
|
66000
65399
|
if (direction === BeamDirection.Down) {
|
|
66001
65400
|
startY += shift;
|
|
66002
65401
|
endY += shift;
|
|
@@ -66061,14 +65460,24 @@
|
|
|
66061
65460
|
paintBeams(cx, cy, canvas, flagsElement, beamsElement) {
|
|
66062
65461
|
for (const v of this.helpers.beamHelpers) {
|
|
66063
65462
|
for (const h of v) {
|
|
66064
|
-
this.
|
|
65463
|
+
this.paintBeamHelper(cx, cy, canvas, h, flagsElement, beamsElement);
|
|
66065
65464
|
}
|
|
66066
65465
|
}
|
|
66067
65466
|
}
|
|
66068
65467
|
drawBeamHelperAsFlags(h) {
|
|
66069
65468
|
return h.beats.length === 1;
|
|
66070
65469
|
}
|
|
66071
|
-
|
|
65470
|
+
hasFlag(beat) {
|
|
65471
|
+
if (beat.isRest) {
|
|
65472
|
+
return false;
|
|
65473
|
+
}
|
|
65474
|
+
const helper = this.helpers.getBeamingHelperForBeat(beat);
|
|
65475
|
+
if (helper) {
|
|
65476
|
+
return helper.hasFlag(this.drawBeamHelperAsFlags(helper), beat);
|
|
65477
|
+
}
|
|
65478
|
+
return BeamingHelper.beatHasFlag(beat);
|
|
65479
|
+
}
|
|
65480
|
+
paintBeamHelper(cx, cy, canvas, h, flagsElement, beamsElement) {
|
|
66072
65481
|
canvas.color = h.voice.index === 0 ? this.resources.mainGlyphColor : this.resources.secondaryGlyphColor;
|
|
66073
65482
|
if (!h.isRestBeamHelper) {
|
|
66074
65483
|
if (this.drawBeamHelperAsFlags(h)) {
|
|
@@ -66079,7 +65488,7 @@
|
|
|
66079
65488
|
}
|
|
66080
65489
|
}
|
|
66081
65490
|
}
|
|
66082
|
-
shouldPaintFlag(beat
|
|
65491
|
+
shouldPaintFlag(beat) {
|
|
66083
65492
|
// no flags for bend grace beats
|
|
66084
65493
|
if (beat.graceType === GraceType.BendGrace) {
|
|
66085
65494
|
return false;
|
|
@@ -66087,10 +65496,6 @@
|
|
|
66087
65496
|
if (beat.deadSlapped) {
|
|
66088
65497
|
return false;
|
|
66089
65498
|
}
|
|
66090
|
-
// we don't have an X-position: cannot paint a flag
|
|
66091
|
-
if (!h.hasBeatLineX(beat)) {
|
|
66092
|
-
return false;
|
|
66093
|
-
}
|
|
66094
65499
|
// no flags for any grace notes on songbook mode
|
|
66095
65500
|
if (beat.graceType !== GraceType.None && this.settings.notation.notationMode === exports.NotationMode.SongBook) {
|
|
66096
65501
|
return false;
|
|
@@ -66105,14 +65510,14 @@
|
|
|
66105
65510
|
}
|
|
66106
65511
|
paintFlag(cx, cy, canvas, h, flagsElement) {
|
|
66107
65512
|
for (const beat of h.beats) {
|
|
66108
|
-
if (!this.shouldPaintFlag(beat
|
|
65513
|
+
if (!this.shouldPaintFlag(beat)) {
|
|
66109
65514
|
continue;
|
|
66110
65515
|
}
|
|
66111
65516
|
const isGrace = beat.graceType !== GraceType.None;
|
|
66112
65517
|
//
|
|
66113
65518
|
// draw line
|
|
66114
65519
|
//
|
|
66115
|
-
const beatLineX =
|
|
65520
|
+
const beatLineX = this.getBeatX(beat, BeatXPosition.Stem);
|
|
66116
65521
|
const direction = this.getBeamDirection(h);
|
|
66117
65522
|
const topY = cy + this.y + this.getFlagTopY(beat, direction);
|
|
66118
65523
|
const bottomY = cy + this.y + this.getFlagBottomY(beat, direction);
|
|
@@ -66123,7 +65528,7 @@
|
|
|
66123
65528
|
else {
|
|
66124
65529
|
flagY = topY;
|
|
66125
65530
|
}
|
|
66126
|
-
if (!h.
|
|
65531
|
+
if (!h.hasStem(true, beat)) {
|
|
66127
65532
|
continue;
|
|
66128
65533
|
}
|
|
66129
65534
|
this.paintBeamingStem(beat, cy + this.y, cx + this.x + beatLineX, topY, bottomY, canvas);
|
|
@@ -66209,10 +65614,10 @@
|
|
|
66209
65614
|
}
|
|
66210
65615
|
for (let i = 0, j = h.beats.length; i < j; i++) {
|
|
66211
65616
|
const beat = h.beats[i];
|
|
66212
|
-
if (
|
|
65617
|
+
if (beat.deadSlapped) {
|
|
66213
65618
|
continue;
|
|
66214
65619
|
}
|
|
66215
|
-
const beatLineX =
|
|
65620
|
+
const beatLineX = this.getBeatX(beat, BeatXPosition.Stem);
|
|
66216
65621
|
const y1 = cy + this.y + this.getBarLineStart(beat, direction);
|
|
66217
65622
|
// ensure we are pixel aligned on the end of the stem to avoid anti-aliasing artifacts
|
|
66218
65623
|
// when combining stems and beams on sub-pixel level
|
|
@@ -66250,7 +65655,7 @@
|
|
|
66250
65655
|
barEndY = barY + this.calculateBeamY(h, barEndX);
|
|
66251
65656
|
LineBarRenderer.paintSingleBar(canvas, cx + this.x + barStartX, barStartY, cx + this.x + barEndX, barEndY, barSize);
|
|
66252
65657
|
// end part
|
|
66253
|
-
barEndX =
|
|
65658
|
+
barEndX = this.getBeatX(h.beats[i + 1], BeatXPosition.Stem);
|
|
66254
65659
|
barStartX = barEndX - brokenBarOffset;
|
|
66255
65660
|
barStartY = barY + this.calculateBeamY(h, barStartX);
|
|
66256
65661
|
barEndY = barY + this.calculateBeamY(h, barEndX);
|
|
@@ -66260,7 +65665,7 @@
|
|
|
66260
65665
|
if (isFullBarJoin) {
|
|
66261
65666
|
// full bar?
|
|
66262
65667
|
barStartX = beatLineX;
|
|
66263
|
-
barEndX =
|
|
65668
|
+
barEndX = this.getBeatX(h.beats[i + 1], BeatXPosition.Stem);
|
|
66264
65669
|
}
|
|
66265
65670
|
else if (i === 0 || !BeamingHelper.isFullBarJoin(h.beats[i - 1], beat, barIndex)) {
|
|
66266
65671
|
barStartX = beatLineX;
|
|
@@ -66295,7 +65700,7 @@
|
|
|
66295
65700
|
}
|
|
66296
65701
|
}
|
|
66297
65702
|
if (h.graceType === GraceType.BeforeBeat) {
|
|
66298
|
-
const beatLineX =
|
|
65703
|
+
const beatLineX = this.getBeatX(h.beats[0], BeatXPosition.Stem);
|
|
66299
65704
|
const flagWidth = this.smuflMetrics.glyphWidths.get(MusicFontSymbol.Flag8thUp) * NoteHeadGlyph.GraceScale;
|
|
66300
65705
|
let slashY = (cy + this.y + this.calculateBeamY(h, beatLineX)) | 0;
|
|
66301
65706
|
slashY += barSize + barSpacing;
|
|
@@ -66322,20 +65727,7 @@
|
|
|
66322
65727
|
const noteOverflowPadding = this.getLineHeight(0.5);
|
|
66323
65728
|
for (const v of this.helpers.beamHelpers) {
|
|
66324
65729
|
for (const h of v) {
|
|
66325
|
-
if (h.isRestBeamHelper)
|
|
66326
|
-
if (h.minRestSteps) {
|
|
66327
|
-
const topY = this.getLineY(h.maxRestSteps / 2) - noteOverflowPadding;
|
|
66328
|
-
if (topY < maxNoteY) {
|
|
66329
|
-
maxNoteY = topY;
|
|
66330
|
-
}
|
|
66331
|
-
}
|
|
66332
|
-
if (h.maxRestSteps) {
|
|
66333
|
-
const bottomY = this.getLineY(h.maxRestSteps & 2) + noteOverflowPadding;
|
|
66334
|
-
if (bottomY < maxNoteY) {
|
|
66335
|
-
maxNoteY = bottomY;
|
|
66336
|
-
}
|
|
66337
|
-
}
|
|
66338
|
-
}
|
|
65730
|
+
if (h.isRestBeamHelper) ;
|
|
66339
65731
|
else if (h.beats.length === 1 && h.beats[0].duration >= Duration.Half) {
|
|
66340
65732
|
if (h.direction === BeamDirection.Up) {
|
|
66341
65733
|
let topY = this.getFlagTopY(h.beats[0], h.direction);
|
|
@@ -66386,17 +65778,6 @@
|
|
|
66386
65778
|
}
|
|
66387
65779
|
}
|
|
66388
65780
|
}
|
|
66389
|
-
const beatContainer = this.getBeatContainer(h.beats[0]);
|
|
66390
|
-
if (beatContainer) {
|
|
66391
|
-
const bBoxTop = beatContainer.getBoundingBoxTop();
|
|
66392
|
-
const bBoxBottom = beatContainer.getBoundingBoxBottom();
|
|
66393
|
-
if (bBoxBottom > minNoteY) {
|
|
66394
|
-
minNoteY = bBoxBottom;
|
|
66395
|
-
}
|
|
66396
|
-
if (bBoxTop < maxNoteY) {
|
|
66397
|
-
maxNoteY = bBoxTop;
|
|
66398
|
-
}
|
|
66399
|
-
}
|
|
66400
65781
|
}
|
|
66401
65782
|
}
|
|
66402
65783
|
if (maxNoteY < rendererTop) {
|
|
@@ -66412,25 +65793,6 @@
|
|
|
66412
65793
|
}
|
|
66413
65794
|
const scale = h.graceType !== GraceType.None ? NoteHeadGlyph.GraceScale : 1;
|
|
66414
65795
|
const barCount = ModelUtils.getIndex(h.shortestDuration) - 2;
|
|
66415
|
-
let stemSize = this.smuflMetrics.standardStemLength * scale;
|
|
66416
|
-
if (h.tremoloDuration) {
|
|
66417
|
-
// for 16th and shorter beats we need more space for all tremolos
|
|
66418
|
-
// for 8th beats we need only more space for 32nd tremolos
|
|
66419
|
-
// the logic here is not perfect but there is no SMuFL guideline
|
|
66420
|
-
// on how tremolos need to extend stems
|
|
66421
|
-
const oneBeamSize = (this.smuflMetrics.beamThickness + this.smuflMetrics.beamSpacing) * scale;
|
|
66422
|
-
if (h.shortestDuration > Duration.Eighth) {
|
|
66423
|
-
if (h.tremoloDuration === Duration.Eighth) {
|
|
66424
|
-
stemSize += oneBeamSize;
|
|
66425
|
-
}
|
|
66426
|
-
else {
|
|
66427
|
-
stemSize += oneBeamSize * 1.5;
|
|
66428
|
-
}
|
|
66429
|
-
}
|
|
66430
|
-
else if (h.tremoloDuration === Duration.ThirtySecond) {
|
|
66431
|
-
stemSize += oneBeamSize * 1.5;
|
|
66432
|
-
}
|
|
66433
|
-
}
|
|
66434
65796
|
const drawingInfo = new BeamingHelperDrawInfo();
|
|
66435
65797
|
h.drawingInfos.set(direction, drawingInfo);
|
|
66436
65798
|
// the beaming logic works like this:
|
|
@@ -66443,33 +65805,17 @@
|
|
|
66443
65805
|
const isRest = h.isRestBeamHelper;
|
|
66444
65806
|
// 1. put direct diagonal line.
|
|
66445
65807
|
drawingInfo.startBeat = firstBeat;
|
|
66446
|
-
drawingInfo.startX =
|
|
66447
|
-
|
|
66448
|
-
|
|
66449
|
-
|
|
66450
|
-
|
|
66451
|
-
: this.getLineY(h.maxRestSteps / 2);
|
|
66452
|
-
}
|
|
66453
|
-
else {
|
|
66454
|
-
drawingInfo.startY =
|
|
66455
|
-
direction === BeamDirection.Up
|
|
66456
|
-
? this.getFlagTopY(firstBeat, direction)
|
|
66457
|
-
: this.getFlagBottomY(firstBeat, direction);
|
|
66458
|
-
}
|
|
65808
|
+
drawingInfo.startX = this.getBeatX(firstBeat, BeatXPosition.Stem);
|
|
65809
|
+
drawingInfo.startY =
|
|
65810
|
+
direction === BeamDirection.Up
|
|
65811
|
+
? this.getFlagTopY(firstBeat, direction)
|
|
65812
|
+
: this.getFlagBottomY(firstBeat, direction);
|
|
66459
65813
|
drawingInfo.endBeat = lastBeat;
|
|
66460
|
-
drawingInfo.endX =
|
|
66461
|
-
|
|
66462
|
-
|
|
66463
|
-
|
|
66464
|
-
|
|
66465
|
-
: this.getLineY(h.maxRestSteps / 2);
|
|
66466
|
-
}
|
|
66467
|
-
else {
|
|
66468
|
-
drawingInfo.endY =
|
|
66469
|
-
direction === BeamDirection.Up
|
|
66470
|
-
? this.getFlagTopY(lastBeat, direction)
|
|
66471
|
-
: this.getFlagBottomY(lastBeat, direction);
|
|
66472
|
-
}
|
|
65814
|
+
drawingInfo.endX = this.getBeatX(lastBeat, BeatXPosition.Stem);
|
|
65815
|
+
drawingInfo.endY =
|
|
65816
|
+
direction === BeamDirection.Up
|
|
65817
|
+
? this.getFlagTopY(lastBeat, direction)
|
|
65818
|
+
: this.getFlagBottomY(lastBeat, direction);
|
|
66473
65819
|
// 2. ensure max slope
|
|
66474
65820
|
// we use the min/max notes to place the beam along their real position
|
|
66475
65821
|
// we only want a maximum of 10 offset for their gradient
|
|
@@ -66494,12 +65840,41 @@
|
|
|
66494
65840
|
drawingInfo.startY - drawingInfo.endY > maxSlope) {
|
|
66495
65841
|
drawingInfo.startY = drawingInfo.endY + maxSlope;
|
|
66496
65842
|
}
|
|
66497
|
-
// 3.
|
|
65843
|
+
// 3. adjust beam drawing order
|
|
65844
|
+
// we can only draw up to 2 beams towards the noteheads, then we have to grow to the other side
|
|
65845
|
+
// here we shift accordingly
|
|
65846
|
+
let barDrawingShift = 0;
|
|
65847
|
+
if (barCount > 2 && !isRest) {
|
|
65848
|
+
const beamSpacing = this.smuflMetrics.beamSpacing * scale;
|
|
65849
|
+
const beamThickness = this.smuflMetrics.beamThickness * scale;
|
|
65850
|
+
const totalBarsHeight = barCount * beamThickness + (barCount - 1) * beamSpacing;
|
|
65851
|
+
if (direction === BeamDirection.Up) {
|
|
65852
|
+
const bottomBarY = drawingInfo.startY + 2 * beamThickness + beamSpacing;
|
|
65853
|
+
const barTopY = bottomBarY - totalBarsHeight;
|
|
65854
|
+
const diff = drawingInfo.startY - barTopY;
|
|
65855
|
+
if (diff > 0) {
|
|
65856
|
+
barDrawingShift = diff * -1;
|
|
65857
|
+
drawingInfo.startY -= diff;
|
|
65858
|
+
drawingInfo.endY -= diff;
|
|
65859
|
+
}
|
|
65860
|
+
}
|
|
65861
|
+
else {
|
|
65862
|
+
const topBarY = drawingInfo.startY - 2 * beamThickness + beamSpacing;
|
|
65863
|
+
const barBottomY = topBarY + totalBarsHeight;
|
|
65864
|
+
const diff = barBottomY - drawingInfo.startY;
|
|
65865
|
+
if (diff > 0) {
|
|
65866
|
+
barDrawingShift = diff;
|
|
65867
|
+
drawingInfo.startY += diff;
|
|
65868
|
+
drawingInfo.endY += diff;
|
|
65869
|
+
}
|
|
65870
|
+
}
|
|
65871
|
+
}
|
|
65872
|
+
// 4. let middle elements shift up/down
|
|
66498
65873
|
if (h.beats.length > 1) {
|
|
66499
65874
|
// check if highest note shifts bar up or down
|
|
66500
65875
|
if (direction === BeamDirection.Up) {
|
|
66501
|
-
const yNeededForHighestNote = this.
|
|
66502
|
-
const yGivenByCurrentValues = drawingInfo.calcY(
|
|
65876
|
+
const yNeededForHighestNote = barDrawingShift + this.getFlagTopY(h.beatOfHighestNote, direction);
|
|
65877
|
+
const yGivenByCurrentValues = drawingInfo.calcY(this.getBeatX(h.beatOfHighestNote, BeatXPosition.Stem));
|
|
66503
65878
|
const diff = yGivenByCurrentValues - yNeededForHighestNote;
|
|
66504
65879
|
if (diff > 0) {
|
|
66505
65880
|
drawingInfo.startY -= diff;
|
|
@@ -66507,8 +65882,8 @@
|
|
|
66507
65882
|
}
|
|
66508
65883
|
}
|
|
66509
65884
|
else {
|
|
66510
|
-
const yNeededForLowestNote = this.
|
|
66511
|
-
const yGivenByCurrentValues = drawingInfo.calcY(
|
|
65885
|
+
const yNeededForLowestNote = barDrawingShift + this.getFlagBottomY(h.beatOfLowestNote, direction);
|
|
65886
|
+
const yGivenByCurrentValues = drawingInfo.calcY(this.getBeatX(h.beatOfLowestNote, BeatXPosition.Stem));
|
|
66512
65887
|
const diff = yNeededForLowestNote - yGivenByCurrentValues;
|
|
66513
65888
|
if (diff > 0) {
|
|
66514
65889
|
drawingInfo.startY += diff;
|
|
@@ -66516,33 +65891,39 @@
|
|
|
66516
65891
|
}
|
|
66517
65892
|
}
|
|
66518
65893
|
// check if rest shifts bar up or down
|
|
66519
|
-
|
|
65894
|
+
let barSpacing = 0;
|
|
65895
|
+
if (h.restBeats.length > 0) {
|
|
65896
|
+
// space needed for the bars, rests need to be below them
|
|
66520
65897
|
const scaleMod = h.graceType !== GraceType.None ? NoteHeadGlyph.GraceScale : 1;
|
|
66521
|
-
|
|
66522
|
-
|
|
66523
|
-
|
|
66524
|
-
|
|
66525
|
-
|
|
66526
|
-
|
|
66527
|
-
|
|
66528
|
-
drawingInfo.
|
|
66529
|
-
|
|
65898
|
+
barSpacing = barCount * (this.smuflMetrics.beamSpacing + this.smuflMetrics.beamThickness) * scaleMod;
|
|
65899
|
+
}
|
|
65900
|
+
for (const b of h.restBeats) {
|
|
65901
|
+
// rest beats which are "under" the beam
|
|
65902
|
+
if (b.isRest && b.index < h.beats[h.beats.length - 1].index) {
|
|
65903
|
+
if (direction === BeamDirection.Up) {
|
|
65904
|
+
const yNeededForRest = this.getBeatContainer(b).getBoundingBoxTop() - barSpacing;
|
|
65905
|
+
const yGivenByCurrentValues = drawingInfo.calcY(this.getBeatX(b, BeatXPosition.Stem));
|
|
65906
|
+
const diff = yGivenByCurrentValues - yNeededForRest;
|
|
65907
|
+
if (diff > 0) {
|
|
65908
|
+
drawingInfo.startY -= diff;
|
|
65909
|
+
drawingInfo.endY -= diff;
|
|
65910
|
+
}
|
|
66530
65911
|
}
|
|
66531
|
-
|
|
66532
|
-
|
|
66533
|
-
|
|
66534
|
-
|
|
66535
|
-
|
|
66536
|
-
|
|
66537
|
-
|
|
66538
|
-
|
|
65912
|
+
else if (direction === BeamDirection.Down) {
|
|
65913
|
+
const yNeededForRest = this.getBeatContainer(b).getBoundingBoxBottom() + barSpacing;
|
|
65914
|
+
const yGivenByCurrentValues = drawingInfo.calcY(this.getBeatX(b, BeatXPosition.Stem));
|
|
65915
|
+
const diff = yNeededForRest - yGivenByCurrentValues;
|
|
65916
|
+
if (diff > 0) {
|
|
65917
|
+
drawingInfo.startY += diff;
|
|
65918
|
+
drawingInfo.endY += diff;
|
|
65919
|
+
}
|
|
66539
65920
|
}
|
|
66540
65921
|
}
|
|
66541
65922
|
}
|
|
66542
65923
|
// check if slash shifts bar up or down
|
|
66543
65924
|
if (h.slashBeats.length > 0) {
|
|
66544
65925
|
for (const b of h.slashBeats) {
|
|
66545
|
-
const yGivenByCurrentValues = drawingInfo.calcY(
|
|
65926
|
+
const yGivenByCurrentValues = drawingInfo.calcY(this.getBeatX(b, BeatXPosition.Stem));
|
|
66546
65927
|
const yNeededForSlash = h.direction === BeamDirection.Up
|
|
66547
65928
|
? this.getFlagTopY(b, h.direction)
|
|
66548
65929
|
: this.getFlagBottomY(b, h.direction);
|
|
@@ -66554,31 +65935,6 @@
|
|
|
66554
65935
|
}
|
|
66555
65936
|
}
|
|
66556
65937
|
}
|
|
66557
|
-
// we can only draw up to 2 beams towards the noteheads, then we have to grow to the other side
|
|
66558
|
-
// here we shift accordingly
|
|
66559
|
-
if (barCount > 2 && !isRest) {
|
|
66560
|
-
const beamSpacing = this.smuflMetrics.beamSpacing * scale;
|
|
66561
|
-
const beamThickness = this.smuflMetrics.beamThickness * scale;
|
|
66562
|
-
const totalBarsHeight = barCount * beamThickness + (barCount - 1) * beamSpacing;
|
|
66563
|
-
if (direction === BeamDirection.Up) {
|
|
66564
|
-
const bottomBarY = drawingInfo.startY + 2 * beamThickness + beamSpacing;
|
|
66565
|
-
const barTopY = bottomBarY - totalBarsHeight;
|
|
66566
|
-
const diff = drawingInfo.startY - barTopY;
|
|
66567
|
-
if (diff > 0) {
|
|
66568
|
-
drawingInfo.startY -= diff;
|
|
66569
|
-
drawingInfo.endY -= diff;
|
|
66570
|
-
}
|
|
66571
|
-
}
|
|
66572
|
-
else {
|
|
66573
|
-
const topBarY = drawingInfo.startY - 2 * beamThickness + beamSpacing;
|
|
66574
|
-
const barBottomY = topBarY + totalBarsHeight;
|
|
66575
|
-
const diff = barBottomY - drawingInfo.startY;
|
|
66576
|
-
if (diff > 0) {
|
|
66577
|
-
drawingInfo.startY += diff;
|
|
66578
|
-
drawingInfo.endY += diff;
|
|
66579
|
-
}
|
|
66580
|
-
}
|
|
66581
|
-
}
|
|
66582
65938
|
}
|
|
66583
65939
|
getMinLineOfBeat(_beat) {
|
|
66584
65940
|
return 0;
|
|
@@ -67099,20 +66455,6 @@
|
|
|
67099
66455
|
}
|
|
67100
66456
|
return 0;
|
|
67101
66457
|
}
|
|
67102
|
-
updateBeamingHelper() {
|
|
67103
|
-
if (this.beamingHelper) {
|
|
67104
|
-
let g = null;
|
|
67105
|
-
if (this.noteHeads) {
|
|
67106
|
-
g = this.noteHeads;
|
|
67107
|
-
}
|
|
67108
|
-
else if (this.deadSlapped) {
|
|
67109
|
-
g = this.deadSlapped;
|
|
67110
|
-
}
|
|
67111
|
-
if (g) {
|
|
67112
|
-
this.beamingHelper.registerBeatLineX('numbered', this.container.beat, this.container.x + this.x + g.x, this.container.x + this.x + g.x + g.width);
|
|
67113
|
-
}
|
|
67114
|
-
}
|
|
67115
|
-
}
|
|
67116
66458
|
static majorKeySignatureOneValues = [
|
|
67117
66459
|
// Flats
|
|
67118
66460
|
59, 66, 61, 68, 63, 58, 65,
|
|
@@ -67237,6 +66579,7 @@
|
|
|
67237
66579
|
this.onTimeX = this.deadSlapped.x + this.deadSlapped.width / 2;
|
|
67238
66580
|
}
|
|
67239
66581
|
this.middleX = this.onTimeX;
|
|
66582
|
+
this.stemX = this.middleX;
|
|
67240
66583
|
}
|
|
67241
66584
|
}
|
|
67242
66585
|
|
|
@@ -67649,7 +66992,7 @@
|
|
|
67649
66992
|
const barSize = this.smuflMetrics.numberedBarRendererBarSize;
|
|
67650
66993
|
const barCount = ModelUtils.getIndex(beat.duration) - 2;
|
|
67651
66994
|
const barStart = cy + this.y;
|
|
67652
|
-
const beatLineX = this.getBeatX(beat, BeatXPosition.PreNotes)
|
|
66995
|
+
const beatLineX = this.getBeatX(beat, BeatXPosition.PreNotes);
|
|
67653
66996
|
const beamY = this.calculateBeamY(h, beatLineX);
|
|
67654
66997
|
for (let barIndex = 0; barIndex < barCount; barIndex++) {
|
|
67655
66998
|
let barStartX = 0;
|
|
@@ -67658,11 +67001,11 @@
|
|
|
67658
67001
|
const barY = barStart + barIndex * barSpacing;
|
|
67659
67002
|
if (i === h.beats.length - 1) {
|
|
67660
67003
|
barStartX = beatLineX;
|
|
67661
|
-
barEndX = this.getBeatX(beat, BeatXPosition.PostNotes)
|
|
67004
|
+
barEndX = this.getBeatX(beat, BeatXPosition.PostNotes);
|
|
67662
67005
|
}
|
|
67663
67006
|
else {
|
|
67664
67007
|
barStartX = beatLineX;
|
|
67665
|
-
barEndX = this.getBeatX(h.beats[i + 1], BeatXPosition.PreNotes)
|
|
67008
|
+
barEndX = this.getBeatX(h.beats[i + 1], BeatXPosition.PreNotes);
|
|
67666
67009
|
}
|
|
67667
67010
|
barStartY = barY + beamY;
|
|
67668
67011
|
canvas.fillRect(cx + this.x + barStartX, barStartY, barEndX - barStartX, barSize);
|
|
@@ -67680,7 +67023,7 @@
|
|
|
67680
67023
|
dotsY = barStart + beamY + barCount * (barSpacing + barSize);
|
|
67681
67024
|
dotsOffset = dotSpacing;
|
|
67682
67025
|
}
|
|
67683
|
-
const dotX = this.getBeatX(beat, BeatXPosition.MiddleNotes)
|
|
67026
|
+
const dotX = this.getBeatX(beat, BeatXPosition.MiddleNotes);
|
|
67684
67027
|
dotCount = Math.abs(dotCount);
|
|
67685
67028
|
for (let d = 0; d < dotCount; d++) {
|
|
67686
67029
|
CanvasHelper.fillMusicFontSymbolSafe(canvas, cx + this.x + dotX, dotsY, 1, MusicFontSymbol.AugmentationDot, true);
|
|
@@ -67729,7 +67072,7 @@
|
|
|
67729
67072
|
return this.getLineY(0) - noteHeadHeight / 2;
|
|
67730
67073
|
}
|
|
67731
67074
|
createPreBeatGlyphs() {
|
|
67732
|
-
this.
|
|
67075
|
+
this.wasFirstOfStaff = this.isFirstOfStaff;
|
|
67733
67076
|
if (this.index === 0 || (this.bar.masterBar.isRepeatStart && this._isOnlyNumbered)) {
|
|
67734
67077
|
this.addPreBeatGlyph(new BarLineGlyph(false, this.bar.staff.track.score.stylesheet.extendBarLines));
|
|
67735
67078
|
}
|
|
@@ -67785,6 +67128,11 @@
|
|
|
67785
67128
|
}
|
|
67786
67129
|
paintBeamingStem(_beat, _cy, _x, _topY, _bottomY, _canvas) {
|
|
67787
67130
|
}
|
|
67131
|
+
paintBeamHelper(cx, cy, canvas, h, flagsElement, beamsElement) {
|
|
67132
|
+
if (h.voice?.index === 0) {
|
|
67133
|
+
super.paintBeamHelper(cx, cy, canvas, h, flagsElement, beamsElement);
|
|
67134
|
+
}
|
|
67135
|
+
}
|
|
67788
67136
|
}
|
|
67789
67137
|
|
|
67790
67138
|
/**
|
|
@@ -68321,9 +67669,8 @@
|
|
|
68321
67669
|
aboveBeatEffects = new Map();
|
|
68322
67670
|
belowBeatEffects = new Map();
|
|
68323
67671
|
beat;
|
|
68324
|
-
beamingHelper;
|
|
68325
67672
|
get direction() {
|
|
68326
|
-
return this.
|
|
67673
|
+
return this.renderer.getBeatDirection(this.beat);
|
|
68327
67674
|
}
|
|
68328
67675
|
get scale() {
|
|
68329
67676
|
return this.beat.graceType !== GraceType.None ? NoteHeadGlyph.GraceScale : 1;
|
|
@@ -68365,7 +67712,7 @@
|
|
|
68365
67712
|
: 0) * scale;
|
|
68366
67713
|
// stem size according to duration
|
|
68367
67714
|
pos -= this.renderer.smuflMetrics.standardStemLength * scale;
|
|
68368
|
-
const topCenterY = this.renderer.centerStaffStemY(this.
|
|
67715
|
+
const topCenterY = this.renderer.centerStaffStemY(this.direction);
|
|
68369
67716
|
return Math.min(topCenterY, pos);
|
|
68370
67717
|
case NoteYPosition.Top:
|
|
68371
67718
|
pos -= n.height / 2;
|
|
@@ -68382,7 +67729,7 @@
|
|
|
68382
67729
|
: -this.renderer.smuflMetrics.glyphHeights.get(n.symbol) / 2) * scale;
|
|
68383
67730
|
// stem size according to duration
|
|
68384
67731
|
pos += this.renderer.smuflMetrics.standardStemLength * scale;
|
|
68385
|
-
const bottomCenterY = this.renderer.centerStaffStemY(this.
|
|
67732
|
+
const bottomCenterY = this.renderer.centerStaffStemY(this.direction);
|
|
68386
67733
|
return Math.max(bottomCenterY, pos);
|
|
68387
67734
|
case NoteYPosition.StemUp:
|
|
68388
67735
|
pos -=
|
|
@@ -68407,11 +67754,6 @@
|
|
|
68407
67754
|
addEffectNoteGlyph(noteGlyph, noteLine) {
|
|
68408
67755
|
super.add(noteGlyph, noteLine);
|
|
68409
67756
|
}
|
|
68410
|
-
updateBeamingHelper(cx) {
|
|
68411
|
-
if (this.beamingHelper) {
|
|
68412
|
-
this.beamingHelper.registerBeatLineX('score', this.beat, cx + this.x + this.upLineX, cx + this.x + this.downLineX);
|
|
68413
|
-
}
|
|
68414
|
-
}
|
|
68415
67757
|
doLayout() {
|
|
68416
67758
|
super.doLayout();
|
|
68417
67759
|
const scoreRenderer = this.renderer;
|
|
@@ -68539,7 +67881,6 @@
|
|
|
68539
67881
|
* @internal
|
|
68540
67882
|
*/
|
|
68541
67883
|
class ScoreRestGlyph extends MusicFontGlyph {
|
|
68542
|
-
beamingHelper;
|
|
68543
67884
|
constructor(x, y, duration) {
|
|
68544
67885
|
super(x, y, 1, ScoreRestGlyph.getSymbol(duration));
|
|
68545
67886
|
}
|
|
@@ -68571,11 +67912,6 @@
|
|
|
68571
67912
|
return MusicFontSymbol.None;
|
|
68572
67913
|
}
|
|
68573
67914
|
}
|
|
68574
|
-
updateBeamingHelper(cx) {
|
|
68575
|
-
if (this.beamingHelper) {
|
|
68576
|
-
this.beamingHelper.registerBeatLineX('score', this.beat, cx + this.x + this.width / 2, cx + this.x + this.width / 2);
|
|
68577
|
-
}
|
|
68578
|
-
}
|
|
68579
67915
|
paint(cx, cy, canvas) {
|
|
68580
67916
|
this.internalPaint(cx, cy, canvas, BeatSubElement.StandardNotationRests);
|
|
68581
67917
|
}
|
|
@@ -69067,10 +68403,11 @@
|
|
|
69067
68403
|
*/
|
|
69068
68404
|
class SlashNoteHeadGlyph extends MusicFontGlyph {
|
|
69069
68405
|
beatEffects = new Map();
|
|
69070
|
-
beamingHelper;
|
|
69071
68406
|
noteHeadElement = NoteSubElement.SlashNoteHead;
|
|
69072
68407
|
effectElement = BeatSubElement.SlashEffects;
|
|
69073
68408
|
_symbol;
|
|
68409
|
+
upLineX = 0;
|
|
68410
|
+
downLineX = 0;
|
|
69074
68411
|
constructor(x, y, duration, isGrace, beat) {
|
|
69075
68412
|
super(x, y, isGrace ? NoteHeadGlyph.GraceScale : 1, SlashNoteHeadGlyph.getSymbol(duration));
|
|
69076
68413
|
this._symbol = SlashNoteHeadGlyph.getSymbol(duration);
|
|
@@ -69121,6 +68458,15 @@
|
|
|
69121
68458
|
if (!Number.isNaN(minEffectY)) {
|
|
69122
68459
|
this.renderer.registerBeatEffectOverflows(minEffectY, maxEffectY);
|
|
69123
68460
|
}
|
|
68461
|
+
const symbol = this._symbol;
|
|
68462
|
+
const stemInfoUp = this.renderer.smuflMetrics.stemUp.has(symbol)
|
|
68463
|
+
? this.renderer.smuflMetrics.stemUp.get(symbol).x
|
|
68464
|
+
: 0;
|
|
68465
|
+
this.upLineX = stemInfoUp;
|
|
68466
|
+
const stemInfoDown = this.renderer.smuflMetrics.stemDown.has(symbol)
|
|
68467
|
+
? this.renderer.smuflMetrics.stemDown.get(symbol).x
|
|
68468
|
+
: 0;
|
|
68469
|
+
this.downLineX = stemInfoDown;
|
|
69124
68470
|
}
|
|
69125
68471
|
static getSymbol(duration) {
|
|
69126
68472
|
switch (duration) {
|
|
@@ -69134,25 +68480,13 @@
|
|
|
69134
68480
|
return MusicFontSymbol.NoteheadSlashHorizontalEnds;
|
|
69135
68481
|
}
|
|
69136
68482
|
}
|
|
69137
|
-
updateBeamingHelper(cx) {
|
|
69138
|
-
if (this.beamingHelper) {
|
|
69139
|
-
const symbol = this._symbol;
|
|
69140
|
-
const stemInfoUp = this.renderer.smuflMetrics.stemUp.has(symbol)
|
|
69141
|
-
? this.renderer.smuflMetrics.stemUp.get(symbol).x
|
|
69142
|
-
: 0;
|
|
69143
|
-
const stemInfoDown = this.renderer.smuflMetrics.stemDown.has(symbol)
|
|
69144
|
-
? this.renderer.smuflMetrics.stemDown.get(symbol).x
|
|
69145
|
-
: 0;
|
|
69146
|
-
this.beamingHelper.registerBeatLineX('slash', this.beat, cx + this.x + stemInfoUp, cx + this.x + stemInfoDown);
|
|
69147
|
-
}
|
|
69148
|
-
}
|
|
69149
68483
|
}
|
|
69150
68484
|
|
|
69151
68485
|
/**
|
|
69152
68486
|
* @internal
|
|
69153
68487
|
*/
|
|
69154
68488
|
class ScoreBeatGlyph extends BeatOnNoteGlyphBase {
|
|
69155
|
-
_collisionOffset =
|
|
68489
|
+
_collisionOffset = Number.NaN;
|
|
69156
68490
|
_skipPaint = false;
|
|
69157
68491
|
_whammy;
|
|
69158
68492
|
noteHeads = null;
|
|
@@ -69203,22 +68537,19 @@
|
|
|
69203
68537
|
getNoteY(note, requestedPosition) {
|
|
69204
68538
|
return this.noteHeads ? this.noteHeads.getNoteY(note, requestedPosition) : 0;
|
|
69205
68539
|
}
|
|
69206
|
-
|
|
69207
|
-
if (this.
|
|
69208
|
-
|
|
68540
|
+
applyRestCollisionOffset() {
|
|
68541
|
+
if (!this.restGlyph) {
|
|
68542
|
+
return;
|
|
69209
68543
|
}
|
|
69210
|
-
|
|
69211
|
-
this.
|
|
69212
|
-
|
|
69213
|
-
|
|
69214
|
-
|
|
69215
|
-
|
|
69216
|
-
|
|
69217
|
-
|
|
69218
|
-
|
|
69219
|
-
this.container.beat.id) {
|
|
69220
|
-
this._skipPaint = true;
|
|
69221
|
-
}
|
|
68544
|
+
if (this.renderer.bar.isMultiVoice && Number.isNaN(this._collisionOffset)) {
|
|
68545
|
+
this._collisionOffset = this.renderer.collisionHelper.applyRestCollisionOffset(this.container.beat, this.restGlyph.y, this.renderer.getScoreHeight(1));
|
|
68546
|
+
this.y += this._collisionOffset;
|
|
68547
|
+
const existingRests = this.renderer.collisionHelper.restDurationsByDisplayTime;
|
|
68548
|
+
if (existingRests.has(this.container.beat.playbackStart) &&
|
|
68549
|
+
existingRests.get(this.container.beat.playbackStart).has(this.container.beat.playbackDuration) &&
|
|
68550
|
+
existingRests.get(this.container.beat.playbackStart).get(this.container.beat.playbackDuration) !==
|
|
68551
|
+
this.container.beat.id) {
|
|
68552
|
+
this._skipPaint = true;
|
|
69222
68553
|
}
|
|
69223
68554
|
}
|
|
69224
68555
|
}
|
|
@@ -69238,7 +68569,6 @@
|
|
|
69238
68569
|
const noteHeads = new ScoreNoteChordGlyph();
|
|
69239
68570
|
this.noteHeads = noteHeads;
|
|
69240
68571
|
noteHeads.beat = this.container.beat;
|
|
69241
|
-
noteHeads.beamingHelper = this.beamingHelper;
|
|
69242
68572
|
const ghost = new GhostNoteContainerGlyph(false);
|
|
69243
68573
|
ghost.renderer = this.renderer;
|
|
69244
68574
|
for (const note of this.container.beat.notes) {
|
|
@@ -69288,22 +68618,18 @@
|
|
|
69288
68618
|
const restGlyph = new ScoreRestGlyph(0, sr.getScoreY(steps), this.container.beat.duration);
|
|
69289
68619
|
this.restGlyph = restGlyph;
|
|
69290
68620
|
restGlyph.beat = this.container.beat;
|
|
69291
|
-
restGlyph.beamingHelper = this.beamingHelper;
|
|
69292
68621
|
this.addNormal(restGlyph);
|
|
69293
68622
|
if (this.renderer.bar.isMultiVoice) {
|
|
69294
68623
|
if (this.container.beat.voice.index === 0) {
|
|
69295
68624
|
const restSizes = BeamingHelper.computeLineHeightsForRest(this.container.beat.duration);
|
|
69296
68625
|
const restTop = restGlyph.y - sr.getScoreHeight(restSizes[0]);
|
|
69297
68626
|
const restBottom = restGlyph.y + sr.getScoreHeight(restSizes[1]);
|
|
69298
|
-
this.renderer.
|
|
68627
|
+
this.renderer.collisionHelper.reserveBeatSlot(this.container.beat, restTop, restBottom);
|
|
69299
68628
|
}
|
|
69300
68629
|
else {
|
|
69301
|
-
this.renderer.
|
|
68630
|
+
this.renderer.collisionHelper.registerRest(this.container.beat);
|
|
69302
68631
|
}
|
|
69303
68632
|
}
|
|
69304
|
-
if (this.beamingHelper) {
|
|
69305
|
-
this.beamingHelper.applyRest(this.container.beat, steps);
|
|
69306
|
-
}
|
|
69307
68633
|
//
|
|
69308
68634
|
// Note dots
|
|
69309
68635
|
//
|
|
@@ -69318,17 +68644,24 @@
|
|
|
69318
68644
|
}
|
|
69319
68645
|
}
|
|
69320
68646
|
super.doLayout();
|
|
68647
|
+
this.applyRestCollisionOffset();
|
|
69321
68648
|
if (this.container.beat.isEmpty) {
|
|
69322
68649
|
this.onTimeX = this.width / 2;
|
|
69323
68650
|
this.middleX = this.onTimeX;
|
|
68651
|
+
this.stemX = this.middleX;
|
|
69324
68652
|
}
|
|
69325
68653
|
else if (this.restGlyph) {
|
|
69326
68654
|
this.onTimeX = this.restGlyph.x + this.restGlyph.width / 2;
|
|
69327
68655
|
this.middleX = this.onTimeX;
|
|
68656
|
+
this.stemX = this.middleX;
|
|
69328
68657
|
}
|
|
69329
68658
|
else if (this.noteHeads) {
|
|
69330
68659
|
this.onTimeX = this.noteHeads.x + this.noteHeads.onTimeX;
|
|
69331
68660
|
this.middleX = this.noteHeads.x + this.noteHeads.width / 2;
|
|
68661
|
+
const direction = this.renderer.getBeatDirection(this.container.beat);
|
|
68662
|
+
this.stemX =
|
|
68663
|
+
this.noteHeads.x +
|
|
68664
|
+
(direction === BeamDirection.Up ? this.noteHeads.upLineX : this.noteHeads.downLineX);
|
|
69332
68665
|
}
|
|
69333
68666
|
}
|
|
69334
68667
|
_createBeatDot(line, group) {
|
|
@@ -69400,7 +68733,7 @@
|
|
|
69400
68733
|
}
|
|
69401
68734
|
const belowBeatEffects = this.noteHeads.belowBeatEffects;
|
|
69402
68735
|
const aboveBeatEffects = this.noteHeads.aboveBeatEffects;
|
|
69403
|
-
const outsideBeatEffects = this.
|
|
68736
|
+
const outsideBeatEffects = this.renderer.getBeatDirection(this.container.beat) === BeamDirection.Up
|
|
69404
68737
|
? this.noteHeads.belowBeatEffects
|
|
69405
68738
|
: this.noteHeads.aboveBeatEffects;
|
|
69406
68739
|
if (n.isStaccato && !belowBeatEffects.has('Staccato')) {
|
|
@@ -69836,7 +69169,7 @@
|
|
|
69836
69169
|
// if we have a line break we draw only a line until the end
|
|
69837
69170
|
if (!endNoteRenderer || endNoteRenderer.staff !== startNoteRenderer.staff) {
|
|
69838
69171
|
const endX = cx + startNoteRenderer.x + startNoteRenderer.width;
|
|
69839
|
-
const noteValueToDraw = note.tieDestination.
|
|
69172
|
+
const noteValueToDraw = note.tieDestination.displayValue;
|
|
69840
69173
|
startNoteRenderer.accidentalHelper.applyAccidentalForValue(note.beat, noteValueToDraw, false, true);
|
|
69841
69174
|
const endY = cy +
|
|
69842
69175
|
startNoteRenderer.y +
|
|
@@ -70372,6 +69705,22 @@
|
|
|
70372
69705
|
doLayout() {
|
|
70373
69706
|
this._effectSlur = null;
|
|
70374
69707
|
this._effectEndSlur = null;
|
|
69708
|
+
// make space for flag
|
|
69709
|
+
const sr = this.renderer;
|
|
69710
|
+
const beat = this.beat;
|
|
69711
|
+
const isGrace = beat.graceType !== GraceType.None;
|
|
69712
|
+
if (sr.hasFlag(beat)) {
|
|
69713
|
+
const direction = this.renderer.getBeatDirection(beat);
|
|
69714
|
+
const scale = isGrace ? NoteHeadGlyph.GraceScale : 1;
|
|
69715
|
+
const symbol = FlagGlyph.getSymbol(beat.duration, direction, isGrace);
|
|
69716
|
+
const flagWidth = this.renderer.smuflMetrics.glyphWidths.get(symbol) * scale;
|
|
69717
|
+
this._flagStretch = flagWidth;
|
|
69718
|
+
}
|
|
69719
|
+
else if (isGrace) {
|
|
69720
|
+
// always use flag size as spacing on grace notes
|
|
69721
|
+
const graceSpacing = this.renderer.smuflMetrics.glyphWidths.get(MusicFontSymbol.Flag8thUp) * NoteHeadGlyph.GraceScale;
|
|
69722
|
+
this._flagStretch = graceSpacing;
|
|
69723
|
+
}
|
|
70375
69724
|
super.doLayout();
|
|
70376
69725
|
if (this._bend) {
|
|
70377
69726
|
this._bend.renderer = this.renderer;
|
|
@@ -70381,7 +69730,7 @@
|
|
|
70381
69730
|
}
|
|
70382
69731
|
getBoundingBoxTop() {
|
|
70383
69732
|
if (this._bend !== null) {
|
|
70384
|
-
return
|
|
69733
|
+
return ModelUtils.minBoundingBox(this._bend.getBoundingBoxTop(), super.getBoundingBoxTop());
|
|
70385
69734
|
}
|
|
70386
69735
|
else {
|
|
70387
69736
|
return super.getBoundingBoxTop();
|
|
@@ -70389,7 +69738,7 @@
|
|
|
70389
69738
|
}
|
|
70390
69739
|
getBoundingBoxBottom() {
|
|
70391
69740
|
if (this._bend !== null) {
|
|
70392
|
-
return
|
|
69741
|
+
return ModelUtils.maxBoundingBox(this._bend.getBoundingBoxBottom(), super.getBoundingBoxTop());
|
|
70393
69742
|
}
|
|
70394
69743
|
else {
|
|
70395
69744
|
return super.getBoundingBoxBottom();
|
|
@@ -70437,7 +69786,7 @@
|
|
|
70437
69786
|
}
|
|
70438
69787
|
// end effect slur on last beat
|
|
70439
69788
|
if (!this._effectEndSlur && n.beat.isEffectSlurDestination && n.beat.effectSlurOrigin) {
|
|
70440
|
-
const direction = this.
|
|
69789
|
+
const direction = this.renderer.getBeatDirection(n.beat);
|
|
70441
69790
|
const startNote = direction === BeamDirection.Up ? n.beat.effectSlurOrigin.minNote : n.beat.effectSlurOrigin.maxNote;
|
|
70442
69791
|
const endNote = direction === BeamDirection.Up ? n.beat.minNote : n.beat.maxNote;
|
|
70443
69792
|
const effectEndSlur = new ScoreSlurGlyph(`score.slur.effect.${startNote.beat.id}`, startNote, endNote, true);
|
|
@@ -70476,6 +69825,15 @@
|
|
|
70476
69825
|
}
|
|
70477
69826
|
}
|
|
70478
69827
|
}
|
|
69828
|
+
_flagStretch = 0;
|
|
69829
|
+
get postBeatStretch() {
|
|
69830
|
+
return super.postBeatStretch + this._flagStretch;
|
|
69831
|
+
}
|
|
69832
|
+
updateWidth() {
|
|
69833
|
+
super.updateWidth();
|
|
69834
|
+
this.width += this._flagStretch;
|
|
69835
|
+
this.minWidth += this._flagStretch;
|
|
69836
|
+
}
|
|
70479
69837
|
}
|
|
70480
69838
|
|
|
70481
69839
|
/**
|
|
@@ -70510,7 +69868,7 @@
|
|
|
70510
69868
|
return this.smuflMetrics.oneStaffSpace;
|
|
70511
69869
|
}
|
|
70512
69870
|
get heightLineCount() {
|
|
70513
|
-
return 5;
|
|
69871
|
+
return Math.max(5, this.bar.staff.standardNotationLineCount);
|
|
70514
69872
|
}
|
|
70515
69873
|
get drawnLineCount() {
|
|
70516
69874
|
return this.bar.staff.standardNotationLineCount;
|
|
@@ -70567,7 +69925,9 @@
|
|
|
70567
69925
|
slashY -= this.smuflMetrics.stemUp.has(symbol)
|
|
70568
69926
|
? this.smuflMetrics.stemUp.get(symbol).bottomY * scale
|
|
70569
69927
|
: 0;
|
|
70570
|
-
|
|
69928
|
+
if (!beat.isRest) {
|
|
69929
|
+
slashY -= this.smuflMetrics.standardStemLength + scale;
|
|
69930
|
+
}
|
|
70571
69931
|
}
|
|
70572
69932
|
return slashY;
|
|
70573
69933
|
}
|
|
@@ -70576,7 +69936,7 @@
|
|
|
70576
69936
|
return this.getBeatContainer(beat).onNotes.getNoteY(minNote, direction === BeamDirection.Up ? NoteYPosition.TopWithStem : NoteYPosition.StemDown);
|
|
70577
69937
|
}
|
|
70578
69938
|
let y = this.getScoreY(this.accidentalHelper.getMinSteps(beat));
|
|
70579
|
-
if (direction === BeamDirection.Up) {
|
|
69939
|
+
if (direction === BeamDirection.Up && !beat.isRest) {
|
|
70580
69940
|
const scale = beat.graceType !== GraceType.None ? NoteHeadGlyph.GraceScale : 1;
|
|
70581
69941
|
y -= this.smuflMetrics.standardStemLength * scale;
|
|
70582
69942
|
}
|
|
@@ -70614,14 +69974,14 @@
|
|
|
70614
69974
|
getBeamDirection(helper) {
|
|
70615
69975
|
return helper.direction;
|
|
70616
69976
|
}
|
|
70617
|
-
centerStaffStemY(
|
|
69977
|
+
centerStaffStemY(direction) {
|
|
70618
69978
|
const isStandardFive = this.bar.staff.standardNotationLineCount === Staff.DefaultStandardNotationLineCount;
|
|
70619
69979
|
if (isStandardFive) {
|
|
70620
69980
|
// center on the middle line for a standard 5-line staff
|
|
70621
69981
|
return this.getScoreY(this.bar.staff.standardNotationLineCount - 1);
|
|
70622
69982
|
}
|
|
70623
69983
|
// for other staff line counts, we align the stem either on the top or bottom line
|
|
70624
|
-
if (
|
|
69984
|
+
if (direction === BeamDirection.Up) {
|
|
70625
69985
|
return this.getScoreY(this.bar.staff.standardNotationLineCount * 2);
|
|
70626
69986
|
}
|
|
70627
69987
|
return this.getScoreY(0);
|
|
@@ -70723,7 +70083,7 @@
|
|
|
70723
70083
|
createLinePreBeatGlyphs() {
|
|
70724
70084
|
// Clef
|
|
70725
70085
|
let hasClef = false;
|
|
70726
|
-
if (this.
|
|
70086
|
+
if (this.isFirstOfStaff ||
|
|
70727
70087
|
this.bar.clef !== this.bar.previousBar.clef ||
|
|
70728
70088
|
this.bar.clefOttava !== this.bar.previousBar.clefOttava) {
|
|
70729
70089
|
// SMUFL: Clefs should be positioned such that the pitch the clef refers to is on the baseline
|
|
@@ -70928,6 +70288,25 @@
|
|
|
70928
70288
|
*/
|
|
70929
70289
|
class SlashBeatContainerGlyph extends BeatContainerGlyph {
|
|
70930
70290
|
_tiedNoteTie = null;
|
|
70291
|
+
doLayout() {
|
|
70292
|
+
// make space for flag
|
|
70293
|
+
const sr = this.renderer;
|
|
70294
|
+
const beat = this.beat;
|
|
70295
|
+
const isGrace = beat.graceType !== GraceType.None;
|
|
70296
|
+
if (sr.hasFlag(beat)) {
|
|
70297
|
+
const direction = this.renderer.getBeatDirection(beat);
|
|
70298
|
+
const scale = isGrace ? NoteHeadGlyph.GraceScale : 1;
|
|
70299
|
+
const symbol = FlagGlyph.getSymbol(beat.duration, direction, isGrace);
|
|
70300
|
+
const flagWidth = this.renderer.smuflMetrics.glyphWidths.get(symbol) * scale;
|
|
70301
|
+
this._flagStretch = flagWidth;
|
|
70302
|
+
}
|
|
70303
|
+
else if (isGrace) {
|
|
70304
|
+
// always use flag size as spacing on grace notes
|
|
70305
|
+
const graceSpacing = this.renderer.smuflMetrics.glyphWidths.get(MusicFontSymbol.Flag8thUp) * NoteHeadGlyph.GraceScale;
|
|
70306
|
+
this._flagStretch = graceSpacing;
|
|
70307
|
+
}
|
|
70308
|
+
super.doLayout();
|
|
70309
|
+
}
|
|
70931
70310
|
createTies(n) {
|
|
70932
70311
|
// create a tie if any effect requires it
|
|
70933
70312
|
if (!n.isVisible) {
|
|
@@ -70944,17 +70323,21 @@
|
|
|
70944
70323
|
this.addTie(tie);
|
|
70945
70324
|
}
|
|
70946
70325
|
}
|
|
70326
|
+
_flagStretch = 0;
|
|
70327
|
+
get postBeatStretch() {
|
|
70328
|
+
return super.postBeatStretch + this._flagStretch;
|
|
70329
|
+
}
|
|
70330
|
+
updateWidth() {
|
|
70331
|
+
super.updateWidth();
|
|
70332
|
+
this.width += this._flagStretch;
|
|
70333
|
+
this.minWidth += this._flagStretch;
|
|
70334
|
+
}
|
|
70947
70335
|
}
|
|
70948
70336
|
|
|
70949
70337
|
/**
|
|
70950
70338
|
* @internal
|
|
70951
70339
|
*/
|
|
70952
70340
|
class SlashRestGlyph extends ScoreRestGlyph {
|
|
70953
|
-
updateBeamingHelper(cx) {
|
|
70954
|
-
if (this.beamingHelper) {
|
|
70955
|
-
this.beamingHelper.registerBeatLineX('slash', this.beat, cx + this.x + this.width / 2, cx + this.x + this.width / 2);
|
|
70956
|
-
}
|
|
70957
|
-
}
|
|
70958
70341
|
paint(cx, cy, canvas) {
|
|
70959
70342
|
super.internalPaint(cx, cy, canvas, BeatSubElement.SlashRests);
|
|
70960
70343
|
}
|
|
@@ -71050,19 +70433,6 @@
|
|
|
71050
70433
|
}
|
|
71051
70434
|
return 0;
|
|
71052
70435
|
}
|
|
71053
|
-
updateBeamingHelper() {
|
|
71054
|
-
if (this.noteHeads) {
|
|
71055
|
-
this.noteHeads.updateBeamingHelper(this.container.x + this.x);
|
|
71056
|
-
}
|
|
71057
|
-
else if (this.deadSlapped) {
|
|
71058
|
-
if (this.beamingHelper) {
|
|
71059
|
-
this.beamingHelper.registerBeatLineX('slash', this.container.beat, this.container.x + this.x + this.deadSlapped.x + this.width, this.container.x + this.x + this.deadSlapped.x);
|
|
71060
|
-
}
|
|
71061
|
-
}
|
|
71062
|
-
else if (this.restGlyph) {
|
|
71063
|
-
this.restGlyph.updateBeamingHelper(this.container.x + this.x);
|
|
71064
|
-
}
|
|
71065
|
-
}
|
|
71066
70436
|
doLayout() {
|
|
71067
70437
|
// create glyphs
|
|
71068
70438
|
const sr = this.renderer;
|
|
@@ -71080,18 +70450,13 @@
|
|
|
71080
70450
|
const noteHeadGlyph = new SlashNoteHeadGlyph(0, glyphY, this.container.beat.duration, isGrace, this.container.beat);
|
|
71081
70451
|
this.noteHeads = noteHeadGlyph;
|
|
71082
70452
|
noteHeadGlyph.beat = this.container.beat;
|
|
71083
|
-
noteHeadGlyph.beamingHelper = this.beamingHelper;
|
|
71084
70453
|
this.addNormal(noteHeadGlyph);
|
|
71085
70454
|
}
|
|
71086
70455
|
else {
|
|
71087
70456
|
const restGlyph = new SlashRestGlyph(0, glyphY, this.container.beat.duration);
|
|
71088
70457
|
this.restGlyph = restGlyph;
|
|
71089
70458
|
restGlyph.beat = this.container.beat;
|
|
71090
|
-
restGlyph.beamingHelper = this.beamingHelper;
|
|
71091
70459
|
this.addNormal(restGlyph);
|
|
71092
|
-
if (this.beamingHelper) {
|
|
71093
|
-
this.beamingHelper.applyRest(this.container.beat, 0);
|
|
71094
|
-
}
|
|
71095
70460
|
}
|
|
71096
70461
|
}
|
|
71097
70462
|
//
|
|
@@ -71105,15 +70470,22 @@
|
|
|
71105
70470
|
super.doLayout();
|
|
71106
70471
|
if (this.container.beat.isEmpty) {
|
|
71107
70472
|
this.onTimeX = this.width / 2;
|
|
70473
|
+
this.stemX = this.onTimeX;
|
|
71108
70474
|
}
|
|
71109
70475
|
else if (this.restGlyph) {
|
|
71110
70476
|
this.onTimeX = this.restGlyph.x + this.restGlyph.width / 2;
|
|
70477
|
+
this.stemX = this.onTimeX;
|
|
71111
70478
|
}
|
|
71112
70479
|
else if (this.noteHeads) {
|
|
71113
70480
|
this.onTimeX = this.noteHeads.x + this.noteHeads.width / 2;
|
|
70481
|
+
const direction = this.renderer.getBeatDirection(this.container.beat);
|
|
70482
|
+
this.stemX =
|
|
70483
|
+
this.noteHeads.x +
|
|
70484
|
+
(direction === BeamDirection.Up ? this.noteHeads.upLineX : this.noteHeads.downLineX);
|
|
71114
70485
|
}
|
|
71115
70486
|
else if (this.deadSlapped) {
|
|
71116
70487
|
this.onTimeX = this.deadSlapped.x + this.deadSlapped.width / 2;
|
|
70488
|
+
this.stemX = this.onTimeX;
|
|
71117
70489
|
}
|
|
71118
70490
|
this.middleX = this.onTimeX;
|
|
71119
70491
|
}
|
|
@@ -71190,7 +70562,9 @@
|
|
|
71190
70562
|
const symbol = SlashNoteHeadGlyph.getSymbol(beat.duration);
|
|
71191
70563
|
const scale = beat.graceType !== GraceType.None ? NoteHeadGlyph.GraceScale : 1;
|
|
71192
70564
|
slashY -= this.smuflMetrics.stemUp.has(symbol) ? this.smuflMetrics.stemUp.get(symbol).bottomY * scale : 0;
|
|
71193
|
-
|
|
70565
|
+
if (!beat.isRest) {
|
|
70566
|
+
slashY -= this.smuflMetrics.standardStemLength + scale;
|
|
70567
|
+
}
|
|
71194
70568
|
return slashY;
|
|
71195
70569
|
}
|
|
71196
70570
|
getFlagBottomY(beat, _direction) {
|
|
@@ -71274,6 +70648,11 @@
|
|
|
71274
70648
|
_?.[Symbol.dispose]?.();
|
|
71275
70649
|
}
|
|
71276
70650
|
}
|
|
70651
|
+
paintBeamHelper(cx, cy, canvas, h, flagsElement, beamsElement) {
|
|
70652
|
+
if (h.voice?.index === 0) {
|
|
70653
|
+
super.paintBeamHelper(cx, cy, canvas, h, flagsElement, beamsElement);
|
|
70654
|
+
}
|
|
70655
|
+
}
|
|
71277
70656
|
}
|
|
71278
70657
|
|
|
71279
70658
|
/**
|
|
@@ -71730,7 +71109,6 @@
|
|
|
71730
71109
|
_deadSlapped = null;
|
|
71731
71110
|
_isGrace;
|
|
71732
71111
|
beat;
|
|
71733
|
-
beamingHelper;
|
|
71734
71112
|
maxStringNote = null;
|
|
71735
71113
|
minStringNote = null;
|
|
71736
71114
|
beatEffects = new Map();
|
|
@@ -71879,11 +71257,6 @@
|
|
|
71879
71257
|
}
|
|
71880
71258
|
}
|
|
71881
71259
|
}
|
|
71882
|
-
updateBeamingHelper(cx) {
|
|
71883
|
-
if (this.beamingHelper && this.beamingHelper.isPositionFrom('tab', this.beat)) {
|
|
71884
|
-
this.beamingHelper.registerBeatLineX('tab', this.beat, cx + this.x + this.width / 2, cx + this.x + this.width / 2);
|
|
71885
|
-
}
|
|
71886
|
-
}
|
|
71887
71260
|
}
|
|
71888
71261
|
|
|
71889
71262
|
/**
|
|
@@ -71891,7 +71264,6 @@
|
|
|
71891
71264
|
*/
|
|
71892
71265
|
class TabRestGlyph extends MusicFontGlyph {
|
|
71893
71266
|
_isVisibleRest;
|
|
71894
|
-
beamingHelper;
|
|
71895
71267
|
constructor(x, y, isVisibleRest, duration) {
|
|
71896
71268
|
super(x, y, 1, ScoreRestGlyph.getSymbol(duration));
|
|
71897
71269
|
this._isVisibleRest = isVisibleRest;
|
|
@@ -71899,11 +71271,6 @@
|
|
|
71899
71271
|
doLayout() {
|
|
71900
71272
|
super.doLayout();
|
|
71901
71273
|
}
|
|
71902
|
-
updateBeamingHelper(cx) {
|
|
71903
|
-
if (this.beamingHelper && this.beamingHelper.isPositionFrom('tab', this.beat)) {
|
|
71904
|
-
this.beamingHelper.registerBeatLineX('tab', this.beat, cx + this.x + this.width / 2, cx + this.x + this.width / 2);
|
|
71905
|
-
}
|
|
71906
|
-
}
|
|
71907
71274
|
paint(cx, cy, canvas) {
|
|
71908
71275
|
if (this._isVisibleRest) {
|
|
71909
71276
|
const _ = ElementStyleHelper.beat(canvas, BeatSubElement.GuitarTabRests, this.beat);
|
|
@@ -71960,7 +71327,6 @@
|
|
|
71960
71327
|
slashNoteHead.effectElement = BeatSubElement.GuitarTabEffects;
|
|
71961
71328
|
this.slash = slashNoteHead;
|
|
71962
71329
|
slashNoteHead.beat = this.container.beat;
|
|
71963
|
-
slashNoteHead.beamingHelper = this.beamingHelper;
|
|
71964
71330
|
this.addNormal(slashNoteHead);
|
|
71965
71331
|
beatEffects = slashNoteHead.beatEffects;
|
|
71966
71332
|
}
|
|
@@ -71968,7 +71334,6 @@
|
|
|
71968
71334
|
const tabNoteNumbers = new TabNoteChordGlyph(0, 0, isGrace);
|
|
71969
71335
|
this.noteNumbers = tabNoteNumbers;
|
|
71970
71336
|
tabNoteNumbers.beat = this.container.beat;
|
|
71971
|
-
tabNoteNumbers.beamingHelper = this.beamingHelper;
|
|
71972
71337
|
for (const note of this.container.beat.notes) {
|
|
71973
71338
|
if (note.isVisible) {
|
|
71974
71339
|
this._createNoteGlyph(note);
|
|
@@ -71990,9 +71355,9 @@
|
|
|
71990
71355
|
// Note dots
|
|
71991
71356
|
//
|
|
71992
71357
|
if (this.container.beat.dots > 0 && tabRenderer.rhythmMode !== exports.TabRhythmMode.Hidden) {
|
|
71358
|
+
const y = tabRenderer.getFlagAndBarPos();
|
|
71993
71359
|
for (let i = 0; i < this.container.beat.dots; i++) {
|
|
71994
|
-
this.addEffect(new AugmentationDotGlyph(0,
|
|
71995
|
-
tabRenderer.settings.notation.rhythmHeight));
|
|
71360
|
+
this.addEffect(new AugmentationDotGlyph(0, y));
|
|
71996
71361
|
}
|
|
71997
71362
|
}
|
|
71998
71363
|
}
|
|
@@ -72002,7 +71367,6 @@
|
|
|
72002
71367
|
const restGlyph = new TabRestGlyph(0, y, tabRenderer.showRests, this.container.beat.duration);
|
|
72003
71368
|
this.restGlyph = restGlyph;
|
|
72004
71369
|
restGlyph.beat = this.container.beat;
|
|
72005
|
-
restGlyph.beamingHelper = this.beamingHelper;
|
|
72006
71370
|
this.addNormal(restGlyph);
|
|
72007
71371
|
//
|
|
72008
71372
|
// Note dots
|
|
@@ -72040,21 +71404,11 @@
|
|
|
72040
71404
|
this.onTimeX = this.slash.x + this.slash.width / 2;
|
|
72041
71405
|
}
|
|
72042
71406
|
this.middleX = this.onTimeX;
|
|
71407
|
+
this.stemX = this.middleX;
|
|
72043
71408
|
for (const g of centeredEffectGlyphs) {
|
|
72044
71409
|
g.x = this.onTimeX;
|
|
72045
71410
|
}
|
|
72046
71411
|
}
|
|
72047
|
-
updateBeamingHelper() {
|
|
72048
|
-
if (this.noteNumbers) {
|
|
72049
|
-
this.noteNumbers.updateBeamingHelper(this.container.x + this.x);
|
|
72050
|
-
}
|
|
72051
|
-
else if (this.restGlyph) {
|
|
72052
|
-
this.restGlyph.updateBeamingHelper(this.container.x + this.x);
|
|
72053
|
-
}
|
|
72054
|
-
else if (this.slash) {
|
|
72055
|
-
this.slash.updateBeamingHelper(this.container.x + this.x);
|
|
72056
|
-
}
|
|
72057
|
-
}
|
|
72058
71412
|
_createNoteGlyph(n) {
|
|
72059
71413
|
const tr = this.renderer;
|
|
72060
71414
|
const noteNumberGlyph = new NoteNumberGlyph(0, 0, n);
|
|
@@ -72065,7 +71419,7 @@
|
|
|
72065
71419
|
this.noteNumbers.addNoteGlyph(noteNumberGlyph, n);
|
|
72066
71420
|
const topY = noteNumberGlyph.y - noteNumberGlyph.height / 2;
|
|
72067
71421
|
const bottomY = topY + noteNumberGlyph.height;
|
|
72068
|
-
this.renderer.
|
|
71422
|
+
this.renderer.collisionHelper.reserveBeatSlot(this.container.beat, topY, bottomY);
|
|
72069
71423
|
const minString = tr.minString;
|
|
72070
71424
|
const maxString = tr.maxString;
|
|
72071
71425
|
if (Number.isNaN(minString) || minString < n.string) {
|
|
@@ -72337,7 +71691,7 @@
|
|
|
72337
71691
|
}
|
|
72338
71692
|
createLinePreBeatGlyphs() {
|
|
72339
71693
|
// Clef
|
|
72340
|
-
if (this.
|
|
71694
|
+
if (this.isFirstOfStaff) {
|
|
72341
71695
|
const center = (this.bar.staff.tuning.length - 1) / 2;
|
|
72342
71696
|
this.createStartSpacing();
|
|
72343
71697
|
this.addPreBeatGlyph(new TabClefGlyph(0, this.getLineY(center)));
|
|
@@ -72428,14 +71782,14 @@
|
|
|
72428
71782
|
// currently only used for duplets
|
|
72429
71783
|
return this.getFlagAndBarPos();
|
|
72430
71784
|
}
|
|
72431
|
-
shouldPaintFlag(beat
|
|
72432
|
-
if (!super.shouldPaintFlag(beat
|
|
71785
|
+
shouldPaintFlag(beat) {
|
|
71786
|
+
if (!super.shouldPaintFlag(beat)) {
|
|
72433
71787
|
return false;
|
|
72434
71788
|
}
|
|
72435
71789
|
if (beat.graceType !== GraceType.None) {
|
|
72436
71790
|
return false;
|
|
72437
71791
|
}
|
|
72438
|
-
return
|
|
71792
|
+
return true;
|
|
72439
71793
|
}
|
|
72440
71794
|
paintBeamingStem(beat, cy, x, topY, bottomY, canvas) {
|
|
72441
71795
|
if (bottomY < topY) {
|
|
@@ -73373,6 +72727,7 @@
|
|
|
73373
72727
|
get AlphaTexParseMode () { return AlphaTexParseMode; },
|
|
73374
72728
|
AlphaTexParser,
|
|
73375
72729
|
get AlphaTexStaffNoteKind () { return AlphaTexStaffNoteKind; },
|
|
72730
|
+
get AlphaTexVoiceMode () { return AlphaTexVoiceMode; },
|
|
73376
72731
|
get ArgumentListParseTypesMode () { return ArgumentListParseTypesMode; }
|
|
73377
72732
|
}, Symbol.toStringTag, { value: 'Module' }));
|
|
73378
72733
|
|