vexflow 4.0.2 → 4.0.3

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 (67) hide show
  1. package/README.md +3 -1
  2. package/build/cjs/vexflow-bravura.js +2 -2
  3. package/build/cjs/vexflow-bravura.js.map +1 -1
  4. package/build/cjs/vexflow-core.js +2 -2
  5. package/build/cjs/vexflow-core.js.map +1 -1
  6. package/build/cjs/vexflow-debug-with-tests.js +508 -265
  7. package/build/cjs/vexflow-debug-with-tests.js.map +1 -1
  8. package/build/cjs/vexflow-debug.js +232 -127
  9. package/build/cjs/vexflow-debug.js.map +1 -1
  10. package/build/cjs/vexflow-font-bravura.js +1 -1
  11. package/build/cjs/vexflow-font-bravura.js.map +1 -1
  12. package/build/cjs/vexflow-font-gonville.js +1 -1
  13. package/build/cjs/vexflow-font-gonville.js.map +1 -1
  14. package/build/cjs/vexflow-font-petaluma.js +1 -1
  15. package/build/cjs/vexflow-font-petaluma.js.map +1 -1
  16. package/build/cjs/vexflow-gonville.js +2 -2
  17. package/build/cjs/vexflow-gonville.js.map +1 -1
  18. package/build/cjs/vexflow-petaluma.js +2 -2
  19. package/build/cjs/vexflow-petaluma.js.map +1 -1
  20. package/build/cjs/vexflow.js +2 -2
  21. package/build/cjs/vexflow.js.map +1 -1
  22. package/build/esm/src/annotation.js +1 -1
  23. package/build/esm/src/chordsymbol.js +33 -9
  24. package/build/esm/src/element.js +10 -0
  25. package/build/esm/src/factory.js +20 -2
  26. package/build/esm/src/flow.js +6 -0
  27. package/build/esm/src/fonts/bravura_metrics.js +12 -12
  28. package/build/esm/src/fonts/gonville_metrics.js +8 -8
  29. package/build/esm/src/fonts/petaluma_metrics.js +8 -8
  30. package/build/esm/src/formatter.js +1 -1
  31. package/build/esm/src/gracenotegroup.js +3 -2
  32. package/build/esm/src/ornament.js +6 -2
  33. package/build/esm/src/stavenote.js +34 -9
  34. package/build/esm/src/stemmablenote.js +1 -0
  35. package/build/esm/src/stringnumber.js +12 -5
  36. package/build/esm/src/tables.js +1 -0
  37. package/build/esm/src/version.js +3 -3
  38. package/build/esm/src/voice.js +4 -2
  39. package/build/esm/tests/chordsymbol_tests.js +91 -9
  40. package/build/esm/tests/ornament_tests.js +98 -94
  41. package/build/esm/tests/stavenote_tests.js +36 -0
  42. package/build/esm/tests/stringnumber_tests.js +28 -23
  43. package/build/types/src/chordsymbol.d.ts +1 -0
  44. package/build/types/src/element.d.ts +4 -1
  45. package/build/types/src/factory.d.ts +8 -4
  46. package/build/types/src/flow.d.ts +2 -0
  47. package/build/types/src/ornament.d.ts +1 -0
  48. package/build/types/src/stringnumber.d.ts +3 -1
  49. package/build/types/src/tables.d.ts +1 -0
  50. package/build/types/src/voice.d.ts +1 -3
  51. package/package.json +1 -1
  52. package/src/annotation.ts +1 -1
  53. package/src/chordsymbol.ts +35 -10
  54. package/src/element.ts +13 -1
  55. package/src/factory.ts +30 -3
  56. package/src/flow.ts +8 -0
  57. package/src/fonts/bravura_metrics.ts +12 -12
  58. package/src/fonts/gonville_metrics.ts +8 -8
  59. package/src/fonts/petaluma_metrics.ts +8 -8
  60. package/src/formatter.ts +1 -1
  61. package/src/gracenotegroup.ts +5 -2
  62. package/src/ornament.ts +6 -2
  63. package/src/stavenote.ts +36 -8
  64. package/src/stemmablenote.ts +1 -0
  65. package/src/stringnumber.ts +15 -6
  66. package/src/tables.ts +1 -0
  67. package/src/voice.ts +2 -3
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * VexFlow 4.0.2 2022-04-28T00:14:05.094Z a968cfa5453a34ff0f8bb8bc882d08ef44f62cea
2
+ * VexFlow 4.0.3 2022-05-16T23:29:47.258Z 1874642be3f8ba11bf7b39ca94d9a36b32a6e8c0
3
3
  * Copyright (c) 2010 Mohit Muthanna Cheppudira <mohit@muthanna.com>
4
4
  * https://www.vexflow.com https://github.com/0xfe/vexflow
5
5
  */
@@ -29,9 +29,9 @@ __webpack_require__.r(__webpack_exports__);
29
29
  /* harmony export */ "ID": () => (/* binding */ ID),
30
30
  /* harmony export */ "DATE": () => (/* binding */ DATE)
31
31
  /* harmony export */ });
32
- const VERSION = '4.0.2';
33
- const ID = 'a968cfa5453a34ff0f8bb8bc882d08ef44f62cea';
34
- const DATE = '2022-04-28T00:14:05.094Z';
32
+ const VERSION = '4.0.3';
33
+ const ID = '1874642be3f8ba11bf7b39ca94d9a36b32a6e8c0';
34
+ const DATE = '2022-05-16T23:29:47.258Z';
35
35
 
36
36
 
37
37
  /***/ }),
@@ -637,7 +637,7 @@ class Annotation extends _modifier__WEBPACK_IMPORTED_MODULE_1__.Modifier {
637
637
  leftWidth = Math.max(leftWidth, textWidth) + Annotation.minAnnotationPadding;
638
638
  }
639
639
  else if (annotation.horizontalJustification === AnnotationHorizontalJustify.RIGHT) {
640
- maxRightGlyphWidth = Math.max(glyphWidth, maxLeftGlyphWidth);
640
+ maxRightGlyphWidth = Math.max(glyphWidth, maxRightGlyphWidth);
641
641
  rightWidth = Math.max(rightWidth, textWidth);
642
642
  }
643
643
  else {
@@ -3045,6 +3045,10 @@ class ChordSymbol extends _modifier__WEBPACK_IMPORTED_MODULE_2__.Modifier {
3045
3045
  static isSubscript(block) {
3046
3046
  return block.symbolModifier !== undefined && block.symbolModifier === SymbolModifiers.SUBSCRIPT;
3047
3047
  }
3048
+ static get minPadding() {
3049
+ const musicFont = _tables__WEBPACK_IMPORTED_MODULE_3__.Tables.currentMusicFont();
3050
+ return musicFont.lookupMetric('glyphs.noteHead.minPadding');
3051
+ }
3048
3052
  /**
3049
3053
  * Estimate the width of the whole chord symbol, based on the sum of the widths of the individual blocks.
3050
3054
  * Estimate how many lines above/below the staff we need.
@@ -3055,11 +3059,16 @@ class ChordSymbol extends _modifier__WEBPACK_IMPORTED_MODULE_2__.Modifier {
3055
3059
  return false;
3056
3060
  let width = 0;
3057
3061
  let nonSuperWidth = 0;
3058
- const reportedWidths = [];
3062
+ let leftWidth = 0;
3063
+ let rightWidth = 0;
3064
+ let maxLeftGlyphWidth = 0;
3065
+ let maxRightGlyphWidth = 0;
3059
3066
  for (const symbol of symbols) {
3060
3067
  const fontSize = _font__WEBPACK_IMPORTED_MODULE_0__.Font.convertSizeToPointValue((_a = symbol.textFont) === null || _a === void 0 ? void 0 : _a.size);
3061
3068
  const fontAdj = _font__WEBPACK_IMPORTED_MODULE_0__.Font.scaleSize(fontSize, 0.05);
3062
3069
  const glyphAdj = fontAdj * 2;
3070
+ const note = symbol.checkAttachedNote();
3071
+ let symbolWidth = 0;
3063
3072
  let lineSpaces = 1;
3064
3073
  let vAlign = false;
3065
3074
  for (let j = 0; j < symbol.symbolBlocks.length; ++j) {
@@ -3115,6 +3124,7 @@ class ChordSymbol extends _modifier__WEBPACK_IMPORTED_MODULE_2__.Modifier {
3115
3124
  }
3116
3125
  block.vAlign = vAlign;
3117
3126
  width += block.width;
3127
+ symbolWidth = width;
3118
3128
  }
3119
3129
  // make kerning adjustments after computing super/subscripts
3120
3130
  symbol.updateKerningAdjustments();
@@ -3127,16 +3137,29 @@ class ChordSymbol extends _modifier__WEBPACK_IMPORTED_MODULE_2__.Modifier {
3127
3137
  symbol.setTextLine(state.text_line + 1);
3128
3138
  state.text_line += lineSpaces + 1;
3129
3139
  }
3130
- if (symbol.getReportWidth()) {
3131
- reportedWidths.push(width);
3132
- }
3133
- else {
3134
- reportedWidths.push(0);
3140
+ if (symbol.getReportWidth() && (0,_typeguard__WEBPACK_IMPORTED_MODULE_5__.isStemmableNote)(note)) {
3141
+ const glyphWidth = note.getGlyph().getWidth();
3142
+ if (symbol.getHorizontal() === ChordSymbolHorizontalJustify.LEFT) {
3143
+ maxLeftGlyphWidth = Math.max(glyphWidth, maxLeftGlyphWidth);
3144
+ leftWidth = Math.max(leftWidth, symbolWidth) + ChordSymbol.minPadding;
3145
+ }
3146
+ else if (symbol.getHorizontal() === ChordSymbolHorizontalJustify.RIGHT) {
3147
+ maxRightGlyphWidth = Math.max(glyphWidth, maxRightGlyphWidth);
3148
+ rightWidth = Math.max(rightWidth, symbolWidth);
3149
+ }
3150
+ else {
3151
+ leftWidth = Math.max(leftWidth, symbolWidth / 2) + ChordSymbol.minPadding;
3152
+ rightWidth = Math.max(rightWidth, symbolWidth / 2);
3153
+ maxLeftGlyphWidth = Math.max(glyphWidth / 2, maxLeftGlyphWidth);
3154
+ maxRightGlyphWidth = Math.max(glyphWidth / 2, maxRightGlyphWidth);
3155
+ }
3135
3156
  }
3157
+ width = 0; // reset symbol width
3136
3158
  }
3137
- width = reportedWidths.reduce((a, b) => a + b, 0);
3138
- state.left_shift += width / 2;
3139
- state.right_shift += width / 2;
3159
+ const rightOverlap = Math.min(Math.max(rightWidth - maxRightGlyphWidth, 0), Math.max(rightWidth - state.right_shift, 0));
3160
+ const leftOverlap = Math.min(Math.max(leftWidth - maxLeftGlyphWidth, 0), Math.max(leftWidth - state.left_shift, 0));
3161
+ state.left_shift += leftOverlap;
3162
+ state.right_shift += rightOverlap;
3140
3163
  return true;
3141
3164
  }
3142
3165
  /**
@@ -4803,6 +4826,7 @@ __webpack_require__.r(__webpack_exports__);
4803
4826
  class Element {
4804
4827
  constructor() {
4805
4828
  var _a;
4829
+ this.children = [];
4806
4830
  this.attrs = {
4807
4831
  id: Element.newID(),
4808
4832
  el: undefined,
@@ -4819,7 +4843,10 @@ class Element {
4819
4843
  static newID() {
4820
4844
  return `auto${Element.ID++}`;
4821
4845
  }
4822
- /** Get element category string. */
4846
+ addChildElement(child) {
4847
+ this.children.push(child);
4848
+ return this;
4849
+ }
4823
4850
  getCategory() {
4824
4851
  return this.constructor.CATEGORY;
4825
4852
  }
@@ -4849,6 +4876,12 @@ class Element {
4849
4876
  this.style = style;
4850
4877
  return this;
4851
4878
  }
4879
+ /** Set the element & associated children style used for rendering. */
4880
+ setGroupStyle(style) {
4881
+ this.style = style;
4882
+ this.children.forEach((child) => child.setGroupStyle(style));
4883
+ return this;
4884
+ }
4852
4885
  /** Get the element style used for rendering. */
4853
4886
  getStyle() {
4854
4887
  return this.style;
@@ -5158,28 +5191,29 @@ __webpack_require__.r(__webpack_exports__);
5158
5191
  /* harmony import */ var _modifiercontext__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./modifiercontext */ "./src/modifiercontext.ts");
5159
5192
  /* harmony import */ var _multimeasurerest__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./multimeasurerest */ "./src/multimeasurerest.ts");
5160
5193
  /* harmony import */ var _notesubgroup__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./notesubgroup */ "./src/notesubgroup.ts");
