vexflow 4.0.1-beta.0 → 4.0.1-beta.1

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 (328) 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 +126 -26
  6. package/build/cjs/vexflow-debug-with-tests.js.map +1 -1
  7. package/build/cjs/vexflow-debug.js +94 -26
  8. package/build/cjs/vexflow-debug.js.map +1 -1
  9. package/build/cjs/vexflow-gonville.js +2 -2
  10. package/build/cjs/vexflow-gonville.js.map +1 -1
  11. package/build/cjs/vexflow-petaluma.js +2 -2
  12. package/build/cjs/vexflow-petaluma.js.map +1 -1
  13. package/build/cjs/vexflow.js +2 -2
  14. package/build/cjs/vexflow.js.map +1 -1
  15. package/build/esm/src/version.js +3 -3
  16. package/package.json +1 -1
  17. package/src/note.ts +2 -2
  18. package/src/stavenote.ts +80 -16
  19. package/build/esm/entry/vexflow-bravura.js +0 -11
  20. package/build/esm/entry/vexflow-core.js +0 -54
  21. package/build/esm/entry/vexflow-debug-with-tests.js +0 -4
  22. package/build/esm/entry/vexflow-debug.js +0 -3
  23. package/build/esm/entry/vexflow-font-bravura.js +0 -7
  24. package/build/esm/entry/vexflow-font-custom.js +0 -7
  25. package/build/esm/entry/vexflow-font-gonville.js +0 -7
  26. package/build/esm/entry/vexflow-font-petaluma.js +0 -7
  27. package/build/esm/entry/vexflow-gonville.js +0 -11
  28. package/build/esm/entry/vexflow-petaluma.js +0 -11
  29. package/build/esm/entry/vexflow.js +0 -9
  30. package/build/esm/src/accidental.js +0 -348
  31. package/build/esm/src/annotation.js +0 -213
  32. package/build/esm/src/articulation.js +0 -264
  33. package/build/esm/src/barnote.js +0 -58
  34. package/build/esm/src/beam.js +0 -632
  35. package/build/esm/src/bend.js +0 -202
  36. package/build/esm/src/boundingbox.js +0 -59
  37. package/build/esm/src/boundingboxcomputation.js +0 -107
  38. package/build/esm/src/canvascontext.js +0 -202
  39. package/build/esm/src/chordsymbol.js +0 -578
  40. package/build/esm/src/clef.js +0 -153
  41. package/build/esm/src/clefnote.js +0 -65
  42. package/build/esm/src/crescendo.js +0 -77
  43. package/build/esm/src/curve.js +0 -118
  44. package/build/esm/src/dot.js +0 -137
  45. package/build/esm/src/easyscore.js +0 -374
  46. package/build/esm/src/element.js +0 -216
  47. package/build/esm/src/factory.js +0 -440
  48. package/build/esm/src/flow.js +0 -275
  49. package/build/esm/src/font.js +0 -264
  50. package/build/esm/src/fonts/bravura_glyphs.js +0 -3239
  51. package/build/esm/src/fonts/bravura_metrics.js +0 -507
  52. package/build/esm/src/fonts/custom_glyphs.js +0 -78
  53. package/build/esm/src/fonts/custom_metrics.js +0 -5
  54. package/build/esm/src/fonts/gonville_glyphs.js +0 -828
  55. package/build/esm/src/fonts/gonville_metrics.js +0 -421
  56. package/build/esm/src/fonts/load_all.js +0 -10
  57. package/build/esm/src/fonts/load_bravura.js +0 -6
  58. package/build/esm/src/fonts/load_custom.js +0 -6
  59. package/build/esm/src/fonts/load_gonville.js +0 -6
  60. package/build/esm/src/fonts/load_petaluma.js +0 -6
  61. package/build/esm/src/fonts/petaluma_glyphs.js +0 -1335
  62. package/build/esm/src/fonts/petaluma_metrics.js +0 -536
  63. package/build/esm/src/fonts/petalumascript_glyphs.js +0 -863
  64. package/build/esm/src/fonts/robotoslab_glyphs.js +0 -863
  65. package/build/esm/src/fonts/textfonts.js +0 -44
  66. package/build/esm/src/formatter.js +0 -568
  67. package/build/esm/src/fraction.js +0 -171
  68. package/build/esm/src/frethandfinger.js +0 -156
  69. package/build/esm/src/ghostnote.js +0 -50
  70. package/build/esm/src/glyph.js +0 -331
  71. package/build/esm/src/glyphnote.js +0 -55
  72. package/build/esm/src/gracenote.js +0 -133
  73. package/build/esm/src/gracenotegroup.js +0 -128
  74. package/build/esm/src/gracetabnote.js +0 -12
  75. package/build/esm/src/index.js +0 -91
  76. package/build/esm/src/keymanager.js +0 -99
  77. package/build/esm/src/keysignature.js +0 -250
  78. package/build/esm/src/keysignote.js +0 -28
  79. package/build/esm/src/modifier.js +0 -128
  80. package/build/esm/src/modifiercontext.js +0 -110
  81. package/build/esm/src/multimeasurerest.js +0 -173
  82. package/build/esm/src/music.js +0 -322
  83. package/build/esm/src/note.js +0 -371
  84. package/build/esm/src/notehead.js +0 -169
  85. package/build/esm/src/notesubgroup.js +0 -59
  86. package/build/esm/src/ornament.js +0 -206
  87. package/build/esm/src/parenthesis.js +0 -76
  88. package/build/esm/src/parser.js +0 -164
  89. package/build/esm/src/pedalmarking.js +0 -192
  90. package/build/esm/src/registry.js +0 -81
  91. package/build/esm/src/rendercontext.js +0 -24
  92. package/build/esm/src/renderer.js +0 -112
  93. package/build/esm/src/repeatnote.js +0 -22
  94. package/build/esm/src/stave.js +0 -547
  95. package/build/esm/src/stavebarline.js +0 -182
  96. package/build/esm/src/staveconnector.js +0 -196
  97. package/build/esm/src/stavehairpin.js +0 -120
  98. package/build/esm/src/staveline.js +0 -218
  99. package/build/esm/src/stavemodifier.js +0 -77
  100. package/build/esm/src/stavenote.js +0 -799
  101. package/build/esm/src/staverepetition.js +0 -155
  102. package/build/esm/src/stavesection.js +0 -58
  103. package/build/esm/src/stavetempo.js +0 -91
  104. package/build/esm/src/stavetext.js +0 -82
  105. package/build/esm/src/stavetie.js +0 -141
  106. package/build/esm/src/stavevolta.js +0 -67
  107. package/build/esm/src/stem.js +0 -131
  108. package/build/esm/src/stemmablenote.js +0 -193
  109. package/build/esm/src/stringnumber.js +0 -231
  110. package/build/esm/src/strokes.js +0 -200
  111. package/build/esm/src/svgcontext.js +0 -414
  112. package/build/esm/src/system.js +0 -116
  113. package/build/esm/src/tables.js +0 -1102
  114. package/build/esm/src/tabnote.js +0 -299
  115. package/build/esm/src/tabslide.js +0 -76
  116. package/build/esm/src/tabstave.js +0 -17
  117. package/build/esm/src/tabtie.js +0 -19
  118. package/build/esm/src/textbracket.js +0 -144
  119. package/build/esm/src/textdynamics.js +0 -81
  120. package/build/esm/src/textformatter.js +0 -177
  121. package/build/esm/src/textnote.js +0 -176
  122. package/build/esm/src/tickable.js +0 -214
  123. package/build/esm/src/tickcontext.js +0 -170
  124. package/build/esm/src/timesigglyph.js +0 -85
  125. package/build/esm/src/timesignature.js +0 -89
  126. package/build/esm/src/timesignote.js +0 -32
  127. package/build/esm/src/tremolo.js +0 -47
  128. package/build/esm/src/tuning.js +0 -54
  129. package/build/esm/src/tuplet.js +0 -240
  130. package/build/esm/src/typeguard.js +0 -30
  131. package/build/esm/src/util.js +0 -58
  132. package/build/esm/src/vex.js +0 -51
  133. package/build/esm/src/vibrato.js +0 -100
  134. package/build/esm/src/vibratobracket.js +0 -50
  135. package/build/esm/src/voice.js +0 -187
  136. package/build/esm/src/web.js +0 -15
  137. package/build/esm/tests/accidental_tests.js +0 -974
  138. package/build/esm/tests/annotation_tests.js +0 -377
  139. package/build/esm/tests/articulation_tests.js +0 -365
  140. package/build/esm/tests/auto_beam_formatting_tests.js +0 -548
  141. package/build/esm/tests/bach_tests.js +0 -335
  142. package/build/esm/tests/barline_tests.js +0 -52
  143. package/build/esm/tests/beam_tests.js +0 -595
  144. package/build/esm/tests/bend_tests.js +0 -215
  145. package/build/esm/tests/boundingbox_tests.js +0 -53
  146. package/build/esm/tests/boundingboxcomputation_tests.js +0 -183
  147. package/build/esm/tests/chordsymbol_tests.js +0 -320
  148. package/build/esm/tests/clef_tests.js +0 -131
  149. package/build/esm/tests/curve_tests.js +0 -118
  150. package/build/esm/tests/dot_tests.js +0 -123
  151. package/build/esm/tests/easyscore_tests.js +0 -459
  152. package/build/esm/tests/factory_tests.js +0 -44
  153. package/build/esm/tests/font_tests.js +0 -135
  154. package/build/esm/tests/formatter/framestack.js +0 -61
  155. package/build/esm/tests/formatter/tests.js +0 -203
  156. package/build/esm/tests/formatter_tests.js +0 -669
  157. package/build/esm/tests/fraction_tests.js +0 -72
  158. package/build/esm/tests/ghostnote_tests.js +0 -77
  159. package/build/esm/tests/glyphnote_tests.js +0 -113
  160. package/build/esm/tests/gracenote_tests.js +0 -370
  161. package/build/esm/tests/gracetabnote_tests.js +0 -79
  162. package/build/esm/tests/index.js +0 -68
  163. package/build/esm/tests/key_clef_tests.js +0 -103
  164. package/build/esm/tests/keymanager_tests.js +0 -68
  165. package/build/esm/tests/keysignature_tests.js +0 -308
  166. package/build/esm/tests/mocks.js +0 -71
  167. package/build/esm/tests/modifier_tests.js +0 -24
  168. package/build/esm/tests/multimeasurerest_tests.js +0 -141
  169. package/build/esm/tests/music_tests.js +0 -161
  170. package/build/esm/tests/notehead_tests.js +0 -137
  171. package/build/esm/tests/notesubgroup_tests.js +0 -149
  172. package/build/esm/tests/offscreencanvas_tests.js +0 -47
  173. package/build/esm/tests/ornament_tests.js +0 -298
  174. package/build/esm/tests/parser_tests.js +0 -122
  175. package/build/esm/tests/pedalmarking_tests.js +0 -64
  176. package/build/esm/tests/percussion_tests.js +0 -180
  177. package/build/esm/tests/registry_tests.js +0 -64
  178. package/build/esm/tests/renderer_tests.js +0 -113
  179. package/build/esm/tests/rests_tests.js +0 -248
  180. package/build/esm/tests/rhythm_tests.js +0 -357
  181. package/build/esm/tests/stave_tests.js +0 -560
  182. package/build/esm/tests/staveconnector_tests.js +0 -402
  183. package/build/esm/tests/stavehairpin_tests.js +0 -90
  184. package/build/esm/tests/staveline_tests.js +0 -122
  185. package/build/esm/tests/stavemodifier_tests.js +0 -51
  186. package/build/esm/tests/stavenote_tests.js +0 -835
  187. package/build/esm/tests/stavetie_tests.js +0 -108
  188. package/build/esm/tests/stringnumber_tests.js +0 -259
  189. package/build/esm/tests/strokes_tests.js +0 -275
  190. package/build/esm/tests/style_tests.js +0 -98
  191. package/build/esm/tests/support/qunit.js +0 -2765
  192. package/build/esm/tests/tabnote_tests.js +0 -474
  193. package/build/esm/tests/tabslide_tests.js +0 -135
  194. package/build/esm/tests/tabstave_tests.js +0 -23
  195. package/build/esm/tests/tabtie_tests.js +0 -173
  196. package/build/esm/tests/textbracket_tests.js +0 -100
  197. package/build/esm/tests/textformatter_tests.js +0 -24
  198. package/build/esm/tests/textnote_tests.js +0 -215
  199. package/build/esm/tests/threevoice_tests.js +0 -132
  200. package/build/esm/tests/tickcontext_tests.js +0 -36
  201. package/build/esm/tests/timesignature_tests.js +0 -134
  202. package/build/esm/tests/tremolo_tests.js +0 -75
  203. package/build/esm/tests/tuning_tests.js +0 -56
  204. package/build/esm/tests/tuplet_tests.js +0 -450
  205. package/build/esm/tests/typeguard_tests.js +0 -82
  206. package/build/esm/tests/vexflow_test_helpers.js +0 -266
  207. package/build/esm/tests/vf_prefix_tests.js +0 -115
  208. package/build/esm/tests/vibrato_tests.js +0 -92
  209. package/build/esm/tests/vibratobracket_tests.js +0 -45
  210. package/build/esm/tests/voice_tests.js +0 -69
  211. package/build/types/entry/vexflow-bravura.d.ts +0 -3
  212. package/build/types/entry/vexflow-core.d.ts +0 -3
  213. package/build/types/entry/vexflow-debug.d.ts +0 -3
  214. package/build/types/entry/vexflow-font-bravura.d.ts +0 -3771
  215. package/build/types/entry/vexflow-font-custom.d.ts +0 -86
  216. package/build/types/entry/vexflow-font-gonville.d.ts +0 -1267
  217. package/build/types/entry/vexflow-font-petaluma.d.ts +0 -1896
  218. package/build/types/entry/vexflow-gonville.d.ts +0 -3
  219. package/build/types/entry/vexflow-petaluma.d.ts +0 -3
  220. package/build/types/entry/vexflow.d.ts +0 -3
  221. package/build/types/src/accidental.d.ts +0 -66
  222. package/build/types/src/annotation.d.ts +0 -60
  223. package/build/types/src/articulation.d.ts +0 -62
  224. package/build/types/src/barnote.d.ts +0 -29
  225. package/build/types/src/beam.d.ts +0 -124
  226. package/build/types/src/bend.d.ts +0 -73
  227. package/build/types/src/boundingbox.d.ts +0 -42
  228. package/build/types/src/boundingboxcomputation.d.ts +0 -33
  229. package/build/types/src/canvascontext.d.ts +0 -89
  230. package/build/types/src/chordsymbol.d.ts +0 -149
  231. package/build/types/src/clef.d.ts +0 -48
  232. package/build/types/src/clefnote.d.ts +0 -25
  233. package/build/types/src/crescendo.d.ts +0 -27
  234. package/build/types/src/curve.d.ts +0 -41
  235. package/build/types/src/dot.d.ts +0 -20
  236. package/build/types/src/easyscore.d.ts +0 -148
  237. package/build/types/src/element.d.ts +0 -202
  238. package/build/types/src/factory.d.ts +0 -271
  239. package/build/types/src/flow.d.ts +0 -245
  240. package/build/types/src/font.d.ts +0 -181
  241. package/build/types/src/fonts/bravura_glyphs.d.ts +0 -3239
  242. package/build/types/src/fonts/bravura_metrics.d.ts +0 -533
  243. package/build/types/src/fonts/custom_glyphs.d.ts +0 -78
  244. package/build/types/src/fonts/custom_metrics.d.ts +0 -5
  245. package/build/types/src/fonts/gonville_glyphs.d.ts +0 -828
  246. package/build/types/src/fonts/gonville_metrics.d.ts +0 -440
  247. package/build/types/src/fonts/load_all.d.ts +0 -1
  248. package/build/types/src/fonts/load_bravura.d.ts +0 -1
  249. package/build/types/src/fonts/load_custom.d.ts +0 -1
  250. package/build/types/src/fonts/load_gonville.d.ts +0 -1
  251. package/build/types/src/fonts/load_petaluma.d.ts +0 -1
  252. package/build/types/src/fonts/petaluma_glyphs.d.ts +0 -1335
  253. package/build/types/src/fonts/petaluma_metrics.d.ts +0 -562
  254. package/build/types/src/fonts/petalumascript_glyphs.d.ts +0 -863
  255. package/build/types/src/fonts/robotoslab_glyphs.d.ts +0 -863
  256. package/build/types/src/fonts/textfonts.d.ts +0 -1
  257. package/build/types/src/formatter.d.ts +0 -203
  258. package/build/types/src/fraction.d.ts +0 -62
  259. package/build/types/src/frethandfinger.d.ts +0 -22
  260. package/build/types/src/ghostnote.d.ts +0 -16
  261. package/build/types/src/glyph.d.ts +0 -139
  262. package/build/types/src/glyphnote.d.ts +0 -17
  263. package/build/types/src/gracenote.d.ts +0 -19
  264. package/build/types/src/gracenotegroup.d.ts +0 -33
  265. package/build/types/src/gracetabnote.d.ts +0 -5
  266. package/build/types/src/index.d.ts +0 -91
  267. package/build/types/src/keymanager.d.ts +0 -25
  268. package/build/types/src/keysignature.d.ts +0 -50
  269. package/build/types/src/keysignote.d.ts +0 -11
  270. package/build/types/src/modifier.d.ts +0 -97
  271. package/build/types/src/modifiercontext.d.ts +0 -45
  272. package/build/types/src/multimeasurerest.d.ts +0 -61
  273. package/build/types/src/music.d.ts +0 -91
  274. package/build/types/src/note.d.ts +0 -230
  275. package/build/types/src/notehead.d.ts +0 -70
  276. package/build/types/src/notesubgroup.d.ts +0 -18
  277. package/build/types/src/ornament.d.ts +0 -76
  278. package/build/types/src/parenthesis.d.ts +0 -22
  279. package/build/types/src/parser.d.ts +0 -45
  280. package/build/types/src/pedalmarking.d.ts +0 -69
  281. package/build/types/src/registry.d.ts +0 -40
  282. package/build/types/src/rendercontext.d.ts +0 -64
  283. package/build/types/src/renderer.d.ts +0 -35
  284. package/build/types/src/repeatnote.d.ts +0 -6
  285. package/build/types/src/stave.d.ts +0 -186
  286. package/build/types/src/stavebarline.d.ts +0 -28
  287. package/build/types/src/staveconnector.d.ts +0 -67
  288. package/build/types/src/stavehairpin.d.ts +0 -56
  289. package/build/types/src/staveline.d.ts +0 -57
  290. package/build/types/src/stavemodifier.d.ts +0 -44
  291. package/build/types/src/stavenote.d.ts +0 -154
  292. package/build/types/src/staverepetition.d.ts +0 -32
  293. package/build/types/src/stavesection.d.ts +0 -15
  294. package/build/types/src/stavetempo.d.ts +0 -25
  295. package/build/types/src/stavetext.d.ts +0 -25
  296. package/build/types/src/stavetie.d.ts +0 -59
  297. package/build/types/src/stavevolta.d.ts +0 -21
  298. package/build/types/src/stem.d.ts +0 -58
  299. package/build/types/src/stemmablenote.d.ts +0 -39
  300. package/build/types/src/stringnumber.d.ts +0 -27
  301. package/build/types/src/strokes.d.ts +0 -33
  302. package/build/types/src/svgcontext.d.ts +0 -131
  303. package/build/types/src/system.d.ts +0 -92
  304. package/build/types/src/tables.d.ts +0 -96
  305. package/build/types/src/tabnote.d.ts +0 -44
  306. package/build/types/src/tabslide.d.ts +0 -34
  307. package/build/types/src/tabstave.d.ts +0 -7
  308. package/build/types/src/tabtie.d.ts +0 -18
  309. package/build/types/src/textbracket.d.ts +0 -55
  310. package/build/types/src/textdynamics.d.ts +0 -39
  311. package/build/types/src/textformatter.d.ts +0 -109
  312. package/build/types/src/textnote.d.ts +0 -49
  313. package/build/types/src/tickable.d.ts +0 -140
  314. package/build/types/src/tickcontext.d.ts +0 -82
  315. package/build/types/src/timesigglyph.d.ts +0 -14
  316. package/build/types/src/timesignature.d.ts +0 -26
  317. package/build/types/src/timesignote.d.ts +0 -11
  318. package/build/types/src/tremolo.d.ts +0 -17
  319. package/build/types/src/tuning.d.ts +0 -23
  320. package/build/types/src/tuplet.d.ts +0 -105
  321. package/build/types/src/typeguard.d.ts +0 -99
  322. package/build/types/src/util.d.ts +0 -27
  323. package/build/types/src/version.d.ts +0 -3
  324. package/build/types/src/vex.d.ts +0 -18
  325. package/build/types/src/vibrato.d.ts +0 -29
  326. package/build/types/src/vibratobracket.d.ts +0 -33
  327. package/build/types/src/voice.d.ts +0 -108
  328. package/build/types/src/web.d.ts +0 -2
