vexflow 5.4.0 → 5.6.0

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.
Files changed (127) hide show
  1. package/build/cjs/vexflow-bravura.js +2 -2
  2. package/build/cjs/vexflow-bravura.js.map +1 -1
  3. package/build/cjs/vexflow-core.js +2 -2
  4. package/build/cjs/vexflow-core.js.map +1 -1
  5. package/build/cjs/vexflow-debug-with-tests.js +1740 -372
  6. package/build/cjs/vexflow-debug-with-tests.js.map +1 -1
  7. package/build/cjs/vexflow-debug.js +565 -258
  8. package/build/cjs/vexflow-debug.js.map +1 -1
  9. package/build/cjs/vexflow.js +2 -2
  10. package/build/cjs/vexflow.js.map +1 -1
  11. package/build/esm/src/annotation.js +2 -1
  12. package/build/esm/src/continuouslayout.js +107 -16
  13. package/build/esm/src/continuousspan.js +9 -1
  14. package/build/esm/src/easyscore/composition.js +83 -18
  15. package/build/esm/src/factory.js +2 -9
  16. package/build/esm/src/formatter.js +1 -1
  17. package/build/esm/src/fretdiagram.js +6 -2
  18. package/build/esm/src/gracenotegroup.js +4 -3
  19. package/build/esm/src/guitarmodifiers.js +4 -1
  20. package/build/esm/src/metrics.js +24 -5
  21. package/build/esm/src/note.js +1 -0
  22. package/build/esm/src/notehead.js +21 -10
  23. package/build/esm/src/phraselayout.js +13 -5
  24. package/build/esm/src/publication.js +10 -5
  25. package/build/esm/src/publicationview.js +3 -2
  26. package/build/esm/src/stave.js +4 -2
  27. package/build/esm/src/stavenote.js +56 -13
  28. package/build/esm/src/stavesection.js +15 -10
  29. package/build/esm/src/stavetie.js +3 -2
  30. package/build/esm/src/strokes.js +1 -1
  31. package/build/esm/src/svgcontext.js +11 -3
  32. package/build/esm/src/tabnote.js +6 -8
  33. package/build/esm/src/tabtie.js +3 -0
  34. package/build/esm/src/version.js +3 -3
  35. package/build/esm/tests/chordsymbol_tests.js +4 -1
  36. package/build/esm/tests/demo_petzold_tests.js +26 -14
  37. package/build/esm/tests/demo_repertoire_tests.js +5 -1
  38. package/build/esm/tests/demos/ballade.js +15 -0
  39. package/build/esm/tests/demos/electric.js +1 -3
  40. package/build/esm/tests/demos/fugue.js +19 -0
  41. package/build/esm/tests/demos/greensleeves.js +1 -2
  42. package/build/esm/tests/demos/kesh.js +2 -3
  43. package/build/esm/tests/demos/saints.js +17 -5
  44. package/build/esm/tests/engraving/continuous-studies.mjs +24 -0
  45. package/build/esm/tests/engraving/publication-studies.mjs +30 -0
  46. package/build/esm/tests/font_tests.js +8 -0
  47. package/build/esm/tests/gracenote_tests.js +1 -1
  48. package/build/esm/tests/gracetabnote_tests.js +19 -3
  49. package/build/esm/tests/node/chord-kerning-tests.mjs +2 -2
  50. package/build/esm/tests/node/continuous-score-tests.mjs +157 -2
  51. package/build/esm/tests/node/easyscore-tests.mjs +38 -0
  52. package/build/esm/tests/node/engraving-layout-tests.mjs +33 -0
  53. package/build/esm/tests/node/instrument-profile-tests.mjs +40 -0
  54. package/build/esm/tests/node/local-engraving-tests.mjs +58 -0
  55. package/build/esm/tests/node/metrics-tests.mjs +2 -0
  56. package/build/esm/tests/node/phrase-layout-tests.mjs +58 -5
  57. package/build/esm/tests/node/publication-tests.mjs +158 -2
  58. package/build/esm/tests/node/svg-export-tests.mjs +50 -21
  59. package/build/esm/tests/scores/ballade.js +399 -0
  60. package/build/esm/tests/scores/drums.js +93 -0
  61. package/build/esm/tests/scores/electric.js +83 -0
  62. package/build/esm/tests/scores/falseta.js +46 -0
  63. package/build/esm/tests/scores/fugue.js +366 -0
  64. package/build/esm/tests/scores/guitar.js +32 -0
  65. package/build/esm/tests/scores/kesh.js +146 -0
  66. package/build/esm/tests/scores/prelude.js +84 -0
  67. package/build/esm/tests/scores/quartertones.js +78 -0
  68. package/build/esm/tests/scores/saints.js +70 -0
  69. package/build/esm/tests/scores/sumer.js +126 -0
  70. package/build/esm/tests/scores/viewer.js +162 -0
  71. package/build/esm/tests/tabnote_tests.js +43 -0
  72. package/build/esm/tests/vexflow_test_helpers.js +1 -0
  73. package/build/esm/tools/explorer/catalog/expression.mjs +16 -6
  74. package/build/esm/tools/explorer/catalog/guitar.mjs +2 -2
  75. package/build/types/src/continuouslayout.d.ts +4 -0
  76. package/build/types/src/continuousspan.d.ts +10 -2
  77. package/build/types/src/easyscore/composition.d.ts +19 -0
  78. package/build/types/src/fretdiagram.d.ts +2 -0
  79. package/build/types/src/instrumentprofile.d.ts +4 -0
  80. package/build/types/src/note.d.ts +2 -0
  81. package/build/types/src/notehead.d.ts +2 -0
  82. package/build/types/src/publication.d.ts +3 -1
  83. package/build/types/src/stave.d.ts +4 -2
  84. package/build/types/src/stavenote.d.ts +10 -0
  85. package/build/types/src/stavesection.d.ts +3 -0
  86. package/build/types/src/svgcontext.d.ts +2 -0
  87. package/build/types/src/typeguard.d.ts +1 -0
  88. package/changelog/CHANGELOG.md +16 -0
  89. package/package.json +4 -1
  90. package/tests/all.html +9 -0
  91. package/tests/demo_petzold_tests.ts +30 -16
  92. package/tests/demos/ballade.ts +36 -0
  93. package/tests/demos/ballade.webp +0 -0
  94. package/tests/demos/electric.ts +1 -3
  95. package/tests/demos/electric.webp +0 -0
  96. package/tests/demos/fugue.ts +27 -0
  97. package/tests/demos/fugue.webp +0 -0
  98. package/tests/demos/greensleeves.ts +1 -3
  99. package/tests/demos/greensleeves.webp +0 -0
  100. package/tests/demos/kesh.ts +2 -4
  101. package/tests/demos/kesh.webp +0 -0
  102. package/tests/demos/saints.ts +20 -7
  103. package/tests/demos/saints.webp +0 -0
  104. package/tests/flow.html +165 -52
  105. package/tests/minuet.webp +0 -0
  106. package/tests/scores/ballade.js +445 -0
  107. package/tests/scores/drums.js +101 -0
  108. package/tests/scores/drums.webp +0 -0
  109. package/tests/scores/electric.js +93 -0
  110. package/tests/scores/electric.webp +0 -0
  111. package/tests/scores/falseta.js +53 -0
  112. package/tests/scores/falseta.webp +0 -0
  113. package/tests/scores/fugue.js +433 -0
  114. package/tests/scores/guitar.js +34 -0
  115. package/tests/scores/index.html +48 -0
  116. package/tests/scores/kesh.js +171 -0
  117. package/tests/scores/kesh.webp +0 -0
  118. package/tests/scores/prelude.js +90 -0
  119. package/tests/scores/prelude.webp +0 -0
  120. package/tests/scores/quartertones.js +83 -0
  121. package/tests/scores/quartertones.webp +0 -0
  122. package/tests/scores/saints.js +85 -0
  123. package/tests/scores/saints.webp +0 -0
  124. package/tests/scores/sumer.js +139 -0
  125. package/tests/scores/sumer.webp +0 -0
  126. package/tests/scores/viewer.css +132 -0
  127. package/tests/scores/viewer.js +150 -0