5161
- /* harmony import */ var _pedalmarking__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./pedalmarking */ "./src/pedalmarking.ts");
5162
- /* harmony import */ var _renderer__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./renderer */ "./src/renderer.ts");
5163
- /* harmony import */ var _repeatnote__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./repeatnote */ "./src/repeatnote.ts");
5164
- /* harmony import */ var _stave__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./stave */ "./src/stave.ts");
5165
- /* harmony import */ var _staveconnector__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./staveconnector */ "./src/staveconnector.ts");
5166
- /* harmony import */ var _staveline__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./staveline */ "./src/staveline.ts");
5167
- /* harmony import */ var _stavenote__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./stavenote */ "./src/stavenote.ts");
5168
- /* harmony import */ var _stavetie__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./stavetie */ "./src/stavetie.ts");
5169
- /* harmony import */ var _stringnumber__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./stringnumber */ "./src/stringnumber.ts");
5170
- /* harmony import */ var _system__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./system */ "./src/system.ts");
5171
- /* harmony import */ var _tabnote__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./tabnote */ "./src/tabnote.ts");
5172
- /* harmony import */ var _tabstave__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./tabstave */ "./src/tabstave.ts");
5173
- /* harmony import */ var _textbracket__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./textbracket */ "./src/textbracket.ts");
5174
- /* harmony import */ var _textdynamics__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./textdynamics */ "./src/textdynamics.ts");
5175
- /* harmony import */ var _textnote__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./textnote */ "./src/textnote.ts");
5176
- /* harmony import */ var _tickcontext__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./tickcontext */ "./src/tickcontext.ts");
5177
- /* harmony import */ var _timesignote__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./timesignote */ "./src/timesignote.ts");
5178
- /* harmony import */ var _tuplet__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./tuplet */ "./src/tuplet.ts");
5179
- /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./util */ "./src/util.ts");
5180
- /* harmony import */ var _vibratobracket__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./vibratobracket */ "./src/vibratobracket.ts");
5181
- /* harmony import */ var _voice__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./voice */ "./src/voice.ts");
5182
- /* harmony import */ var _web__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./web */ "./src/web.ts");
5194
+ /* harmony import */ var _ornament__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./ornament */ "./src/ornament.ts");
5195
+ /* harmony import */ var _pedalmarking__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./pedalmarking */ "./src/pedalmarking.ts");
5196
+ /* harmony import */ var _renderer__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./renderer */ "./src/renderer.ts");
5197
+ /* harmony import */ var _repeatnote__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./repeatnote */ "./src/repeatnote.ts");
5198
+ /* harmony import */ var _stave__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./stave */ "./src/stave.ts");
5199
+ /* harmony import */ var _staveconnector__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./staveconnector */ "./src/staveconnector.ts");
5200
+ /* harmony import */ var _staveline__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./staveline */ "./src/staveline.ts");
5201
+ /* harmony import */ var _stavenote__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./stavenote */ "./src/stavenote.ts");
5202
+ /* harmony import */ var _stavetie__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./stavetie */ "./src/stavetie.ts");
5203
+ /* harmony import */ var _stringnumber__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./stringnumber */ "./src/stringnumber.ts");
5204
+ /* harmony import */ var _system__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./system */ "./src/system.ts");
5205
+ /* harmony import */ var _tabnote__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./tabnote */ "./src/tabnote.ts");
5206
+ /* harmony import */ var _tabstave__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./tabstave */ "./src/tabstave.ts");
5207
+ /* harmony import */ var _textbracket__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./textbracket */ "./src/textbracket.ts");
5208
+ /* harmony import */ var _textdynamics__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./textdynamics */ "./src/textdynamics.ts");
5209
+ /* harmony import */ var _textnote__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./textnote */ "./src/textnote.ts");
5210
+ /* harmony import */ var _tickcontext__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./tickcontext */ "./src/tickcontext.ts");
5211
+ /* harmony import */ var _timesignote__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./timesignote */ "./src/timesignote.ts");
5212
+ /* harmony import */ var _tuplet__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./tuplet */ "./src/tuplet.ts");
5213
+ /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./util */ "./src/util.ts");
5214
+ /* harmony import */ var _vibratobracket__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./vibratobracket */ "./src/vibratobracket.ts");
5215
+ /* harmony import */ var _voice__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./voice */ "./src/voice.ts");
5216
+ /* harmony import */ var _web__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ./web */ "./src/web.ts");
5183
5217
  // [VexFlow](https://vexflow.com) - Copyright (c) Mohit Muthanna 2010.
5184
5218
  // @author Mohit Cheppudira
5185
5219
  // MIT License
@@ -5223,12 +5257,13 @@ __webpack_require__.r(__webpack_exports__);
5223
5257
 
5224
5258
 
5225
5259
 
5260
+
5226
5261
 
5227
5262
 
5228
5263
  // eslint-disable-next-line
5229
5264
  function L(...args) {
5230
5265
  if (Factory.DEBUG)
5231
- (0,_util__WEBPACK_IMPORTED_MODULE_38__.log)('Vex.Flow.Factory', args);
5266
+ (0,_util__WEBPACK_IMPORTED_MODULE_39__.log)('Vex.Flow.Factory', args);
5232
5267
  }
5233
5268
  /**
5234
5269
  * Factory implements a high level API around VexFlow.
@@ -5288,7 +5323,7 @@ class Factory {
5288
5323
  }
5289
5324
  if (elementId == '') {
5290
5325
  L(this);
5291
- throw new _util__WEBPACK_IMPORTED_MODULE_38__.RuntimeError('renderer.elementId not set in FactoryOptions');
5326
+ throw new _util__WEBPACK_IMPORTED_MODULE_39__.RuntimeError('renderer.elementId not set in FactoryOptions');
5292
5327
  }
5293
5328
  let backend = this.options.renderer.backend;
5294
5329
  if (backend === undefined) {
@@ -5297,14 +5332,14 @@ class Factory {
5297
5332
  // but is not an instance of window.HTMLCanvasElement.
5298
5333
  // In fact, `window` might be undefined here.
5299
5334
  // See: https://www.npmjs.com/package/canvas
5300
- if ((0,_web__WEBPACK_IMPORTED_MODULE_41__.isHTMLCanvas)(elem)) {
5301
- backend = _renderer__WEBPACK_IMPORTED_MODULE_21__.Renderer.Backends.CANVAS;
5335
+ if ((0,_web__WEBPACK_IMPORTED_MODULE_42__.isHTMLCanvas)(elem)) {
5336
+ backend = _renderer__WEBPACK_IMPORTED_MODULE_22__.Renderer.Backends.CANVAS;
5302
5337
  }
5303
5338
  else {
5304
- backend = _renderer__WEBPACK_IMPORTED_MODULE_21__.Renderer.Backends.SVG;
5339
+ backend = _renderer__WEBPACK_IMPORTED_MODULE_22__.Renderer.Backends.SVG;
5305
5340
  }
5306
5341
  }
5307
- this.context = _renderer__WEBPACK_IMPORTED_MODULE_21__.Renderer.buildContext(elementId, backend, width, height, background);
5342
+ this.context = _renderer__WEBPACK_IMPORTED_MODULE_22__.Renderer.buildContext(elementId, backend, width, height, background);
5308
5343
  }
5309
5344
  getContext() {
5310
5345
  return this.context;
@@ -5323,7 +5358,7 @@ class Factory {
5323
5358
  Stave(params) {
5324
5359
  const staveSpace = this.options.stave.space;
5325
5360
  const p = Object.assign({ x: 0, y: 0, width: this.options.renderer.width - staveSpace * 1.0, options: { spacing_between_lines_px: staveSpace * 1.0 } }, params);
5326
- const stave = new _stave__WEBPACK_IMPORTED_MODULE_23__.Stave(p.x, p.y, p.width, p.options);
5361
+ const stave = new _stave__WEBPACK_IMPORTED_MODULE_24__.Stave(p.x, p.y, p.width, p.options);
5327
5362
  this.staves.push(stave);
5328
5363
  stave.setContext(this.context);
5329
5364
  this.stave = stave;
@@ -5332,14 +5367,14 @@ class Factory {
5332
5367
  TabStave(params) {
5333
5368
  const staveSpace = this.options.stave.space;
5334
5369
  const p = Object.assign({ x: 0, y: 0, width: this.options.renderer.width - staveSpace * 1.0, options: { spacing_between_lines_px: staveSpace * 1.3 } }, params);
5335
- const stave = new _tabstave__WEBPACK_IMPORTED_MODULE_31__.TabStave(p.x, p.y, p.width, p.options);
5370
+ const stave = new _tabstave__WEBPACK_IMPORTED_MODULE_32__.TabStave(p.x, p.y, p.width, p.options);
5336
5371
  this.staves.push(stave);
5337
5372
  stave.setContext(this.context);
5338
5373
  this.stave = stave;
5339
5374
  return stave;
5340
5375
  }
5341
5376
  StaveNote(noteStruct) {
5342
- const note = new _stavenote__WEBPACK_IMPORTED_MODULE_26__.StaveNote(noteStruct);
5377
+ const note = new _stavenote__WEBPACK_IMPORTED_MODULE_27__.StaveNote(noteStruct);
5343
5378
  if (this.stave)
5344
5379
  note.setStave(this.stave);
5345
5380
  note.setContext(this.context);
@@ -5355,7 +5390,7 @@ class Factory {
5355
5390
  return note;
5356
5391
  }
5357
5392
  RepeatNote(type, noteStruct, options) {
5358
- const note = new _repeatnote__WEBPACK_IMPORTED_MODULE_22__.RepeatNote(type, noteStruct, options);
5393
+ const note = new _repeatnote__WEBPACK_IMPORTED_MODULE_23__.RepeatNote(type, noteStruct, options);
5359
5394
  if (this.stave)
5360
5395
  note.setStave(this.stave);
5361
5396
  note.setContext(this.context);
@@ -5371,7 +5406,7 @@ class Factory {
5371
5406
  return ghostNote;
5372
5407
  }
5373
5408
  TextNote(noteStruct) {
5374
- const textNote = new _textnote__WEBPACK_IMPORTED_MODULE_34__.TextNote(noteStruct);
5409
+ const textNote = new _textnote__WEBPACK_IMPORTED_MODULE_35__.TextNote(noteStruct);
5375
5410
  if (this.stave)
5376
5411
  textNote.setStave(this.stave);
5377
5412
  textNote.setContext(this.context);
@@ -5400,7 +5435,7 @@ class Factory {
5400
5435
  }
5401
5436
  TimeSigNote(params) {
5402
5437
  const p = Object.assign({ time: '4/4' }, params);
5403
- const timeSigNote = new _timesignote__WEBPACK_IMPORTED_MODULE_36__.TimeSigNote(p.time);
5438
+ const timeSigNote = new _timesignote__WEBPACK_IMPORTED_MODULE_37__.TimeSigNote(p.time);
5404
5439
  if (this.stave)
5405
5440
  timeSigNote.setStave(this.stave);
5406
5441
  timeSigNote.setContext(this.context);
@@ -5416,7 +5451,7 @@ class Factory {
5416
5451
  return keySigNote;
5417
5452
  }
5418
5453
  TabNote(noteStruct) {
5419
- const note = new _tabnote__WEBPACK_IMPORTED_MODULE_30__.TabNote(noteStruct);
5454
+ const note = new _tabnote__WEBPACK_IMPORTED_MODULE_31__.TabNote(noteStruct);
5420
5455
  if (this.stave)
5421
5456
  note.setStave(this.stave);
5422
5457
  note.setContext(this.context);
@@ -5477,9 +5512,25 @@ class Factory {
5477
5512
  articulation.setContext(this.context);
5478
5513
  return articulation;
5479
5514
  }
5515
+ Ornament(type, params) {
5516
+ const options = Object.assign({ type, position: 0, accidental: '' }, params);
5517
+ const ornament = new _ornament__WEBPACK_IMPORTED_MODULE_20__.Ornament(type);
5518
+ ornament.setPosition(options.position);
5519
+ if (options.upperAccidental) {
5520
+ ornament.setUpperAccidental(options.upperAccidental);
5521
+ }
5522
+ if (options.lowerAccidental) {
5523
+ ornament.setLowerAccidental(options.lowerAccidental);
5524
+ }
5525
+ if (typeof options.delayed !== 'undefined') {
5526
+ ornament.setDelayed(options.delayed);
5527
+ }
5528
+ ornament.setContext(this.context);
5529
+ return ornament;
5530
+ }
5480
5531
  TextDynamics(params) {
5481
5532
  const p = Object.assign({ text: 'p', duration: 'q', dots: 0, line: 0 }, params);
5482
- const text = new _textdynamics__WEBPACK_IMPORTED_MODULE_33__.TextDynamics({
5533
+ const text = new _textdynamics__WEBPACK_IMPORTED_MODULE_34__.TextDynamics({
5483
5534
  text: p.text,
5484
5535
  line: p.line,
5485
5536
  duration: p.duration,
@@ -5498,20 +5549,21 @@ class Factory {
5498
5549
  fingering.setContext(this.context);
5499
5550
  return fingering;
5500
5551
  }
5501
- StringNumber(params) {
5502
- const stringNumber = new _stringnumber__WEBPACK_IMPORTED_MODULE_28__.StringNumber(params.number);
5552
+ StringNumber(params, drawCircle = true) {
5553
+ const stringNumber = new _stringnumber__WEBPACK_IMPORTED_MODULE_29__.StringNumber(params.number);
5503
5554
  stringNumber.setPosition(params.position);
5504
5555
  stringNumber.setContext(this.context);
5556
+ stringNumber.setDrawCircle(drawCircle);
5505
5557
  return stringNumber;
5506
5558
  }
5507
5559
  TickContext() {
5508
- return new _tickcontext__WEBPACK_IMPORTED_MODULE_35__.TickContext();
5560
+ return new _tickcontext__WEBPACK_IMPORTED_MODULE_36__.TickContext();
5509
5561
  }
5510
5562
  ModifierContext() {
5511
5563
  return new _modifiercontext__WEBPACK_IMPORTED_MODULE_17__.ModifierContext();
5512
5564
  }
5513
5565
  MultiMeasureRest(params) {
5514
- const numMeasures = (0,_util__WEBPACK_IMPORTED_MODULE_38__.defined)(params.number_of_measures, 'NoNumberOfMeasures');
5566
+ const numMeasures = (0,_util__WEBPACK_IMPORTED_MODULE_39__.defined)(params.number_of_measures, 'NoNumberOfMeasures');
5515
5567
  const multiMeasureRest = new _multimeasurerest__WEBPACK_IMPORTED_MODULE_18__.MultiMeasureRest(numMeasures, params);
5516
5568
  multiMeasureRest.setContext(this.context);
5517
5569
  this.renderQ.push(multiMeasureRest);
@@ -5519,12 +5571,12 @@ class Factory {
5519
5571
  }
5520
5572
  Voice(params) {
5521
5573
  const p = Object.assign({ time: '4/4' }, params);
5522
- const voice = new _voice__WEBPACK_IMPORTED_MODULE_40__.Voice(p.time, p.options);
5574
+ const voice = new _voice__WEBPACK_IMPORTED_MODULE_41__.Voice(p.time);
5523
5575
  this.voices.push(voice);
5524
5576
  return voice;
5525
5577
  }
5526
5578
  StaveConnector(params) {
5527
- const connector = new _staveconnector__WEBPACK_IMPORTED_MODULE_24__.StaveConnector(params.top_stave, params.bottom_stave);
5579
+ const connector = new _staveconnector__WEBPACK_IMPORTED_MODULE_25__.StaveConnector(params.top_stave, params.bottom_stave);
5528
5580
  connector.setType(params.type).setContext(this.context);
5529
5581
  this.renderQ.push(connector);
5530
5582
  return connector;
@@ -5534,7 +5586,7 @@ class Factory {
5534
5586
  }
5535
5587
  Tuplet(params) {
5536
5588
  const p = Object.assign({ notes: [], options: {} }, params);
5537
- const tuplet = new _tuplet__WEBPACK_IMPORTED_MODULE_37__.Tuplet(p.notes, p.options).setContext(this.context);
5589
+ const tuplet = new _tuplet__WEBPACK_IMPORTED_MODULE_38__.Tuplet(p.notes, p.options).setContext(this.context);
5538
5590
  this.renderQ.push(tuplet);
5539
5591
  return tuplet;
5540
5592
  }
@@ -5557,7 +5609,7 @@ class Factory {
5557
5609
  }
5558
5610
  StaveTie(params) {
5559
5611
  var _a;
5560
- const tie = new _stavetie__WEBPACK_IMPORTED_MODULE_27__.StaveTie({
5612
+ const tie = new _stavetie__WEBPACK_IMPORTED_MODULE_28__.StaveTie({
5561
5613
  first_note: params.from,
5562
5614
  last_note: params.to,
5563
5615
  first_indices: params.first_indices,
@@ -5571,7 +5623,7 @@ class Factory {
5571
5623
  }
5572
5624
  StaveLine(params) {
5573
5625
  var _a, _b;
5574
- const line = new _staveline__WEBPACK_IMPORTED_MODULE_25__.StaveLine({
5626
+ const line = new _staveline__WEBPACK_IMPORTED_MODULE_26__.StaveLine({
5575
5627
  first_note: params.from,
5576
5628
  last_note: params.to,
5577
5629
  first_indices: params.first_indices,
@@ -5586,7 +5638,7 @@ class Factory {
5586
5638
  return line;
5587
5639
  }
5588
5640
  VibratoBracket(params) {
5589
- const vibratoBracket = new _vibratobracket__WEBPACK_IMPORTED_MODULE_39__.VibratoBracket({
5641
+ const vibratoBracket = new _vibratobracket__WEBPACK_IMPORTED_MODULE_40__.VibratoBracket({
5590
5642
  start: params.from,
5591
5643
  stop: params.to,
5592
5644
  });
@@ -5599,7 +5651,7 @@ class Factory {
5599
5651
  return vibratoBracket;
5600
5652
  }
5601
5653
  TextBracket(params) {
5602
- const textBracket = new _textbracket__WEBPACK_IMPORTED_MODULE_32__.TextBracket({
5654
+ const textBracket = new _textbracket__WEBPACK_IMPORTED_MODULE_33__.TextBracket({
5603
5655
  start: params.from,
5604
5656
  stop: params.to,
5605
5657
  text: params.text,
@@ -5616,7 +5668,7 @@ class Factory {
5616
5668
  }
5617
5669
  System(params = {}) {
5618
5670
  params.factory = this;
5619
- const system = new _system__WEBPACK_IMPORTED_MODULE_29__.System(params).setContext(this.context);
5671
+ const system = new _system__WEBPACK_IMPORTED_MODULE_30__.System(params).setContext(this.context);
5620
5672
  this.systems.push(system);
5621
5673
  return system;
5622
5674
  }
@@ -5639,8 +5691,8 @@ class Factory {
5639
5691
  const p = Object.assign({ notes: [], options: {
5640
5692
  style: 'mixed',
5641
5693
  } }, params);
5642
- const pedal = new _pedalmarking__WEBPACK_IMPORTED_MODULE_20__.PedalMarking(p.notes);
5643
- pedal.setType(_pedalmarking__WEBPACK_IMPORTED_MODULE_20__.PedalMarking.typeString[p.options.style]);
5694
+ const pedal = new _pedalmarking__WEBPACK_IMPORTED_MODULE_21__.PedalMarking(p.notes);
5695
+ pedal.setType(_pedalmarking__WEBPACK_IMPORTED_MODULE_21__.PedalMarking.typeString[p.options.style]);
5644
5696
  pedal.setContext(this.context);
5645
5697
  this.renderQ.push(pedal);
5646
5698
  return pedal;
@@ -5915,6 +5967,12 @@ class Flow {
5915
5967
  const fonts = _tables__WEBPACK_IMPORTED_MODULE_63__.Tables.MUSIC_FONT_STACK;
5916
5968
  return fonts.map((font) => font.getName());
5917
5969
  }
5970
+ static get SOFTMAX_FACTOR() {
5971
+ return _tables__WEBPACK_IMPORTED_MODULE_63__.Tables.SOFTMAX_FACTOR;
5972
+ }
5973
+ static set SOFTMAX_FACTOR(factor) {
5974
+ _tables__WEBPACK_IMPORTED_MODULE_63__.Tables.SOFTMAX_FACTOR = factor;
5975
+ }
5918
5976
  static get NOTATION_FONT_SCALE() {
5919
5977
  return _tables__WEBPACK_IMPORTED_MODULE_63__.Tables.NOTATION_FONT_SCALE;
5920
5978
  }
@@ -10206,21 +10264,21 @@ const BravuraMetrics = {
10206
10264
  xOffset: -12,
10207
10265
  yOffset: 0,
10208
10266
  stemUpYOffset: 0,
10209
- reportedWidth: 10,
10267
+ reportedWidth: 20,
10210
10268
  },
10211
10269
  brassDoitMedium: {
10212
10270
  scale: 1.0,
10213
10271
  xOffset: 16,
10214
10272
  yOffset: 0,
10215
10273
  stemUpYOffset: 0,
10216
- reportedWidth: 15,
10274
+ reportedWidth: 22,
10217
10275
  },
10218
10276
  brassFallLipShort: {
10219
10277
  scale: 1.0,
10220
10278
  xOffset: 16,
10221
10279
  yOffset: 0,
10222
10280
  stemUpYOffset: 0,
10223
- reportedWidth: 5,
10281
+ reportedWidth: 15,
10224
10282
  },
10225
10283
  brassLiftMedium: {
10226
10284
  scale: 1.0,
@@ -10260,22 +10318,22 @@ const BravuraMetrics = {
10260
10318
  brassFlip: {
10261
10319
  scale: 1.0,
10262
10320
  xOffset: 10,
10263
- yOffset: -4,
10264
- stemUpYOffset: 0,
10265
- reportedWidth: 5,
10321
+ yOffset: 0,
10322
+ stemUpYOffset: 7,
10323
+ reportedWidth: 10,
10266
10324
  },
10267
10325
  brassJazzTurn: {
10268
10326
  scale: 1.0,
10269
- xOffset: 6,
10270
- yOffset: -4,
10271
- stemUpYOffset: 0,
10272
- reportedWidth: 5,
10327
+ xOffset: 0,
10328
+ yOffset: 0,
10329
+ stemUpYOffset: 8,
10330
+ reportedWidth: 31,
10273
10331
  },
10274
10332
  brassSmear: {
10275
10333
  scale: 1.0,
10276
10334
  xOffset: 10,
10277
- yOffset: -4,
10278
- stemUpYOffset: 0,
10335
+ yOffset: 0,
10336
+ stemUpYOffset: 8,
10279
10337
  reportedWidth: 5,
10280
10338
  },
10281
10339
  },
@@ -11598,21 +11656,21 @@ const GonvilleMetrics = {
11598
11656
  xOffset: -12,
11599
11657
  yOffset: 0,
11600
11658
  stemUpYOffset: 0,
11601
- reportedWidth: 10,
11659
+ reportedWidth: 15,
11602
11660
  },
11603
11661
  brassDoitMedium: {
11604
11662
  scale: 1.0,
11605
11663
  xOffset: 16,
11606
11664
  yOffset: 0,
11607
11665
  stemUpYOffset: 0,
11608
- reportedWidth: 5,
11666
+ reportedWidth: 22,
11609
11667
  },
11610
11668
  brassFallLipShort: {
11611
11669
  scale: 1.0,
11612
11670
  xOffset: 17,
11613
11671
  yOffset: 0,
11614
11672
  stemUpYOffset: 0,
11615
- reportedWidth: 5,
11673
+ reportedWidth: 15,
11616
11674
  },
11617
11675
  brassLiftMedium: {
11618
11676
  scale: 1.0,
@@ -11653,21 +11711,21 @@ const GonvilleMetrics = {
11653
11711
  scale: 1.0,
11654
11712
  xOffset: 10,
11655
11713
  yOffset: -4,
11656
- stemUpYOffset: 0,
11714
+ stemUpYOffset: 7,
11657
11715
  reportedWidth: 5,
11658
11716
  },
11659
11717
  brassJazzTurn: {
11660
11718
  scale: 1.0,
11661
- xOffset: 6,
11719
+ xOffset: 3,
11662
11720
  yOffset: -4,
11663
- stemUpYOffset: 0,
11664
- reportedWidth: 5,
11721
+ stemUpYOffset: 10,
11722
+ reportedWidth: 28,
11665
11723
  },
11666
11724
  brassSmear: {
11667
11725
  scale: 1.0,
11668
11726
  xOffset: 10,
11669
11727
  yOffset: -4,
11670
- stemUpYOffset: 0,
11728
+ stemUpYOffset: 9,
11671
11729
  reportedWidth: 5,
11672
11730
  },
11673
11731
  },
@@ -13669,28 +13727,28 @@ const PetalumaMetrics = {
13669
13727
  xOffset: -12,
13670
13728
  yOffset: 0,
13671
13729
  stemUpYOffset: 0,
13672
- reportedWidth: 10,
13730
+ reportedWidth: 15,
13673
13731
  },
13674
13732
  brassDoitMedium: {
13675
13733
  scale: 1.0,
13676
13734
  xOffset: 16,
13677
13735
  yOffset: 0,
13678
13736
  stemUpYOffset: 0,
13679
- reportedWidth: 5,
13737
+ reportedWidth: 19,
13680
13738
  },
13681
13739
  brassFallLipShort: {
13682
13740
  scale: 1.0,
13683
13741
  xOffset: 16,
13684
13742
  yOffset: 0,
13685
13743
  stemUpYOffset: 0,
13686
- reportedWidth: 5,
13744
+ reportedWidth: 19,
13687
13745
  },
13688
13746
  brassLiftMedium: {
13689
13747
  scale: 1.0,
13690
13748
  xOffset: 16,
13691
13749
  yOffset: 5,
13692
13750
  stemUpYOffset: 0,
13693
- reportedWidth: 5,
13751
+ reportedWidth: 15,
13694
13752
  },
13695
13753
  brassFallRoughMedium: {
13696
13754
  scale: 1.0,
@@ -13724,21 +13782,21 @@ const PetalumaMetrics = {
13724
13782
  scale: 1.0,
13725
13783
  xOffset: 10,
13726
13784
  yOffset: -4,
13727
- stemUpYOffset: 0,
13785
+ stemUpYOffset: 7,
13728
13786
  reportedWidth: 5,
13729
13787
  },
13730
13788
  brassJazzTurn: {
13731
13789
  scale: 1.0,
13732
13790
  xOffset: 6,
13733
13791
  yOffset: -4,
13734
- stemUpYOffset: 0,
13735
- reportedWidth: 5,
13792
+ stemUpYOffset: 5,
13793
+ reportedWidth: 30,
13736
13794
  },
13737
13795
  brassSmear: {
13738
13796
  scale: 1.0,
13739
13797
  xOffset: 10,
13740
13798
  yOffset: -4,
13741
- stemUpYOffset: 0,
13799
+ stemUpYOffset: 5,
13742
13800
  reportedWidth: 5,
13743
13801
  },
13744
13802
  },
@@ -15702,7 +15760,7 @@ function getRestLineForNextNoteGroup(notes, currRestLine, currNoteIndex, compare
15702
15760
  */