@@ -1,248 +0,0 @@
1
- import { VexFlowTests } from './vexflow_test_helpers.js';
2
- import { Beam } from '../src/beam.js';
3
- import { Dot } from '../src/dot.js';
4
- import { Flow } from '../src/flow.js';
5
- import { Formatter } from '../src/formatter.js';
6
- import { Stave } from '../src/stave.js';
7
- import { StaveNote } from '../src/stavenote.js';
8
- import { Tuplet } from '../src/tuplet.js';
9
- import { Voice } from '../src/voice.js';
10
- const RestsTests = {
11
- Start() {
12
- QUnit.module('Rests');
13
- const run = VexFlowTests.runTests;
14
- run('Rests - Dotted', basic);
15
- run('Auto Align Rests - Beamed Notes Stems Up', beamsUp);
16
- run('Auto Align Rests - Beamed Notes Stems Down', beamsDown);
17
- run('Auto Align Rests - Tuplets Stems Up', tupletsUp);
18
- run('Auto Align Rests - Tuplets Stems Down', tupletsDown);
19
- run('Auto Align Rests - Single Voice (Default)', singleVoiceDefaultAlignment);
20
- run('Auto Align Rests - Single Voice (Align All)', singleVoiceAlignAll);
21
- run('Auto Align Rests - Multi Voice', multiVoice);
22
- },
23
- };
24
- function setupContext(options, contextBuilder, width = 350, height = 150) {
25
- const context = contextBuilder(options.elementId, width, height);
26
- context.scale(0.9, 0.9);
27
- context.fillStyle = '#221';
28
- context.strokeStyle = '#221';
29
- context.font = '10pt Arial';
30
- const stave = new Stave(10, 30, width).addClef('treble').addTimeSignature('4/4').setContext(context).draw();
31
- return { context, stave };
32
- }
33
- function basic(options, contextBuilder) {
34
- const { context, stave } = setupContext(options, contextBuilder, 700);
35
- const notes = [
36
- new StaveNote({ keys: ['b/4'], stem_direction: 1, duration: 'wr' }),
37
- new StaveNote({ keys: ['b/4'], stem_direction: 1, duration: 'hr' }),
38
- new StaveNote({ keys: ['b/4'], stem_direction: 1, duration: '4r' }),
39
- new StaveNote({ keys: ['b/4'], stem_direction: 1, duration: '8r' }),
40
- new StaveNote({ keys: ['b/4'], stem_direction: 1, duration: '16r' }),
41
- new StaveNote({ keys: ['b/4'], stem_direction: 1, duration: '32r' }),
42
- new StaveNote({ keys: ['b/4'], stem_direction: 1, duration: '64r' }),
43
- new StaveNote({ keys: ['b/4'], stem_direction: 1, duration: '128r' }),
44
- ];
45
- Dot.buildAndAttach(notes, { all: true });
46
- Formatter.FormatAndDraw(context, stave, notes);
47
- ok(true, 'Dotted Rest Test');
48
- }
49
- const note = (noteStruct) => new StaveNote(noteStruct);
50
- function beamsUp(options, contextBuilder) {
51
- const { context, stave } = setupContext(options, contextBuilder, 600, 160);
52
- const notes = [
53
- note({ keys: ['e/5'], stem_direction: 1, duration: '8' }),
54
- note({ keys: ['b/4'], stem_direction: 1, duration: '8r' }),
55
- note({ keys: ['b/5'], stem_direction: 1, duration: '8' }),
56
- note({ keys: ['c/5'], stem_direction: 1, duration: '8' }),
57
- note({ keys: ['b/4', 'd/5', 'a/5'], stem_direction: 1, duration: '8' }),
58
- note({ keys: ['b/4'], stem_direction: 1, duration: '8r' }),
59
- note({ keys: ['b/4'], stem_direction: 1, duration: '8r' }),
60
- note({ keys: ['c/4'], stem_direction: 1, duration: '8' }),
61
- note({ keys: ['b/4', 'd/5', 'a/5'], stem_direction: 1, duration: '8' }),
62
- note({ keys: ['b/4'], stem_direction: 1, duration: '8' }),
63
- note({ keys: ['b/4'], stem_direction: 1, duration: '8r' }),
64
- note({ keys: ['c/4'], stem_direction: 1, duration: '8' }),
65
- ];
66
- const beam1 = new Beam(notes.slice(0, 4));
67
- const beam2 = new Beam(notes.slice(4, 8));
68
- const beam3 = new Beam(notes.slice(8, 12));
69
- Formatter.FormatAndDraw(context, stave, notes);
70
- beam1.setContext(context).draw();
71
- beam2.setContext(context).draw();
72
- beam3.setContext(context).draw();
73
- ok(true, 'Auto Align Rests - Beams Up Test');
74
- }
75
- function beamsDown(options, contextBuilder) {
76
- const { context, stave } = setupContext(options, contextBuilder, 600, 160);
77
- const notes = [
78
- note({ keys: ['a/5'], stem_direction: -1, duration: '8' }),
79
- note({ keys: ['b/4'], stem_direction: -1, duration: '8r' }),
80
- note({ keys: ['b/5'], stem_direction: -1, duration: '8' }),
81
- note({ keys: ['c/5'], stem_direction: -1, duration: '8' }),
82
- note({ keys: ['b/4', 'd/5', 'a/5'], stem_direction: -1, duration: '8' }),
83
- note({ keys: ['b/4'], stem_direction: -1, duration: '8r' }),
84
- note({ keys: ['b/4'], stem_direction: -1, duration: '8r' }),
85
- note({ keys: ['e/4'], stem_direction: -1, duration: '8' }),
86
- note({ keys: ['b/4', 'd/5', 'a/5'], stem_direction: -1, duration: '8' }),
87
- note({ keys: ['b/4'], stem_direction: -1, duration: '8' }),
88
- note({ keys: ['b/4'], stem_direction: -1, duration: '8r' }),
89
- note({ keys: ['e/4'], stem_direction: -1, duration: '8' }),
90
- ];
91
- const beam1 = new Beam(notes.slice(0, 4));
92
- const beam2 = new Beam(notes.slice(4, 8));
93
- const beam3 = new Beam(notes.slice(8, 12));
94
- Formatter.FormatAndDraw(context, stave, notes);
95
- beam1.setContext(context).draw();
96
- beam2.setContext(context).draw();
97
- beam3.setContext(context).draw();
98
- ok(true, 'Auto Align Rests - Beams Down Test');
99
- }
100
- function tupletsUp(options, contextBuilder) {
101
- const { context, stave } = setupContext(options, contextBuilder, 600, 160);
102
- const notes = [
103
- note({ keys: ['b/4'], stem_direction: 1, duration: '4' }),
104
- note({ keys: ['b/4'], stem_direction: 1, duration: '4' }),
105
- note({ keys: ['a/5'], stem_direction: 1, duration: '4r' }),
106
- note({ keys: ['a/5'], stem_direction: 1, duration: '4r' }),
107
- note({ keys: ['g/5'], stem_direction: 1, duration: '4r' }),
108
- note({ keys: ['b/5'], stem_direction: 1, duration: '4' }),
109
- note({ keys: ['a/5'], stem_direction: 1, duration: '4' }),
110
- note({ keys: ['g/5'], stem_direction: 1, duration: '4r' }),
111
- note({ keys: ['b/4'], stem_direction: 1, duration: '4' }),
112
- note({ keys: ['a/5'], stem_direction: 1, duration: '4' }),
113
- note({ keys: ['b/4'], stem_direction: 1, duration: '4r' }),
114
- note({ keys: ['b/4'], stem_direction: 1, duration: '4r' }),
115
- ];
116
- const tuplet1 = new Tuplet(notes.slice(0, 3)).setTupletLocation(Tuplet.LOCATION_TOP);
117
- const tuplet2 = new Tuplet(notes.slice(3, 6)).setTupletLocation(Tuplet.LOCATION_TOP);
118
- const tuplet3 = new Tuplet(notes.slice(6, 9)).setTupletLocation(Tuplet.LOCATION_TOP);
119
- const tuplet4 = new Tuplet(notes.slice(9, 12)).setTupletLocation(Tuplet.LOCATION_TOP);
120
- Formatter.FormatAndDraw(context, stave, notes);
121
- tuplet1.setContext(context).draw();
122
- tuplet2.setContext(context).draw();
123
- tuplet3.setContext(context).draw();
124
- tuplet4.setContext(context).draw();
125
- ok(true, 'Auto Align Rests - Tuplets Stem Up Test');
126
- }
127
- function tupletsDown(options, contextBuilder) {
128
- const { context, stave } = setupContext(options, contextBuilder, 600, 160);
129
- const notes = [
130
- note({ keys: ['a/5'], stem_direction: -1, duration: '8r' }),
131
- note({ keys: ['g/5'], stem_direction: -1, duration: '8r' }),
132
- note({ keys: ['b/4'], stem_direction: -1, duration: '8' }),
133
- note({ keys: ['a/5'], stem_direction: -1, duration: '8r' }),
134
- note({ keys: ['g/5'], stem_direction: -1, duration: '8' }),
135
- note({ keys: ['b/5'], stem_direction: -1, duration: '8' }),
136
- note({ keys: ['a/5'], stem_direction: -1, duration: '8' }),
137
- note({ keys: ['g/5'], stem_direction: -1, duration: '8r' }),
138
- note({ keys: ['b/4'], stem_direction: -1, duration: '8' }),
139
- note({ keys: ['a/5'], stem_direction: -1, duration: '8' }),
140
- note({ keys: ['g/5'], stem_direction: -1, duration: '8r' }),
141
- note({ keys: ['b/4'], stem_direction: -1, duration: '8r' }),
142
- ];
143
- const beam1 = new Beam(notes.slice(0, 3));
144
- const beam2 = new Beam(notes.slice(3, 6));
145
- const beam3 = new Beam(notes.slice(6, 9));
146
- const beam4 = new Beam(notes.slice(9, 12));
147
- const tuplet1 = new Tuplet(notes.slice(0, 3)).setTupletLocation(Tuplet.LOCATION_BOTTOM);
148
- const tuplet2 = new Tuplet(notes.slice(3, 6)).setTupletLocation(Tuplet.LOCATION_BOTTOM);
149
- const tuplet3 = new Tuplet(notes.slice(6, 9)).setTupletLocation(Tuplet.LOCATION_BOTTOM);
150
- const tuplet4 = new Tuplet(notes.slice(9, 12)).setTupletLocation(Tuplet.LOCATION_BOTTOM);
151
- Formatter.FormatAndDraw(context, stave, notes);
152
- tuplet1.setContext(context).draw();
153
- tuplet2.setContext(context).draw();
154
- tuplet3.setContext(context).draw();
155
- tuplet4.setContext(context).draw();
156
- beam1.setContext(context).draw();
157
- beam2.setContext(context).draw();
158
- beam3.setContext(context).draw();
159
- beam4.setContext(context).draw();
160
- ok(true, 'Auto Align Rests - Tuplets Stem Down Test');
161
- }
162
- function singleVoiceDefaultAlignment(options, contextBuilder) {
163
- const { context, stave } = setupContext(options, contextBuilder, 600, 160);
164
- const notes = [
165
- note({ keys: ['b/4'], stem_direction: -1, duration: '4r' }),
166
- note({ keys: ['b/4'], stem_direction: -1, duration: '4r' }),
167
- note({ keys: ['f/4'], stem_direction: -1, duration: '4' }),
168
- note({ keys: ['e/5'], stem_direction: -1, duration: '8' }),
169
- note({ keys: ['b/4'], stem_direction: -1, duration: '8r' }),
170
- note({ keys: ['a/5'], stem_direction: -1, duration: '8' }),
171
- note({ keys: ['b/4'], stem_direction: -1, duration: '8r' }),
172
- note({ keys: ['b/4'], stem_direction: -1, duration: '8' }),
173
- note({ keys: ['e/5'], stem_direction: -1, duration: '8' }),
174
- note({ keys: ['a/5'], stem_direction: 1, duration: '4' }),
175
- note({ keys: ['b/4'], stem_direction: 1, duration: '4r' }),
176
- note({ keys: ['b/5'], stem_direction: 1, duration: '4' }),
177
- note({ keys: ['d/5'], stem_direction: -1, duration: '4' }),
178
- note({ keys: ['g/5'], stem_direction: -1, duration: '4' }),
179
- note({ keys: ['b/4'], stem_direction: -1, duration: '4r' }),
180
- note({ keys: ['b/4'], stem_direction: -1, duration: '4r' }),
181
- ];
182
- const beam = new Beam(notes.slice(5, 9));
183
- const tuplet = new Tuplet(notes.slice(9, 12)).setTupletLocation(Tuplet.LOCATION_TOP);
184
- Formatter.FormatAndDraw(context, stave, notes);
185
- tuplet.setContext(context).draw();
186
- beam.setContext(context).draw();
187
- ok(true, 'Auto Align Rests - Default Test');
188
- }
189
- function singleVoiceAlignAll(options, contextBuilder) {
190
- const { context, stave } = setupContext(options, contextBuilder, 600, 160);
191
- const notes = [
192
- note({ keys: ['b/4'], stem_direction: -1, duration: '4r' }),
193
- note({ keys: ['b/4'], stem_direction: -1, duration: '4r' }),
194
- note({ keys: ['f/4'], stem_direction: -1, duration: '4' }),
195
- note({ keys: ['e/5'], stem_direction: -1, duration: '8' }),
196
- note({ keys: ['b/4'], stem_direction: -1, duration: '8r' }),
197
- note({ keys: ['a/5'], stem_direction: -1, duration: '8' }),
198
- note({ keys: ['b/4'], stem_direction: -1, duration: '8r' }),
199
- note({ keys: ['b/4'], stem_direction: -1, duration: '8' }),
200
- note({ keys: ['e/5'], stem_direction: -1, duration: '8' }),
201
- note({ keys: ['a/5'], stem_direction: 1, duration: '4' }),
202
- note({ keys: ['b/4'], stem_direction: 1, duration: '4r' }),
203
- note({ keys: ['b/5'], stem_direction: 1, duration: '4' }),
204
- note({ keys: ['d/5'], stem_direction: -1, duration: '4' }),
205
- note({ keys: ['g/5'], stem_direction: -1, duration: '4' }),
206
- note({ keys: ['b/4'], stem_direction: -1, duration: '4r' }),
207
- note({ keys: ['b/4'], stem_direction: -1, duration: '4r' }),
208
- ];
209
- const beam = new Beam(notes.slice(5, 9));
210
- const tuplet = new Tuplet(notes.slice(9, 12)).setTupletLocation(Tuplet.LOCATION_TOP);
211
- Formatter.FormatAndDraw(context, stave, notes, { align_rests: true });
212
- tuplet.setContext(context).draw();
213
- beam.setContext(context).draw();
214
- ok(true, 'Auto Align Rests - Align All Test');
215
- }
216
- function multiVoice(options, contextBuilder) {
217
- const ctx = contextBuilder(options.elementId, 600, 200);
218
- const stave = new Stave(50, 10, 500).addClef('treble').setContext(ctx).addTimeSignature('4/4').draw();
219
- const noteOnStave = (noteStruct) => new StaveNote(noteStruct).setStave(stave);
220
- const notes1 = [
221
- noteOnStave({ keys: ['c/4', 'e/4', 'g/4'], duration: '4' }),
222
- noteOnStave({ keys: ['b/4'], duration: '4r' }),
223
- noteOnStave({ keys: ['c/4', 'd/4', 'a/4'], duration: '4' }),
224
- noteOnStave({ keys: ['b/4'], duration: '4r' }),
225
- ];
226
- const notes2 = [
227
- noteOnStave({ keys: ['e/3'], stem_direction: -1, duration: '8' }),
228
- noteOnStave({ keys: ['b/4'], stem_direction: -1, duration: '8r' }),
229
- noteOnStave({ keys: ['b/4'], stem_direction: -1, duration: '8r' }),
230
- noteOnStave({ keys: ['e/3'], stem_direction: -1, duration: '8' }),
231
- noteOnStave({ keys: ['e/3'], stem_direction: -1, duration: '8' }),
232
- noteOnStave({ keys: ['b/4'], stem_direction: -1, duration: '8r' }),
233
- noteOnStave({ keys: ['e/3'], stem_direction: -1, duration: '8' }),
234
- noteOnStave({ keys: ['e/3'], stem_direction: -1, duration: '8' }),
235
- ];
236
- const voice1 = new Voice(Flow.TIME4_4).addTickables(notes1);
237
- const voice2 = new Voice(Flow.TIME4_4).addTickables(notes2);
238
- new Formatter().joinVoices([voice1, voice2]).formatToStave([voice1, voice2], stave, { align_rests: true });
239
- const beam2_1 = new Beam(notes2.slice(0, 4));
240
- const beam2_2 = new Beam(notes2.slice(4, 8));
241
- voice2.draw(ctx);
242
- voice1.draw(ctx);
243
- beam2_1.setContext(ctx).draw();
244
- beam2_2.setContext(ctx).draw();
245
- ok(true, 'Strokes Test Multi Voice');
246
- }
247
- VexFlowTests.register(RestsTests);
248
- export { RestsTests };
@@ -1,357 +0,0 @@
1
- import { VexFlowTests } from './vexflow_test_helpers.js';
2
- import { Annotation } from '../src/annotation.js';
3
- import { Beam } from '../src/beam.js';
4
- import { Formatter } from '../src/formatter.js';
5
- import { Stave } from '../src/stave.js';
6
- import { BarlineType } from '../src/stavebarline.js';
7
- import { StaveNote } from '../src/stavenote.js';
8
- const RhythmTests = {
9
- Start() {
10
- QUnit.module('Rhythm');
11
- const run = VexFlowTests.runTests;
12
- run('Rhythm Draw - slash notes', drawBasic);
13
- run('Rhythm Draw - beamed slash notes', drawBeamedSlashNotes);
14
- run('Rhythm Draw - beamed slash notes, some rests', drawSlashAndBeamAndRests);
15
- run('Rhythm Draw - 16th note rhythm with scratches', drawSixtenthWithScratches);
16
- run('Rhythm Draw - 32nd note rhythm with scratches', drawThirtySecondWithScratches);
17
- },
18
- };
19
- function drawBasic(options, contextBuilder) {
20
- const ctx = contextBuilder(options.elementId, 800, 150);
21
- const staveBar1 = new Stave(10, 30, 150);
22
- staveBar1.setBegBarType(BarlineType.DOUBLE);
23
- staveBar1.setEndBarType(BarlineType.SINGLE);
24
- staveBar1.addClef('treble');
25
- staveBar1.addTimeSignature('4/4');
26
- staveBar1.addKeySignature('C');
27
- staveBar1.setContext(ctx).draw();
28
- const notesBar1 = [new StaveNote({ keys: ['b/4'], duration: '1s', stem_direction: -1 })];
29
- Formatter.FormatAndDraw(ctx, staveBar1, notesBar1);
30
- const staveBar2 = new Stave(staveBar1.getWidth() + staveBar1.getX(), staveBar1.getY(), 120);
31
- staveBar2.setBegBarType(BarlineType.SINGLE);
32
- staveBar2.setEndBarType(BarlineType.SINGLE);
33
- staveBar2.setContext(ctx).draw();
34
- const notesBar2 = [
35
- new StaveNote({ keys: ['b/4'], duration: '2s', stem_direction: -1 }),
36
- new StaveNote({ keys: ['b/4'], duration: '2s', stem_direction: -1 }),
37
- ];
38
- Formatter.FormatAndDraw(ctx, staveBar2, notesBar2);
39
- const staveBar3 = new Stave(staveBar2.getWidth() + staveBar2.getX(), staveBar2.getY(), 170);
40
- staveBar3.setContext(ctx).draw();
41
- const notesBar3 = [
42
- new StaveNote({
43
- keys: ['b/4'],
44
- duration: '4s',
45
- stem_direction: -1,
46
- }),
47
- new StaveNote({
48
- keys: ['b/4'],
49
- duration: '4s',
50
- stem_direction: -1,
51
- }),
52
- new StaveNote({
53
- keys: ['b/4'],
54
- duration: '4s',
55
- stem_direction: -1,
56
- }),
57
- new StaveNote({
58
- keys: ['b/4'],
59
- duration: '4s',
60
- stem_direction: -1,
61
- }),
62
- ];
63
- Formatter.FormatAndDraw(ctx, staveBar3, notesBar3);
64
- const staveBar4 = new Stave(staveBar3.getWidth() + staveBar3.getX(), staveBar3.getY(), 200);
65
- staveBar4.setContext(ctx).draw();
66
- const notesBar4 = [
67
- new StaveNote({
68
- keys: ['b/4'],
69
- duration: '8s',
70
- stem_direction: -1,
71
- }),
72
- new StaveNote({
73
- keys: ['b/4'],
74
- duration: '8s',
75
- stem_direction: -1,
76
- }),
77
- new StaveNote({
78
- keys: ['b/4'],
79
- duration: '8s',
80
- stem_direction: -1,
81
- }),
82
- new StaveNote({
83
- keys: ['b/4'],
84
- duration: '8s',
85
- stem_direction: -1,
86
- }),
87
- new StaveNote({
88
- keys: ['b/4'],
89
- duration: '8s',
90
- stem_direction: -1,
91
- }),
92
- new StaveNote({
93
- keys: ['b/4'],
94
- duration: '8s',
95
- stem_direction: -1,
96
- }),
97
- new StaveNote({
98
- keys: ['b/4'],
99
- duration: '8s',
100
- stem_direction: -1,
101
- }),
102
- new StaveNote({
103
- keys: ['b/4'],
104
- duration: '8s',
105
- stem_direction: -1,
106
- }),
107
- ];
108
- Formatter.FormatAndDraw(ctx, staveBar4, notesBar4);
109
- expect(0);
110
- }
111
- function drawBeamedSlashNotes(options, contextBuilder) {
112
- const ctx = contextBuilder(options.elementId, 800, 150);
113
- const staveBar1 = new Stave(10, 30, 300);
114
- staveBar1.setBegBarType(BarlineType.DOUBLE);
115
- staveBar1.setEndBarType(BarlineType.SINGLE);
116
- staveBar1.addClef('treble');
117
- staveBar1.addTimeSignature('4/4');
118
- staveBar1.addKeySignature('C');
119
- staveBar1.setContext(ctx).draw();
120
- const notesBar1_part1 = [
121
- new StaveNote({
122
- keys: ['b/4'],
123
- duration: '8s',
124
- stem_direction: -1,
125
- }),
126
- new StaveNote({
127
- keys: ['b/4'],
128
- duration: '8s',
129
- stem_direction: -1,
130
- }),
131
- new StaveNote({
132
- keys: ['b/4'],
133
- duration: '8s',
134
- stem_direction: -1,
135
- }),
136
- new StaveNote({
137
- keys: ['b/4'],
138
- duration: '8s',
139
- stem_direction: -1,
140
- }),
141
- ];
142
- const notesBar1_part2 = [
143
- new StaveNote({
144
- keys: ['b/4'],
145
- duration: '8s',
146
- stem_direction: -1,
147
- }),
148
- new StaveNote({
149
- keys: ['b/4'],
150
- duration: '8s',
151
- stem_direction: -1,
152
- }),
153
- new StaveNote({
154
- keys: ['b/4'],
155
- duration: '8s',
156
- stem_direction: -1,
157
- }),
158
- new StaveNote({
159
- keys: ['b/4'],
160
- duration: '8s',
161
- stem_direction: -1,
162
- }),
163
- ];
164
- const beam1 = new Beam(notesBar1_part1);
165
- const beam2 = new Beam(notesBar1_part2);
166
- const notesBar1 = notesBar1_part1.concat(notesBar1_part2);
167
- Formatter.FormatAndDraw(ctx, staveBar1, notesBar1);
168
- beam1.setContext(ctx).draw();
169
- beam2.setContext(ctx).draw();
170
- expect(0);
171
- }
172
- function drawSlashAndBeamAndRests(options, contextBuilder) {
173
- const ctx = contextBuilder(options.elementId, 800, 150);
174
- const staveBar1 = new Stave(10, 30, 300);
175
- staveBar1.setBegBarType(BarlineType.DOUBLE);
176
- staveBar1.setEndBarType(BarlineType.SINGLE);
177
- staveBar1.addClef('treble');
178
- staveBar1.addTimeSignature('4/4');
179
- staveBar1.addKeySignature('F');
180
- staveBar1.setContext(ctx).draw();
181
- const notesBar1_part1 = [
182
- new StaveNote({
183
- keys: ['b/4'],
184
- duration: '8s',
185
- stem_direction: -1,
186
- }),
187
- new StaveNote({ keys: ['b/4'], duration: '8s', stem_direction: -1 }),
188
- ];
189
- notesBar1_part1[0].addModifier(new Annotation('C7').setFont('Times', VexFlowTests.Font.size + 2), 0);
190
- const notesBar1_part2 = [
191
- new StaveNote({
192
- keys: ['b/4'],
193
- duration: '8r',
194
- stem_direction: -1,
195
- }),
196
- new StaveNote({
197
- keys: ['b/4'],
198
- duration: '8s',
199
- stem_direction: -1,
200
- }),
201
- new StaveNote({
202
- keys: ['b/4'],
203
- duration: '8r',
204
- stem_direction: -1,
205
- }),
206
- new StaveNote({
207
- keys: ['b/4'],
208
- duration: '8s',
209
- stem_direction: -1,
210
- }),
211
- new StaveNote({
212
- keys: ['b/4'],
213
- duration: '8r',
214
- stem_direction: -1,
215
- }),
216
- new StaveNote({
217
- keys: ['b/4'],
218
- duration: '8s',
219
- stem_direction: -1,
220
- }),
221
- ];
222
- const beam1 = new Beam(notesBar1_part1);
223
- Formatter.FormatAndDraw(ctx, staveBar1, notesBar1_part1.concat(notesBar1_part2));
224
- beam1.setContext(ctx).draw();
225
- const staveBar2 = new Stave(staveBar1.getWidth() + staveBar1.getX(), staveBar1.getY(), 220);
226
- staveBar2.setContext(ctx).draw();
227
- const notesBar2 = [
228
- new StaveNote({
229
- keys: ['b/4'],
230
- duration: '1s',
231
- stem_direction: -1,
232
- }),
233
- ];
234
- notesBar2[0].addModifier(new Annotation('F').setFont('Times', VexFlowTests.Font.size + 2), 0);
235
- Formatter.FormatAndDraw(ctx, staveBar2, notesBar2);
236
- expect(0);
237
- }
238
- function drawSixtenthWithScratches(options, contextBuilder) {
239
- const ctx = contextBuilder(options.elementId, 800, 150);
240
- const staveBar1 = new Stave(10, 30, 300);
241
- staveBar1.setBegBarType(BarlineType.DOUBLE);
242
- staveBar1.setEndBarType(BarlineType.SINGLE);
243
- staveBar1.addClef('treble');
244
- staveBar1.addTimeSignature('4/4');
245
- staveBar1.addKeySignature('F');
246
- staveBar1.setContext(ctx).draw();
247
- const notesBar1_part1 = [
248
- new StaveNote({
249
- keys: ['b/4'],
250
- duration: '16s',
251
- stem_direction: -1,
252
- }),
253
- new StaveNote({
254
- keys: ['b/4'],
255
- duration: '16s',
256
- stem_direction: -1,
257
- }),
258
- new StaveNote({
259
- keys: ['b/4'],
260
- duration: '16m',
261
- stem_direction: -1,
262
- }),
263
- new StaveNote({
264
- keys: ['b/4'],
265
- duration: '16s',
266
- stem_direction: -1,
267
- }),
268
- ];
269
- const notesBar1_part2 = [
270
- new StaveNote({
271
- keys: ['b/4'],
272
- duration: '16m',
273
- stem_direction: -1,
274
- }),
275
- new StaveNote({
276
- keys: ['b/4'],
277
- duration: '16s',
278
- stem_direction: -1,
279
- }),
280
- new StaveNote({
281
- keys: ['b/4'],
282
- duration: '16r',
283
- stem_direction: -1,
284
- }),
285
- new StaveNote({
286
- keys: ['b/4'],
287
- duration: '16s',
288
- stem_direction: -1,
289
- }),
290
- ];
291
- notesBar1_part1[0].addModifier(new Annotation('C7').setFont('Times', VexFlowTests.Font.size + 3), 0);
292
- const beam1 = new Beam(notesBar1_part1);
293
- const beam2 = new Beam(notesBar1_part2);
294
- Formatter.FormatAndDraw(ctx, staveBar1, notesBar1_part1.concat(notesBar1_part2));
295
- beam1.setContext(ctx).draw();
296
- beam2.setContext(ctx).draw();
297
- expect(0);
298
- }
299
- function drawThirtySecondWithScratches(options, contextBuilder) {
300
- const ctx = contextBuilder(options.elementId, 800, 150);
301
- const staveBar1 = new Stave(10, 30, 300);
302
- staveBar1.setBegBarType(BarlineType.DOUBLE);
303
- staveBar1.setEndBarType(BarlineType.SINGLE);
304
- staveBar1.addClef('treble');
305
- staveBar1.addTimeSignature('4/4');
306
- staveBar1.addKeySignature('F');
307
- staveBar1.setContext(ctx).draw();
308
- const notesBar1_part1 = [
309
- new StaveNote({
310
- keys: ['b/4'],
311
- duration: '32s',
312
- stem_direction: 1,
313
- }),
314
- new StaveNote({
315
- keys: ['b/4'],
316
- duration: '32s',
317
- stem_direction: 1,
318
- }),
319
- new StaveNote({
320
- keys: ['b/4'],
321
- duration: '32m',
322
- stem_direction: 1,
323
- }),
324
- new StaveNote({
325
- keys: ['b/4'],
326
- duration: '32s',
327
- stem_direction: 1,
328
- }),
329
- new StaveNote({
330
- keys: ['b/4'],
331
- duration: '32m',
332
- stem_direction: 1,
333
- }),
334
- new StaveNote({
335
- keys: ['b/4'],
336
- duration: '32s',
337
- stem_direction: 1,
338
- }),
339
- new StaveNote({
340
- keys: ['b/4'],
341
- duration: '32r',
342
- stem_direction: 1,
343
- }),
344
- new StaveNote({
345
- keys: ['b/4'],
346
- duration: '32s',
347
- stem_direction: 1,
348
- }),
349
- ];
350
- notesBar1_part1[0].addModifier(new Annotation('C7').setFont('Times', VexFlowTests.Font.size + 3), 0);
351
- const beam1 = new Beam(notesBar1_part1);
352
- Formatter.FormatAndDraw(ctx, staveBar1, notesBar1_part1);
353
- beam1.setContext(ctx).draw();
354
- expect(0);
355
- }
356
- VexFlowTests.register(RhythmTests);
357
- export { RhythmTests };