@@ -0,0 +1,366 @@
1
+ "use strict";
2
+ var BachFugue = (() => {
3
+ const fugueBars = [
4
+ ['B4/8/r, D4/8[dynamic="mp"], E4/8, F4/8, G4/8, E4/8', null],
5
+ [
6
+ 'F4/16[id="r2-0-0"], D4/16, C#4/16, D4/16[id="r2-3-0"], Bb4/q[id="r2-4-0",articulations="staccatissimo.above"], G4/q[ornament="tr.above"]',
7
+ null,
8
+ ],
9
+ [
10
+ 'A4/q[id="r3-0-0",dynamic="p"], A4/16[id="r3-4-0"], G4/16, F4/16, E4/16, G4/16, F4/16, E4/16, D4/16',
11
+ 'C4/8/r, A3/8, B3/8, C4/8, D4/8, B3/8',
12
+ ],
13
+ [
14
+ [
15
+ 'E4/8, C5/8[id="r4-2-0"], C5/16[id="r4-4-0"], B4/16, A4/16, B4/16, B4/16, A4/16, G#4/16, A4/16',
16
+ 'B4/q/r[spacer="yes"], F4/q, D4/q[ornament="tr.below"]',
17
+ ],
18
+ 'C4/16, A3/16, G#3/16, A3/16, D3/h/r[spacer="yes"]',
19
+ ],
20
+ [
21
+ [
22
+ 'A4/16[id="r5-0-0"], G4/16, F#4/16, G4/16, E5/q[articulations="staccatissimo.above"], G4/q[id="r5-8-0"]',
23
+ 'E4/q[id="r5-0-1"], E4/16[id="r5-4-1"], D4/16, C#4/16, B3/16, D4/16, C#4/16, B3/16, A3/16',
24
+ ],
25
+ null,
26
+ ],
27
+ [
28
+ [
29
+ 'F4/8, D5/8[id="r6-2-0"], D5/16[id="r6-4-0"], C5/16, Bb4/16, A4/16, C5/16, Bb4/16, A4/16, G4/16',
30
+ 'D4/q[dynamic="mf"], D4/q/r, D4/q/r',
31
+ ],
32
+ 'D3/8/r, D3/8, E3/8, F3/8, G3/8, E3/8',
33
+ ],
34
+ [
35
+ [
36
+ 'A4/q, G4/h[id="r7-4-0"]',
37
+ 'C4/8/r, F4/8[id="r7-2-1"], F4/16[id="r7-4-1"], E4/16, D4/16, E4/16, E4/16, D4/16, C#4/16, D4/16',
38
+ ],
39
+ 'F3/16, D3/16, C#3/16, D3/16, Bb3/q[articulations="staccatissimo.above"], G3/q[ornament="tr.above"]',
40
+ ],
41
+ [
42
+ ['G4/8[id="r8-0-0"], E4/8, F4/8, G4/8, A4/8, F4/8', 'C#4/q, D4/8, E4/8, C#4/8, D4/8'],
43
+ 'A3/q[id="l8-0-0"], A3/16[id="l8-4-0"], G3/16, F3/16, E3/16, G3/16, F3/16, E3/16, D3/16',
44
+ ],
45
+ [
46
+ [
47
+ 'Bb4/16, G4/16, F#4/16, G4/16, Eb5/q[articulations="staccatissimo.above"], C#5/q[ornament="turn.above"]',
48
+ 'Eb4/8, D4/8, G4/q, E4/q',
49
+ ],
50
+ 'G3/8, Bb3/8[id="l9-2-0"], Bb3/16[id="l9-4-0"], A3/16, G3/16, A3/16, A3/16, G3/16, F3/16, G3/16',
51
+ ],
52
+ [
53
+ [
54
+ 'D5/q, D5/q[articulations="staccatissimo.above"], B4/q[ornament="turn.above"]',
55
+ 'E4/16/r, A4/16, G4/16, A4/16, F4/q, D4/q',
56
+ ],
57
+ 'G3/16, F3/16, E3/16, F3/16, A3/16, G3/16, F3/16, G3/16, G3/16, F3/16, E3/16, F3/16',
58
+ ],
59
+ [
60
+ [
61
+ 'C5/q, C5/q[articulations="staccatissimo.above"], A4/q[ornament="turn.above"]',
62
+ 'E4/16/r, G4/16, F4/16, G4/16, Eb4/q, C4/q',
63
+ ],
64
+ 'F3/16, E3/16, D3/16, E3/16, G3/16, F3/16, Eb3/16, F3/16, F3/16, Eb3/16, D3/16, Eb3/16',
65
+ ],
66
+ [
67
+ ['Bb4/h.[id="r12-0-0"]', 'E4/8/r, A4/8, G4/8, F4/8, E4/8, G4/8'],
68
+ 'Eb3/16, D3/16, C#3/16, D3/16, Bb3/q[articulations="staccatissimo.above"], G3/q[ornament="tr.above"]',
69
+ ],
70
+ [
71
+ ['Bb4/8[id="r13-0-0"], A4/8, B4/8, C#5/8, D5/8, B4/8', 'C#4/q[dynamic="p"], D4/8, E4/8, B4/q/r[spacer="yes"]'],
72
+ [
73
+ 'A3/q[id="l13-0-0"], A3/16[id="l13-4-0"], G3/16, F3/16, E3/16, A3/q',
74
+ 'D3/h/r[spacer="yes"], G3/16, F3/16, E3/16, D3/16',
75
+ ],
76
+ ],
77
+ [
78
+ [
79
+ 'C#5/16, A4/16, G#4/16, A4/16, F5/q[articulations="staccatissimo.above"], D5/q[ornament="tr.above"]',
80
+ 'C4/8/r, E4/8, D4/8, C#4/8, B3/8, D4/8',
81
+ ],
82
+ 'E3/8, C#3/8, D3/8, E3/8, F3/8, D3/8',
83
+ ],
84
+ [
85
+ [
86
+ 'E5/8, A5/8[id="r15-2-0"], A5/16[id="r15-4-0"], G5/16, F#5/16, E5/16, G5/16, F#5/16, E5/16, D5/16',
87
+ 'C#4/16, E4/16, F4/16, E4/16, B4/q/r[spacer="yes"], C4/q',
88
+ ],
89
+ ['A3/q, A3/q, D3/q/r[spacer="yes"]', 'D3/q/r[spacer="yes"], F#3/8, E3/8, D3/8, F#3/8'],
90
+ ],
91
+ [
92
+ [
93
+ 'Eb5/16, C6/16, Bb5/8, G5/16/r, A5/16, G#5/16, F#5/16, A5/16, G#5/16, F#5/16, E5/16',
94
+ 'Bb3/16[dynamic="f"], D4/16, Eb4/16, D4/16, B3/q, E4/q[id="r16-8-1"]',
95
+ ],
96
+ 'G3/q, G#3/8, F#3/8, E3/8, G#3/8',
97
+ ],
98
+ [
99
+ [
100
+ 'D5/16, C5/16, B4/16, C5/16, C5/16, B4/16, A4/16, B4/16, B4/16, A4/16, G#4/16, A4/16',
101
+ 'E4/8[id="r17-0-1"], D4/8/r, D4/q/r, D4/q/r',
102
+ ],
103
+ 'A3/8, A2/8, B2/8, C3/8, D3/8, B2/8',
104
+ ],
105
+ [
106
+ 'G4/q[id="r18-0-0"], G4/16[id="r18-4-0"], F4/16, E4/16, F4/16, F4/16, E4/16, D4/16, A4/16',
107
+ ['B3/8/r, A3/8, B3/8, C#4/8, D4/8, B3/8', 'C#3/16, A2/16, G#2/16, A2/16, F3/q, D3/q[ornament="tr.below"]'],
108
+ ],
109
+ [
110
+ [
111
+ 'A4/h.[id="r19-0-0"]',
112
+ 'B4/q/r[spacer="yes"], F4/q[articulations="staccatissimo.below"], D4/q[ornament="tr.below"]',
113
+ ],
114
+ [
115
+ 'C4/16, A3/16, G#3/16, A3/16, E3/16, D3/16, C3/16, D3/16, D3/16, C3/16, B2/16, C3/16',
116
+ 'E3/8, F3/8, D3/h/r[spacer="yes"]',
117
+ ],
118
+ ],
119
+ [
120
+ [
121
+ 'A4/q[id="r20-0-0"], A4/16[id="r20-4-0"], D#5/16, E5/16, A4/16, C5/16, B4/16, A4/16, G#4/16',
122
+ 'E4/8, F4/8, B4/q/r[spacer="yes"], B4/q/r[spacer="yes"]',
123
+ ],
124
+ ['D3/q/r[spacer="yes"], B3/h[ornament="tr.above"]', 'C3/8, D3/8, E3/8, D3/8, E3/q'],
125
+ ],
126
+ [
127
+ 'A4/q[id="r21-0-0",dynamic="mp",ornament="mordentInverted.above"], A4/16[id="r21-4-0"], G4/16, F4/16, E4/16, G4/16, F4/16, E4/16, D4/16',
128
+ ['A3/q, B3/q/r, B3/q/r', 'A3/8[id="l21-0-1"], A2/8, B2/8[id="l21-4-1"], C#3/8, D3/8, B2/8'],
129
+ ],
130
+ [
131
+ 'E4/8, E5/8, D5/8, C#5/8, B4/8, D5/8',
132
+ 'C#3/16, A2/16, G#2/16, A2/16, F3/q[articulations="staccatissimo.above"], D3/q[ornament="tr.above"]',
133
+ ],
134
+ [
135
+ 'C#5/16, E5/16, F5/16, E5/16, G4/q[articulations="staccatissimo.below"], Bb4/q[id="r23-8-0"]',
136
+ 'A3/8, F3/8, E3/8, D3/8, C#3/8, E3/8',
137
+ ],
138
+ [
139
+ 'Bb4/16[id="r24-0-0"], A4/16, G4/16, A4/16, A4/16, G4/16, F4/16, G4/16, G4/16, F4/16, E4/16, F4/16',
140
+ 'D3/16, F3/16, G3/16, F3/16, A2/q[articulations="staccatissimo.above"], C#3/q[ornament="tr.above"]',
141
+ ],
142
+ [
143
+ 'F4/q[id="r25-0-0",dynamic="p"], F4/16[id="r25-4-0"], E4/16, F#4/16, G4/16, F#4/16, G4/16, A4/16, G4/16',
144
+ ['C4/8/r, D4/8, C4/8, Bb3/8, A3/8, C4/8', 'D3/h.'],
145
+ ],
146
+ [
147
+ 'G4/16, A4/16, Bb4/16, A4/16, A4/16, B4/16, C5/16, B4/16, B4/16, C#5/16, D5/16, C#5/16',
148
+ ['Bb3/q, D4/h', 'B2/8/r, G3/8, F#3/8, E3/8, D3/8, F3/8'],
149
+ ],
150
+ [
151
+ 'C#5/8, A5/8, G5/8, F5/8, E5/8, G5/8',
152
+ [
153
+ 'G3/q, B3/q/r, B3/q/r',
154
+ 'E3/q[id="l27-0-1"], E3/16[id="l27-4-1"], D3/16, C#3/16, B2/16, D3/16, C#3/16, B2/16, A2/16',
155
+ ],
156
+ ],
157
+ [
158
+ ['F5/16, A5/16, Bb5/16, A5/16, C#5/q, E5/q[id="r28-8-0"]', 'E4/8/r, D4/8, E4/8, F4/8, G4/8, E4/8'],
159
+ 'D3/q[id="l28-0-0"], D3/q/r[id="l28-4-0"], D3/q/r',
160
+ ],
161
+ [
162
+ [
163
+ 'E5/8[id="r29-0-0"], A4/8, D5/q, C5/q[id="r29-8-0"]',
164
+ 'F4/16, D4/16, C#4/16, D4/16, Bb4/q, G4/q[ornament="mordent.below"]',
165
+ ],
166
+ 'D3/8/r, A3/8, G3/8, F3/8, E3/8, G3/8',
167
+ ],
168
+ [
169
+ [
170
+ 'C5/8[id="r30-0-0"], Eb5/8[id="r30-2-0"], Eb5/16[id="r30-4-0"], D5/16, C5/16, D5/16, D5/16, C5/16, Bb4/16, C5/16',
171
+ 'A4/q, B4/h/r[spacer="yes"]',
172
+ ],
173
+ [
174
+ 'F#3/16, A3/16, Bb3/16, A3/16, F#3/q[articulations="staccatissimo.above"], A3/q[articulations="staccatissimo.above"]',
175
+ 'D3/q/r[spacer="yes"], D3/q, F#3/q',
176
+ ],
177
+ ],
178
+ [
179
+ 'C5/16, Bb4/16, A4/16, Bb4/16, D5/16, C5/16, Bb4/16, C5/16, C5/16, Bb4/16, A4/16, Bb4/16',
180
+ [
181
+ 'A3/16/r, G3/16, F#3/16, G3/16, E3/q[articulations="staccatissimo.above"], G3/q[articulations="staccatissimo.above"]',
182
+ 'G2/q, C3/q, E3/q',
183
+ ],
184
+ ],
185
+ [
186
+ 'Bb4/16, A4/16, G4/16, A4/16, C5/16, Bb4/16, A4/16, Bb4/16, Bb4/16, A4/16, G4/16, A4/16',
187
+ [
188
+ 'A3/16/r, F3/16, E3/16, F3/16, D3/q[articulations="staccatissimo.above"], F3/q[articulations="staccatissimo.above"]',
189
+ 'F2/q, Bb2/q, D3/q',
190
+ ],
191
+ ],
192
+ [
193
+ 'A4/16, G4/16, F4/16, G4/16, E5/q[articulations="staccatissimo.above"], C#5/q[ornament="tr.above"]',
194
+ ['C4/8/r, F3/8, G3/8, A3/8, Bb3/8, G3/8', 'E3/h.'],
195
+ ],
196
+ [
197
+ 'D5/q[id="r34-0-0",dynamic="mf"], D5/16[id="r34-4-0"], C5/16, Bb4/16, A4/16, C5/16, Bb4/16, A4/16, G4/16',
198
+ ['A3/8, F3/8, G3/8, A3/8, G3/q', 'F3/8, D3/8, E3/8, F#3/8, G3/8, E3/8'],
199
+ ],
200
+ [
201
+ 'A4/8, F#4/8, G4/8, A4/8, Bb4/8, G4/8',
202
+ ['C4/8/r, A3/8, G3/8, F3/8, E3/8, G3/8', 'F#3/16, D3/16, C#3/16, D3/16, Bb3/8, A3/8, G3/8, Bb3/8'],
203
+ ],
204
+ [
205
+ 'A4/16, C5/16, Eb5/8[id="r36-2-0"], Eb5/16[id="r36-4-0"], D5/16, C5/16, Bb4/16, D5/16, C5/16, Bb4/16, A4/16',
206
+ ['F#3/8, Bb3/8, A3/8, G3/8, F#3/8, A3/8', 'A3/8, G3/8, F#3/8, E3/8, D3/8, F#3/8'],
207
+ ],
208
+ [
209
+ 'Bb4/16, D5/16, F5/8[id="r37-2-0"], F5/16[id="r37-4-0"], E5/16, D5/16, C#5/16, E5/16, D5/16, C#5/16, B4/16',
210
+ ['G3/8, C4/8, B3/8, A3/8, G#3/8, B3/8', 'A2/8, A3/8, G#3/8, F#3/8, E3/8, G#3/8'],
211
+ ],
212
+ [
213
+ 'C#5/16[id="r38-0-0"], E5/16, Bb5/8[id="r38-2-0"], Bb5/16[id="r38-4-0"], A5/16, G5/16, F5/16, A5/16, G5/16, F5/16, E5/16[id="r38-11-0"]',
214
+ ['A3/8, F4/8, E4/8, D4/8, C#4/8, E4/8', 'A2/8, D4/8, C#4/8, B3/8, A3/8, C#4/8'],
215
+ ],
216
+ [
217
+ 'G5/16[dynamic="f"], F5/16, E5/16, F5/16, F5/16, E5/16, D5/16, E5/16, E5/16, D5/16, C#5/16, D5/16',
218
+ ['D4/8, D4/8/r, D4/q/r, D4/q/r', 'D4/8, D3/8, E3/8, F3/8, G3/8, E3/8'],
219
+ ],
220
+ [
221
+ [
222
+ 'C5/q[id="r40-0-0"], C5/16[id="r40-4-0"], Bb4/16, A4/16, Bb4/16, Bb4/16, A4/16, G4/16, D5/16',
223
+ 'D4/8/r, D4/8, E4/8, F#4/8, G4/8, E4/8',
224
+ ],
225
+ 'F#3/16, D3/16, C#3/16, D3/16, Bb3/q[articulations="staccatissimo.above"], G3/q[ornament="tr.above"]',
226
+ ],
227
+ [
228
+ [
229
+ 'D5/h.[id="r41-0-0"]',
230
+ 'F4/16, D#4/16, C#4/16, D4/16, Bb4/q[articulations="staccatissimo.below"], G4/q[ornament="tr.below"]',
231
+ ],
232
+ 'A3/8, Bb3/8, A3/16, G3/16, F3/16, G3/16, G3/16, F3/16, E3/16, F3/16',
233
+ ],
234
+ [
235
+ [
236
+ 'D5/q[id="r42-0-0"], D5/16[id="r42-4-0"], G#5/16, A5/16, D5/16, F5/16, E5/16, D5/16, C#5/16',
237
+ 'A4/8, Bb4/8, E4/h[ornament="tr.below"]',
238
+ ],
239
+ 'F3/8, G3/8, A3/8, G3/8, A3/q',
240
+ ],
241
+ [
242
+ ['D5/h.[dynamic="mf"]', 'E4/8/r, (A4 C5)/8, (G4 Bb4)/8, (F#4 A4)/8, (E4 G4)/8, (G4 Bb4)/8'],
243
+ ['D4/8/r, (D3 F#3)/8[id="l43-2-0"], (E3 G3)/8[id="l43-4-0"], (F#3 A3)/8, (G3 Bb3)/8, (E3 G3)/8', 'D3/h.'],
244
+ ],
245
+ [
246
+ ['D5/h.[articulations="fermata.above"]', '(F#4 A4)/h.'],
247
+ ['(F#3 A3)/h.', 'D3/h.[articulations="fermata.below"]'],
248
+ ],
249
+ ];
250
+ const fuguePhrases = [
251
+ ['crescendo', 'r5-0-0', 'r5-8-0', 'below'],
252
+ ['crescendo', 'r38-0-0', 'r38-11-0', 'below'],
253
+ ['diminuendo', 'r2-0-0', 'r2-4-0', 'below'],
254
+ ['slur', 'r2-0-0', 'r2-3-0', 'above'],
255
+ ['tie', 'r3-0-0', 'r3-4-0', 'above'],
256
+ ['tie', 'r4-2-0', 'r4-4-0', 'above'],
257
+ ['tie', 'r6-2-0', 'r6-4-0', 'above'],
258
+ ['tie', 'r7-4-0', 'r8-0-0', 'above'],
259
+ ['tie', 'r12-0-0', 'r13-0-0', 'above'],
260
+ ['tie', 'r15-2-0', 'r15-4-0', 'above'],
261
+ ['tie', 'r5-0-1', 'r5-4-1', 'below'],
262
+ ['tie', 'r7-2-1', 'r7-4-1', 'below'],
263
+ ['tie', 'r16-8-1', 'r17-0-1', 'below'],
264
+ ['tie', 'r18-0-0', 'r18-4-0', 'above'],
265
+ ['tie', 'r19-0-0', 'r20-0-0', 'above'],
266
+ ['tie', 'r20-0-0', 'r20-4-0', 'above'],
267
+ ['tie', 'r21-0-0', 'r21-4-0', 'above'],
268
+ ['tie', 'r23-8-0', 'r24-0-0', 'above'],
269
+ ['tie', 'r25-0-0', 'r25-4-0', 'above'],
270
+ ['tie', 'r28-8-0', 'r29-0-0', 'above'],
271
+ ['tie', 'r29-8-0', 'r30-0-0', 'above'],
272
+ ['tie', 'r30-2-0', 'r30-4-0', 'above'],
273
+ ['tie', 'r34-0-0', 'r34-4-0', 'above'],
274
+ ['tie', 'r36-2-0', 'r36-4-0', 'above'],
275
+ ['tie', 'r37-2-0', 'r37-4-0', 'above'],
276
+ ['tie', 'r38-2-0', 'r38-4-0', 'above'],
277
+ ['tie', 'r40-0-0', 'r40-4-0', 'above'],
278
+ ['tie', 'r41-0-0', 'r42-0-0', 'above'],
279
+ ['tie', 'r42-0-0', 'r42-4-0', 'above'],
280
+ ['tie', 'l8-0-0', 'l8-4-0', 'above'],
281
+ ['tie', 'l9-2-0', 'l9-4-0', 'above'],
282
+ ['tie', 'l13-0-0', 'l13-4-0', 'above'],
283
+ ['tie', 'l27-0-1', 'l27-4-1', 'below'],
284
+ ];
285
+ function fugueNoteMarks(VF) {
286
+ return ({ ornament, spacer, dynamic }, note, builder) => {
287
+ if (dynamic) {
288
+ const text = [...dynamic].map((letter) => VF.TextDynamics.GLYPHS[letter]).join('');
289
+ note.addModifier(builder
290
+ .getFactory()
291
+ .Annotation({ text, vJustify: 'bottom', font: { family: 'Bravura', size: 23 } })
292
+ .setYShift(5));
293
+ }
294
+ if (ornament) {
295
+ const [type, position] = ornament.split('.');
296
+ note.addModifier(builder.getFactory().Ornament(type, { position }));
297
+ }
298
+ if (spacer)
299
+ note.setStyle({ fillStyle: 'transparent', strokeStyle: 'transparent' });
300
+ };
301
+ }
302
+ function fugueMusic(VF, count) {
303
+ const bars = fugueBars.slice(0, count);
304
+ const staves = ['treble', 'bass'].map((clef, hand) => (Object.assign(Object.assign({ id: clef, clef, key: 'Dm', time: '3/4' }, (hand === 0 ? { name: 'Piano', shortName: 'Pno.' } : {})), { measures: bars.map((bar, index) => {
305
+ const music = bar[hand];
306
+ if (music === null) {
307
+ return {
308
+ voices: [
309
+ {
310
+ notes: [
311
+ { keys: ['d/3'], clef, duration: 'wr', alignCenter: true, durationOverride: new VF.Fraction(3, 4) },
312
+ ],
313
+ },
314
+ ],
315
+ };
316
+ }
317
+ const entrance = hand === 0 ? index === 0 : index === 2 || index === 5;
318
+ const autoBeam = entrance ? { groups: [new VF.Fraction(3, 4)] } : true;
319
+ const voices = Array.isArray(music)
320
+ ? music.map((notes, i) => ({
321
+ notes,
322
+ stem: i === 0 ? 'up' : 'down',
323
+ autoBeam: { autoStem: false },
324
+ }))
325
+ : [{ notes: music, autoBeam }];
326
+ return { voices };
327
+ }) })));
328
+ const pedal = [
329
+ [8, 'l8-0-0', 'l8-4-0'],
330
+ [21, 'l21-0-1', 'l21-4-1'],
331
+ [28, 'l28-0-0', 'l28-4-0'],
332
+ [43, 'l43-2-0', 'l43-4-0'],
333
+ ];
334
+ const sections = [
335
+ [1, 'Subject'],
336
+ [3, 'Answer'],
337
+ [6, 'Bass entry'],
338
+ [22, 'Inversion'],
339
+ [34, 'Stretto'],
340
+ [43, 'Cadence'],
341
+ ];
342
+ const spans = fuguePhrases
343
+ .filter(([, , to]) => Number(to.slice(1).split('-')[0]) <= count)
344
+ .map(([kind, from, to, side]) => ({ kind, from, to, side, id: kind + '-' + from }));
345
+ for (const [bar, from, to] of pedal) {
346
+ if (bar <= count)
347
+ spans.push({ kind: 'pedal', id: 'pedal-' + bar, from, to, text: 'Ped.' });
348
+ }
349
+ return {
350
+ accidentals: 'key-aware',
351
+ staves,
352
+ sheet: { measurePadding: 15 },
353
+ system: { spaceBetweenStaves: 9, details: { spacing: { mode: 'optical' } } },
354
+ continuous: {
355
+ measureNumbers: true,
356
+ boundaries: sections
357
+ .filter(([measure]) => measure <= count)
358
+ .map(([measure, rehearsal]) => ({ measure, rehearsal })),
359
+ groups: [{ first: 'treble', last: 'bass', type: 'brace', barlines: true }],
360
+ spans,
361
+ },
362
+ };
363
+ }
364
+ return { music: fugueMusic, noteMarks: fugueNoteMarks };
365
+ })();
366
+ globalThis.BachFugue = BachFugue;
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ (() => {
3
+ function guitarScore(score, bars, time, continuous = {}) {
4
+ return {
5
+ continuous,
6
+ staves: ['staff', 'tab'].map((view) => ({
7
+ id: view,
8
+ name: view === 'tab' ? 'TAB' : 'Guitar',
9
+ shortName: view === 'tab' ? 'TAB' : 'Gtr.',
10
+ kind: view === 'tab' ? 'tab' : 'stave',
11
+ time,
12
+ spaceAbove: view === 'tab' ? 6 : 0,
13
+ measures: bars.map((voices, m) => ({
14
+ voices: voices.map((events, v) => ({
15
+ notes: events.map((attack, i) => {
16
+ const id = [view, m, v, i].join('-');
17
+ const stemDirection = v === 0 ? 1 : -1;
18
+ if (typeof attack === 'string')
19
+ return view === 'tab'
20
+ ? score.make.ghostNote({ duration: attack })
21
+ : { id, note: { keys: ['b/4'], duration: attack + 'r', stemDirection } };
22
+ return view === 'tab'
23
+ ? { id, tab: Object.assign(Object.assign({}, attack.tab), { stemDirection }), drawStem: true }
24
+ : { id, note: Object.assign(Object.assign({}, attack.note), { stemDirection }) };
25
+ }),
26
+ })),
27
+ })),
28
+ })),
29
+ };
30
+ }
31
+ window.FeaturedScores.guitarScore = guitarScore;
32
+ })();
@@ -0,0 +1,146 @@
1
+ "use strict";
2
+ (() => {
3
+ const title = 'The Kesh Jig';
4
+ const credit = 'Traditional Irish jig · Fiddle, flute and cello';
5
+ const intro = 'The fiddle leads strain A. The flute counts its rest, reads the fiddle’s second ending as a cue, then joins at B. Print either edition.';
6
+ const choices = ['Full score', 'Flute part'];
7
+ const control = 'Edition';
8
+ const strains = [
9
+ [
10
+ ['G4/q, G4/8', 'G4/8, A4, B4', 'G'],
11
+ ['A4/q, A4/8', 'A4/8, B4, D5', 'D'],
12
+ ['E5/8, D5, D5', 'G5/8, D5, D5', 'G'],
13
+ ['E5/8, D5, B4', 'D5/8, B4, A4', '', 'D'],
14
+ ['G4/q, G4/8', 'G4/8, A4, B4', 'G'],
15
+ ['A4/q, A4/8', 'A4/8, B4, D5', 'D'],
16
+ ['E5/8, D5, D5', 'G5/8, D5, B4', 'G'],
17
+ ['A4/8, G4, F#4', 'G4/q, D4/8', 'D', 'G'],
18
+ ['A4/8, G4, F#4', 'G4/q, A4/8', 'D', 'G'],
19
+ ],
20
+ [
21
+ ['B4/q, B4/8', 'D5/8, B4, D5', 'G'],
22
+ ['E5/8, G5, E5', 'D5/8, B4, G4', 'C', 'G'],
23
+ ['B4/q, B4/8', 'D5/8, B4, G4'],
24
+ ['A4/8, B4, A4', 'A4/8, G4, A4', 'Am'],
25
+ ['B4/8, A4, B4', 'D5/8, B4, D5', 'G'],
26
+ ['E5/8, G5, E5', 'D5/8, B4, D5', 'C', 'G'],
27
+ ['E5/q.', 'A5/8, G5, A5', 'C', 'D'],
28
+ ['B5/8, G5, G5', 'G5/q, A4/8', 'G'],
29
+ ['B5/8, G5, G5', 'G5/q.', 'G'],
30
+ ],
31
+ ];
32
+ function fiddleMarks({ chord, cut }, note, builder) {
33
+ const f = builder.getFactory();
34
+ if (chord)
35
+ note.addModifier(f.ChordSymbol().addText(chord));
36
+ if (cut) {
37
+ const grace = f.GraceNote({ keys: [cut], duration: '8', slash: true });
38
+ note.addModifier(f.GraceNoteGroup({ notes: [grace], slur: true }));
39
+ }
40
+ }
41
+ function fiddleStrain(bars, strain, spans) {
42
+ return bars.map(([first, second, chord, change], bar) => {
43
+ const beats = [first.split(', '), second.split(', ')];
44
+ const id = (beat, i) => ['bow', strain, bar, beat, i].join('-');
45
+ if (bar === 2 || bar === 6) {
46
+ const beat = beats[0].length === 3 ? 0 : 1;
47
+ spans.push({ id: id(beat, 0), kind: 'slur', from: id(beat, 0), to: id(beat, 2) });
48
+ }
49
+ if (bar >= 7)
50
+ spans.push({
51
+ id: 'ending-' + strain + '-' + bar,
52
+ kind: 'volta',
53
+ text: bar === 7 ? '1.' : '2.',
54
+ from: id(0, 0),
55
+ to: id(1, beats[1].length - 1),
56
+ });
57
+ return beats
58
+ .flatMap((notes, beat) => notes.map((token, i) => {
59
+ const marks = ['id="' + id(beat, i) + '"'];
60
+ const harmony = beat === 0 ? chord : change;
61
+ if (i === 0 && harmony)
62
+ marks.push('chord="' + harmony + '"');
63
+ if (beat === 0 && i === 1 && (bar === 0 || bar === 4 || bar === 8))
64
+ marks.push('cut="' + (strain ? 'd/5' : 'b/4') + '"');
65
+ return token + '[' + marks.join(',') + ']';
66
+ }))
67
+ .join(', ');
68
+ });
69
+ }
70
+ const flute = [
71
+ 'G4/q., B4/q.',
72
+ 'C5/q., B4/q.',
73
+ 'G4/q., B4/q.',
74
+ 'E5/q., D5/q.',
75
+ 'G4/q., B4/q.',
76
+ 'C5/q., B4/q.',
77
+ 'G4/q., F#5/q.',
78
+ 'G5/q., A4/q.',
79
+ 'G5/q., G4/q.',
80
+ ];
81
+ const roots = [
82
+ 'G2',
83
+ 'D3',
84
+ 'G2',
85
+ 'D3',
86
+ 'G2',
87
+ 'D3',
88
+ 'G2',
89
+ 'D3',
90
+ 'D3',
91
+ 'G2',
92
+ 'C3',
93
+ 'G2',
94
+ 'A2',
95
+ 'G2',
96
+ 'C3',
97
+ 'D3',
98
+ 'G2',
99
+ 'G2',
100
+ ];
101
+ function publication(choice, VF) {
102
+ const staff = (id, name, clef, bars) => ({
103
+ id,
104
+ name,
105
+ shortName: name.slice(0, 2) + '.',
106
+ clef,
107
+ key: 'G',
108
+ time: '6/8',
109
+ measures: bars.map((notes) => ({ voices: [{ notes, autoBeam: true }] })),
110
+ });
111
+ const silence = [{ keys: ['d/5'], duration: 'wr', durationOverride: new VF.Fraction(6, 8) }];
112
+ const spans = [];
113
+ const melody = strains.flatMap((bars, i) => fiddleStrain(bars, i, spans));
114
+ const spec = {
115
+ accidentals: 'key-aware',
116
+ continuous: {
117
+ measureNumbers: true,
118
+ compressRests: true,
119
+ spans,
120
+ boundaries: [
121
+ { measure: 1, rehearsal: 'A', repeatStart: true },
122
+ { measure: 8, repeatEnd: true },
123
+ { measure: 10, rehearsal: 'B', repeatStart: true, breakBefore: 'force' },
124
+ { measure: 17, repeatEnd: true },
125
+ ],
126
+ },
127
+ staves: [
128
+ staff('vn', 'Fiddle', 'treble', melody),
129
+ staff('fl', 'Flute', 'treble', [...Array(9).fill(silence), ...flute]),
130
+ staff('vc', 'Cello', 'bass', roots.map((root, i) => root + '/q., ' + (i === 17 ? 'G2' : i % 2 ? 'A2' : 'D3') + '/q.')),
131
+ ],
132
+ };
133
+ const part = choice === 'Flute part';
134
+ return {
135
+ spec,
136
+ options: Object.assign({ paper: 'A4', noteHooks: [fiddleMarks], title, subtitle: part ? 'Flute part' : 'Fiddle, flute and cello', header: title, staffSize: part ? 8 : 6.5 }, (part
137
+ ? {
138
+ staves: ['fl'],
139
+ systemBreaks: [14],
140
+ regions: [{ kind: 'cue', staff: 'vn', measure: 9, label: 'Fiddle cue' }],
141
+ }
142
+ : { systemBreaks: [5, 10, 14] })),
143
+ };
144
+ }
145
+ window.FeaturedScores.kesh = { title, credit, intro, choices, control, publication };
146
+ })();
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+ (() => {
3
+ const title = 'Prelude in C major';
4
+ const credit = 'Johann Sebastian Bach · The Well-Tempered Clavier, BWV 846';
5
+ const intro = 'Andante, legato · ♩ = 72. Follow the first arpeggio from the bass staff into the treble. Select a note and narrow the page to follow the same attack after reflow.';
6
+ const focus = 'arp-0-1';
7
+ const action = 'Inspect the arpeggio';
8
+ const harmony = [
9
+ ['c/4', 'e/4', 'g/4', 'c/5', 'e/5'],
10
+ ['c/4', 'd/4', 'a/4', 'd/5', 'f/5'],
11
+ ['b/3', 'd/4', 'g/4', 'd/5', 'f/5'],
12
+ ['c/4', 'e/4', 'g/4', 'c/5', 'e/5'],
13
+ ['c/4', 'e/4', 'a/4', 'e/5', 'a/5'],
14
+ ['c/4', 'd/4', 'f#/4', 'a/4', 'd/5'],
15
+ ['b/3', 'd/4', 'g/4', 'd/5', 'g/5'],
16
+ ['b/3', 'c/4', 'e/4', 'g/4', 'c/5'],
17
+ ];
18
+ function create(VF, score) {
19
+ const measures = harmony.map(([bass, inner, a, b, c], m) => {
20
+ const half = [bass, inner, a, b, c, a, b, c];
21
+ const notes = [...half, ...half].map((key, i) => ({
22
+ id: 'arp-' + m + '-' + i,
23
+ stave: i % 8 < 2 ? 'lh' : 'rh',
24
+ note: { keys: [key], clef: i % 8 < 2 ? 'bass' : 'treble', duration: '16', stemDirection: i % 8 < 2 ? 1 : -1 },
25
+ }));
26
+ return { voices: [{ notes }] };
27
+ });
28
+ const dynamics = ['p', '', 'mf', 'p', 'mp', '', 'mf', 'p'];
29
+ return {
30
+ spec: {
31
+ system: { spaceBetweenStaves: 8, details: { spacing: { mode: 'optical' } } },
32
+ staves: [
33
+ { id: 'rh', name: 'Piano', shortName: '', measures },
34
+ {
35
+ id: 'lh',
36
+ clef: 'bass',
37
+ measures: dynamics.map((text) => ({
38
+ voices: [
39
+ {
40
+ notes: [
41
+ text
42
+ ? score.make.textDynamics({ text, line: 10, duration: 'w' })
43
+ : score.make.ghostNote({ duration: 'w' }),
44
+ ],
45
+ },
46
+ ],
47
+ })),
48
+ },
49
+ ],
50
+ continuous: {
51
+ boundaries: [3, 5, 7].map((measure) => ({ measure, breakBefore: 'force' })),
52
+ groups: [{ first: 'rh', last: 'lh', type: 'brace', barlines: true }],
53
+ },
54
+ },
55
+ decorate(c) {
56
+ for (const [m] of harmony.entries())
57
+ for (let i = 0; i < 16; i += 4) {
58
+ const group = [0, 1, 2, 3].map((j) => c.getNote('arp-' + m + '-' + (i + j)));
59
+ score.beam(group, { autoStem: false });
60
+ const beam = group[0].getBeam();
61
+ beam.renderOptions.flatBeams = i % 8 === 4;
62
+ beam.renderOptions.minSlope = -0.035;
63
+ beam.renderOptions.maxSlope = 0.035;
64
+ }
65
+ c.staves[0][0].setTempo({ name: 'Andante, legato', duration: 'q', bpm: 72 }, -22);
66
+ c.getNote('arp-5-2').addModifier(score.make.accidental({ type: '#' }));
67
+ c.getNote('arp-2-4').addModifier(score.make.articulation({ type: 'accent', position: 'above' }));
68
+ c.getNote('arp-3-4').addModifier(score.make.articulation({ type: 'tenuto', position: 'above' }));
69
+ for (const [m, type] of [
70
+ [1, VF.StaveHairpin.type.CRESC],
71
+ [2, VF.StaveHairpin.type.DECRESC],
72
+ ]) {
73
+ score.make.hairpin({
74
+ from: c.getNote('arp-' + m + '-0'),
75
+ to: c.getNote('arp-' + m + '-8'),
76
+ type,
77
+ options: { leftShiftPx: m === 2 ? 30 : 0, yShift: -6, height: 7 },
78
+ });
79
+ }
80
+ },
81
+ };
82
+ }
83
+ window.FeaturedScores.prelude = { title, credit, intro, focus, action, create };
84
+ })();