15703
15761
  class Formatter {
15704
15762
  constructor(options) {
15705
- this.formatterOptions = Object.assign({ globalSoftmax: false, softmaxFactor: 100, maxIterations: 5 }, options);
15763
+ this.formatterOptions = Object.assign({ globalSoftmax: false, softmaxFactor: _tables__WEBPACK_IMPORTED_MODULE_6__.Tables.SOFTMAX_FACTOR, maxIterations: 5 }, options);
15706
15764
  this.justifyWidth = 0;
15707
15765
  this.totalCost = 0;
15708
15766
  this.totalShift = 0;
@@ -17569,12 +17627,13 @@ __webpack_require__.r(__webpack_exports__);
17569
17627
  /* harmony import */ var _beam__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./beam */ "./src/beam.ts");
17570
17628
  /* harmony import */ var _formatter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./formatter */ "./src/formatter.ts");
17571
17629
  /* harmony import */ var _modifier__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./modifier */ "./src/modifier.ts");
17572
- /* harmony import */ var _stavetie__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./stavetie */ "./src/stavetie.ts");
17573
- /* harmony import */ var _tables__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./tables */ "./src/tables.ts");
17574
- /* harmony import */ var _tabtie__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./tabtie */ "./src/tabtie.ts");
17575
- /* harmony import */ var _typeguard__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./typeguard */ "./src/typeguard.ts");
17576
- /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./util */ "./src/util.ts");
17577
- /* harmony import */ var _voice__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./voice */ "./src/voice.ts");
17630
+ /* harmony import */ var _stavenote__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./stavenote */ "./src/stavenote.ts");
17631
+ /* harmony import */ var _stavetie__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./stavetie */ "./src/stavetie.ts");
17632
+ /* harmony import */ var _tables__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./tables */ "./src/tables.ts");
17633
+ /* harmony import */ var _tabtie__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./tabtie */ "./src/tabtie.ts");
17634
+ /* harmony import */ var _typeguard__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./typeguard */ "./src/typeguard.ts");
17635
+ /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./util */ "./src/util.ts");
17636
+ /* harmony import */ var _voice__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./voice */ "./src/voice.ts");
17578
17637
  // [VexFlow](https://vexflow.com) - Copyright (c) Mohit Muthanna 2010.
17579
17638
  //
17580
17639
  // ## Description
@@ -17590,11 +17649,12 @@ __webpack_require__.r(__webpack_exports__);
17590
17649
 
17591
17650
 
17592
17651
 
17652
+
17593
17653
  // To enable logging for this class. Set `GraceNoteGroup.DEBUG` to `true`.
17594
17654
  // eslint-disable-next-line
17595
17655
  function L(...args) {
17596
17656
  if (GraceNoteGroup.DEBUG)
17597
- (0,_util__WEBPACK_IMPORTED_MODULE_7__.log)('Vex.Flow.GraceNoteGroup', args);
17657
+ (0,_util__WEBPACK_IMPORTED_MODULE_8__.log)('Vex.Flow.GraceNoteGroup', args);
17598
17658
  }
17599
17659
  /** GraceNoteGroup is used to format and render grace notes. */
17600
17660
  class GraceNoteGroup extends _modifier__WEBPACK_IMPORTED_MODULE_2__.Modifier {
@@ -17607,10 +17667,10 @@ class GraceNoteGroup extends _modifier__WEBPACK_IMPORTED_MODULE_2__.Modifier {
17607
17667
  this.width = 0;
17608
17668
  this.show_slur = show_slur;
17609
17669
  this.slur = undefined;
17610
- this.voice = new _voice__WEBPACK_IMPORTED_MODULE_8__.Voice({
17670
+ this.voice = new _voice__WEBPACK_IMPORTED_MODULE_9__.Voice({
17611
17671
  num_beats: 4,
17612
17672
  beat_value: 4,
17613
- resolution: _tables__WEBPACK_IMPORTED_MODULE_4__.Tables.RESOLUTION,
17673
+ resolution: _tables__WEBPACK_IMPORTED_MODULE_5__.Tables.RESOLUTION,
17614
17674
  }).setStrict(false);
17615
17675
  this.render_options = {
17616
17676
  slur_y_shift: 0,
@@ -17620,7 +17680,7 @@ class GraceNoteGroup extends _modifier__WEBPACK_IMPORTED_MODULE_2__.Modifier {
17620
17680
  return this;
17621
17681
  }
17622
17682
  static get CATEGORY() {
17623
- return _typeguard__WEBPACK_IMPORTED_MODULE_6__.Category.GraceNoteGroup;
17683
+ return _typeguard__WEBPACK_IMPORTED_MODULE_7__.Category.GraceNoteGroup;
17624
17684
  }
17625
17685
  /** Arranges groups inside a `ModifierContext`. */
17626
17686
  static format(gracenote_groups, state) {
@@ -17634,7 +17694,7 @@ class GraceNoteGroup extends _modifier__WEBPACK_IMPORTED_MODULE_2__.Modifier {
17634
17694
  for (let i = 0; i < gracenote_groups.length; ++i) {
17635
17695
  const gracenote_group = gracenote_groups[i];
17636
17696
  const note = gracenote_group.getNote();
17637
- const is_stavenote = (0,_typeguard__WEBPACK_IMPORTED_MODULE_6__.isStaveNote)(note);
17697
+ const is_stavenote = (0,_typeguard__WEBPACK_IMPORTED_MODULE_7__.isStaveNote)(note);
17638
17698
  const spacing = is_stavenote ? group_spacing_stave : group_spacing_tab;
17639
17699
  if (is_stavenote && note !== prev_note) {
17640
17700
  // Iterate through all notes to get the displaced pixels
@@ -17657,7 +17717,7 @@ class GraceNoteGroup extends _modifier__WEBPACK_IMPORTED_MODULE_2__.Modifier {
17657
17717
  for (let i = 0; i < group_list.length; ++i) {
17658
17718
  const gracenote_group = group_list[i].gracenote_group;
17659
17719
  formatWidth = gracenote_group.getWidth() + group_list[i].spacing;
17660
- gracenote_group.setSpacingFromNextModifier(group_shift - Math.min(formatWidth, group_shift));
17720
+ gracenote_group.setSpacingFromNextModifier(group_shift - Math.min(formatWidth, group_shift) + _stavenote__WEBPACK_IMPORTED_MODULE_3__.StaveNote.minNoteheadPadding);
17661
17721
  }
17662
17722
  state.left_shift += group_shift;
17663
17723
  return true;
@@ -17687,7 +17747,7 @@ class GraceNoteGroup extends _modifier__WEBPACK_IMPORTED_MODULE_2__.Modifier {
17687
17747
  return this;
17688
17748
  }
17689
17749
  getWidth() {
17690
- return this.width;
17750
+ return this.width + _stavenote__WEBPACK_IMPORTED_MODULE_3__.StaveNote.minNoteheadPadding;
17691
17751
  }
17692
17752
  getGraceNotes() {
17693
17753
  return this.grace_notes;
@@ -17704,8 +17764,8 @@ class GraceNoteGroup extends _modifier__WEBPACK_IMPORTED_MODULE_2__.Modifier {
17704
17764
  this.beams.forEach((beam) => beam.setContext(ctx).draw());
17705
17765
  if (this.show_slur) {
17706
17766
  // Create and draw slur.
17707
- const is_stavenote = (0,_typeguard__WEBPACK_IMPORTED_MODULE_6__.isStaveNote)(note);
17708
- const TieClass = is_stavenote ? _stavetie__WEBPACK_IMPORTED_MODULE_3__.StaveTie : _tabtie__WEBPACK_IMPORTED_MODULE_5__.TabTie;
17767
+ const is_stavenote = (0,_typeguard__WEBPACK_IMPORTED_MODULE_7__.isStaveNote)(note);
17768
+ const TieClass = is_stavenote ? _stavetie__WEBPACK_IMPORTED_MODULE_4__.StaveTie : _tabtie__WEBPACK_IMPORTED_MODULE_6__.TabTie;
17709
17769
  this.slur = new TieClass({
17710
17770
  last_note: this.grace_notes[0],
17711
17771
  first_note: note,
@@ -20469,6 +20529,10 @@ class Ornament extends _modifier__WEBPACK_IMPORTED_MODULE_1__.Modifier {
20469
20529
  static get CATEGORY() {
20470
20530
  return _typeguard__WEBPACK_IMPORTED_MODULE_5__.Category.Ornament;
20471
20531
  }
20532
+ static get minPadding() {
20533
+ const musicFont = _tables__WEBPACK_IMPORTED_MODULE_3__.Tables.currentMusicFont();
20534
+ return musicFont.lookupMetric('glyphs.noteHead.minPadding');
20535
+ }
20472
20536
  /** Arrange ornaments inside `ModifierContext` */
20473
20537
  static format(ornaments, state) {
20474
20538
  if (!ornaments || ornaments.length === 0)
@@ -20489,8 +20553,8 @@ class Ornament extends _modifier__WEBPACK_IMPORTED_MODULE_1__.Modifier {
20489
20553
  if (ornament.reportedWidth && ornament.x_shift < 0) {
20490
20554
  left_shift += ornament.reportedWidth;
20491
20555
  }
20492
- else if (ornament.reportedWidth && ornament.x_shift > 0) {
20493
- right_shift += ornament.reportedWidth;
20556
+ else if (ornament.reportedWidth && ornament.x_shift >= 0) {
20557
+ right_shift += ornament.reportedWidth + Ornament.minPadding;
20494
20558
  }
20495
20559
  else {
20496
20560
  width = Math.max(ornament.getWidth(), width);
@@ -23544,10 +23608,43 @@ class StaveNote extends _stemmablenote__WEBPACK_IMPORTED_MODULE_4__.StemmableNot
23544
23608
  note: notes[i],
23545
23609
  });
23546
23610
  }
23547
- const voices = notesList.length;
23548
- let noteU = notesList[0];
23549
- const noteM = voices > 2 ? notesList[1] : undefined;
23550
- let noteL = voices > 2 ? notesList[2] : notesList[1];
23611
+ let voices = 0;
23612
+ let noteU = undefined;
23613
+ let noteM = undefined;
23614
+ let noteL = undefined;
23615
+ const draw = [false, false, false];
23616
+ for (let i = 0; i < notesList.length; i++) {
23617
+ draw[i] = notesList[i].note.render_options.draw == false ? false : true;
23618
+ }
23619
+ if (draw[0] && draw[1] && draw[2]) {
23620
+ // Three visible notes
23621
+ voices = 3;
23622
+ noteU = notesList[0];
23623
+ noteM = notesList[1];
23624
+ noteL = notesList[2];
23625
+ }
23626
+ else if (draw[0] && draw[1]) {
23627
+ // Two visible notes, 0 & 1
23628
+ voices = 2;
23629
+ noteU = notesList[0];
23630
+ noteL = notesList[1];
23631
+ }
23632
+ else if (draw[0] && draw[2]) {
23633
+ // Two visible notes, 0 & 2
23634
+ voices = 2;
23635
+ noteU = notesList[0];
23636
+ noteL = notesList[2];
23637
+ }
23638
+ else if (draw[1] && draw[2]) {
23639
+ // Two visible notes, 1 & 2
23640
+ voices = 2;
23641
+ noteU = notesList[1];
23642
+ noteL = notesList[2];
23643
+ }
23644
+ else {
23645
+ // No shift required for less than 2 visible notes
23646
+ return true;
23647
+ }
23551
23648
  // for two voice backward compatibility, ensure upper voice is stems up
23552
23649
  // for three voices, the voices must be in order (upper, middle, lower)
23553
23650
  if (voices === 2 && noteU.stemDirection === -1 && noteL.stemDirection === 1) {
@@ -23825,6 +23922,7 @@ class StaveNote extends _stemmablenote__WEBPACK_IMPORTED_MODULE_4__.StemmableNot
23825
23922
  stem_down_x_offset: noteProps.stem_down_x_offset,
23826
23923
  line: noteProps.line,
23827
23924
  });
23925
+ this.addChildElement(notehead);
23828
23926
  this._noteHeads[i] = notehead;
23829
23927
  }
23830
23928
  }
@@ -24085,11 +24183,7 @@ class StaveNote extends _stemmablenote__WEBPACK_IMPORTED_MODULE_4__.StemmableNot
24085
24183
  // Sets the style of the complete StaveNote, including all keys
24086
24184
  // and the stem.
24087
24185
  setStyle(style) {
24088
- super.setStyle(style);
24089
- this._noteHeads.forEach((notehead) => notehead.setStyle(style));
24090
- if (this.stem)
24091
- this.stem.setStyle(style);
24092
- return this;
24186
+ return super.setGroupStyle(style);
24093
24187
  }
24094
24188
  setStemStyle(style) {
24095
24189
  const stem = this.getStem();
@@ -25459,6 +25553,7 @@ class StemmableNote extends _note__WEBPACK_IMPORTED_MODULE_1__.Note {
25459
25553
  }
25460
25554
  setStem(stem) {
25461
25555
  this.stem = stem;
25556
+ this.addChildElement(stem);
25462
25557
  return this;
25463
25558
  }
25464
25559
  // Builds and sets a new stem
@@ -25689,7 +25784,6 @@ class StringNumber extends _modifier__WEBPACK_IMPORTED_MODULE_1__.Modifier {
25689
25784
  constructor(number) {
25690
25785
  super();
25691
25786
  this.string_number = number;
25692
- this.setWidth(20); // ???
25693
25787
  this.position = _modifier__WEBPACK_IMPORTED_MODULE_1__.Modifier.Position.ABOVE; // Default position above stem or note head
25694
25788
  this.x_shift = 0;
25695
25789
  this.y_shift = 0;
@@ -25700,6 +25794,8 @@ class StringNumber extends _modifier__WEBPACK_IMPORTED_MODULE_1__.Modifier {
25700
25794
  this.dashed = true; // true - draw dashed extension false - no extension
25701
25795
  this.leg = _renderer__WEBPACK_IMPORTED_MODULE_2__.Renderer.LineEndType.NONE; // draw upward/downward leg at the of extension line
25702
25796
  this.radius = 8;
25797
+ this.drawCircle = true;
25798
+ this.setWidth(this.radius * 2 + 4);
25703
25799
  this.resetFont();
25704
25800
  }
25705
25801
  static get CATEGORY() {
@@ -25826,6 +25922,10 @@ class StringNumber extends _modifier__WEBPACK_IMPORTED_MODULE_1__.Modifier {
25826
25922
  this.dashed = dashed;
25827
25923
  return this;
25828
25924
  }
25925
+ setDrawCircle(drawCircle) {
25926
+ this.drawCircle = drawCircle;
25927
+ return this;
25928
+ }
25829
25929
  draw() {
25830
25930
  const ctx = this.checkContext();
25831
25931
  const note = this.checkAttachedNote();
@@ -25869,10 +25969,12 @@ class StringNumber extends _modifier__WEBPACK_IMPORTED_MODULE_1__.Modifier {
25869
25969
  throw new _util__WEBPACK_IMPORTED_MODULE_6__.RuntimeError('InvalidPosition', `The position ${this.position} is invalid`);
25870
25970
  }
25871
25971
  ctx.save();
25872
- ctx.beginPath();
25873
- ctx.arc(dot_x, dot_y, this.radius, 0, Math.PI * 2, false);
25874
- ctx.setLineWidth(1.5);
25875
- ctx.stroke();
25972
+ if (this.drawCircle) {
25973
+ ctx.beginPath();
25974
+ ctx.arc(dot_x, dot_y, this.radius, 0, Math.PI * 2, false);
25975
+ ctx.setLineWidth(1.5);
25976
+ ctx.stroke();
25977
+ }
25876
25978
  ctx.setFont(this.textFont);
25877
25979
  const x = dot_x - ctx.measureText(this.string_number).width / 2;
25878
25980
  ctx.fillText('' + this.string_number, x, dot_y + 4.5);
@@ -27597,6 +27699,7 @@ class Tables {
27597
27699
  return Object.assign(Object.assign(Object.assign({}, code.common), { getWidth: getWidth }), glyphTypeProperties);
27598
27700
  }
27599
27701
  }
27702
+ Tables.SOFTMAX_FACTOR = 100;
27600
27703
  Tables.STEM_WIDTH = 1.5;
27601
27704
  Tables.STEM_HEIGHT = 35;
27602
27705
  Tables.STAVE_LINE_THICKNESS = 1;
@@ -31571,7 +31674,7 @@ var VoiceMode;
31571
31674
  * `Voice` is mainly a container object to group `Tickables` for formatting.
31572
31675
  */
31573
31676
  class Voice extends _element__WEBPACK_IMPORTED_MODULE_0__.Element {
31574
- constructor(time, options) {
31677
+ constructor(time) {
31575
31678
  super();
31576
31679
  this.resolutionMultiplier = 1;
31577
31680
  this.mode = VoiceMode.STRICT;
@@ -31579,7 +31682,9 @@ class Voice extends _element__WEBPACK_IMPORTED_MODULE_0__.Element {
31579
31682
  this.ticksUsed = new _fraction__WEBPACK_IMPORTED_MODULE_1__.Fraction(0, 1);
31580
31683
  this.largestTickWidth = 0;
31581
31684
  this.tickables = [];
31582
- this.options = Object.assign({ softmaxFactor: 100 }, options);
31685
+ this.options = {
31686
+ softmaxFactor: _tables__WEBPACK_IMPORTED_MODULE_2__.Tables.SOFTMAX_FACTOR,
31687
+ };
31583
31688
  // Convert the `time` string into a VoiceTime object if necessary.
31584
31689
  let voiceTime;
31585
31690
  if (typeof time === 'string') {
@@ -35971,9 +36076,12 @@ __webpack_require__.r(__webpack_exports__);
35971
36076
  /* harmony import */ var _vexflow_test_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./vexflow_test_helpers */ "./tests/vexflow_test_helpers.ts");
35972
36077
  /* harmony import */ var _src_accidental__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../src/accidental */ "./src/accidental.ts");
35973
36078
  /* harmony import */ var _src_chordsymbol__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../src/chordsymbol */ "./src/chordsymbol.ts");
35974
- /* harmony import */ var _src_formatter__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../src/formatter */ "./src/formatter.ts");
35975
- /* harmony import */ var _src_stave__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../src/stave */ "./src/stave.ts");
35976
- /* harmony import */ var _src_stavenote__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../src/stavenote */ "./src/stavenote.ts");
36079
+ /* harmony import */ var _src_font__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../src/font */ "./src/font.ts");
36080
+ /* harmony import */ var _src_formatter__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../src/formatter */ "./src/formatter.ts");
36081
+ /* harmony import */ var _src_ornament__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../src/ornament */ "./src/ornament.ts");
36082
+ /* harmony import */ var _src_stave__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../src/stave */ "./src/stave.ts");
36083
+ /* harmony import */ var _src_stavenote__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../src/stavenote */ "./src/stavenote.ts");
36084
+ /* harmony import */ var _src_tables__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../src/tables */ "./src/tables.ts");
35977
36085
  // [VexFlow](https://vexflow.com) - Copyright (c) Mohit Muthanna 2010.
35978
36086
  // MIT License
35979
36087
  //
@@ -35984,10 +36092,14 @@ __webpack_require__.r(__webpack_exports__);
35984
36092
 
35985
36093
 
35986
36094
 
36095
+
36096
+
36097
+
35987
36098
  const ChordSymbolTests = {
35988
36099
  Start() {
35989
36100
  QUnit.module('ChordSymbol');
35990
36101
  const run = _vexflow_test_helpers__WEBPACK_IMPORTED_MODULE_0__.VexFlowTests.runTests;
36102
+ run('Chord Symbol With Modifiers', withModifiers);
35991
36103
  run('Chord Symbol Font Size Tests', fontSize);
35992
36104
  run('Chord Symbol Kerning Tests', kern);
35993
36105
  run('Top Chord Symbols', top);
@@ -36002,6 +36114,92 @@ const superscript = { symbolModifier: _src_chordsymbol__WEBPACK_IMPORTED_MODULE_
36002
36114
  const subscript = { symbolModifier: _src_chordsymbol__WEBPACK_IMPORTED_MODULE_2__.ChordSymbol.symbolModifiers.SUBSCRIPT };
36003
36115
  // Helper function for creating StaveNotes.
36004
36116
  const note = (factory, keys, duration, chordSymbol) => factory.StaveNote({ keys, duration }).addModifier(chordSymbol, 0);
36117
+ /** Calculate the glyph's width in the current music font. */
36118
+ // How is this different from Glyph.getWidth()? The numbers don't match up.
36119
+ function getGlyphWidth(glyphName) {
36120
+ // `38` seems to be the `font_scale` specified in many classes, such as
36121
+ // Accidental, Articulation, Ornament, Strokes. Does this mean `38pt`???
36122
+ //
36123
+ // However, tables.ts specifies:
36124
+ // NOTATION_FONT_SCALE: 39,
36125
+ // TABLATURE_FONT_SCALE: 39,
36126
+ const musicFont = _src_tables__WEBPACK_IMPORTED_MODULE_8__.Tables.currentMusicFont();
36127
+ const glyph = musicFont.getGlyphs()[glyphName];
36128
+ const widthInEm = (glyph.x_max - glyph.x_min) / musicFont.getResolution();
36129
+ return widthInEm * 38 * _src_font__WEBPACK_IMPORTED_MODULE_3__.Font.scaleToPxFrom.pt;
36130
+ }
36131
+ function withModifiers(options) {
36132
+ const f = _vexflow_test_helpers__WEBPACK_IMPORTED_MODULE_0__.VexFlowTests.makeFactory(options, 750, 580);
36133
+ const ctx = f.getContext();
36134
+ ctx.scale(1.5, 1.5);
36135
+ ctx.fillStyle = '#221';
36136
+ ctx.strokeStyle = '#221';
36137
+ function draw(chords, y) {
36138
+ const notes = [
36139
+ note(f, ['c/4'], 'q', chords[0]).addModifier(new _src_ornament__WEBPACK_IMPORTED_MODULE_5__.Ornament('doit')),
36140
+ note(f, ['c/4'], 'q', chords[1]),
36141
+ note(f, ['c/4'], 'q', chords[2]).addModifier(new _src_ornament__WEBPACK_IMPORTED_MODULE_5__.Ornament('fall')),
36142
+ note(f, ['c/4'], 'q', chords[3]),
36143
+ ];
36144
+ const score = f.EasyScore();
36145
+ const voice = score.voice(notes, { time: '4/4' });
36146
+ const formatter = f.Formatter();
36147
+ formatter.joinVoices([voice]);
36148
+ const voiceW = formatter.preCalculateMinTotalWidth([voice]);
36149
+ const staffW = voiceW + _src_stave__WEBPACK_IMPORTED_MODULE_6__.Stave.defaultPadding + getGlyphWidth('gClef');
36150
+ formatter.format([voice], voiceW);
36151
+ const staff = f.Stave({ x: 10, y, width: staffW }).addClef('treble').draw();
36152
+ voice.draw(ctx, staff);
36153
+ }
36154
+ let chords = [];
36155
+ chords.push(f
36156
+ .ChordSymbol({ fontSize: 10 })
36157
+ .addText('F7')
36158
+ .addGlyph('leftParenTall')
36159
+ .addGlyphOrText('b9', superscript)
36160
+ .addGlyphOrText('#11', subscript)
36161
+ .addGlyph('rightParenTall'));
36162
+ chords.push(f.ChordSymbol({ fontSize: 12 }).addText('F7').addGlyphOrText('b9', superscript).addGlyphOrText('#11', subscript));
36163
+ chords.push(f
36164
+ .ChordSymbol({ fontSize: 14 })
36165
+ .addText('F7')
36166
+ .addGlyph('leftParenTall')
36167
+ .addGlyphOrText('add 3', superscript)
36168
+ .addGlyphOrText('omit 9', subscript)
36169
+ .addGlyph('rightParenTall'));
36170
+ chords.push(f
36171
+ .ChordSymbol({ fontSize: 16 })
36172
+ .addText('F7')
36173
+ .addGlyph('leftParenTall')
36174
+ .addGlyphOrText('b9', superscript)
36175
+ .addGlyphOrText('#11', subscript)
36176
+ .addGlyph('rightParenTall'));
36177
+ draw(chords, 40);
36178
+ chords = [];
36179
+ chords.push(f
36180
+ .ChordSymbol({ fontSize: 10 })
36181
+ .setFontSize(10)
36182
+ .addText('F7')
36183
+ .addGlyphOrText('#11', superscript)
36184
+ .addGlyphOrText('b9', subscript));
36185
+ chords.push(f.ChordSymbol({ fontSize: 12 }).addText('F7').addGlyphOrText('#11', superscript).addGlyphOrText('b9', subscript));
36186
+ chords.push(f.ChordSymbol({ fontSize: 14 }).addText('F7').addGlyphOrText('#11', superscript).addGlyphOrText('b9', subscript));
36187
+ chords.push(f
36188
+ .ChordSymbol({ fontSize: 16 })
36189
+ .setFontSize(16)
36190
+ .addText('F7')
36191
+ .addGlyphOrText('#11', superscript)
36192
+ .addGlyphOrText('b9', subscript));
36193
+ draw(chords, 140);
36194
+ chords = [
36195
+ f.ChordSymbol({ fontSize: 10 }).addGlyphOrText('Ab').addGlyphOrText('7(#11b9)', superscript),
36196
+ f.ChordSymbol({ fontSize: 14 }).addGlyphOrText('C#').addGlyphOrText('7(#11b9)', superscript),
36197
+ f.ChordSymbol({ fontSize: 16 }).addGlyphOrText('Ab').addGlyphOrText('7(#11b9)', superscript),
36198
+ f.ChordSymbol({ fontSize: 18 }).addGlyphOrText('C#').addGlyphOrText('7(#11b9)', superscript),
36199
+ ];
36200
+ draw(chords, 240);
36201
+ ok(true, 'Font Size Chord Symbol');
36202
+ }
36005
36203
  function fontSize(options) {
36006
36204
  const f = _vexflow_test_helpers__WEBPACK_IMPORTED_MODULE_0__.VexFlowTests.makeFactory(options, 750, 580);
36007
36205
  const ctx = f.getContext();
@@ -36079,7 +36277,7 @@ function fontSize(options) {
36079
36277
  ok(true, 'Font Size Chord Symbol');
36080
36278
  }
36081
36279
  function kern(options) {
36082
- const f = _vexflow_test_helpers__WEBPACK_IMPORTED_MODULE_0__.VexFlowTests.makeFactory(options, 650, 650);
36280
+ const f = _vexflow_test_helpers__WEBPACK_IMPORTED_MODULE_0__.VexFlowTests.makeFactory(options, 650 * 1.5, 650);
36083
36281
  const ctx = f.getContext();
36084
36282
  ctx.scale(1.5, 1.5);
36085
36283
  ctx.fillStyle = '#221';
@@ -36128,7 +36326,7 @@ function kern(options) {
36128
36326
  ok(true, 'Chord Symbol Kerning Tests');
36129
36327
  }
36130
36328
  function top(options) {
36131
- const f = _vexflow_test_helpers__WEBPACK_IMPORTED_MODULE_0__.VexFlowTests.makeFactory(options, 650, 650);
36329
+ const f = _vexflow_test_helpers__WEBPACK_IMPORTED_MODULE_0__.VexFlowTests.makeFactory(options, 650 * 1.5, 650);
36132
36330
  const ctx = f.getContext();
36133
36331
  ctx.scale(1.5, 1.5);
36134
36332
  ctx.fillStyle = '#221';
@@ -36174,18 +36372,18 @@ function top(options) {
36174
36372
  ok(true, 'Top Chord Symbol');
36175
36373
  }
36176
36374
  function topJustify(options) {
36177
- const f = _vexflow_test_helpers__WEBPACK_IMPORTED_MODULE_0__.VexFlowTests.makeFactory(options, 500, 680);
36375
+ const f = _vexflow_test_helpers__WEBPACK_IMPORTED_MODULE_0__.VexFlowTests.makeFactory(options, 500 * 1.5, 680);
36178
36376
  const ctx = f.getContext();
36179
36377
  ctx.scale(1.5, 1.5);
36180
36378
  ctx.fillStyle = '#221';
36181
36379
  ctx.strokeStyle = '#221';
36182
36380
  function draw(chord1, chord2, y) {
36183
- const stave = new _src_stave__WEBPACK_IMPORTED_MODULE_4__.Stave(10, y, 450).addClef('treble').setContext(ctx).draw();
36381
+ const stave = new _src_stave__WEBPACK_IMPORTED_MODULE_6__.Stave(10, y, 450).addClef('treble').setContext(ctx).draw();
36184
36382
  const notes = [
36185
36383
  note(f, ['e/4', 'a/4', 'd/5'], 'h', chord1).addModifier(new _src_accidental__WEBPACK_IMPORTED_MODULE_1__.Accidental('b'), 0),
36186
36384
  note(f, ['c/4', 'e/4', 'B/4'], 'h', chord2),
36187
36385
  ];
36188
- _src_formatter__WEBPACK_IMPORTED_MODULE_3__.Formatter.FormatAndDraw(ctx, stave, notes);
36386
+ _src_formatter__WEBPACK_IMPORTED_MODULE_4__.Formatter.FormatAndDraw(ctx, stave, notes);
36189
36387
  }
36190
36388
  let chord1 = f.ChordSymbol().addText('F7').setHorizontal('left').addGlyphOrText('(#11b9)', superscript);
36191
36389
  let chord2 = f.ChordSymbol({ hJustify: 'left' }).addText('C').addGlyphSuperscript('majorSeventh');
@@ -36216,20 +36414,20 @@ function topJustify(options) {
36216
36414
  ok(true, 'Top Chord Justified');
36217
36415
  }
36218
36416
  function bottom(options) {
36219
- const f = _vexflow_test_helpers__WEBPACK_IMPORTED_MODULE_0__.VexFlowTests.makeFactory(options, 600, 230);
36417
+ const f = _vexflow_test_helpers__WEBPACK_IMPORTED_MODULE_0__.VexFlowTests.makeFactory(options, 600 * 1.5, 230);
36220
36418
  const ctx = f.getContext();
36221
36419
  ctx.scale(1.5, 1.5);
36222
36420
  ctx.fillStyle = '#221';
36223
36421
  ctx.strokeStyle = '#221';
36224
36422
  function draw(chords, y) {
36225
- const stave = new _src_stave__WEBPACK_IMPORTED_MODULE_4__.Stave(10, y, 400).addClef('treble').setContext(ctx).draw();
36423
+ const stave = new _src_stave__WEBPACK_IMPORTED_MODULE_6__.Stave(10, y, 400).addClef('treble').setContext(ctx).draw();
36226
36424
  const notes = [
36227
36425
  note(f, ['c/4', 'f/4', 'a/4'], 'q', chords[0]),
36228
36426
  note(f, ['c/4', 'e/4', 'b/4'], 'q', chords[1]).addModifier(new _src_accidental__WEBPACK_IMPORTED_MODULE_1__.Accidental('b'), 2),
36229
36427
  note(f, ['c/4', 'e/4', 'g/4'], 'q', chords[2]),
36230
36428
  note(f, ['c/4', 'f/4', 'a/4'], 'q', chords[3]).addModifier(new _src_accidental__WEBPACK_IMPORTED_MODULE_1__.Accidental('#'), 1),
36231
36429
  ];
36232
- _src_formatter__WEBPACK_IMPORTED_MODULE_3__.Formatter.FormatAndDraw(ctx, stave, notes);
36430
+ _src_formatter__WEBPACK_IMPORTED_MODULE_4__.Formatter.FormatAndDraw(ctx, stave, notes);
36233
36431
  }
36234
36432
  const chords = [
36235
36433
  f.ChordSymbol({ vJustify: 'bottom' }).addText('I').addTextSuperscript('6').addTextSubscript('4'),
@@ -36241,22 +36439,22 @@ function bottom(options) {
36241
36439
  ok(true, 'Bottom Chord Symbol');
36242
36440
  }
36243
36441
  function bottomStemDown(options) {
36244
- const f = _vexflow_test_helpers__WEBPACK_IMPORTED_MODULE_0__.VexFlowTests.makeFactory(options, 600, 330);
36442
+ const f = _vexflow_test_helpers__WEBPACK_IMPORTED_MODULE_0__.VexFlowTests.makeFactory(options, 600 * 1.5, 330);
36245
36443
  const ctx = f.getContext();
36246
36444
  ctx.scale(1.5, 1.5);
36247
36445
  ctx.fillStyle = '#221';
36248
36446
  ctx.strokeStyle = '#221';
36249
36447
  function draw(chords, y) {
36250
36448
  // Helper function to create a StaveNote with a ChordSymbol and the stem pointing down.
36251
- const note = (keys, duration, chordSymbol) => new _src_stavenote__WEBPACK_IMPORTED_MODULE_5__.StaveNote({ keys, duration, stem_direction: -1 }).addModifier(chordSymbol, 0);
36252
- const stave = new _src_stave__WEBPACK_IMPORTED_MODULE_4__.Stave(10, y, 400).addClef('treble').setContext(ctx).draw();
36449
+ const note = (keys, duration, chordSymbol) => new _src_stavenote__WEBPACK_IMPORTED_MODULE_7__.StaveNote({ keys, duration, stem_direction: -1 }).addModifier(chordSymbol, 0);
36450
+ const stave = new _src_stave__WEBPACK_IMPORTED_MODULE_6__.Stave(10, y, 400).addClef('treble').setContext(ctx).draw();
36253
36451
  const notes = [
36254
36452
  note(['c/4', 'f/4', 'a/4'], 'q', chords[0]),
36255
36453
  note(['c/4', 'e/4', 'b/4'], 'q', chords[1]).addModifier(new _src_accidental__WEBPACK_IMPORTED_MODULE_1__.Accidental('b'), 2),
36256
36454
  note(['c/4', 'e/4', 'g/4'], 'q', chords[2]),
36257
36455
  note(['c/4', 'f/4', 'a/4'], 'q', chords[3]).addModifier(new _src_accidental__WEBPACK_IMPORTED_MODULE_1__.Accidental('#'), 1),
36258
36456
  ];
36259
- _src_formatter__WEBPACK_IMPORTED_MODULE_3__.Formatter.FormatAndDraw(ctx, stave, notes);
36457
+ _src_formatter__WEBPACK_IMPORTED_MODULE_4__.Formatter.FormatAndDraw(ctx, stave, notes);
36260
36458
  }
36261
36459
  const chords = [
36262
36460
  f.ChordSymbol({ vJustify: 'bottom' }).addGlyphOrText('F'),
@@ -36268,22 +36466,22 @@ function bottomStemDown(options) {
36268
36466
  ok(true, 'Bottom Stem Down Chord Symbol');
36269
36467
  }
36270
36468
  function doubleBottom(options) {
36271
- const f = _vexflow_test_helpers__WEBPACK_IMPORTED_MODULE_0__.VexFlowTests.makeFactory(options, 600, 260);
36469
+ const f = _vexflow_test_helpers__WEBPACK_IMPORTED_MODULE_0__.VexFlowTests.makeFactory(options, 600 * 1.5, 260);
36272
36470
  const ctx = f.getContext();
36273
36471
  ctx.scale(1.5, 1.5);
36274
36472
  ctx.fillStyle = '#221';
36275
36473
  ctx.strokeStyle = '#221';
36276
36474
  function draw(chords, chords2, y) {
36277
36475
  // Helper function to create a StaveNote with two ChordSymbols attached.
36278
- const note = (keys, duration, chordSymbol1, chordSymbol2) => new _src_stavenote__WEBPACK_IMPORTED_MODULE_5__.StaveNote({ keys, duration }).addModifier(chordSymbol1, 0).addModifier(chordSymbol2, 0);
36279
- const stave = new _src_stave__WEBPACK_IMPORTED_MODULE_4__.Stave(10, y, 450).addClef('treble').setContext(ctx).draw();
36476
+ const note = (keys, duration, chordSymbol1, chordSymbol2) => new _src_stavenote__WEBPACK_IMPORTED_MODULE_7__.StaveNote({ keys, duration }).addModifier(chordSymbol1, 0).addModifier(chordSymbol2, 0);
36477
+ const stave = f.Stave({ x: 10, y, width: 450 }).addClef('treble').setContext(ctx).draw();
36280
36478
  const notes = [
36281
36479
  note(['c/4', 'f/4', 'a/4'], 'q', chords[0], chords2[0]),
36282
- note(['c/4', 'e/4', 'b/4'], 'q', chords[1], chords2[1]).addModifier(new _src_accidental__WEBPACK_IMPORTED_MODULE_1__.Accidental('b'), 2),
36480
+ note(['c/4', 'e/4', 'b/4'], 'q', chords[1], chords2[1]).addModifier(f.Accidental({ type: 'b' }), 2),
36283
36481
  note(['c/4', 'e/4', 'g/4'], 'q', chords[2], chords2[2]),
36284
- note(['c/4', 'f/4', 'a/4'], 'q', chords[3], chords2[3]).addModifier(new _src_accidental__WEBPACK_IMPORTED_MODULE_1__.Accidental('#'), 1),
36482
+ note(['c/4', 'f/4', 'a/4'], 'q', chords[3], chords2[3]).addModifier(f.Accidental({ type: '#' }), 1),
36285
36483
  ];
36286
- _src_formatter__WEBPACK_IMPORTED_MODULE_3__.Formatter.FormatAndDraw(ctx, stave, notes);
36484
+ _src_formatter__WEBPACK_IMPORTED_MODULE_4__.Formatter.FormatAndDraw(ctx, stave, notes);
36287
36485
  }
36288
36486
  const chords1 = [
36289
36487
  f.ChordSymbol({ vJustify: 'bottom' }).addText('I').addTextSuperscript('6').addTextSubscript('4'),
@@ -41040,90 +41238,94 @@ function drawOrnamentsDisplaced(options, contextBuilder) {
41040
41238
  * Helper function for the next two tests: drawOrnamentsDelayed and drawOrnamentsDelayedMultipleDraws.
41041
41239
  * setDelayed(true) shifts the turn symbol to the right (after its note).
41042
41240
  */
41043
- const addDelayedTurns = (options, contextBuilder) => {
41241
+ const addDelayedTurns = (f) => {
41044
41242
  // Get the rendering context
41045
- const context = contextBuilder(options.elementId, 550, 195);
41046
- const stave = new _src_stave__WEBPACK_IMPORTED_MODULE_7__.Stave(10, 30, 500);
41243
+ const context = f.getContext();
41244
+ const stave = f.Stave({ x: 10, y: 30, width: 500 });
41047
41245
  stave.setContext(context).draw();
41048
41246
  const notes = [
41049
- new _src_stavenote__WEBPACK_IMPORTED_MODULE_8__.StaveNote({ keys: ['a/4'], duration: '4', stem_direction: 1 }),
41050
- new _src_stavenote__WEBPACK_IMPORTED_MODULE_8__.StaveNote({ keys: ['a/4'], duration: '4', stem_direction: 1 }),
41051
- new _src_stavenote__WEBPACK_IMPORTED_MODULE_8__.StaveNote({ keys: ['a/4'], duration: '4', stem_direction: 1 }),
41052
- new _src_stavenote__WEBPACK_IMPORTED_MODULE_8__.StaveNote({ keys: ['a/4'], duration: '4', stem_direction: 1 }),
41247
+ f.StaveNote({ keys: ['a/4'], duration: '4', stem_direction: 1 }),
41248
+ f.StaveNote({ keys: ['a/4'], duration: '4', stem_direction: 1 }),
41249
+ f.StaveNote({ keys: ['a/4'], duration: '4', stem_direction: 1 }),
41250
+ f.StaveNote({ keys: ['a/4'], duration: '4', stem_direction: 1 }),
41053
41251
  ];
41054
- notes[0].addModifier(new _src_ornament__WEBPACK_IMPORTED_MODULE_6__.Ornament('turn').setDelayed(true), 0);
41055
- notes[1].addModifier(new _src_ornament__WEBPACK_IMPORTED_MODULE_6__.Ornament('turn_inverted').setDelayed(true), 0);
41056
- notes[2].addModifier(new _src_ornament__WEBPACK_IMPORTED_MODULE_6__.Ornament('turn_inverted').setDelayed(true), 0);
41057
- notes[3].addModifier(new _src_ornament__WEBPACK_IMPORTED_MODULE_6__.Ornament('turn').setDelayed(true), 0);
41252
+ notes[0].addModifier(f.Ornament('turn', { delayed: true }), 0);
41253
+ notes[1].addModifier(f.Ornament('turn_inverted', { delayed: true }), 0);
41254
+ notes[2].addModifier(f.Ornament('turn_inverted', { delayed: true }), 0);
41255
+ notes[3].addModifier(f.Ornament('turn', { delayed: true }), 0);
41058
41256
  return { context, stave, notes };
41059
41257
  };
41060
- function drawOrnamentsDelayed(options, contextBuilder) {
41258
+ function drawOrnamentsDelayed(options) {
41061
41259
  expect(0);
41062
- const { context, stave, notes } = addDelayedTurns(options, contextBuilder);
41260
+ const f = _vexflow_test_helpers__WEBPACK_IMPORTED_MODULE_0__.VexFlowTests.makeFactory(options, 550, 195);
41261
+ const { context, stave, notes } = addDelayedTurns(f);
41063
41262
  // Helper function to justify and draw a 4/4 voice
41064
41263
  _src_formatter__WEBPACK_IMPORTED_MODULE_4__.Formatter.FormatAndDraw(context, stave, notes);
41065
41264
  }
41066
- function drawOrnamentsDelayedMultipleDraws(options, contextBuilder) {
41265
+ function drawOrnamentsDelayedMultipleDraws(options) {
41067
41266
  expect(0);
41068
- const { context, stave, notes } = addDelayedTurns(options, contextBuilder);
41267
+ const f = _vexflow_test_helpers__WEBPACK_IMPORTED_MODULE_0__.VexFlowTests.makeFactory(options, 550, 195);
41268
+ const { context, stave, notes } = addDelayedTurns(f);
41069
41269
  // We can FormatAndDraw() two times, and it looks fine.
41070
41270
  // However, if you inspect the SVG element, you will see duplicate paths.
41071
41271
  _src_formatter__WEBPACK_IMPORTED_MODULE_4__.Formatter.FormatAndDraw(context, stave, notes);
41072
41272
  _src_formatter__WEBPACK_IMPORTED_MODULE_4__.Formatter.FormatAndDraw(context, stave, notes);
41073
41273
  }
41074
- function drawOrnamentsStacked(options, contextBuilder) {
41274
+ function drawOrnamentsStacked(options) {
41075
41275
  expect(0);
41076
41276
  // Get the rendering context
41077
- const ctx = contextBuilder(options.elementId, 550, 195);
41078
- const stave = new _src_stave__WEBPACK_IMPORTED_MODULE_7__.Stave(10, 30, 500);
41277
+ const f = _vexflow_test_helpers__WEBPACK_IMPORTED_MODULE_0__.VexFlowTests.makeFactory(options, 550, 195);
41278
+ const ctx = f.getContext();
41279
+ const stave = f.Stave({ x: 10, y: 30, width: 500 });
41079
41280
  stave.setContext(ctx).draw();
41080
41281
  const notes = [
41081
- new _src_stavenote__WEBPACK_IMPORTED_MODULE_8__.StaveNote({ keys: ['a/4'], duration: '4', stem_direction: 1 }),
41082
- new _src_stavenote__WEBPACK_IMPORTED_MODULE_8__.StaveNote({ keys: ['a/4'], duration: '4', stem_direction: 1 }),
41083
- new _src_stavenote__WEBPACK_IMPORTED_MODULE_8__.StaveNote({ keys: ['a/4'], duration: '4', stem_direction: 1 }),
41084
- new _src_stavenote__WEBPACK_IMPORTED_MODULE_8__.StaveNote({ keys: ['a/4'], duration: '4', stem_direction: 1 }),
41282
+ f.StaveNote({ keys: ['a/4'], duration: '4', stem_direction: 1 }),
41283
+ f.StaveNote({ keys: ['a/4'], duration: '4', stem_direction: 1 }),
41284
+ f.StaveNote({ keys: ['a/4'], duration: '4', stem_direction: 1 }),
41285
+ f.StaveNote({ keys: ['a/4'], duration: '4', stem_direction: 1 }),
41085
41286
  ];
41086
- notes[0].addModifier(new _src_ornament__WEBPACK_IMPORTED_MODULE_6__.Ornament('mordent'), 0);
41087
- notes[1].addModifier(new _src_ornament__WEBPACK_IMPORTED_MODULE_6__.Ornament('turn_inverted'), 0);
41088
- notes[2].addModifier(new _src_ornament__WEBPACK_IMPORTED_MODULE_6__.Ornament('turn'), 0);
41089
- notes[3].addModifier(new _src_ornament__WEBPACK_IMPORTED_MODULE_6__.Ornament('turn_inverted'), 0);
41090
- notes[0].addModifier(new _src_ornament__WEBPACK_IMPORTED_MODULE_6__.Ornament('turn'), 0);
41091
- notes[1].addModifier(new _src_ornament__WEBPACK_IMPORTED_MODULE_6__.Ornament('prallup'), 0);
41092
- notes[2].addModifier(new _src_ornament__WEBPACK_IMPORTED_MODULE_6__.Ornament('upmordent'), 0);
41093
- notes[3].addModifier(new _src_ornament__WEBPACK_IMPORTED_MODULE_6__.Ornament('lineprall'), 0);
41287
+ notes[0].addModifier(f.Ornament('mordent'), 0);
41288
+ notes[1].addModifier(f.Ornament('turn_inverted'), 0);
41289
+ notes[2].addModifier(f.Ornament('turn'), 0);
41290
+ notes[3].addModifier(f.Ornament('turn_inverted'), 0);
41291
+ notes[0].addModifier(f.Ornament('turn'), 0);
41292
+ notes[1].addModifier(f.Ornament('prallup'), 0);
41293
+ notes[2].addModifier(f.Ornament('upmordent'), 0);
41294
+ notes[3].addModifier(f.Ornament('lineprall'), 0);
41094
41295
  // Helper function to justify and draw a 4/4 voice
41095
41296
  _src_formatter__WEBPACK_IMPORTED_MODULE_4__.Formatter.FormatAndDraw(ctx, stave, notes);
41096
41297
  }
41097
- function drawOrnamentsWithAccidentals(options, contextBuilder) {
41298
+ function drawOrnamentsWithAccidentals(options) {
41098
41299
  expect(0);
41099
41300
  // Get the rendering context
41100
- const ctx = contextBuilder(options.elementId, 650, 250);
41101
- const stave = new _src_stave__WEBPACK_IMPORTED_MODULE_7__.Stave(10, 60, 600);
41301
+ const f = _vexflow_test_helpers__WEBPACK_IMPORTED_MODULE_0__.VexFlowTests.makeFactory(options, 650, 250);
41302
+ const ctx = f.getContext();
41303
+ const stave = f.Stave({ x: 10, y: 60, width: 600 });
41102
41304
  stave.setContext(ctx).draw();
41103
41305
  const notes = [
41104
- new _src_stavenote__WEBPACK_IMPORTED_MODULE_8__.StaveNote({ keys: ['f/4'], duration: '4', stem_direction: 1 }),
41105
- new _src_stavenote__WEBPACK_IMPORTED_MODULE_8__.StaveNote({ keys: ['f/4'], duration: '4', stem_direction: 1 }),
41106
- new _src_stavenote__WEBPACK_IMPORTED_MODULE_8__.StaveNote({ keys: ['f/4'], duration: '4', stem_direction: 1 }),
41107
- new _src_stavenote__WEBPACK_IMPORTED_MODULE_8__.StaveNote({ keys: ['f/4'], duration: '4', stem_direction: 1 }),
41108
- new _src_stavenote__WEBPACK_IMPORTED_MODULE_8__.StaveNote({ keys: ['f/4'], duration: '4', stem_direction: 1 }),
41109
- new _src_stavenote__WEBPACK_IMPORTED_MODULE_8__.StaveNote({ keys: ['f/4'], duration: '4', stem_direction: 1 }),
41110
- new _src_stavenote__WEBPACK_IMPORTED_MODULE_8__.StaveNote({ keys: ['f/4'], duration: '4', stem_direction: 1 }),
41111
- new _src_stavenote__WEBPACK_IMPORTED_MODULE_8__.StaveNote({ keys: ['f/4'], duration: '4', stem_direction: 1 }),
41112
- new _src_stavenote__WEBPACK_IMPORTED_MODULE_8__.StaveNote({ keys: ['f/4'], duration: '4', stem_direction: 1 }),
41113
- new _src_stavenote__WEBPACK_IMPORTED_MODULE_8__.StaveNote({ keys: ['f/4'], duration: '4', stem_direction: 1 }),
41114
- new _src_stavenote__WEBPACK_IMPORTED_MODULE_8__.StaveNote({ keys: ['f/4'], duration: '4', stem_direction: 1 }),
41306
+ f.StaveNote({ keys: ['f/4'], duration: '4', stem_direction: 1 }),
41307
+ f.StaveNote({ keys: ['f/4'], duration: '4', stem_direction: 1 }),
41308
+ f.StaveNote({ keys: ['f/4'], duration: '4', stem_direction: 1 }),
41309
+ f.StaveNote({ keys: ['f/4'], duration: '4', stem_direction: 1 }),
41310
+ f.StaveNote({ keys: ['f/4'], duration: '4', stem_direction: 1 }),
41311
+ f.StaveNote({ keys: ['f/4'], duration: '4', stem_direction: 1 }),
41312
+ f.StaveNote({ keys: ['f/4'], duration: '4', stem_direction: 1 }),
41313
+ f.StaveNote({ keys: ['f/4'], duration: '4', stem_direction: 1 }),
41314
+ f.StaveNote({ keys: ['f/4'], duration: '4', stem_direction: 1 }),
41315
+ f.StaveNote({ keys: ['f/4'], duration: '4', stem_direction: 1 }),
41316
+ f.StaveNote({ keys: ['f/4'], duration: '4', stem_direction: 1 }),
41115
41317
  ];
41116
- notes[0].addModifier(new _src_ornament__WEBPACK_IMPORTED_MODULE_6__.Ornament('mordent').setUpperAccidental('#').setLowerAccidental('#'), 0);
41117
- notes[1].addModifier(new _src_ornament__WEBPACK_IMPORTED_MODULE_6__.Ornament('turn_inverted').setLowerAccidental('b').setUpperAccidental('b'), 0);
41118
- notes[2].addModifier(new _src_ornament__WEBPACK_IMPORTED_MODULE_6__.Ornament('turn').setUpperAccidental('##').setLowerAccidental('##'), 0);
41119
- notes[3].addModifier(new _src_ornament__WEBPACK_IMPORTED_MODULE_6__.Ornament('mordent_inverted').setLowerAccidental('db').setUpperAccidental('db'), 0);
41120
- notes[4].addModifier(new _src_ornament__WEBPACK_IMPORTED_MODULE_6__.Ornament('turn_inverted').setUpperAccidental('++').setLowerAccidental('++'), 0);
41121
- notes[5].addModifier(new _src_ornament__WEBPACK_IMPORTED_MODULE_6__.Ornament('tr').setUpperAccidental('n').setLowerAccidental('n'), 0);
41122
- notes[6].addModifier(new _src_ornament__WEBPACK_IMPORTED_MODULE_6__.Ornament('prallup').setUpperAccidental('d').setLowerAccidental('d'), 0);
41123
- notes[7].addModifier(new _src_ornament__WEBPACK_IMPORTED_MODULE_6__.Ornament('lineprall').setUpperAccidental('db').setLowerAccidental('db'), 0);
41124
- notes[8].addModifier(new _src_ornament__WEBPACK_IMPORTED_MODULE_6__.Ornament('upmordent').setUpperAccidental('bbs').setLowerAccidental('bbs'), 0);
41125
- notes[9].addModifier(new _src_ornament__WEBPACK_IMPORTED_MODULE_6__.Ornament('prallprall').setUpperAccidental('bb').setLowerAccidental('bb'), 0);
41126
- notes[10].addModifier(new _src_ornament__WEBPACK_IMPORTED_MODULE_6__.Ornament('turn_inverted').setUpperAccidental('+').setLowerAccidental('+'), 0);
41318
+ notes[0].addModifier(f.Ornament('mordent', { lowerAccidental: '#', upperAccidental: '#' }), 0);
41319
+ notes[1].addModifier(f.Ornament('turn_inverted', { lowerAccidental: 'b', upperAccidental: 'b' }), 0);
41320
+ notes[2].addModifier(f.Ornament('turn', { upperAccidental: '##', lowerAccidental: '##' }), 0);
41321
+ notes[3].addModifier(f.Ornament('mordent_inverted', { lowerAccidental: 'db', upperAccidental: 'db' }), 0);
41322
+ notes[4].addModifier(f.Ornament('turn_inverted', { upperAccidental: '++', lowerAccidental: '++' }), 0);
41323
+ notes[5].addModifier(f.Ornament('tr', { upperAccidental: 'n', lowerAccidental: 'n' }), 0);
41324
+ notes[6].addModifier(f.Ornament('prallup', { upperAccidental: 'd', lowerAccidental: 'd' }), 0);
41325
+ notes[7].addModifier(f.Ornament('lineprall', { upperAccidental: 'db', lowerAccidental: 'db' }), 0);
41326
+ notes[8].addModifier(f.Ornament('upmordent', { upperAccidental: 'bbs', lowerAccidental: 'bbs' }), 0);
41327
+ notes[9].addModifier(f.Ornament('prallprall', { upperAccidental: 'bb', lowerAccidental: 'bb' }), 0);
41328
+ notes[10].addModifier(f.Ornament('turn_inverted', { upperAccidental: '+', lowerAccidental: '+' }), 0);
41127
41329
  // Helper function to justify and draw a 4/4 voice
41128
41330
  _src_formatter__WEBPACK_IMPORTED_MODULE_4__.Formatter.FormatAndDraw(ctx, stave, notes);
41129
41331
  }
@@ -41177,29 +41379,29 @@ function jazzOrnaments(options) {
41177
41379
  let curY = yStart;
41178
41380
  let mods = [
41179
41381
  // measure 1
41180
- new _src_ornament__WEBPACK_IMPORTED_MODULE_6__.Ornament('scoop'),
41181
- new _src_ornament__WEBPACK_IMPORTED_MODULE_6__.Ornament('doit'),
41182
- new _src_ornament__WEBPACK_IMPORTED_MODULE_6__.Ornament('fall'),
41183
- new _src_ornament__WEBPACK_IMPORTED_MODULE_6__.Ornament('doitLong'),
41382
+ f.Ornament('scoop'),
41383
+ f.Ornament('doit'),
41384
+ f.Ornament('fall'),
41385
+ f.Ornament('doitLong'),
41184
41386
  ];
41185
41387
  draw(mods, ['a/5'], curX, width, curY, -1);
41186
41388
  curX += width;
41187
41389
  mods = [
41188
41390
  // measure 2
41189
- new _src_ornament__WEBPACK_IMPORTED_MODULE_6__.Ornament('fallLong'),
41190
- new _src_ornament__WEBPACK_IMPORTED_MODULE_6__.Ornament('bend'),
41191
- new _src_ornament__WEBPACK_IMPORTED_MODULE_6__.Ornament('plungerClosed'),
41192
- new _src_ornament__WEBPACK_IMPORTED_MODULE_6__.Ornament('plungerOpen'),
41193
- new _src_ornament__WEBPACK_IMPORTED_MODULE_6__.Ornament('bend'),
41391
+ f.Ornament('fallLong'),
41392
+ f.Ornament('bend'),
41393
+ f.Ornament('plungerClosed'),
41394
+ f.Ornament('plungerOpen'),
41395
+ f.Ornament('bend'),
41194
41396
  ];
41195
41397
  draw(mods, ['a/5'], curX, width, curY, -1);
41196
41398
  curX += width;
41197
41399
  mods = [
41198
41400
  // measure 3
41199
- new _src_ornament__WEBPACK_IMPORTED_MODULE_6__.Ornament('flip'),
41200
- new _src_ornament__WEBPACK_IMPORTED_MODULE_6__.Ornament('jazzTurn'),
41201
- new _src_ornament__WEBPACK_IMPORTED_MODULE_6__.Ornament('smear'),
41202
- new _src_ornament__WEBPACK_IMPORTED_MODULE_6__.Ornament('doit'),
41401
+ f.Ornament('flip'),
41402
+ f.Ornament('jazzTurn'),
41403
+ f.Ornament('smear'),
41404
+ f.Ornament('doit'),
41203
41405
  ];
41204
41406
  draw(mods, ['a/5'], curX, width, curY, 1);
41205
41407
  // second line
@@ -41207,29 +41409,29 @@ function jazzOrnaments(options) {
41207
41409
  curY += staffHeight;
41208
41410
  mods = [
41209
41411
  // measure 4
41210
- new _src_ornament__WEBPACK_IMPORTED_MODULE_6__.Ornament('scoop'),
41211
- new _src_ornament__WEBPACK_IMPORTED_MODULE_6__.Ornament('doit'),
41212
- new _src_ornament__WEBPACK_IMPORTED_MODULE_6__.Ornament('fall'),
41213
- new _src_ornament__WEBPACK_IMPORTED_MODULE_6__.Ornament('doitLong'),
41412
+ f.Ornament('scoop'),
41413
+ f.Ornament('doit'),
41414
+ f.Ornament('fall'),
41415
+ f.Ornament('doitLong'),
41214
41416
  ];
41215
41417
  draw(mods, ['e/5'], curX, width, curY);
41216
41418
  curX += width;
41217
41419
  mods = [
41218
41420
  // measure 5
41219
- new _src_ornament__WEBPACK_IMPORTED_MODULE_6__.Ornament('fallLong'),
41220
- new _src_ornament__WEBPACK_IMPORTED_MODULE_6__.Ornament('bend'),
41221
- new _src_ornament__WEBPACK_IMPORTED_MODULE_6__.Ornament('plungerClosed'),
41222
- new _src_ornament__WEBPACK_IMPORTED_MODULE_6__.Ornament('plungerOpen'),
41223
- new _src_ornament__WEBPACK_IMPORTED_MODULE_6__.Ornament('bend'),
41421
+ f.Ornament('fallLong'),
41422
+ f.Ornament('bend'),
41423
+ f.Ornament('plungerClosed'),
41424
+ f.Ornament('plungerOpen'),
41425
+ f.Ornament('bend'),
41224
41426
  ];
41225
41427
  draw(mods, ['e/5'], curX, width, curY);
41226
41428
  curX += width;
41227
41429
  mods = [
41228
41430
  // measure 6
41229
- new _src_ornament__WEBPACK_IMPORTED_MODULE_6__.Ornament('flip'),
41230
- new _src_ornament__WEBPACK_IMPORTED_MODULE_6__.Ornament('jazzTurn'),
41231
- new _src_ornament__WEBPACK_IMPORTED_MODULE_6__.Ornament('smear'),
41232
- new _src_ornament__WEBPACK_IMPORTED_MODULE_6__.Ornament('doit'),
41431
+ f.Ornament('flip'),
41432
+ f.Ornament('jazzTurn'),
41433
+ f.Ornament('smear'),
41434
+ f.Ornament('doit'),
41233
41435
  ];
41234
41436
  draw(mods, ['e/5'], curX, width, curY);
41235
41437
  // third line
@@ -41237,29 +41439,29 @@ function jazzOrnaments(options) {
41237
41439
  curY += staffHeight;
41238
41440
  mods = [
41239
41441
  // measure 7
41240
- new _src_ornament__WEBPACK_IMPORTED_MODULE_6__.Ornament('scoop'),
41241
- new _src_ornament__WEBPACK_IMPORTED_MODULE_6__.Ornament('doit'),
41242
- new _src_ornament__WEBPACK_IMPORTED_MODULE_6__.Ornament('fall'),
41243
- new _src_ornament__WEBPACK_IMPORTED_MODULE_6__.Ornament('doitLong'),
41442
+ f.Ornament('scoop'),
41443
+ f.Ornament('doit'),
41444
+ f.Ornament('fall'),
41445
+ f.Ornament('doitLong'),
41244
41446
  ];
41245
41447
  draw(mods, ['e/4'], curX, width, curY);
41246
41448
  curX += width;
41247
41449
  mods = [
41248
41450
  // measure 8
41249
- new _src_ornament__WEBPACK_IMPORTED_MODULE_6__.Ornament('fallLong'),
41250
- new _src_ornament__WEBPACK_IMPORTED_MODULE_6__.Ornament('bend'),
41251
- new _src_ornament__WEBPACK_IMPORTED_MODULE_6__.Ornament('plungerClosed'),
41252
- new _src_ornament__WEBPACK_IMPORTED_MODULE_6__.Ornament('plungerOpen'),
41253
- new _src_ornament__WEBPACK_IMPORTED_MODULE_6__.Ornament('bend'),
41451
+ f.Ornament('fallLong'),
41452
+ f.Ornament('bend'),
41453
+ f.Ornament('plungerClosed'),
41454
+ f.Ornament('plungerOpen'),
41455
+ f.Ornament('bend'),
41254
41456
  ];
41255
41457
  draw(mods, ['e/4'], curX, width, curY);
41256
41458
  curX += width;
41257
41459
  mods = [
41258
41460
  // measure 9
41259
- new _src_ornament__WEBPACK_IMPORTED_MODULE_6__.Ornament('flip'),
41260
- new _src_ornament__WEBPACK_IMPORTED_MODULE_6__.Ornament('jazzTurn'),
41261
- new _src_ornament__WEBPACK_IMPORTED_MODULE_6__.Ornament('smear'),
41262
- new _src_ornament__WEBPACK_IMPORTED_MODULE_6__.Ornament('doit'),
41461
+ f.Ornament('flip'),
41462
+ f.Ornament('jazzTurn'),
41463
+ f.Ornament('smear'),
41464
+ f.Ornament('doit'),
41263
41465
  ];
41264
41466
  draw(mods, ['e/4'], curX, width, curY);
41265
41467
  }
@@ -44266,6 +44468,7 @@ const StaveNoteTests = {
44266
44468
  run('Beam and Dot Placement - Stem Up', dotsAndBeamsUp);
44267
44469
  run('Beam and Dot Placement - Stem Down', dotsAndBeamsDown);
44268
44470
  run('Note Heads Placement - Simple', noteHeadsSimple);
44471
+ run('Note Heads Placement - Hidden Notes', noteHeadsHidden);
44269
44472
  run('Center Aligned Note', centerAlignedRest);
44270
44473
  run('Center Aligned Note with Articulation', centerAlignedRestFermata);
44271
44474
  run('Center Aligned Note with Annotation', centerAlignedRestAnnotation);
@@ -45031,6 +45234,41 @@ function noteHeadsSimple(options) {
45031
45234
  vf.draw();
45032
45235
  expect(0);
45033
45236
  }
45237
+ function noteHeadsHidden(options) {
45238
+ const vf = _vexflow_test_helpers__WEBPACK_IMPORTED_MODULE_0__.VexFlowTests.makeFactory(options, 800, 250);
45239
+ const score = vf.EasyScore();
45240
+ const system1 = vf.System({ y: 100, x: 50, width: 200 });
45241
+ const notes1 = score.notes('g4/w');
45242
+ notes1[0].render_options.draw = false;
45243
+ system1
45244
+ .addStave({
45245
+ voices: [
45246
+ score.voice([...score.beam(score.notes('a4/8, b4/8', { stem: 'up' })), ...score.notes('a4/q/r, a4/h/r')]),
45247
+ score.voice(notes1),
45248
+ ],
45249
+ })
45250
+ .addClef('treble')
45251
+ .addTimeSignature('4/4');
45252
+ const system2 = vf.System({ y: 100, x: 250, width: 150 });
45253
+ const notes2 = score.notes('b4/w');
45254
+ notes2[0].render_options.draw = false;
45255
+ system2.addStave({
45256
+ voices: [score.voice(score.notes('b4/h, b4/h/r')), score.voice(notes2)],
45257
+ });
45258
+ const system3 = vf.System({ y: 100, x: 400, width: 150 });
45259
+ system3.addStave({
45260
+ voices: [score.voice(score.notes('d5/h, d5/h/r')), score.voice(score.notes('e4/w'))],
45261
+ });
45262
+ const system4 = vf.System({ y: 100, x: 550, width: 150 });
45263
+ const notes4 = score.notes('e4/q, e4/q/r, e4/h/r');
45264
+ notes4[0].render_options.draw = false;
45265
+ notes4[2].render_options.draw = false;
45266
+ system4.addStave({
45267
+ voices: [score.voice(notes4), score.voice(score.notes('e4/8, e4/8/r, e4/q/r, e4/h/r'))],
45268
+ });
45269
+ vf.draw();
45270
+ expect(0);
45271
+ }
45034
45272
  function centerAlignedRest(options) {
45035
45273
  const f = _vexflow_test_helpers__WEBPACK_IMPORTED_MODULE_0__.VexFlowTests.makeFactory(options, 400, 160);
45036
45274
  const stave = f.Stave({ x: 10, y: 10, width: 350 }).addClef('treble').addTimeSignature('4/4');
@@ -45280,37 +45518,39 @@ const StringNumberTests = {
45280
45518
  QUnit.module('StringNumber');
45281
45519
  const run = _vexflow_test_helpers__WEBPACK_IMPORTED_MODULE_0__.VexFlowTests.runTests;
45282
45520
  run('String Number In Notation', drawMultipleMeasures);
45521
+ run('String Number In Notation - no circle', drawMultipleMeasures, { drawCircle: false });
45283
45522
  run('Fret Hand Finger In Notation', drawFretHandFingers);
45284
45523
  run('Multi Voice With Strokes, String & Finger Numbers', multi);
45285
45524
  run('Complex Measure With String & Finger Numbers', drawAccidentals);
45286
45525
  },
45287
45526
  };
45288
45527
  function drawMultipleMeasures(options) {
45528
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
45289
45529
  const f = _vexflow_test_helpers__WEBPACK_IMPORTED_MODULE_0__.VexFlowTests.makeFactory(options, 775, 200);
45290
45530
  const score = f.EasyScore();
45291
45531
  // bar 1
45292
45532
  const stave1 = f.Stave({ width: 300 }).setEndBarType(_src_stavebarline__WEBPACK_IMPORTED_MODULE_4__.BarlineType.DOUBLE).addClef('treble');
45293
45533
  const notes1 = score.notes('(c4 e4 g4)/4., (c5 e5 g5)/8, (c4 f4 g4)/4, (c4 f4 g4)/4', { stem: 'down' });
45294
45534
  notes1[0]
45295
- .addModifier(f.StringNumber({ number: '5', position: 'right' }), 0)
45296
- .addModifier(f.StringNumber({ number: '4', position: 'left' }), 1)
45297
- .addModifier(f.StringNumber({ number: '3', position: 'right' }), 2);
45535
+ .addModifier(f.StringNumber({ number: '5', position: 'right' }, (_a = options.params) === null || _a === void 0 ? void 0 : _a.drawCircle), 0)
45536
+ .addModifier(f.StringNumber({ number: '4', position: 'left' }, (_b = options.params) === null || _b === void 0 ? void 0 : _b.drawCircle), 1)
45537
+ .addModifier(f.StringNumber({ number: '3', position: 'right' }, (_c = options.params) === null || _c === void 0 ? void 0 : _c.drawCircle), 2);
45298
45538
  notes1[1]
45299
45539
  .addModifier(f.Accidental({ type: '#' }), 0)
45300
- .addModifier(f.StringNumber({ number: '5', position: 'below' }), 0)
45540
+ .addModifier(f.StringNumber({ number: '5', position: 'below' }, (_d = options.params) === null || _d === void 0 ? void 0 : _d.drawCircle), 0)
45301
45541
  .addModifier(f.Accidental({ type: '#' }).setAsCautionary(), 1)
45302
45542
  .addModifier(f
45303
- .StringNumber({ number: '3', position: 'above' })
45543
+ .StringNumber({ number: '3', position: 'above' }, (_e = options.params) === null || _e === void 0 ? void 0 : _e.drawCircle)
45304
45544
  .setLastNote(notes1[3])
45305
45545
  .setLineEndType(_src_renderer__WEBPACK_IMPORTED_MODULE_2__.Renderer.LineEndType.DOWN), 2);
45306
45546
  notes1[2]
45307
- .addModifier(f.StringNumber({ number: '5', position: 'left' }), 0)
45308
- .addModifier(f.StringNumber({ number: '3', position: 'left' }), 2)
45547
+ .addModifier(f.StringNumber({ number: '5', position: 'left' }, (_f = options.params) === null || _f === void 0 ? void 0 : _f.drawCircle), 0)
45548
+ .addModifier(f.StringNumber({ number: '3', position: 'left' }, (_g = options.params) === null || _g === void 0 ? void 0 : _g.drawCircle), 2)
45309
45549
  .addModifier(f.Accidental({ type: '#' }), 1);
45310
45550
  notes1[3]
45311
- .addModifier(f.StringNumber({ number: '5', position: 'right' }).setOffsetY(7), 0)
45312
- .addModifier(f.StringNumber({ number: '4', position: 'right' }).setOffsetY(6), 1)
45313
- .addModifier(f.StringNumber({ number: '3', position: 'right' }).setOffsetY(-6), 2);
45551
+ .addModifier(f.StringNumber({ number: '5', position: 'right' }, (_h = options.params) === null || _h === void 0 ? void 0 : _h.drawCircle).setOffsetY(7), 0)
45552
+ .addModifier(f.StringNumber({ number: '4', position: 'right' }, (_j = options.params) === null || _j === void 0 ? void 0 : _j.drawCircle).setOffsetY(6), 1)
45553
+ .addModifier(f.StringNumber({ number: '3', position: 'right' }, (_k = options.params) === null || _k === void 0 ? void 0 : _k.drawCircle).setOffsetY(-6), 2);
45314
45554
  const voice1 = score.voice(notes1);
45315
45555
  f.Formatter().joinVoices([voice1]).formatToStave([voice1], stave1);
45316
45556
  // bar 2 - juxtaposing second bar next to first bar
@@ -45319,21 +45559,24 @@ function drawMultipleMeasures(options) {
45319
45559
  .setEndBarType(_src_stavebarline__WEBPACK_IMPORTED_MODULE_4__.BarlineType.DOUBLE);
45320
45560
  const notes2 = score.notes('(c4 e4 g4)/4, (c5 e5 g5), (c4 f4 g4), (c4 f4 g4)', { stem: 'up' });
45321
45561
  notes2[0]
45322
- .addModifier(f.StringNumber({ number: '5', position: 'right' }), 0)
45323
- .addModifier(f.StringNumber({ number: '4', position: 'left' }), 1)
45324
- .addModifier(f.StringNumber({ number: '3', position: 'right' }), 2);
45562
+ .addModifier(f.StringNumber({ number: '5', position: 'right' }, (_l = options.params) === null || _l === void 0 ? void 0 : _l.drawCircle), 0)
45563
+ .addModifier(f.StringNumber({ number: '4', position: 'left' }, (_m = options.params) === null || _m === void 0 ? void 0 : _m.drawCircle), 1)
45564
+ .addModifier(f.StringNumber({ number: '3', position: 'right' }, (_o = options.params) === null || _o === void 0 ? void 0 : _o.drawCircle), 2);
45325
45565
  notes2[1]
45326
45566
  .addModifier(f.Accidental({ type: '#' }), 0)
45327
- .addModifier(f.StringNumber({ number: '5', position: 'below' }), 0)
45567
+ .addModifier(f.StringNumber({ number: '5', position: 'below' }, (_p = options.params) === null || _p === void 0 ? void 0 : _p.drawCircle), 0)
45328
45568
  .addModifier(f.Accidental({ type: '#' }), 1)
45329
- .addModifier(f.StringNumber({ number: '3', position: 'above' }).setLastNote(notes2[3]).setDashed(false), 2);
45569
+ .addModifier(f
45570
+ .StringNumber({ number: '3', position: 'above' }, (_q = options.params) === null || _q === void 0 ? void 0 : _q.drawCircle)
45571
+ .setLastNote(notes2[3])
45572
+ .setDashed(false), 2);
45330
45573
  notes2[2]
45331
- .addModifier(f.StringNumber({ number: '3', position: 'left' }), 2)
45574
+ .addModifier(f.StringNumber({ number: '3', position: 'left' }, (_r = options.params) === null || _r === void 0 ? void 0 : _r.drawCircle), 2)
45332
45575
  .addModifier(f.Accidental({ type: '#' }), 1);
45333
45576
  notes2[3]
45334
- .addModifier(f.StringNumber({ number: '5', position: 'right' }).setOffsetY(7), 0)
45335
- .addModifier(f.StringNumber({ number: '4', position: 'right' }).setOffsetY(6), 1)
45336
- .addModifier(f.StringNumber({ number: '3', position: 'right' }).setOffsetY(-6), 2);
45577
+ .addModifier(f.StringNumber({ number: '5', position: 'right' }, (_s = options.params) === null || _s === void 0 ? void 0 : _s.drawCircle).setOffsetY(7), 0)
45578
+ .addModifier(f.StringNumber({ number: '4', position: 'right' }, (_t = options.params) === null || _t === void 0 ? void 0 : _t.drawCircle).setOffsetY(6), 1)
45579
+ .addModifier(f.StringNumber({ number: '3', position: 'right' }, (_u = options.params) === null || _u === void 0 ? void 0 : _u.drawCircle).setOffsetY(-6), 2);
45337
45580
  const voice2 = score.voice(notes2);
45338
45581
  f.Formatter().joinVoices([voice2]).formatToStave([voice2], stave2);
45339
45582
  // bar 3 - juxtaposing third bar next to second bar
@@ -45342,10 +45585,10 @@ function drawMultipleMeasures(options) {
45342
45585
  .setEndBarType(_src_stavebarline__WEBPACK_IMPORTED_MODULE_4__.BarlineType.END);
45343
45586
  const notesBar3 = score.notes('(c4 e4 g4 a4)/1.');
45344
45587
  notesBar3[0]
45345
- .addModifier(f.StringNumber({ number: '5', position: 'below' }), 0)
45346
- .addModifier(f.StringNumber({ number: '4', position: 'right' }), 1)
45347
- .addModifier(f.StringNumber({ number: '3', position: 'left' }), 2)
45348
- .addModifier(f.StringNumber({ number: '2', position: 'above' }), 3);
45588
+ .addModifier(f.StringNumber({ number: '5', position: 'below' }, (_v = options.params) === null || _v === void 0 ? void 0 : _v.drawCircle), 0)
45589
+ .addModifier(f.StringNumber({ number: '4', position: 'right' }, (_w = options.params) === null || _w === void 0 ? void 0 : _w.drawCircle), 1)
45590
+ .addModifier(f.StringNumber({ number: '3', position: 'left' }, (_x = options.params) === null || _x === void 0 ? void 0 : _x.drawCircle), 2)
45591
+ .addModifier(f.StringNumber({ number: '2', position: 'above' }, (_y = options.params) === null || _y === void 0 ? void 0 : _y.drawCircle), 3);
45349
45592
  const voice3 = score.voice(notesBar3, { time: '6/4' });
45350
45593
  f.Formatter().joinVoices([voice3]).formatToStave([voice3], stave3);
45351
45594
  f.draw();