vexflow 5.0.0-alpha.4 → 5.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -6
- package/build/cjs/vexflow-bravura.js +2 -2
- package/build/cjs/vexflow-bravura.js.map +1 -1
- package/build/cjs/vexflow-core.js +2 -2
- package/build/cjs/vexflow-core.js.map +1 -1
- package/build/cjs/vexflow-debug-with-tests.js +1546 -1393
- package/build/cjs/vexflow-debug-with-tests.js.map +1 -1
- package/build/cjs/vexflow-debug.js +600 -549
- package/build/cjs/vexflow-debug.js.map +1 -1
- package/build/cjs/vexflow.js +2 -2
- package/build/cjs/vexflow.js.map +1 -1
- package/build/esm/src/annotation.js +0 -2
- package/build/esm/src/barnote.js +3 -3
- package/build/esm/src/beam.js +2 -4
- package/build/esm/src/bend.js +11 -3
- package/build/esm/src/chordsymbol.js +0 -4
- package/build/esm/src/clef.js +0 -2
- package/build/esm/src/curve.js +8 -5
- package/build/esm/src/element.js +11 -17
- package/build/esm/src/factory.js +4 -4
- package/build/esm/src/flag.js +20 -0
- package/build/esm/src/formatter.js +4 -4
- package/build/esm/src/glyphnote.js +0 -2
- package/build/esm/src/gracenote.js +0 -2
- package/build/esm/src/gracenotegroup.js +17 -8
- package/build/esm/src/index.js +1 -0
- package/build/esm/src/keysignature.js +38 -31
- package/build/esm/src/keysignote.js +1 -1
- package/build/esm/src/metrics.js +55 -7
- package/build/esm/src/modifier.js +4 -2
- package/build/esm/src/notehead.js +6 -1
- package/build/esm/src/ornament.js +0 -2
- package/build/esm/src/pedalmarking.js +33 -41
- package/build/esm/src/stave.js +10 -16
- package/build/esm/src/stavebarline.js +2 -3
- package/build/esm/src/stavehairpin.js +1 -1
- package/build/esm/src/staveline.js +0 -4
- package/build/esm/src/stavemodifier.js +0 -2
- package/build/esm/src/stavenote.js +16 -28
- package/build/esm/src/staverepetition.js +3 -2
- package/build/esm/src/stavesection.js +13 -15
- package/build/esm/src/stavetempo.js +3 -2
- package/build/esm/src/stavetext.js +2 -2
- package/build/esm/src/stavetie.js +0 -4
- package/build/esm/src/stavevolta.js +3 -2
- package/build/esm/src/stem.js +0 -4
- package/build/esm/src/stemmablenote.js +5 -6
- package/build/esm/src/stringnumber.js +0 -2
- package/build/esm/src/svgcontext.js +0 -1
- package/build/esm/src/tabnote.js +2 -8
- package/build/esm/src/textbracket.js +0 -3
- package/build/esm/src/textnote.js +0 -2
- package/build/esm/src/timesignature.js +2 -4
- package/build/esm/src/timesignote.js +2 -0
- package/build/esm/src/tuplet.js +37 -30
- package/build/esm/src/version.js +3 -3
- package/build/esm/src/vexflow.js +6 -2
- package/build/esm/tests/accidental_tests.js +30 -17
- package/build/esm/tests/annotation_tests.js +12 -12
- package/build/esm/tests/articulation_tests.js +13 -13
- package/build/esm/tests/auto_beam_formatting_tests.js +33 -33
- package/build/esm/tests/beam_tests.js +1 -1
- package/build/esm/tests/bend_tests.js +7 -7
- package/build/esm/tests/chordsymbol_tests.js +8 -8
- package/build/esm/tests/curve_tests.js +34 -0
- package/build/esm/tests/{bach_tests.js → demo_petzold_tests.js} +7 -7
- package/build/esm/tests/dot_tests.js +4 -4
- package/build/esm/tests/formatter_tests.js +25 -25
- package/build/esm/tests/gracenote_tests.js +2 -1
- package/build/esm/tests/gracetabnote_tests.js +1 -1
- package/build/esm/tests/index.js +1 -1
- package/build/esm/tests/key_clef_tests.js +6 -6
- package/build/esm/tests/keysignature_tests.js +20 -17
- package/build/esm/tests/notehead_tests.js +10 -7
- package/build/esm/tests/offscreencanvas_tests.js +1 -1
- package/build/esm/tests/ornament_tests.js +8 -8
- package/build/esm/tests/pedalmarking_tests.js +27 -0
- package/build/esm/tests/percussion_tests.js +6 -3
- package/build/esm/tests/renderer_tests.js +1 -1
- package/build/esm/tests/rests_tests.js +26 -26
- package/build/esm/tests/rhythm_tests.js +15 -15
- package/build/esm/tests/stave_tests.js +44 -43
- package/build/esm/tests/staveconnector_tests.js +73 -73
- package/build/esm/tests/stavehairpin_tests.js +1 -1
- package/build/esm/tests/stavemodifier_tests.js +3 -3
- package/build/esm/tests/stavenote_tests.js +29 -29
- package/build/esm/tests/stringnumber_tests.js +1 -1
- package/build/esm/tests/strokes_tests.js +1 -1
- package/build/esm/tests/style_tests.js +1 -1
- package/build/esm/tests/tabnote_tests.js +7 -7
- package/build/esm/tests/tabslide_tests.js +6 -6
- package/build/esm/tests/tabstave_tests.js +1 -1
- package/build/esm/tests/tabtie_tests.js +8 -8
- package/build/esm/tests/textnote_tests.js +1 -1
- package/build/esm/tests/threevoice_tests.js +2 -2
- package/build/esm/tests/timesignature_tests.js +23 -13
- package/build/esm/tests/vibrato_tests.js +3 -3
- package/build/esm/tests/voice_tests.js +1 -1
- package/build/types/src/bend.d.ts +6 -0
- package/build/types/src/curve.d.ts +5 -4
- package/build/types/src/element.d.ts +10 -11
- package/build/types/src/factory.d.ts +2 -2
- package/build/types/src/flag.d.ts +12 -0
- package/build/types/src/frethandfinger.d.ts +1 -1
- package/build/types/src/index.d.ts +1 -0
- package/build/types/src/keysignature.d.ts +7 -7
- package/build/types/src/metrics.d.ts +5 -0
- package/build/types/src/modifier.d.ts +1 -1
- package/build/types/src/pedalmarking.d.ts +2 -2
- package/build/types/src/stave.d.ts +1 -3
- package/build/types/src/stavebarline.d.ts +1 -1
- package/build/types/src/staveline.d.ts +1 -1
- package/build/types/src/stavemodifier.d.ts +0 -1
- package/build/types/src/staverepetition.d.ts +1 -1
- package/build/types/src/stavesection.d.ts +3 -4
- package/build/types/src/stavetempo.d.ts +1 -2
- package/build/types/src/stavetext.d.ts +1 -2
- package/build/types/src/stavevolta.d.ts +1 -2
- package/build/types/src/stemmablenote.d.ts +2 -3
- package/build/types/src/tuplet.d.ts +2 -12
- package/build/types/src/typeguard.d.ts +1 -0
- package/package.json +32 -28
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* VexFlow 5.0.0-
|
|
2
|
+
* VexFlow 5.0.0-beta.0 2024-09-12T19:16:57.446Z 2daeb4def8b685227f2a3c924177b40ddcc5bda3
|
|
3
3
|
* Copyright (c) 2023-present VexFlow contributors (see https://github.com/vexflow/vexflow/blob/main/AUTHORS.md).
|
|
4
4
|
*/
|
|
5
5
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
@@ -29,9 +29,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
29
29
|
/* harmony export */ VERSION: () => (/* binding */ VERSION)
|
|
30
30
|
/* harmony export */ });
|
|
31
31
|
// Gruntfile.js uses string-replace-loader to replace these values during build time.
|
|
32
|
-
const VERSION = '5.0.0-
|
|
33
|
-
const ID = '
|
|
34
|
-
const DATE = '2024-
|
|
32
|
+
const VERSION = '5.0.0-beta.0';
|
|
33
|
+
const ID = '2daeb4def8b685227f2a3c924177b40ddcc5bda3';
|
|
34
|
+
const DATE = '2024-09-12T19:16:57.446Z';
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
/***/ }),
|
|
@@ -721,7 +721,6 @@ class Annotation extends _modifier__WEBPACK_IMPORTED_MODULE_2__.Modifier {
|
|
|
721
721
|
const stemDirection = note.hasStem() ? note.getStemDirection() : _stem__WEBPACK_IMPORTED_MODULE_3__.Stem.UP;
|
|
722
722
|
const start = note.getModifierStartXY(_modifier__WEBPACK_IMPORTED_MODULE_2__.ModifierPosition.ABOVE, this.index);
|
|
723
723
|
this.setRendered();
|
|
724
|
-
this.applyStyle();
|
|
725
724
|
ctx.openGroup('annotation', this.getAttribute('id'));
|
|
726
725
|
const textWidth = this.getWidth();
|
|
727
726
|
const textHeight = _font__WEBPACK_IMPORTED_MODULE_0__.Font.convertSizeToPixelValue(this.fontInfo.size);
|
|
@@ -782,7 +781,6 @@ class Annotation extends _modifier__WEBPACK_IMPORTED_MODULE_2__.Modifier {
|
|
|
782
781
|
this.y = y;
|
|
783
782
|
this.renderText(ctx, 0, 0);
|
|
784
783
|
ctx.closeGroup();
|
|
785
|
-
this.restoreStyle();
|
|
786
784
|
}
|
|
787
785
|
}
|
|
788
786
|
/** To enable logging for this class. Set `VexFlow.Annotation.DEBUG` to `true`. */
|
|
@@ -1254,11 +1252,11 @@ class BarNote extends _note__WEBPACK_IMPORTED_MODULE_0__.Note {
|
|
|
1254
1252
|
draw() {
|
|
1255
1253
|
const ctx = this.checkContext();
|
|
1256
1254
|
L('Rendering bar line at: ', this.getAbsoluteX());
|
|
1257
|
-
this.applyStyle(ctx);
|
|
1258
1255
|
const barline = new _stavebarline__WEBPACK_IMPORTED_MODULE_1__.Barline(this.type);
|
|
1259
1256
|
barline.setX(this.getAbsoluteX());
|
|
1260
|
-
barline.
|
|
1261
|
-
|
|
1257
|
+
barline.setStave(this.checkStave());
|
|
1258
|
+
barline.setContext(ctx);
|
|
1259
|
+
barline.drawWithStyle();
|
|
1262
1260
|
this.setRendered();
|
|
1263
1261
|
}
|
|
1264
1262
|
}
|
|
@@ -2044,7 +2042,7 @@ class Beam extends _element__WEBPACK_IMPORTED_MODULE_0__.Element {
|
|
|
2044
2042
|
if (stem) {
|
|
2045
2043
|
const stemX = note.getStemX();
|
|
2046
2044
|
stem.setNoteHeadXBounds(stemX, stemX);
|
|
2047
|
-
stem.setContext(ctx).
|
|
2045
|
+
stem.setContext(ctx).drawWithStyle();
|
|
2048
2046
|
}
|
|
2049
2047
|
}, this);
|
|
2050
2048
|
}
|
|
@@ -2112,12 +2110,10 @@ class Beam extends _element__WEBPACK_IMPORTED_MODULE_0__.Element {
|
|
|
2112
2110
|
if (!this.postFormatted) {
|
|
2113
2111
|
this.postFormat();
|
|
2114
2112
|
}
|
|
2115
|
-
this.drawStems(ctx);
|
|
2116
|
-
this.applyStyle();
|
|
2117
2113
|
ctx.openGroup('beam', this.getAttribute('id'));
|
|
2114
|
+
this.drawStems(ctx);
|
|
2118
2115
|
this.drawBeamLines(ctx);
|
|
2119
2116
|
ctx.closeGroup();
|
|
2120
|
-
this.restoreStyle();
|
|
2121
2117
|
}
|
|
2122
2118
|
}
|
|
2123
2119
|
|
|
@@ -2135,19 +2131,21 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2135
2131
|
/* harmony export */ Bend: () => (/* binding */ Bend)
|
|
2136
2132
|
/* harmony export */ });
|
|
2137
2133
|
/* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./element */ "./src/element.ts");
|
|
2138
|
-
/* harmony import */ var
|
|
2139
|
-
/* harmony import */ var
|
|
2140
|
-
/* harmony import */ var
|
|
2134
|
+
/* harmony import */ var _metrics__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./metrics */ "./src/metrics.ts");
|
|
2135
|
+
/* harmony import */ var _modifier__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./modifier */ "./src/modifier.ts");
|
|
2136
|
+
/* harmony import */ var _typeguard__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./typeguard */ "./src/typeguard.ts");
|
|
2137
|
+
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./util */ "./src/util.ts");
|
|
2141
2138
|
// Copyright (c) 2023-present VexFlow contributors: https://github.com/vexflow/vexflow/graphs/contributors
|
|
2142
2139
|
// MIT License
|
|
2143
2140
|
|
|
2144
2141
|
|
|
2145
2142
|
|
|
2146
2143
|
|
|
2144
|
+
|
|
2147
2145
|
/** Bend implements tablature bends. */
|
|
2148
|
-
class Bend extends
|
|
2146
|
+
class Bend extends _modifier__WEBPACK_IMPORTED_MODULE_2__.Modifier {
|
|
2149
2147
|
static get CATEGORY() {
|
|
2150
|
-
return
|
|
2148
|
+
return _typeguard__WEBPACK_IMPORTED_MODULE_3__.Category.Bend;
|
|
2151
2149
|
}
|
|
2152
2150
|
static get UP() {
|
|
2153
2151
|
return 0;
|
|
@@ -2164,7 +2162,7 @@ class Bend extends _modifier__WEBPACK_IMPORTED_MODULE_1__.Modifier {
|
|
|
2164
2162
|
for (let i = 0; i < bends.length; ++i) {
|
|
2165
2163
|
const bend = bends[i];
|
|
2166
2164
|
const note = bend.checkAttachedNote();
|
|
2167
|
-
if ((0,
|
|
2165
|
+
if ((0,_typeguard__WEBPACK_IMPORTED_MODULE_3__.isTabNote)(note)) {
|
|
2168
2166
|
const stringPos = note.leastString() - 1;
|
|
2169
2167
|
if (state.topTextLine < stringPos) {
|
|
2170
2168
|
state.topTextLine = stringPos;
|
|
@@ -2178,6 +2176,15 @@ class Bend extends _modifier__WEBPACK_IMPORTED_MODULE_1__.Modifier {
|
|
|
2178
2176
|
state.topTextLine += 1;
|
|
2179
2177
|
return true;
|
|
2180
2178
|
}
|
|
2179
|
+
/** Set the element style used for rendering the lines. */
|
|
2180
|
+
setStyleLine(style) {
|
|
2181
|
+
this.styleLine = style;
|
|
2182
|
+
return this;
|
|
2183
|
+
}
|
|
2184
|
+
/** Get the element style used for rendering the lines. */
|
|
2185
|
+
getStyleLine() {
|
|
2186
|
+
return this.styleLine;
|
|
2187
|
+
}
|
|
2181
2188
|
/**
|
|
2182
2189
|
* Example of a phrase:
|
|
2183
2190
|
* ```
|
|
@@ -2210,13 +2217,13 @@ class Bend extends _modifier__WEBPACK_IMPORTED_MODULE_1__.Modifier {
|
|
|
2210
2217
|
*/
|
|
2211
2218
|
constructor(phrase) {
|
|
2212
2219
|
super();
|
|
2220
|
+
this.styleLine = _metrics__WEBPACK_IMPORTED_MODULE_1__.Metrics.getStyle('Bend.line');
|
|
2213
2221
|
this.xShift = 0;
|
|
2214
2222
|
this.tap = '';
|
|
2215
2223
|
this.renderOptions = {
|
|
2216
2224
|
bendWidth: 8,
|
|
2217
2225
|
releaseWidth: 8,
|
|
2218
2226
|
};
|
|
2219
|
-
this.setStyle({ lineWidth: 1.0, strokeStyle: 'black', fillStyle: 'black' });
|
|
2220
2227
|
this.phrase = phrase;
|
|
2221
2228
|
this.updateWidth();
|
|
2222
2229
|
}
|
|
@@ -2231,14 +2238,14 @@ class Bend extends _modifier__WEBPACK_IMPORTED_MODULE_1__.Modifier {
|
|
|
2231
2238
|
return this;
|
|
2232
2239
|
}
|
|
2233
2240
|
getTextHeight() {
|
|
2234
|
-
const element = new _element__WEBPACK_IMPORTED_MODULE_0__.Element(
|
|
2241
|
+
const element = new _element__WEBPACK_IMPORTED_MODULE_0__.Element(_typeguard__WEBPACK_IMPORTED_MODULE_3__.Category.Bend);
|
|
2235
2242
|
element.setText(this.phrase[0].text);
|
|
2236
2243
|
return element.getHeight();
|
|
2237
2244
|
}
|
|
2238
2245
|
/** Recalculate width. */
|
|
2239
2246
|
updateWidth() {
|
|
2240
2247
|
const measureText = (text) => {
|
|
2241
|
-
const element = new _element__WEBPACK_IMPORTED_MODULE_0__.Element(
|
|
2248
|
+
const element = new _element__WEBPACK_IMPORTED_MODULE_0__.Element(_typeguard__WEBPACK_IMPORTED_MODULE_3__.Category.Bend);
|
|
2242
2249
|
element.setText(text);
|
|
2243
2250
|
return element.getWidth();
|
|
2244
2251
|
};
|
|
@@ -2264,8 +2271,7 @@ class Bend extends _modifier__WEBPACK_IMPORTED_MODULE_1__.Modifier {
|
|
|
2264
2271
|
const ctx = this.checkContext();
|
|
2265
2272
|
const note = this.checkAttachedNote();
|
|
2266
2273
|
this.setRendered();
|
|
2267
|
-
this.
|
|
2268
|
-
const start = note.getModifierStartXY(_modifier__WEBPACK_IMPORTED_MODULE_1__.Modifier.Position.RIGHT, this.index);
|
|
2274
|
+
const start = note.getModifierStartXY(_modifier__WEBPACK_IMPORTED_MODULE_2__.Modifier.Position.RIGHT, this.index);
|
|
2269
2275
|
start.x += 3;
|
|
2270
2276
|
start.y += 0.5;
|
|
2271
2277
|
const xShift = this.xShift;
|
|
@@ -2278,12 +2284,14 @@ class Bend extends _modifier__WEBPACK_IMPORTED_MODULE_1__.Modifier {
|
|
|
2278
2284
|
const renderBend = (x, y, width, height) => {
|
|
2279
2285
|
const cpX = x + width;
|
|
2280
2286
|
const cpY = y;
|
|
2287
|
+
this.applyStyle(ctx, this.styleLine);
|
|
2281
2288
|
ctx.beginPath();
|
|
2282
2289
|
ctx.moveTo(x, y);
|
|
2283
2290
|
ctx.quadraticCurveTo(cpX, cpY, x + width, height);
|
|
2284
2291
|
ctx.stroke();
|
|
2285
2292
|
};
|
|
2286
2293
|
const renderRelease = (x, y, width, height) => {
|
|
2294
|
+
this.applyStyle(ctx, this.styleLine);
|
|
2287
2295
|
ctx.beginPath();
|
|
2288
2296
|
ctx.moveTo(x, height);
|
|
2289
2297
|
ctx.quadraticCurveTo(x + width, height, x + width, y);
|
|
@@ -2308,7 +2316,7 @@ class Bend extends _modifier__WEBPACK_IMPORTED_MODULE_1__.Modifier {
|
|
|
2308
2316
|
let lastBendDrawWidth = 0;
|
|
2309
2317
|
let lastDrawnWidth = 0;
|
|
2310
2318
|
if ((_a = this.tap) === null || _a === void 0 ? void 0 : _a.length) {
|
|
2311
|
-
const tapStart = note.getModifierStartXY(
|
|
2319
|
+
const tapStart = note.getModifierStartXY(_modifier__WEBPACK_IMPORTED_MODULE_2__.Modifier.Position.CENTER, this.index);
|
|
2312
2320
|
renderText(tapStart.x, this.tap);
|
|
2313
2321
|
}
|
|
2314
2322
|
for (let i = 0; i < this.phrase.length; ++i) {
|
|
@@ -2344,7 +2352,7 @@ class Bend extends _modifier__WEBPACK_IMPORTED_MODULE_1__.Modifier {
|
|
|
2344
2352
|
start.x += lastDrawnWidth;
|
|
2345
2353
|
}
|
|
2346
2354
|
if (!lastBend || lastBend.x === undefined) {
|
|
2347
|
-
throw new
|
|
2355
|
+
throw new _util__WEBPACK_IMPORTED_MODULE_4__.RuntimeError('NoLastBendForBend', 'Internal error.');
|
|
2348
2356
|
}
|
|
2349
2357
|
// Final arrowhead and text
|
|
2350
2358
|
if (lastBend.type === Bend.UP) {
|
|
@@ -2353,7 +2361,6 @@ class Bend extends _modifier__WEBPACK_IMPORTED_MODULE_1__.Modifier {
|
|
|
2353
2361
|
else if (lastBend.type === Bend.DOWN) {
|
|
2354
2362
|
renderArrowHead(lastBend.x + lastDrawnWidth, start.y, -1);
|
|
2355
2363
|
}
|
|
2356
|
-
this.restoreStyle();
|
|
2357
2364
|
}
|
|
2358
2365
|
}
|
|
2359
2366
|
|
|
@@ -3032,9 +3039,6 @@ class ChordSymbol extends _modifier__WEBPACK_IMPORTED_MODULE_4__.Modifier {
|
|
|
3032
3039
|
const ctx = this.checkContext();
|
|
3033
3040
|
const note = this.checkAttachedNote();
|
|
3034
3041
|
this.setRendered();
|
|
3035
|
-
// We're changing context parameters. Save current state.
|
|
3036
|
-
ctx.save();
|
|
3037
|
-
this.applyStyle();
|
|
3038
3042
|
ctx.openGroup('chordsymbol', this.getAttribute('id'));
|
|
3039
3043
|
const start = note.getModifierStartXY(_modifier__WEBPACK_IMPORTED_MODULE_4__.Modifier.Position.ABOVE, this.index);
|
|
3040
3044
|
ctx.setFont(this.fontInfo);
|
|
@@ -3085,8 +3089,6 @@ class ChordSymbol extends _modifier__WEBPACK_IMPORTED_MODULE_4__.Modifier {
|
|
|
3085
3089
|
symbol.renderText(ctx, 0, 0);
|
|
3086
3090
|
});
|
|
3087
3091
|
ctx.closeGroup();
|
|
3088
|
-
this.restoreStyle();
|
|
3089
|
-
ctx.restore();
|
|
3090
3092
|
}
|
|
3091
3093
|
// Get the `BoundingBox` for the entire chord
|
|
3092
3094
|
getBoundingBox() {
|
|
@@ -3292,12 +3294,10 @@ class Clef extends _stavemodifier__WEBPACK_IMPORTED_MODULE_2__.StaveModifier {
|
|
|
3292
3294
|
const stave = this.checkStave();
|
|
3293
3295
|
const ctx = stave.checkContext();
|
|
3294
3296
|
this.setRendered();
|
|
3295
|
-
this.applyStyle(ctx);
|
|
3296
3297
|
ctx.openGroup('clef', this.getAttribute('id'));
|
|
3297
3298
|
this.y = stave.getYForLine(this.line);
|
|
3298
3299
|
this.renderText(ctx, 0, 0);
|
|
3299
3300
|
ctx.closeGroup();
|
|
3300
|
-
this.restoreStyle(ctx);
|
|
3301
3301
|
}
|
|
3302
3302
|
}
|
|
3303
3303
|
/** To enable logging for this class, set `VexFlow.Clef.DEBUG` to `true`. */
|
|
@@ -3535,9 +3535,8 @@ class Curve extends _element__WEBPACK_IMPORTED_MODULE_0__.Element {
|
|
|
3535
3535
|
this.renderOptions = Object.assign({ thickness: 2, xShift: 0, yShift: 10, position: CurvePosition.NEAR_HEAD, positionEnd: CurvePosition.NEAR_HEAD, invert: false, cps: [
|
|
3536
3536
|
{ x: 0, y: 10 },
|
|
3537
3537
|
{ x: 0, y: 10 },
|
|
3538
|
-
] }, options);
|
|
3539
|
-
this.from
|
|
3540
|
-
this.to = to;
|
|
3538
|
+
], openingDirection: 'auto' }, options);
|
|
3539
|
+
this.setNotes(from, to);
|
|
3541
3540
|
}
|
|
3542
3541
|
setNotes(from, to) {
|
|
3543
3542
|
if (!from && !to) {
|
|
@@ -3556,7 +3555,6 @@ class Curve extends _element__WEBPACK_IMPORTED_MODULE_0__.Element {
|
|
|
3556
3555
|
renderCurve(params) {
|
|
3557
3556
|
var _a, _b;
|
|
3558
3557
|
const ctx = this.checkContext();
|
|
3559
|
-
this.applyStyle();
|
|
3560
3558
|
const xShift = this.renderOptions.xShift;
|
|
3561
3559
|
const yShift = this.renderOptions.yShift * params.direction;
|
|
3562
3560
|
const firstX = params.firstX + xShift;
|
|
@@ -3577,7 +3575,6 @@ class Curve extends _element__WEBPACK_IMPORTED_MODULE_0__.Element {
|
|
|
3577
3575
|
ctx.closePath();
|
|
3578
3576
|
if (!((_b = this.style) === null || _b === void 0 ? void 0 : _b.lineDash))
|
|
3579
3577
|
ctx.fill();
|
|
3580
|
-
this.restoreStyle();
|
|
3581
3578
|
}
|
|
3582
3579
|
draw() {
|
|
3583
3580
|
this.checkContext();
|
|
@@ -3626,6 +3623,12 @@ class Curve extends _element__WEBPACK_IMPORTED_MODULE_0__.Element {
|
|
|
3626
3623
|
lastX = stave.getTieEndX();
|
|
3627
3624
|
lastY = firstNote.getStemExtents()[endMetric];
|
|
3628
3625
|
}
|
|
3626
|
+
if (this.renderOptions.openingDirection === 'up') {
|
|
3627
|
+
stemDirection = 1;
|
|
3628
|
+
}
|
|
3629
|
+
if (this.renderOptions.openingDirection === 'down') {
|
|
3630
|
+
stemDirection = -1;
|
|
3631
|
+
}
|
|
3629
3632
|
this.renderCurve({
|
|
3630
3633
|
firstX,
|
|
3631
3634
|
lastX,
|
|
@@ -3877,7 +3880,6 @@ class EasyScoreGrammar {
|
|
|
3877
3880
|
CHORD() {
|
|
3878
3881
|
return {
|
|
3879
3882
|
expect: [this.LPAREN, this.NOTES, this.RPAREN],
|
|
3880
|
-
// eslint-disable-next-line
|
|
3881
3883
|
run: (state) => this.builder.addChord(state.matches[1]),
|
|
3882
3884
|
};
|
|
3883
3885
|
}
|
|
@@ -3896,7 +3898,6 @@ class EasyScoreGrammar {
|
|
|
3896
3898
|
return {
|
|
3897
3899
|
expect: [this.NOTENAME, this.ACCIDENTAL, this.OCTAVE],
|
|
3898
3900
|
run: (state) => {
|
|
3899
|
-
// eslint-disable-next-line
|
|
3900
3901
|
const s = state;
|
|
3901
3902
|
this.builder.addSingleNote(s.matches[0], s.matches[1], s.matches[2]);
|
|
3902
3903
|
},
|
|
@@ -3913,7 +3914,6 @@ class EasyScoreGrammar {
|
|
|
3913
3914
|
return {
|
|
3914
3915
|
expect: [this.DOT],
|
|
3915
3916
|
zeroOrMore: true,
|
|
3916
|
-
// eslint-disable-next-line
|
|
3917
3917
|
run: (state) => this.builder.setNoteDots(state.matches),
|
|
3918
3918
|
};
|
|
3919
3919
|
}
|
|
@@ -3921,7 +3921,6 @@ class EasyScoreGrammar {
|
|
|
3921
3921
|
return {
|
|
3922
3922
|
expect: [this.SLASH, this.MAYBESLASH, this.TYPES],
|
|
3923
3923
|
maybe: true,
|
|
3924
|
-
// eslint-disable-next-line
|
|
3925
3924
|
run: (state) => this.builder.setNoteType(state.matches[2]),
|
|
3926
3925
|
};
|
|
3927
3926
|
}
|
|
@@ -3929,7 +3928,6 @@ class EasyScoreGrammar {
|
|
|
3929
3928
|
return {
|
|
3930
3929
|
expect: [this.SLASH, this.DURATIONS],
|
|
3931
3930
|
maybe: true,
|
|
3932
|
-
// eslint-disable-next-line
|
|
3933
3931
|
run: (state) => this.builder.setNoteDuration(state.matches[1]),
|
|
3934
3932
|
};
|
|
3935
3933
|
}
|
|
@@ -3949,7 +3947,6 @@ class EasyScoreGrammar {
|
|
|
3949
3947
|
const unquote = (str) => str.slice(1, -1);
|
|
3950
3948
|
return {
|
|
3951
3949
|
expect: [this.KEY, this.EQUALS, this.VAL],
|
|
3952
|
-
// eslint-disable-next-line
|
|
3953
3950
|
run: (state) => this.builder.addNoteOption(state.matches[0], unquote(state.matches[2])),
|
|
3954
3951
|
};
|
|
3955
3952
|
}
|
|
@@ -4194,7 +4191,6 @@ class EasyScore {
|
|
|
4194
4191
|
*/
|
|
4195
4192
|
setOptions(options) {
|
|
4196
4193
|
var _a, _b;
|
|
4197
|
-
// eslint-disable-next-line
|
|
4198
4194
|
const factory = options.factory; // ! operator, because options.factory was set in Factory.EasyScore().
|
|
4199
4195
|
const builder = (_a = options.builder) !== null && _a !== void 0 ? _a : new Builder(factory);
|
|
4200
4196
|
this.options = Object.assign(Object.assign({ commitHooks: [setId, setClass, _articulation__WEBPACK_IMPORTED_MODULE_0__.Articulation.easyScoreHook, _frethandfinger__WEBPACK_IMPORTED_MODULE_2__.FretHandFinger.easyScoreHook], throwOnError: false }, options), { factory,
|
|
@@ -4312,9 +4308,8 @@ class Element {
|
|
|
4312
4308
|
}
|
|
4313
4309
|
constructor(category) {
|
|
4314
4310
|
var _a;
|
|
4315
|
-
// Element objects keep a list of children that they are responsible for.
|
|
4316
|
-
// Children inherit the style from their parents (see: setGroupStyle(s)).
|
|
4317
4311
|
this.children = [];
|
|
4312
|
+
this.style = {};
|
|
4318
4313
|
this._text = '';
|
|
4319
4314
|
this.metricsValid = false;
|
|
4320
4315
|
this._textMetrics = {
|
|
@@ -4344,12 +4339,13 @@ class Element {
|
|
|
4344
4339
|
};
|
|
4345
4340
|
this.rendered = false;
|
|
4346
4341
|
this._fontInfo = _metrics__WEBPACK_IMPORTED_MODULE_2__.Metrics.getFontInfo(this.attrs.type);
|
|
4342
|
+
this.style = _metrics__WEBPACK_IMPORTED_MODULE_2__.Metrics.getStyle(this.attrs.type);
|
|
4347
4343
|
this.fontScale = _metrics__WEBPACK_IMPORTED_MODULE_2__.Metrics.get(`${this.attrs.type}.fontScale`);
|
|
4348
4344
|
// If a default registry exist, then register with it right away.
|
|
4349
4345
|
(_a = _registry__WEBPACK_IMPORTED_MODULE_3__.Registry.getDefaultRegistry()) === null || _a === void 0 ? void 0 : _a.register(this);
|
|
4350
4346
|
}
|
|
4351
4347
|
/**
|
|
4352
|
-
* Adds a child
|
|
4348
|
+
* Adds a child to the Element, which lets it inherit the
|
|
4353
4349
|
* same style as the parent when setGroupStyle() is called.
|
|
4354
4350
|
*
|
|
4355
4351
|
* Examples of children are noteheads and stems. Modifiers such
|
|
@@ -4357,7 +4353,10 @@ class Element {
|
|
|
4357
4353
|
*
|
|
4358
4354
|
* Note that StaveNote calls setGroupStyle() when setStyle() is called.
|
|
4359
4355
|
*/
|
|
4360
|
-
|
|
4356
|
+
addChild(child) {
|
|
4357
|
+
if (child.parent)
|
|
4358
|
+
throw new _util__WEBPACK_IMPORTED_MODULE_5__.RuntimeError('Element', 'Parent already defined');
|
|
4359
|
+
child.parent = this;
|
|
4361
4360
|
this.children.push(child);
|
|
4362
4361
|
return this;
|
|
4363
4362
|
}
|
|
@@ -4370,7 +4369,7 @@ class Element {
|
|
|
4370
4369
|
* Example:
|
|
4371
4370
|
* ```typescript
|
|
4372
4371
|
* element.setStyle({ fillStyle: 'red', strokeStyle: 'red' });
|
|
4373
|
-
* element.
|
|
4372
|
+
* element.drawWithStyle();
|
|
4374
4373
|
* ```
|
|
4375
4374
|
* Note: If the element draws additional sub-elements (i.e.: Modifiers in a Stave),
|
|
4376
4375
|
* the style can be applied to all of them by means of the context:
|
|
@@ -4378,7 +4377,7 @@ class Element {
|
|
|
4378
4377
|
* element.setStyle({ fillStyle: 'red', strokeStyle: 'red' });
|
|
4379
4378
|
* element.getContext().setFillStyle('red');
|
|
4380
4379
|
* element.getContext().setStrokeStyle('red');
|
|
4381
|
-
* element.
|
|
4380
|
+
* element.drawWithStyle();
|
|
4382
4381
|
* ```
|
|
4383
4382
|
* or using drawWithStyle:
|
|
4384
4383
|
* ```typescript
|
|
@@ -4402,11 +4401,8 @@ class Element {
|
|
|
4402
4401
|
}
|
|
4403
4402
|
/** Apply the element style to `context`. */
|
|
4404
4403
|
applyStyle(context = this.context, style = this.getStyle()) {
|
|
4405
|
-
if (!style)
|
|
4406
|
-
return this;
|
|
4407
4404
|
if (!context)
|
|
4408
4405
|
return this;
|
|
4409
|
-
context.save();
|
|
4410
4406
|
if (style.shadowColor)
|
|
4411
4407
|
context.setShadowColor(style.shadowColor);
|
|
4412
4408
|
if (style.shadowBlur)
|
|
@@ -4421,24 +4417,17 @@ class Element {
|
|
|
4421
4417
|
context.setLineDash(style.lineDash.split(' ').map(Number));
|
|
4422
4418
|
return this;
|
|
4423
4419
|
}
|
|
4424
|
-
/** Restore the style of `context`. */
|
|
4425
|
-
restoreStyle(context = this.context, style = this.getStyle()) {
|
|
4426
|
-
if (!style)
|
|
4427
|
-
return this;
|
|
4428
|
-
if (!context)
|
|
4429
|
-
return this;
|
|
4430
|
-
context.restore();
|
|
4431
|
-
return this;
|
|
4432
|
-
}
|
|
4433
4420
|
/**
|
|
4434
4421
|
* Draw the element and all its sub-elements (i.e.: Modifiers in a Stave)
|
|
4435
4422
|
* with the element's style (see `getStyle()` and `setStyle()`)
|
|
4436
4423
|
*/
|
|
4437
4424
|
drawWithStyle() {
|
|
4438
|
-
this.checkContext();
|
|
4439
|
-
|
|
4425
|
+
const ctx = this.checkContext();
|
|
4426
|
+
ctx.save();
|
|
4427
|
+
this.applyStyle(ctx);
|
|
4440
4428
|
this.draw();
|
|
4441
|
-
|
|
4429
|
+
ctx.restore();
|
|
4430
|
+
return this;
|
|
4442
4431
|
}
|
|
4443
4432
|
/** Draw an element. */
|
|
4444
4433
|
draw() {
|
|
@@ -4744,7 +4733,6 @@ class Element {
|
|
|
4744
4733
|
}
|
|
4745
4734
|
/** Render the element text. */
|
|
4746
4735
|
renderText(ctx, xPos, yPos) {
|
|
4747
|
-
ctx.save();
|
|
4748
4736
|
ctx.setFont(this._fontInfo);
|
|
4749
4737
|
ctx.fillText(this._text, xPos + this.x + this.xShift, yPos + this.y + this.yShift);
|
|
4750
4738
|
this.children.forEach((child) => {
|
|
@@ -4752,7 +4740,6 @@ class Element {
|
|
|
4752
4740
|
ctx.setFont(child.fontInfo);
|
|
4753
4741
|
ctx.fillText(child.text, xPos + child.x + child.xShift, yPos + child.y + child.yShift);
|
|
4754
4742
|
});
|
|
4755
|
-
ctx.restore();
|
|
4756
4743
|
}
|
|
4757
4744
|
/** Measure the text using the textFont. */
|
|
4758
4745
|
measureText() {
|
|
@@ -5376,13 +5363,13 @@ class Factory {
|
|
|
5376
5363
|
draw() {
|
|
5377
5364
|
const ctx = this.context;
|
|
5378
5365
|
this.systems.forEach((s) => s.setContext(ctx).format());
|
|
5379
|
-
this.staves.forEach((s) => s.setContext(ctx).
|
|
5380
|
-
this.voices.forEach((v) => v.setContext(ctx).
|
|
5366
|
+
this.staves.forEach((s) => s.setContext(ctx).drawWithStyle());
|
|
5367
|
+
this.voices.forEach((v) => v.setContext(ctx).drawWithStyle());
|
|
5381
5368
|
this.renderQ.forEach((e) => {
|
|
5382
5369
|
if (!e.isRendered())
|
|
5383
|
-
e.setContext(ctx).
|
|
5370
|
+
e.setContext(ctx).drawWithStyle();
|
|
5384
5371
|
});
|
|
5385
|
-
this.systems.forEach((s) => s.setContext(ctx).
|
|
5372
|
+
this.systems.forEach((s) => s.setContext(ctx).drawWithStyle());
|
|
5386
5373
|
this.reset();
|
|
5387
5374
|
}
|
|
5388
5375
|
}
|
|
@@ -5390,6 +5377,53 @@ class Factory {
|
|
|
5390
5377
|
Factory.DEBUG = false;
|
|
5391
5378
|
|
|
5392
5379
|
|
|
5380
|
+
/***/ }),
|
|
5381
|
+
|
|
5382
|
+
/***/ "./src/flag.ts":
|
|
5383
|
+
/*!*********************!*\
|
|
5384
|
+
!*** ./src/flag.ts ***!
|
|
5385
|
+
\*********************/
|
|
5386
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
5387
|
+
|
|
5388
|
+
__webpack_require__.r(__webpack_exports__);
|
|
5389
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
5390
|
+
/* harmony export */ Flag: () => (/* binding */ Flag)
|
|
5391
|
+
/* harmony export */ });
|
|
5392
|
+
/* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./element */ "./src/element.ts");
|
|
5393
|
+
/* harmony import */ var _typeguard__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./typeguard */ "./src/typeguard.ts");
|
|
5394
|
+
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./util */ "./src/util.ts");
|
|
5395
|
+
// Copyright (c) 2023-present VexFlow contributors: https://github.com/vexflow/vexflow/graphs/contributors
|
|
5396
|
+
// MIT License
|
|
5397
|
+
|
|
5398
|
+
|
|
5399
|
+
|
|
5400
|
+
// eslint-disable-next-line
|
|
5401
|
+
function L(...args) {
|
|
5402
|
+
if (Flag.DEBUG)
|
|
5403
|
+
(0,_util__WEBPACK_IMPORTED_MODULE_2__.log)('VexFlow.Flag', args);
|
|
5404
|
+
}
|
|
5405
|
+
/**
|
|
5406
|
+
* `Flags` are typically not manipulated
|
|
5407
|
+
* directly, but used internally in `StaveNote`.
|
|
5408
|
+
*/
|
|
5409
|
+
class Flag extends _element__WEBPACK_IMPORTED_MODULE_0__.Element {
|
|
5410
|
+
static get CATEGORY() {
|
|
5411
|
+
return _typeguard__WEBPACK_IMPORTED_MODULE_1__.Category.Flag;
|
|
5412
|
+
}
|
|
5413
|
+
/** Draw the notehead. */
|
|
5414
|
+
draw() {
|
|
5415
|
+
const ctx = this.checkContext();
|
|
5416
|
+
this.setRendered();
|
|
5417
|
+
ctx.openGroup('flag', this.getAttribute('id'));
|
|
5418
|
+
L("Drawing flag '", this.text, "' at", this.x, this.y);
|
|
5419
|
+
this.renderText(ctx, 0, 0);
|
|
5420
|
+
ctx.closeGroup();
|
|
5421
|
+
}
|
|
5422
|
+
}
|
|
5423
|
+
/** To enable logging for this class. Set `VexFlow.NoteHead.DEBUG` to `true`. */
|
|
5424
|
+
Flag.DEBUG = false;
|
|
5425
|
+
|
|
5426
|
+
|
|
5393
5427
|
/***/ }),
|
|
5394
5428
|
|
|
5395
5429
|
/***/ "./src/font.ts":
|
|
@@ -6019,8 +6053,8 @@ class Formatter {
|
|
|
6019
6053
|
.joinVoices([voice]) // , { alignRests: options.alignRests })
|
|
6020
6054
|
.formatToStave([voice], stave, { alignRests: options.alignRests, stave });
|
|
6021
6055
|
// Render the voice and beams to the stave.
|
|
6022
|
-
voice.setStave(stave).
|
|
6023
|
-
beams.forEach((beam) => beam.setContext(ctx).
|
|
6056
|
+
voice.setContext(ctx).setStave(stave).drawWithStyle();
|
|
6057
|
+
beams.forEach((beam) => beam.setContext(ctx).drawWithStyle());
|
|
6024
6058
|
// Return the bounding box of the voice.
|
|
6025
6059
|
return voice.getBoundingBox();
|
|
6026
6060
|
}
|
|
@@ -6062,9 +6096,9 @@ class Formatter {
|
|
|
6062
6096
|
// Render voices and beams to staves.
|
|
6063
6097
|
notevoice.draw(ctx, stave);
|
|
6064
6098
|
tabvoice.draw(ctx, tabstave);
|
|
6065
|
-
beams.forEach((beam) => beam.setContext(ctx).
|
|
6099
|
+
beams.forEach((beam) => beam.setContext(ctx).drawWithStyle());
|
|
6066
6100
|
// Draw a connector between tab and note staves.
|
|
6067
|
-
new _staveconnector__WEBPACK_IMPORTED_MODULE_5__.StaveConnector(stave, tabstave).setContext(ctx).
|
|
6101
|
+
new _staveconnector__WEBPACK_IMPORTED_MODULE_5__.StaveConnector(stave, tabstave).setContext(ctx).drawWithStyle();
|
|
6068
6102
|
}
|
|
6069
6103
|
/**
|
|
6070
6104
|
* Automatically set the vertical position of rests based on previous/next note positions.
|
|
@@ -6184,7 +6218,6 @@ class Formatter {
|
|
|
6184
6218
|
throw new _util__WEBPACK_IMPORTED_MODULE_9__.RuntimeError('BadArgument', "'voices' required to run preCalculateMinTotalWidth");
|
|
6185
6219
|
}
|
|
6186
6220
|
this.createTickContexts(voices);
|
|
6187
|
-
// eslint-disable-next-line
|
|
6188
6221
|
const { list: contextList, map: contextMap } = this.tickContexts;
|
|
6189
6222
|
this.minTotalWidth = 0;
|
|
6190
6223
|
// Go through each tick context and calculate total width,
|
|
@@ -6272,11 +6305,9 @@ class Formatter {
|
|
|
6272
6305
|
if (!(staveTickToContextMap ? staveTickToContextMap[integerTicks] : undefined)) {
|
|
6273
6306
|
const newContext = new _modifiercontext__WEBPACK_IMPORTED_MODULE_3__.ModifierContext();
|
|
6274
6307
|
contexts.push(newContext);
|
|
6275
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
6276
6308
|
staveTickToContextMap[integerTicks] = newContext;
|
|
6277
6309
|
}
|
|
6278
6310
|
// Add this tickable to the TickContext.
|
|
6279
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
6280
6311
|
tickable.addToModifierContext(staveTickToContextMap[integerTicks]);
|
|
6281
6312
|
ticksUsed.add(tickable.getTicks());
|
|
6282
6313
|
});
|
|
@@ -6690,7 +6721,6 @@ class Formatter {
|
|
|
6690
6721
|
// This method is just like `format` except that the `justifyWidth` is inferred from the `stave`.
|
|
6691
6722
|
formatToStave(voices, stave, optionsParam) {
|
|
6692
6723
|
const options = Object.assign({ context: stave.getContext() }, optionsParam);
|
|
6693
|
-
// eslint-disable-next-line
|
|
6694
6724
|
const justifyWidth = stave.getNoteEndX() - stave.getNoteStartX() - _stave__WEBPACK_IMPORTED_MODULE_4__.Stave.defaultPadding;
|
|
6695
6725
|
L('Formatting voices to width: ', justifyWidth);
|
|
6696
6726
|
return this.format(voices, justifyWidth, options);
|
|
@@ -7234,14 +7264,12 @@ class GlyphNote extends _note__WEBPACK_IMPORTED_MODULE_0__.Note {
|
|
|
7234
7264
|
const stave = this.checkStave();
|
|
7235
7265
|
const ctx = stave.checkContext();
|
|
7236
7266
|
this.setRendered();
|
|
7237
|
-
this.applyStyle(ctx);
|
|
7238
7267
|
ctx.openGroup('glyphNote', this.getAttribute('id'));
|
|
7239
7268
|
this.x = this.isCenterAligned() ? this.getAbsoluteX() - this.getWidth() / 2 : this.getAbsoluteX();
|
|
7240
7269
|
this.y = stave.getYForLine(this.options.line);
|
|
7241
7270
|
this.renderText(ctx, 0, 0);
|
|
7242
7271
|
this.drawModifiers();
|
|
7243
7272
|
ctx.closeGroup();
|
|
7244
|
-
this.restoreStyle(ctx);
|
|
7245
7273
|
}
|
|
7246
7274
|
}
|
|
7247
7275
|
|
|
@@ -13229,14 +13257,12 @@ class GraceNote extends _stavenote__WEBPACK_IMPORTED_MODULE_0__.StaveNote {
|
|
|
13229
13257
|
}
|
|
13230
13258
|
// FIXME: avoid staff lines, ledger lines or others.
|
|
13231
13259
|
const ctx = this.checkContext();
|
|
13232
|
-
ctx.save();
|
|
13233
13260
|
ctx.setLineWidth(1 * scale); // FIXME: use more appropriate value.
|
|
13234
13261
|
ctx.beginPath();
|
|
13235
13262
|
ctx.moveTo(slashBBox.x1, slashBBox.y1);
|
|
13236
13263
|
ctx.lineTo(slashBBox.x2, slashBBox.y2);
|
|
13237
13264
|
ctx.closePath();
|
|
13238
13265
|
ctx.stroke();
|
|
13239
|
-
ctx.restore();
|
|
13240
13266
|
}
|
|
13241
13267
|
}
|
|
13242
13268
|
calcBeamedNotesSlashBBox(slashStemOffset, slashBeamOffset, protrusions) {
|
|
@@ -13329,7 +13355,7 @@ class GraceNoteGroup extends _modifier__WEBPACK_IMPORTED_MODULE_2__.Modifier {
|
|
|
13329
13355
|
return false;
|
|
13330
13356
|
const groupList = [];
|
|
13331
13357
|
let prevNote = null;
|
|
13332
|
-
let
|
|
13358
|
+
let shift = 0;
|
|
13333
13359
|
for (let i = 0; i < gracenoteGroups.length; ++i) {
|
|
13334
13360
|
const gracenoteGroup = gracenoteGroups[i];
|
|
13335
13361
|
const note = gracenoteGroup.getNote();
|
|
@@ -13338,17 +13364,23 @@ class GraceNoteGroup extends _modifier__WEBPACK_IMPORTED_MODULE_2__.Modifier {
|
|
|
13338
13364
|
if (isStavenote && note !== prevNote) {
|
|
13339
13365
|
// Iterate through all notes to get the displaced pixels
|
|
13340
13366
|
for (let n = 0; n < note.keys.length; ++n) {
|
|
13341
|
-
|
|
13367
|
+
shift = Math.max(note.getLeftDisplacedHeadPx(), shift);
|
|
13342
13368
|
}
|
|
13343
13369
|
prevNote = note;
|
|
13344
13370
|
}
|
|
13345
|
-
groupList.push({ shift:
|
|
13371
|
+
groupList.push({ shift: shift, gracenoteGroup, spacing });
|
|
13346
13372
|
}
|
|
13347
13373
|
// If first note left shift in case it is displaced
|
|
13348
13374
|
let groupShift = groupList[0].shift;
|
|
13349
13375
|
let formatWidth;
|
|
13376
|
+
let right = false;
|
|
13377
|
+
let left = false;
|
|
13350
13378
|
for (let i = 0; i < groupList.length; ++i) {
|
|
13351
13379
|
const gracenoteGroup = groupList[i].gracenoteGroup;
|
|
13380
|
+
if (gracenoteGroup.position === _modifier__WEBPACK_IMPORTED_MODULE_2__.Modifier.Position.RIGHT)
|
|
13381
|
+
right = true;
|
|
13382
|
+
else
|
|
13383
|
+
left = true;
|
|
13352
13384
|
gracenoteGroup.preFormat();
|
|
13353
13385
|
formatWidth = gracenoteGroup.getWidth() + groupList[i].spacing;
|
|
13354
13386
|
groupShift = Math.max(formatWidth, groupShift);
|
|
@@ -13358,7 +13390,10 @@ class GraceNoteGroup extends _modifier__WEBPACK_IMPORTED_MODULE_2__.Modifier {
|
|
|
13358
13390
|
formatWidth = gracenoteGroup.getWidth() + groupList[i].spacing;
|
|
13359
13391
|
gracenoteGroup.setSpacingFromNextModifier(groupShift - Math.min(formatWidth, groupShift) + _stavenote__WEBPACK_IMPORTED_MODULE_3__.StaveNote.minNoteheadPadding);
|
|
13360
13392
|
}
|
|
13361
|
-
|
|
13393
|
+
if (right)
|
|
13394
|
+
state.rightShift += groupShift;
|
|
13395
|
+
if (left)
|
|
13396
|
+
state.leftShift += groupShift;
|
|
13362
13397
|
return true;
|
|
13363
13398
|
}
|
|
13364
13399
|
//** `GraceNoteGroup` inherits from `Modifier` and is placed inside a `ModifierContext`. */
|
|
@@ -13417,11 +13452,11 @@ class GraceNoteGroup extends _modifier__WEBPACK_IMPORTED_MODULE_2__.Modifier {
|
|
|
13417
13452
|
const note = this.checkAttachedNote();
|
|
13418
13453
|
this.setRendered();
|
|
13419
13454
|
L('Drawing grace note group for:', note);
|
|
13420
|
-
this.alignSubNotesWithNote(this.getGraceNotes(), note); // Modifier function
|
|
13455
|
+
this.alignSubNotesWithNote(this.getGraceNotes(), note, this.position); // Modifier function
|
|
13421
13456
|
// Draw grace notes.
|
|
13422
|
-
this.graceNotes.forEach((graceNote) => graceNote.setContext(ctx).
|
|
13457
|
+
this.graceNotes.forEach((graceNote) => graceNote.setContext(ctx).drawWithStyle());
|
|
13423
13458
|
// Draw beams.
|
|
13424
|
-
this.beams.forEach((beam) => beam.setContext(ctx).
|
|
13459
|
+
this.beams.forEach((beam) => beam.setContext(ctx).drawWithStyle());
|
|
13425
13460
|
if (this.showSlur) {
|
|
13426
13461
|
// Create and draw slur.
|
|
13427
13462
|
const isStavenote = (0,_typeguard__WEBPACK_IMPORTED_MODULE_7__.isStaveNote)(note);
|
|
@@ -13434,7 +13469,7 @@ class GraceNoteGroup extends _modifier__WEBPACK_IMPORTED_MODULE_2__.Modifier {
|
|
|
13434
13469
|
});
|
|
13435
13470
|
this.slur.renderOptions.cp2 = 12;
|
|
13436
13471
|
this.slur.renderOptions.yShift = (isStavenote ? 7 : 5) + this.renderOptions.slurYShift;
|
|
13437
|
-
this.slur.setContext(ctx).
|
|
13472
|
+
this.slur.setContext(ctx).drawWithStyle();
|
|
13438
13473
|
}
|
|
13439
13474
|
}
|
|
13440
13475
|
}
|
|
@@ -13499,14 +13534,14 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
13499
13534
|
/* harmony export */ BEAM_LEFT: () => (/* reexport safe */ _beam__WEBPACK_IMPORTED_MODULE_4__.BEAM_LEFT),
|
|
13500
13535
|
/* harmony export */ BEAM_RIGHT: () => (/* reexport safe */ _beam__WEBPACK_IMPORTED_MODULE_4__.BEAM_RIGHT),
|
|
13501
13536
|
/* harmony export */ BarNote: () => (/* reexport safe */ _barnote__WEBPACK_IMPORTED_MODULE_3__.BarNote),
|
|
13502
|
-
/* harmony export */ Barline: () => (/* reexport safe */
|
|
13503
|
-
/* harmony export */ BarlineType: () => (/* reexport safe */
|
|
13537
|
+
/* harmony export */ Barline: () => (/* reexport safe */ _stavebarline__WEBPACK_IMPORTED_MODULE_46__.Barline),
|
|
13538
|
+
/* harmony export */ BarlineType: () => (/* reexport safe */ _stavebarline__WEBPACK_IMPORTED_MODULE_46__.BarlineType),
|
|
13504
13539
|
/* harmony export */ Beam: () => (/* reexport safe */ _beam__WEBPACK_IMPORTED_MODULE_4__.Beam),
|
|
13505
13540
|
/* harmony export */ Bend: () => (/* reexport safe */ _bend__WEBPACK_IMPORTED_MODULE_5__.Bend),
|
|
13506
13541
|
/* harmony export */ BoundingBox: () => (/* reexport safe */ _boundingbox__WEBPACK_IMPORTED_MODULE_6__.BoundingBox),
|
|
13507
13542
|
/* harmony export */ Builder: () => (/* reexport safe */ _easyscore__WEBPACK_IMPORTED_MODULE_14__.Builder),
|
|
13508
13543
|
/* harmony export */ CanvasContext: () => (/* reexport safe */ _canvascontext__WEBPACK_IMPORTED_MODULE_7__.CanvasContext),
|
|
13509
|
-
/* harmony export */ Category: () => (/* reexport safe */
|
|
13544
|
+
/* harmony export */ Category: () => (/* reexport safe */ _typeguard__WEBPACK_IMPORTED_MODULE_78__.Category),
|
|
13510
13545
|
/* harmony export */ ChordSymbol: () => (/* reexport safe */ _chordsymbol__WEBPACK_IMPORTED_MODULE_8__.ChordSymbol),
|
|
13511
13546
|
/* harmony export */ ChordSymbolBlock: () => (/* reexport safe */ _chordsymbol__WEBPACK_IMPORTED_MODULE_8__.ChordSymbolBlock),
|
|
13512
13547
|
/* harmony export */ ChordSymbolHorizontalJustify: () => (/* reexport safe */ _chordsymbol__WEBPACK_IMPORTED_MODULE_8__.ChordSymbolHorizontalJustify),
|
|
@@ -13521,110 +13556,111 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
13521
13556
|
/* harmony export */ EasyScoreGrammar: () => (/* reexport safe */ _easyscore__WEBPACK_IMPORTED_MODULE_14__.EasyScoreGrammar),
|
|
13522
13557
|
/* harmony export */ Element: () => (/* reexport safe */ _element__WEBPACK_IMPORTED_MODULE_15__.Element),
|
|
13523
13558
|
/* harmony export */ Factory: () => (/* reexport safe */ _factory__WEBPACK_IMPORTED_MODULE_16__.Factory),
|
|
13559
|
+
/* harmony export */ Flag: () => (/* reexport safe */ _flag__WEBPACK_IMPORTED_MODULE_18__.Flag),
|
|
13524
13560
|
/* harmony export */ Font: () => (/* reexport safe */ _font__WEBPACK_IMPORTED_MODULE_17__.Font),
|
|
13525
13561
|
/* harmony export */ FontStyle: () => (/* reexport safe */ _font__WEBPACK_IMPORTED_MODULE_17__.FontStyle),
|
|
13526
13562
|
/* harmony export */ FontWeight: () => (/* reexport safe */ _font__WEBPACK_IMPORTED_MODULE_17__.FontWeight),
|
|
13527
|
-
/* harmony export */ Formatter: () => (/* reexport safe */
|
|
13528
|
-
/* harmony export */ Fraction: () => (/* reexport safe */
|
|
13529
|
-
/* harmony export */ FretHandFinger: () => (/* reexport safe */
|
|
13530
|
-
/* harmony export */ GhostNote: () => (/* reexport safe */
|
|
13531
|
-
/* harmony export */ GlyphNote: () => (/* reexport safe */
|
|
13532
|
-
/* harmony export */ GraceNote: () => (/* reexport safe */
|
|
13533
|
-
/* harmony export */ GraceNoteGroup: () => (/* reexport safe */
|
|
13534
|
-
/* harmony export */ GraceTabNote: () => (/* reexport safe */
|
|
13535
|
-
/* harmony export */ KeyManager: () => (/* reexport safe */
|
|
13536
|
-
/* harmony export */ KeySigNote: () => (/* reexport safe */
|
|
13537
|
-
/* harmony export */ KeySignature: () => (/* reexport safe */
|
|
13538
|
-
/* harmony export */ Modifier: () => (/* reexport safe */
|
|
13539
|
-
/* harmony export */ ModifierContext: () => (/* reexport safe */
|
|
13540
|
-
/* harmony export */ ModifierPosition: () => (/* reexport safe */
|
|
13541
|
-
/* harmony export */ MultiMeasureRest: () => (/* reexport safe */
|
|
13542
|
-
/* harmony export */ Music: () => (/* reexport safe */
|
|
13543
|
-
/* harmony export */ Note: () => (/* reexport safe */
|
|
13544
|
-
/* harmony export */ NoteHead: () => (/* reexport safe */
|
|
13545
|
-
/* harmony export */ NoteSubGroup: () => (/* reexport safe */
|
|
13546
|
-
/* harmony export */ Ornament: () => (/* reexport safe */
|
|
13547
|
-
/* harmony export */ Parenthesis: () => (/* reexport safe */
|
|
13548
|
-
/* harmony export */ Parser: () => (/* reexport safe */
|
|
13549
|
-
/* harmony export */ PedalMarking: () => (/* reexport safe */
|
|
13563
|
+
/* harmony export */ Formatter: () => (/* reexport safe */ _formatter__WEBPACK_IMPORTED_MODULE_19__.Formatter),
|
|
13564
|
+
/* harmony export */ Fraction: () => (/* reexport safe */ _fraction__WEBPACK_IMPORTED_MODULE_20__.Fraction),
|
|
13565
|
+
/* harmony export */ FretHandFinger: () => (/* reexport safe */ _frethandfinger__WEBPACK_IMPORTED_MODULE_21__.FretHandFinger),
|
|
13566
|
+
/* harmony export */ GhostNote: () => (/* reexport safe */ _ghostnote__WEBPACK_IMPORTED_MODULE_22__.GhostNote),
|
|
13567
|
+
/* harmony export */ GlyphNote: () => (/* reexport safe */ _glyphnote__WEBPACK_IMPORTED_MODULE_23__.GlyphNote),
|
|
13568
|
+
/* harmony export */ GraceNote: () => (/* reexport safe */ _gracenote__WEBPACK_IMPORTED_MODULE_24__.GraceNote),
|
|
13569
|
+
/* harmony export */ GraceNoteGroup: () => (/* reexport safe */ _gracenotegroup__WEBPACK_IMPORTED_MODULE_25__.GraceNoteGroup),
|
|
13570
|
+
/* harmony export */ GraceTabNote: () => (/* reexport safe */ _gracetabnote__WEBPACK_IMPORTED_MODULE_26__.GraceTabNote),
|
|
13571
|
+
/* harmony export */ KeyManager: () => (/* reexport safe */ _keymanager__WEBPACK_IMPORTED_MODULE_27__.KeyManager),
|
|
13572
|
+
/* harmony export */ KeySigNote: () => (/* reexport safe */ _keysignote__WEBPACK_IMPORTED_MODULE_29__.KeySigNote),
|
|
13573
|
+
/* harmony export */ KeySignature: () => (/* reexport safe */ _keysignature__WEBPACK_IMPORTED_MODULE_28__.KeySignature),
|
|
13574
|
+
/* harmony export */ Modifier: () => (/* reexport safe */ _modifier__WEBPACK_IMPORTED_MODULE_30__.Modifier),
|
|
13575
|
+
/* harmony export */ ModifierContext: () => (/* reexport safe */ _modifiercontext__WEBPACK_IMPORTED_MODULE_31__.ModifierContext),
|
|
13576
|
+
/* harmony export */ ModifierPosition: () => (/* reexport safe */ _modifier__WEBPACK_IMPORTED_MODULE_30__.ModifierPosition),
|
|
13577
|
+
/* harmony export */ MultiMeasureRest: () => (/* reexport safe */ _multimeasurerest__WEBPACK_IMPORTED_MODULE_32__.MultiMeasureRest),
|
|
13578
|
+
/* harmony export */ Music: () => (/* reexport safe */ _music__WEBPACK_IMPORTED_MODULE_33__.Music),
|
|
13579
|
+
/* harmony export */ Note: () => (/* reexport safe */ _note__WEBPACK_IMPORTED_MODULE_34__.Note),
|
|
13580
|
+
/* harmony export */ NoteHead: () => (/* reexport safe */ _notehead__WEBPACK_IMPORTED_MODULE_35__.NoteHead),
|
|
13581
|
+
/* harmony export */ NoteSubGroup: () => (/* reexport safe */ _notesubgroup__WEBPACK_IMPORTED_MODULE_36__.NoteSubGroup),
|
|
13582
|
+
/* harmony export */ Ornament: () => (/* reexport safe */ _ornament__WEBPACK_IMPORTED_MODULE_37__.Ornament),
|
|
13583
|
+
/* harmony export */ Parenthesis: () => (/* reexport safe */ _parenthesis__WEBPACK_IMPORTED_MODULE_38__.Parenthesis),
|
|
13584
|
+
/* harmony export */ Parser: () => (/* reexport safe */ _parser__WEBPACK_IMPORTED_MODULE_39__.Parser),
|
|
13585
|
+
/* harmony export */ PedalMarking: () => (/* reexport safe */ _pedalmarking__WEBPACK_IMPORTED_MODULE_40__.PedalMarking),
|
|
13550
13586
|
/* harmony export */ Piece: () => (/* reexport safe */ _easyscore__WEBPACK_IMPORTED_MODULE_14__.Piece),
|
|
13551
|
-
/* harmony export */ Registry: () => (/* reexport safe */
|
|
13552
|
-
/* harmony export */ RenderContext: () => (/* reexport safe */
|
|
13553
|
-
/* harmony export */ Renderer: () => (/* reexport safe */
|
|
13554
|
-
/* harmony export */ RendererBackends: () => (/* reexport safe */
|
|
13555
|
-
/* harmony export */ RendererLineEndType: () => (/* reexport safe */
|
|
13556
|
-
/* harmony export */ RepeatNote: () => (/* reexport safe */
|
|
13557
|
-
/* harmony export */ Repetition: () => (/* reexport safe */
|
|
13558
|
-
/* harmony export */ RuntimeError: () => (/* reexport safe */
|
|
13559
|
-
/* harmony export */ SVGContext: () => (/* reexport safe */
|
|
13560
|
-
/* harmony export */ Stave: () => (/* reexport safe */
|
|
13561
|
-
/* harmony export */ StaveConnector: () => (/* reexport safe */
|
|
13562
|
-
/* harmony export */ StaveHairpin: () => (/* reexport safe */
|
|
13563
|
-
/* harmony export */ StaveLine: () => (/* reexport safe */
|
|
13564
|
-
/* harmony export */ StaveModifier: () => (/* reexport safe */
|
|
13565
|
-
/* harmony export */ StaveModifierPosition: () => (/* reexport safe */
|
|
13566
|
-
/* harmony export */ StaveNote: () => (/* reexport safe */
|
|
13567
|
-
/* harmony export */ StaveSection: () => (/* reexport safe */
|
|
13568
|
-
/* harmony export */ StaveTempo: () => (/* reexport safe */
|
|
13569
|
-
/* harmony export */ StaveText: () => (/* reexport safe */
|
|
13570
|
-
/* harmony export */ StaveTie: () => (/* reexport safe */
|
|
13571
|
-
/* harmony export */ Stem: () => (/* reexport safe */
|
|
13572
|
-
/* harmony export */ StemmableNote: () => (/* reexport safe */
|
|
13573
|
-
/* harmony export */ StringNumber: () => (/* reexport safe */
|
|
13574
|
-
/* harmony export */ Stroke: () => (/* reexport safe */
|
|
13587
|
+
/* harmony export */ Registry: () => (/* reexport safe */ _registry__WEBPACK_IMPORTED_MODULE_41__.Registry),
|
|
13588
|
+
/* harmony export */ RenderContext: () => (/* reexport safe */ _rendercontext__WEBPACK_IMPORTED_MODULE_42__.RenderContext),
|
|
13589
|
+
/* harmony export */ Renderer: () => (/* reexport safe */ _renderer__WEBPACK_IMPORTED_MODULE_43__.Renderer),
|
|
13590
|
+
/* harmony export */ RendererBackends: () => (/* reexport safe */ _renderer__WEBPACK_IMPORTED_MODULE_43__.RendererBackends),
|
|
13591
|
+
/* harmony export */ RendererLineEndType: () => (/* reexport safe */ _renderer__WEBPACK_IMPORTED_MODULE_43__.RendererLineEndType),
|
|
13592
|
+
/* harmony export */ RepeatNote: () => (/* reexport safe */ _repeatnote__WEBPACK_IMPORTED_MODULE_44__.RepeatNote),
|
|
13593
|
+
/* harmony export */ Repetition: () => (/* reexport safe */ _staverepetition__WEBPACK_IMPORTED_MODULE_52__.Repetition),
|
|
13594
|
+
/* harmony export */ RuntimeError: () => (/* reexport safe */ _util__WEBPACK_IMPORTED_MODULE_79__.RuntimeError),
|
|
13595
|
+
/* harmony export */ SVGContext: () => (/* reexport safe */ _svgcontext__WEBPACK_IMPORTED_MODULE_62__.SVGContext),
|
|
13596
|
+
/* harmony export */ Stave: () => (/* reexport safe */ _stave__WEBPACK_IMPORTED_MODULE_45__.Stave),
|
|
13597
|
+
/* harmony export */ StaveConnector: () => (/* reexport safe */ _staveconnector__WEBPACK_IMPORTED_MODULE_47__.StaveConnector),
|
|
13598
|
+
/* harmony export */ StaveHairpin: () => (/* reexport safe */ _stavehairpin__WEBPACK_IMPORTED_MODULE_48__.StaveHairpin),
|
|
13599
|
+
/* harmony export */ StaveLine: () => (/* reexport safe */ _staveline__WEBPACK_IMPORTED_MODULE_49__.StaveLine),
|
|
13600
|
+
/* harmony export */ StaveModifier: () => (/* reexport safe */ _stavemodifier__WEBPACK_IMPORTED_MODULE_50__.StaveModifier),
|
|
13601
|
+
/* harmony export */ StaveModifierPosition: () => (/* reexport safe */ _stavemodifier__WEBPACK_IMPORTED_MODULE_50__.StaveModifierPosition),
|
|
13602
|
+
/* harmony export */ StaveNote: () => (/* reexport safe */ _stavenote__WEBPACK_IMPORTED_MODULE_51__.StaveNote),
|
|
13603
|
+
/* harmony export */ StaveSection: () => (/* reexport safe */ _stavesection__WEBPACK_IMPORTED_MODULE_53__.StaveSection),
|
|
13604
|
+
/* harmony export */ StaveTempo: () => (/* reexport safe */ _stavetempo__WEBPACK_IMPORTED_MODULE_54__.StaveTempo),
|
|
13605
|
+
/* harmony export */ StaveText: () => (/* reexport safe */ _stavetext__WEBPACK_IMPORTED_MODULE_55__.StaveText),
|
|
13606
|
+
/* harmony export */ StaveTie: () => (/* reexport safe */ _stavetie__WEBPACK_IMPORTED_MODULE_56__.StaveTie),
|
|
13607
|
+
/* harmony export */ Stem: () => (/* reexport safe */ _stem__WEBPACK_IMPORTED_MODULE_58__.Stem),
|
|
13608
|
+
/* harmony export */ StemmableNote: () => (/* reexport safe */ _stemmablenote__WEBPACK_IMPORTED_MODULE_59__.StemmableNote),
|
|
13609
|
+
/* harmony export */ StringNumber: () => (/* reexport safe */ _stringnumber__WEBPACK_IMPORTED_MODULE_60__.StringNumber),
|
|
13610
|
+
/* harmony export */ Stroke: () => (/* reexport safe */ _strokes__WEBPACK_IMPORTED_MODULE_61__.Stroke),
|
|
13575
13611
|
/* harmony export */ SymbolModifiers: () => (/* reexport safe */ _chordsymbol__WEBPACK_IMPORTED_MODULE_8__.SymbolModifiers),
|
|
13576
|
-
/* harmony export */ System: () => (/* reexport safe */
|
|
13577
|
-
/* harmony export */ TabNote: () => (/* reexport safe */
|
|
13578
|
-
/* harmony export */ TabSlide: () => (/* reexport safe */
|
|
13579
|
-
/* harmony export */ TabStave: () => (/* reexport safe */
|
|
13580
|
-
/* harmony export */ TabTie: () => (/* reexport safe */
|
|
13581
|
-
/* harmony export */ TextBracket: () => (/* reexport safe */
|
|
13582
|
-
/* harmony export */ TextBracketPosition: () => (/* reexport safe */
|
|
13583
|
-
/* harmony export */ TextDynamics: () => (/* reexport safe */
|
|
13584
|
-
/* harmony export */ TextJustification: () => (/* reexport safe */
|
|
13585
|
-
/* harmony export */ TextNote: () => (/* reexport safe */
|
|
13586
|
-
/* harmony export */ TickContext: () => (/* reexport safe */
|
|
13587
|
-
/* harmony export */ Tickable: () => (/* reexport safe */
|
|
13588
|
-
/* harmony export */ TimeSigNote: () => (/* reexport safe */
|
|
13589
|
-
/* harmony export */ TimeSignature: () => (/* reexport safe */
|
|
13590
|
-
/* harmony export */ Tremolo: () => (/* reexport safe */
|
|
13591
|
-
/* harmony export */ Tuning: () => (/* reexport safe */
|
|
13592
|
-
/* harmony export */ Tuplet: () => (/* reexport safe */
|
|
13593
|
-
/* harmony export */ TupletLocation: () => (/* reexport safe */
|
|
13594
|
-
/* harmony export */ VexFlow: () => (/* reexport safe */
|
|
13595
|
-
/* harmony export */ Vibrato: () => (/* reexport safe */
|
|
13596
|
-
/* harmony export */ VibratoBracket: () => (/* reexport safe */
|
|
13597
|
-
/* harmony export */ Voice: () => (/* reexport safe */
|
|
13598
|
-
/* harmony export */ VoiceMode: () => (/* reexport safe */
|
|
13599
|
-
/* harmony export */ Volta: () => (/* reexport safe */
|
|
13600
|
-
/* harmony export */ VoltaType: () => (/* reexport safe */
|
|
13601
|
-
/* harmony export */ defined: () => (/* reexport safe */
|
|
13602
|
-
/* harmony export */ drawDot: () => (/* reexport safe */
|
|
13612
|
+
/* harmony export */ System: () => (/* reexport safe */ _system__WEBPACK_IMPORTED_MODULE_63__.System),
|
|
13613
|
+
/* harmony export */ TabNote: () => (/* reexport safe */ _tabnote__WEBPACK_IMPORTED_MODULE_64__.TabNote),
|
|
13614
|
+
/* harmony export */ TabSlide: () => (/* reexport safe */ _tabslide__WEBPACK_IMPORTED_MODULE_65__.TabSlide),
|
|
13615
|
+
/* harmony export */ TabStave: () => (/* reexport safe */ _tabstave__WEBPACK_IMPORTED_MODULE_66__.TabStave),
|
|
13616
|
+
/* harmony export */ TabTie: () => (/* reexport safe */ _tabtie__WEBPACK_IMPORTED_MODULE_67__.TabTie),
|
|
13617
|
+
/* harmony export */ TextBracket: () => (/* reexport safe */ _textbracket__WEBPACK_IMPORTED_MODULE_68__.TextBracket),
|
|
13618
|
+
/* harmony export */ TextBracketPosition: () => (/* reexport safe */ _textbracket__WEBPACK_IMPORTED_MODULE_68__.TextBracketPosition),
|
|
13619
|
+
/* harmony export */ TextDynamics: () => (/* reexport safe */ _textdynamics__WEBPACK_IMPORTED_MODULE_69__.TextDynamics),
|
|
13620
|
+
/* harmony export */ TextJustification: () => (/* reexport safe */ _textnote__WEBPACK_IMPORTED_MODULE_70__.TextJustification),
|
|
13621
|
+
/* harmony export */ TextNote: () => (/* reexport safe */ _textnote__WEBPACK_IMPORTED_MODULE_70__.TextNote),
|
|
13622
|
+
/* harmony export */ TickContext: () => (/* reexport safe */ _tickcontext__WEBPACK_IMPORTED_MODULE_72__.TickContext),
|
|
13623
|
+
/* harmony export */ Tickable: () => (/* reexport safe */ _tickable__WEBPACK_IMPORTED_MODULE_71__.Tickable),
|
|
13624
|
+
/* harmony export */ TimeSigNote: () => (/* reexport safe */ _timesignote__WEBPACK_IMPORTED_MODULE_74__.TimeSigNote),
|
|
13625
|
+
/* harmony export */ TimeSignature: () => (/* reexport safe */ _timesignature__WEBPACK_IMPORTED_MODULE_73__.TimeSignature),
|
|
13626
|
+
/* harmony export */ Tremolo: () => (/* reexport safe */ _tremolo__WEBPACK_IMPORTED_MODULE_75__.Tremolo),
|
|
13627
|
+
/* harmony export */ Tuning: () => (/* reexport safe */ _tuning__WEBPACK_IMPORTED_MODULE_76__.Tuning),
|
|
13628
|
+
/* harmony export */ Tuplet: () => (/* reexport safe */ _tuplet__WEBPACK_IMPORTED_MODULE_77__.Tuplet),
|
|
13629
|
+
/* harmony export */ TupletLocation: () => (/* reexport safe */ _tuplet__WEBPACK_IMPORTED_MODULE_77__.TupletLocation),
|
|
13630
|
+
/* harmony export */ VexFlow: () => (/* reexport safe */ _vexflow__WEBPACK_IMPORTED_MODULE_80__.VexFlow),
|
|
13631
|
+
/* harmony export */ Vibrato: () => (/* reexport safe */ _vibrato__WEBPACK_IMPORTED_MODULE_81__.Vibrato),
|
|
13632
|
+
/* harmony export */ VibratoBracket: () => (/* reexport safe */ _vibratobracket__WEBPACK_IMPORTED_MODULE_82__.VibratoBracket),
|
|
13633
|
+
/* harmony export */ Voice: () => (/* reexport safe */ _voice__WEBPACK_IMPORTED_MODULE_83__.Voice),
|
|
13634
|
+
/* harmony export */ VoiceMode: () => (/* reexport safe */ _voice__WEBPACK_IMPORTED_MODULE_83__.VoiceMode),
|
|
13635
|
+
/* harmony export */ Volta: () => (/* reexport safe */ _stavevolta__WEBPACK_IMPORTED_MODULE_57__.Volta),
|
|
13636
|
+
/* harmony export */ VoltaType: () => (/* reexport safe */ _stavevolta__WEBPACK_IMPORTED_MODULE_57__.VoltaType),
|
|
13637
|
+
/* harmony export */ defined: () => (/* reexport safe */ _util__WEBPACK_IMPORTED_MODULE_79__.defined),
|
|
13638
|
+
/* harmony export */ drawDot: () => (/* reexport safe */ _rendercontext__WEBPACK_IMPORTED_MODULE_42__.drawDot),
|
|
13603
13639
|
/* harmony export */ getBottomY: () => (/* reexport safe */ _articulation__WEBPACK_IMPORTED_MODULE_2__.getBottomY),
|
|
13604
13640
|
/* harmony export */ getInitialOffset: () => (/* reexport safe */ _articulation__WEBPACK_IMPORTED_MODULE_2__.getInitialOffset),
|
|
13605
13641
|
/* harmony export */ getTopY: () => (/* reexport safe */ _articulation__WEBPACK_IMPORTED_MODULE_2__.getTopY),
|
|
13606
|
-
/* harmony export */ globalObject: () => (/* reexport safe */
|
|
13607
|
-
/* harmony export */ isAccidental: () => (/* reexport safe */
|
|
13608
|
-
/* harmony export */ isAnnotation: () => (/* reexport safe */
|
|
13609
|
-
/* harmony export */ isBarline: () => (/* reexport safe */
|
|
13610
|
-
/* harmony export */ isCategory: () => (/* reexport safe */
|
|
13611
|
-
/* harmony export */ isDot: () => (/* reexport safe */
|
|
13612
|
-
/* harmony export */ isGraceNote: () => (/* reexport safe */
|
|
13613
|
-
/* harmony export */ isGraceNoteGroup: () => (/* reexport safe */
|
|
13614
|
-
/* harmony export */ isHTMLCanvas: () => (/* reexport safe */
|
|
13615
|
-
/* harmony export */ isHTMLDiv: () => (/* reexport safe */
|
|
13616
|
-
/* harmony export */ isNote: () => (/* reexport safe */
|
|
13617
|
-
/* harmony export */ isRenderContext: () => (/* reexport safe */
|
|
13618
|
-
/* harmony export */ isStaveNote: () => (/* reexport safe */
|
|
13619
|
-
/* harmony export */ isStemmableNote: () => (/* reexport safe */
|
|
13620
|
-
/* harmony export */ isTabNote: () => (/* reexport safe */
|
|
13621
|
-
/* harmony export */ log: () => (/* reexport safe */
|
|
13622
|
-
/* harmony export */ midLine: () => (/* reexport safe */
|
|
13623
|
-
/* harmony export */ normalizeAngle: () => (/* reexport safe */
|
|
13624
|
-
/* harmony export */ prefix: () => (/* reexport safe */
|
|
13625
|
-
/* harmony export */ sumArray: () => (/* reexport safe */
|
|
13626
|
-
/* harmony export */ upperFirst: () => (/* reexport safe */
|
|
13627
|
-
/* harmony export */ warn: () => (/* reexport safe */
|
|
13642
|
+
/* harmony export */ globalObject: () => (/* reexport safe */ _util__WEBPACK_IMPORTED_MODULE_79__.globalObject),
|
|
13643
|
+
/* harmony export */ isAccidental: () => (/* reexport safe */ _typeguard__WEBPACK_IMPORTED_MODULE_78__.isAccidental),
|
|
13644
|
+
/* harmony export */ isAnnotation: () => (/* reexport safe */ _typeguard__WEBPACK_IMPORTED_MODULE_78__.isAnnotation),
|
|
13645
|
+
/* harmony export */ isBarline: () => (/* reexport safe */ _typeguard__WEBPACK_IMPORTED_MODULE_78__.isBarline),
|
|
13646
|
+
/* harmony export */ isCategory: () => (/* reexport safe */ _typeguard__WEBPACK_IMPORTED_MODULE_78__.isCategory),
|
|
13647
|
+
/* harmony export */ isDot: () => (/* reexport safe */ _typeguard__WEBPACK_IMPORTED_MODULE_78__.isDot),
|
|
13648
|
+
/* harmony export */ isGraceNote: () => (/* reexport safe */ _typeguard__WEBPACK_IMPORTED_MODULE_78__.isGraceNote),
|
|
13649
|
+
/* harmony export */ isGraceNoteGroup: () => (/* reexport safe */ _typeguard__WEBPACK_IMPORTED_MODULE_78__.isGraceNoteGroup),
|
|
13650
|
+
/* harmony export */ isHTMLCanvas: () => (/* reexport safe */ _web__WEBPACK_IMPORTED_MODULE_84__.isHTMLCanvas),
|
|
13651
|
+
/* harmony export */ isHTMLDiv: () => (/* reexport safe */ _web__WEBPACK_IMPORTED_MODULE_84__.isHTMLDiv),
|
|
13652
|
+
/* harmony export */ isNote: () => (/* reexport safe */ _typeguard__WEBPACK_IMPORTED_MODULE_78__.isNote),
|
|
13653
|
+
/* harmony export */ isRenderContext: () => (/* reexport safe */ _typeguard__WEBPACK_IMPORTED_MODULE_78__.isRenderContext),
|
|
13654
|
+
/* harmony export */ isStaveNote: () => (/* reexport safe */ _typeguard__WEBPACK_IMPORTED_MODULE_78__.isStaveNote),
|
|
13655
|
+
/* harmony export */ isStemmableNote: () => (/* reexport safe */ _typeguard__WEBPACK_IMPORTED_MODULE_78__.isStemmableNote),
|
|
13656
|
+
/* harmony export */ isTabNote: () => (/* reexport safe */ _typeguard__WEBPACK_IMPORTED_MODULE_78__.isTabNote),
|
|
13657
|
+
/* harmony export */ log: () => (/* reexport safe */ _util__WEBPACK_IMPORTED_MODULE_79__.log),
|
|
13658
|
+
/* harmony export */ midLine: () => (/* reexport safe */ _util__WEBPACK_IMPORTED_MODULE_79__.midLine),
|
|
13659
|
+
/* harmony export */ normalizeAngle: () => (/* reexport safe */ _util__WEBPACK_IMPORTED_MODULE_79__.normalizeAngle),
|
|
13660
|
+
/* harmony export */ prefix: () => (/* reexport safe */ _util__WEBPACK_IMPORTED_MODULE_79__.prefix),
|
|
13661
|
+
/* harmony export */ sumArray: () => (/* reexport safe */ _util__WEBPACK_IMPORTED_MODULE_79__.sumArray),
|
|
13662
|
+
/* harmony export */ upperFirst: () => (/* reexport safe */ _util__WEBPACK_IMPORTED_MODULE_79__.upperFirst),
|
|
13663
|
+
/* harmony export */ warn: () => (/* reexport safe */ _util__WEBPACK_IMPORTED_MODULE_79__.warn)
|
|
13628
13664
|
/* harmony export */ });
|
|
13629
13665
|
/* harmony import */ var _accidental__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./accidental */ "./src/accidental.ts");
|
|
13630
13666
|
/* harmony import */ var _annotation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./annotation */ "./src/annotation.ts");
|
|
@@ -13644,72 +13680,73 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
13644
13680
|
/* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./element */ "./src/element.ts");
|
|
13645
13681
|
/* harmony import */ var _factory__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./factory */ "./src/factory.ts");
|
|
13646
13682
|
/* harmony import */ var _font__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./font */ "./src/font.ts");
|
|
13647
|
-
/* harmony import */ var
|
|
13648
|
-
/* harmony import */ var
|
|
13649
|
-
/* harmony import */ var
|
|
13650
|
-
/* harmony import */ var
|
|
13651
|
-
/* harmony import */ var
|
|
13652
|
-
/* harmony import */ var
|
|
13653
|
-
/* harmony import */ var
|
|
13654
|
-
/* harmony import */ var
|
|
13655
|
-
/* harmony import */ var
|
|
13656
|
-
/* harmony import */ var
|
|
13657
|
-
/* harmony import */ var
|
|
13658
|
-
/* harmony import */ var
|
|
13659
|
-
/* harmony import */ var
|
|
13660
|
-
/* harmony import */ var
|
|
13661
|
-
/* harmony import */ var
|
|
13662
|
-
/* harmony import */ var
|
|
13663
|
-
/* harmony import */ var
|
|
13664
|
-
/* harmony import */ var
|
|
13665
|
-
/* harmony import */ var
|
|
13666
|
-
/* harmony import */ var
|
|
13667
|
-
/* harmony import */ var
|
|
13668
|
-
/* harmony import */ var
|
|
13669
|
-
/* harmony import */ var
|
|
13670
|
-
/* harmony import */ var
|
|
13671
|
-
/* harmony import */ var
|
|
13672
|
-
/* harmony import */ var
|
|
13673
|
-
/* harmony import */ var
|
|
13674
|
-
/* harmony import */ var
|
|
13675
|
-
/* harmony import */ var
|
|
13676
|
-
/* harmony import */ var
|
|
13677
|
-
/* harmony import */ var
|
|
13678
|
-
/* harmony import */ var
|
|
13679
|
-
/* harmony import */ var
|
|
13680
|
-
/* harmony import */ var
|
|
13681
|
-
/* harmony import */ var
|
|
13682
|
-
/* harmony import */ var
|
|
13683
|
-
/* harmony import */ var
|
|
13684
|
-
/* harmony import */ var
|
|
13685
|
-
/* harmony import */ var
|
|
13686
|
-
/* harmony import */ var
|
|
13687
|
-
/* harmony import */ var
|
|
13688
|
-
/* harmony import */ var
|
|
13689
|
-
/* harmony import */ var
|
|
13690
|
-
/* harmony import */ var
|
|
13691
|
-
/* harmony import */ var
|
|
13692
|
-
/* harmony import */ var
|
|
13693
|
-
/* harmony import */ var
|
|
13694
|
-
/* harmony import */ var
|
|
13695
|
-
/* harmony import */ var
|
|
13696
|
-
/* harmony import */ var
|
|
13697
|
-
/* harmony import */ var
|
|
13698
|
-
/* harmony import */ var
|
|
13699
|
-
/* harmony import */ var
|
|
13700
|
-
/* harmony import */ var
|
|
13701
|
-
/* harmony import */ var
|
|
13702
|
-
/* harmony import */ var
|
|
13703
|
-
/* harmony import */ var
|
|
13704
|
-
/* harmony import */ var
|
|
13705
|
-
/* harmony import */ var
|
|
13706
|
-
/* harmony import */ var
|
|
13707
|
-
/* harmony import */ var
|
|
13708
|
-
/* harmony import */ var
|
|
13709
|
-
/* harmony import */ var
|
|
13710
|
-
/* harmony import */ var
|
|
13711
|
-
/* harmony import */ var
|
|
13712
|
-
/* harmony import */ var
|
|
13683
|
+
/* harmony import */ var _flag__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./flag */ "./src/flag.ts");
|
|
13684
|
+
/* harmony import */ var _formatter__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./formatter */ "./src/formatter.ts");
|
|
13685
|
+
/* harmony import */ var _fraction__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./fraction */ "./src/fraction.ts");
|
|
13686
|
+
/* harmony import */ var _frethandfinger__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./frethandfinger */ "./src/frethandfinger.ts");
|
|
13687
|
+
/* harmony import */ var _ghostnote__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./ghostnote */ "./src/ghostnote.ts");
|
|
13688
|
+
/* harmony import */ var _glyphnote__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./glyphnote */ "./src/glyphnote.ts");
|
|
13689
|
+
/* harmony import */ var _gracenote__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./gracenote */ "./src/gracenote.ts");
|
|
13690
|
+
/* harmony import */ var _gracenotegroup__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./gracenotegroup */ "./src/gracenotegroup.ts");
|
|
13691
|
+
/* harmony import */ var _gracetabnote__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./gracetabnote */ "./src/gracetabnote.ts");
|
|
13692
|
+
/* harmony import */ var _keymanager__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./keymanager */ "./src/keymanager.ts");
|
|
13693
|
+
/* harmony import */ var _keysignature__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./keysignature */ "./src/keysignature.ts");
|
|
13694
|
+
/* harmony import */ var _keysignote__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./keysignote */ "./src/keysignote.ts");
|
|
13695
|
+
/* harmony import */ var _modifier__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./modifier */ "./src/modifier.ts");
|
|
13696
|
+
/* harmony import */ var _modifiercontext__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./modifiercontext */ "./src/modifiercontext.ts");
|
|
13697
|
+
/* harmony import */ var _multimeasurerest__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./multimeasurerest */ "./src/multimeasurerest.ts");
|
|
13698
|
+
/* harmony import */ var _music__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./music */ "./src/music.ts");
|
|
13699
|
+
/* harmony import */ var _note__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./note */ "./src/note.ts");
|
|
13700
|
+
/* harmony import */ var _notehead__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./notehead */ "./src/notehead.ts");
|
|
13701
|
+
/* harmony import */ var _notesubgroup__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./notesubgroup */ "./src/notesubgroup.ts");
|
|
13702
|
+
/* harmony import */ var _ornament__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./ornament */ "./src/ornament.ts");
|
|
13703
|
+
/* harmony import */ var _parenthesis__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./parenthesis */ "./src/parenthesis.ts");
|
|
13704
|
+
/* harmony import */ var _parser__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./parser */ "./src/parser.ts");
|
|
13705
|
+
/* harmony import */ var _pedalmarking__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./pedalmarking */ "./src/pedalmarking.ts");
|
|
13706
|
+
/* harmony import */ var _registry__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./registry */ "./src/registry.ts");
|
|
13707
|
+
/* harmony import */ var _rendercontext__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ./rendercontext */ "./src/rendercontext.ts");
|
|
13708
|
+
/* harmony import */ var _renderer__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ./renderer */ "./src/renderer.ts");
|
|
13709
|
+
/* harmony import */ var _repeatnote__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ./repeatnote */ "./src/repeatnote.ts");
|
|
13710
|
+
/* harmony import */ var _stave__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ./stave */ "./src/stave.ts");
|
|
13711
|
+
/* harmony import */ var _stavebarline__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! ./stavebarline */ "./src/stavebarline.ts");
|
|
13712
|
+
/* harmony import */ var _staveconnector__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(/*! ./staveconnector */ "./src/staveconnector.ts");
|
|
13713
|
+
/* harmony import */ var _stavehairpin__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(/*! ./stavehairpin */ "./src/stavehairpin.ts");
|
|
13714
|
+
/* harmony import */ var _staveline__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(/*! ./staveline */ "./src/staveline.ts");
|
|
13715
|
+
/* harmony import */ var _stavemodifier__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(/*! ./stavemodifier */ "./src/stavemodifier.ts");
|
|
13716
|
+
/* harmony import */ var _stavenote__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(/*! ./stavenote */ "./src/stavenote.ts");
|
|
13717
|
+
/* harmony import */ var _staverepetition__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(/*! ./staverepetition */ "./src/staverepetition.ts");
|
|
13718
|
+
/* harmony import */ var _stavesection__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(/*! ./stavesection */ "./src/stavesection.ts");
|
|
13719
|
+
/* harmony import */ var _stavetempo__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(/*! ./stavetempo */ "./src/stavetempo.ts");
|
|
13720
|
+
/* harmony import */ var _stavetext__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(/*! ./stavetext */ "./src/stavetext.ts");
|
|
13721
|
+
/* harmony import */ var _stavetie__WEBPACK_IMPORTED_MODULE_56__ = __webpack_require__(/*! ./stavetie */ "./src/stavetie.ts");
|
|
13722
|
+
/* harmony import */ var _stavevolta__WEBPACK_IMPORTED_MODULE_57__ = __webpack_require__(/*! ./stavevolta */ "./src/stavevolta.ts");
|
|
13723
|
+
/* harmony import */ var _stem__WEBPACK_IMPORTED_MODULE_58__ = __webpack_require__(/*! ./stem */ "./src/stem.ts");
|
|
13724
|
+
/* harmony import */ var _stemmablenote__WEBPACK_IMPORTED_MODULE_59__ = __webpack_require__(/*! ./stemmablenote */ "./src/stemmablenote.ts");
|
|
13725
|
+
/* harmony import */ var _stringnumber__WEBPACK_IMPORTED_MODULE_60__ = __webpack_require__(/*! ./stringnumber */ "./src/stringnumber.ts");
|
|
13726
|
+
/* harmony import */ var _strokes__WEBPACK_IMPORTED_MODULE_61__ = __webpack_require__(/*! ./strokes */ "./src/strokes.ts");
|
|
13727
|
+
/* harmony import */ var _svgcontext__WEBPACK_IMPORTED_MODULE_62__ = __webpack_require__(/*! ./svgcontext */ "./src/svgcontext.ts");
|
|
13728
|
+
/* harmony import */ var _system__WEBPACK_IMPORTED_MODULE_63__ = __webpack_require__(/*! ./system */ "./src/system.ts");
|
|
13729
|
+
/* harmony import */ var _tabnote__WEBPACK_IMPORTED_MODULE_64__ = __webpack_require__(/*! ./tabnote */ "./src/tabnote.ts");
|
|
13730
|
+
/* harmony import */ var _tabslide__WEBPACK_IMPORTED_MODULE_65__ = __webpack_require__(/*! ./tabslide */ "./src/tabslide.ts");
|
|
13731
|
+
/* harmony import */ var _tabstave__WEBPACK_IMPORTED_MODULE_66__ = __webpack_require__(/*! ./tabstave */ "./src/tabstave.ts");
|
|
13732
|
+
/* harmony import */ var _tabtie__WEBPACK_IMPORTED_MODULE_67__ = __webpack_require__(/*! ./tabtie */ "./src/tabtie.ts");
|
|
13733
|
+
/* harmony import */ var _textbracket__WEBPACK_IMPORTED_MODULE_68__ = __webpack_require__(/*! ./textbracket */ "./src/textbracket.ts");
|
|
13734
|
+
/* harmony import */ var _textdynamics__WEBPACK_IMPORTED_MODULE_69__ = __webpack_require__(/*! ./textdynamics */ "./src/textdynamics.ts");
|
|
13735
|
+
/* harmony import */ var _textnote__WEBPACK_IMPORTED_MODULE_70__ = __webpack_require__(/*! ./textnote */ "./src/textnote.ts");
|
|
13736
|
+
/* harmony import */ var _tickable__WEBPACK_IMPORTED_MODULE_71__ = __webpack_require__(/*! ./tickable */ "./src/tickable.ts");
|
|
13737
|
+
/* harmony import */ var _tickcontext__WEBPACK_IMPORTED_MODULE_72__ = __webpack_require__(/*! ./tickcontext */ "./src/tickcontext.ts");
|
|
13738
|
+
/* harmony import */ var _timesignature__WEBPACK_IMPORTED_MODULE_73__ = __webpack_require__(/*! ./timesignature */ "./src/timesignature.ts");
|
|
13739
|
+
/* harmony import */ var _timesignote__WEBPACK_IMPORTED_MODULE_74__ = __webpack_require__(/*! ./timesignote */ "./src/timesignote.ts");
|
|
13740
|
+
/* harmony import */ var _tremolo__WEBPACK_IMPORTED_MODULE_75__ = __webpack_require__(/*! ./tremolo */ "./src/tremolo.ts");
|
|
13741
|
+
/* harmony import */ var _tuning__WEBPACK_IMPORTED_MODULE_76__ = __webpack_require__(/*! ./tuning */ "./src/tuning.ts");
|
|
13742
|
+
/* harmony import */ var _tuplet__WEBPACK_IMPORTED_MODULE_77__ = __webpack_require__(/*! ./tuplet */ "./src/tuplet.ts");
|
|
13743
|
+
/* harmony import */ var _typeguard__WEBPACK_IMPORTED_MODULE_78__ = __webpack_require__(/*! ./typeguard */ "./src/typeguard.ts");
|
|
13744
|
+
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_79__ = __webpack_require__(/*! ./util */ "./src/util.ts");
|
|
13745
|
+
/* harmony import */ var _vexflow__WEBPACK_IMPORTED_MODULE_80__ = __webpack_require__(/*! ./vexflow */ "./src/vexflow.ts");
|
|
13746
|
+
/* harmony import */ var _vibrato__WEBPACK_IMPORTED_MODULE_81__ = __webpack_require__(/*! ./vibrato */ "./src/vibrato.ts");
|
|
13747
|
+
/* harmony import */ var _vibratobracket__WEBPACK_IMPORTED_MODULE_82__ = __webpack_require__(/*! ./vibratobracket */ "./src/vibratobracket.ts");
|
|
13748
|
+
/* harmony import */ var _voice__WEBPACK_IMPORTED_MODULE_83__ = __webpack_require__(/*! ./voice */ "./src/voice.ts");
|
|
13749
|
+
/* harmony import */ var _web__WEBPACK_IMPORTED_MODULE_84__ = __webpack_require__(/*! ./web */ "./src/web.ts");
|
|
13713
13750
|
// Copyright (c) 2023-present VexFlow contributors: https://github.com/vexflow/vexflow/graphs/contributors
|
|
13714
13751
|
// MIT License
|
|
13715
13752
|
|
|
@@ -13774,6 +13811,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
13774
13811
|
|
|
13775
13812
|
|
|
13776
13813
|
|
|
13814
|
+
|
|
13777
13815
|
|
|
13778
13816
|
|
|
13779
13817
|
// Do not export './tables' because it is internal. Its public API is accessible via VexFlow.*.
|
|
@@ -13938,11 +13976,13 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
13938
13976
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
13939
13977
|
/* harmony export */ KeySignature: () => (/* binding */ KeySignature)
|
|
13940
13978
|
/* harmony export */ });
|
|
13941
|
-
/* harmony import */ var
|
|
13942
|
-
/* harmony import */ var
|
|
13943
|
-
/* harmony import */ var
|
|
13944
|
-
/* harmony import */ var
|
|
13945
|
-
/* harmony import */ var
|
|
13979
|
+
/* harmony import */ var _boundingbox__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./boundingbox */ "./src/boundingbox.ts");
|
|
13980
|
+
/* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./element */ "./src/element.ts");
|
|
13981
|
+
/* harmony import */ var _glyphs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./glyphs */ "./src/glyphs.ts");
|
|
13982
|
+
/* harmony import */ var _stavemodifier__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./stavemodifier */ "./src/stavemodifier.ts");
|
|
13983
|
+
/* harmony import */ var _tables__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./tables */ "./src/tables.ts");
|
|
13984
|
+
/* harmony import */ var _typeguard__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./typeguard */ "./src/typeguard.ts");
|
|
13985
|
+
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./util */ "./src/util.ts");
|
|
13946
13986
|
// Copyright (c) 2023-present VexFlow contributors: https://github.com/vexflow/vexflow/graphs/contributors
|
|
13947
13987
|
// @author Cyril Silverman
|
|
13948
13988
|
//
|
|
@@ -13955,35 +13995,42 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
13955
13995
|
|
|
13956
13996
|
|
|
13957
13997
|
|
|
13958
|
-
|
|
13998
|
+
|
|
13999
|
+
|
|
14000
|
+
class KeySignature extends _stavemodifier__WEBPACK_IMPORTED_MODULE_3__.StaveModifier {
|
|
13959
14001
|
static get CATEGORY() {
|
|
13960
|
-
return
|
|
14002
|
+
return _typeguard__WEBPACK_IMPORTED_MODULE_5__.Category.KeySignature;
|
|
13961
14003
|
}
|
|
13962
14004
|
// Create a new Key Signature based on a `keySpec`
|
|
13963
14005
|
constructor(keySpec, cancelKeySpec, alterKeySpec) {
|
|
13964
14006
|
super();
|
|
13965
14007
|
this.accList = [];
|
|
13966
14008
|
this.setKeySig(keySpec, cancelKeySpec, alterKeySpec);
|
|
13967
|
-
this.setPosition(
|
|
13968
|
-
this.
|
|
14009
|
+
this.setPosition(_stavemodifier__WEBPACK_IMPORTED_MODULE_3__.StaveModifierPosition.BEGIN);
|
|
14010
|
+
this.children = [];
|
|
13969
14011
|
this.paddingForced = false;
|
|
13970
14012
|
}
|
|
13971
14013
|
// Add an accidental glyph to the `KeySignature` instance which represents
|
|
13972
14014
|
// the provided `acc`. If `nextAcc` is also provided, the appropriate
|
|
13973
14015
|
// spacing will be included in the glyph's position
|
|
13974
14016
|
convertToGlyph(acc, nextAcc, stave) {
|
|
13975
|
-
const code =
|
|
13976
|
-
const glyph = new
|
|
14017
|
+
const code = _tables__WEBPACK_IMPORTED_MODULE_4__.Tables.accidentalCodes(acc.type);
|
|
14018
|
+
const glyph = new _element__WEBPACK_IMPORTED_MODULE_1__.Element(_typeguard__WEBPACK_IMPORTED_MODULE_5__.Category.KeySignature);
|
|
13977
14019
|
glyph.setText(code);
|
|
13978
14020
|
// Determine spacing between current accidental and the next accidental
|
|
13979
|
-
|
|
14021
|
+
let extraWidth = 1;
|
|
13980
14022
|
// Place the glyph on the stave
|
|
13981
14023
|
glyph.setYShift(stave.getYForLine(acc.line));
|
|
13982
|
-
if (this.
|
|
13983
|
-
const prevGlyph = this.
|
|
14024
|
+
if (this.children.length > 0) {
|
|
14025
|
+
const prevGlyph = this.children[this.children.length - 1];
|
|
14026
|
+
const isNatural = (el) => el.getText() === _glyphs__WEBPACK_IMPORTED_MODULE_2__.Glyphs.accidentalNatural;
|
|
14027
|
+
const yShiftDiff = (el1, el2) => Math.abs(el2.getYShift() - el1.getYShift());
|
|
14028
|
+
if ((isNatural(prevGlyph) || isNatural(glyph)) && yShiftDiff(prevGlyph, glyph) < 10) {
|
|
14029
|
+
extraWidth = 2;
|
|
14030
|
+
}
|
|
13984
14031
|
glyph.setXShift(prevGlyph.getXShift() + prevGlyph.getWidth() + extraWidth);
|
|
13985
14032
|
}
|
|
13986
|
-
this.
|
|
14033
|
+
this.children.push(glyph);
|
|
13987
14034
|
// Expand size of key signature
|
|
13988
14035
|
this.width += glyph.getWidth() + extraWidth;
|
|
13989
14036
|
}
|
|
@@ -13994,9 +14041,10 @@ class KeySignature extends _stavemodifier__WEBPACK_IMPORTED_MODULE_1__.StaveModi
|
|
|
13994
14041
|
this.cancelKeySpec = spec;
|
|
13995
14042
|
return this;
|
|
13996
14043
|
}
|
|
14044
|
+
// Convert the `cancelKeySpec` into a list of naturals to be displayed
|
|
13997
14045
|
convertToCancelAccList(spec) {
|
|
13998
14046
|
// Get the accidental list for the cancelled key signature
|
|
13999
|
-
const cancelAccList =
|
|
14047
|
+
const cancelAccList = _tables__WEBPACK_IMPORTED_MODULE_4__.Tables.keySignature(spec);
|
|
14000
14048
|
// If the cancelled key has a different accidental type, ie: # vs b
|
|
14001
14049
|
const differentTypes = this.accList.length > 0 && cancelAccList.length > 0 && cancelAccList[0].type !== this.accList[0].type;
|
|
14002
14050
|
// Determine how many naturals needed to add
|
|
@@ -14021,11 +14069,34 @@ class KeySignature extends _stavemodifier__WEBPACK_IMPORTED_MODULE_1__.StaveModi
|
|
|
14021
14069
|
type: cancelAccList[0].type,
|
|
14022
14070
|
};
|
|
14023
14071
|
}
|
|
14072
|
+
// Add this key signature to the start of a stave.
|
|
14024
14073
|
addToStave(stave) {
|
|
14025
14074
|
this.paddingForced = true;
|
|
14026
14075
|
stave.addModifier(this);
|
|
14027
14076
|
return this;
|
|
14028
14077
|
}
|
|
14078
|
+
// Get the `BoundingBox`
|
|
14079
|
+
getBoundingBox() {
|
|
14080
|
+
if (!this.formatted)
|
|
14081
|
+
this.format();
|
|
14082
|
+
return super.getBoundingBox();
|
|
14083
|
+
}
|
|
14084
|
+
// Calculate the width and height for the entire signature
|
|
14085
|
+
calculateDimensions() {
|
|
14086
|
+
let boundingBox;
|
|
14087
|
+
if (this.children.length > 0) {
|
|
14088
|
+
boundingBox = this.children[0].getBoundingBox();
|
|
14089
|
+
}
|
|
14090
|
+
else {
|
|
14091
|
+
boundingBox = new _boundingbox__WEBPACK_IMPORTED_MODULE_0__.BoundingBox(this.x + this.xShift, this.y + this.yShift, 0, 0);
|
|
14092
|
+
}
|
|
14093
|
+
this.children.forEach((glyph) => {
|
|
14094
|
+
boundingBox.mergeWith(glyph.getBoundingBox());
|
|
14095
|
+
});
|
|
14096
|
+
this.width = boundingBox.getW();
|
|
14097
|
+
this.height = boundingBox.getH();
|
|
14098
|
+
this.y = boundingBox.getY();
|
|
14099
|
+
}
|
|
14029
14100
|
// Apply the accidental staff line placement based on the `clef` and
|
|
14030
14101
|
// the accidental `type` for the key signature ('# or 'b').
|
|
14031
14102
|
convertAccLines(clef, type, accList = this.accList) {
|
|
@@ -14081,16 +14152,19 @@ class KeySignature extends _stavemodifier__WEBPACK_IMPORTED_MODULE_1__.StaveModi
|
|
|
14081
14152
|
}
|
|
14082
14153
|
}
|
|
14083
14154
|
}
|
|
14155
|
+
// Get the padding required for this modifier
|
|
14084
14156
|
getPadding(index) {
|
|
14085
14157
|
if (!this.formatted)
|
|
14086
14158
|
this.format();
|
|
14087
|
-
return this.
|
|
14159
|
+
return this.children.length === 0 || (!this.paddingForced && index < 2) ? 0 : this.padding;
|
|
14088
14160
|
}
|
|
14161
|
+
// Get the width of the modifier
|
|
14089
14162
|
getWidth() {
|
|
14090
14163
|
if (!this.formatted)
|
|
14091
|
-
this.
|
|
14164
|
+
this.format();
|
|
14092
14165
|
return this.width;
|
|
14093
14166
|
}
|
|
14167
|
+
// Set the key signature to a specific key, ie: 'C' or 'Gm'
|
|
14094
14168
|
setKeySig(keySpec, cancelKeySpec, alterKeySpec) {
|
|
14095
14169
|
this.formatted = false;
|
|
14096
14170
|
this.keySpec = keySpec;
|
|
@@ -14106,6 +14180,7 @@ class KeySignature extends _stavemodifier__WEBPACK_IMPORTED_MODULE_1__.StaveModi
|
|
|
14106
14180
|
this.alterKeySpec = alterKeySpec;
|
|
14107
14181
|
return this;
|
|
14108
14182
|
}
|
|
14183
|
+
// Convert the `alterKeySpec` into a list of accidentals to be displayed
|
|
14109
14184
|
convertToAlterAccList(alterKeySpec) {
|
|
14110
14185
|
const max = Math.min(alterKeySpec.length, this.accList.length);
|
|
14111
14186
|
for (let i = 0; i < max; ++i) {
|
|
@@ -14114,11 +14189,12 @@ class KeySignature extends _stavemodifier__WEBPACK_IMPORTED_MODULE_1__.StaveModi
|
|
|
14114
14189
|
}
|
|
14115
14190
|
}
|
|
14116
14191
|
}
|
|
14192
|
+
// Format and position the modifier
|
|
14117
14193
|
format() {
|
|
14118
14194
|
const stave = this.checkStave();
|
|
14119
14195
|
this.width = 0;
|
|
14120
|
-
this.
|
|
14121
|
-
this.accList =
|
|
14196
|
+
this.children = [];
|
|
14197
|
+
this.accList = _tables__WEBPACK_IMPORTED_MODULE_4__.Tables.keySignature((0,_util__WEBPACK_IMPORTED_MODULE_6__.defined)(this.keySpec));
|
|
14122
14198
|
const accList = this.accList;
|
|
14123
14199
|
const firstAccidentalType = accList.length > 0 ? accList[0].type : undefined;
|
|
14124
14200
|
let cancelAccList;
|
|
@@ -14129,7 +14205,7 @@ class KeySignature extends _stavemodifier__WEBPACK_IMPORTED_MODULE_1__.StaveModi
|
|
|
14129
14205
|
this.convertToAlterAccList(this.alterKeySpec);
|
|
14130
14206
|
}
|
|
14131
14207
|
if (this.accList.length > 0) {
|
|
14132
|
-
const clef = (this.position ===
|
|
14208
|
+
const clef = (this.position === _stavemodifier__WEBPACK_IMPORTED_MODULE_3__.StaveModifierPosition.END ? stave.getEndClef() : stave.getClef()) || stave.getClef();
|
|
14133
14209
|
if (cancelAccList) {
|
|
14134
14210
|
this.convertAccLines(clef, cancelAccList.type, cancelAccList.accList);
|
|
14135
14211
|
}
|
|
@@ -14138,43 +14214,22 @@ class KeySignature extends _stavemodifier__WEBPACK_IMPORTED_MODULE_1__.StaveModi
|
|
|
14138
14214
|
this.convertToGlyph(this.accList[i], this.accList[i + 1], stave);
|
|
14139
14215
|
}
|
|
14140
14216
|
}
|
|
14217
|
+
this.calculateDimensions();
|
|
14141
14218
|
this.formatted = true;
|
|
14142
14219
|
}
|
|
14143
|
-
|
|
14144
|
-
this.width = 0;
|
|
14145
|
-
this.accList = _tables__WEBPACK_IMPORTED_MODULE_2__.Tables.keySignature((0,_util__WEBPACK_IMPORTED_MODULE_4__.defined)(this.keySpec));
|
|
14146
|
-
if (this.cancelKeySpec) {
|
|
14147
|
-
this.convertToCancelAccList(this.cancelKeySpec);
|
|
14148
|
-
}
|
|
14149
|
-
if (this.alterKeySpec) {
|
|
14150
|
-
this.convertToAlterAccList(this.alterKeySpec);
|
|
14151
|
-
}
|
|
14152
|
-
if (this.accList.length > 0) {
|
|
14153
|
-
for (let i = 0; i < this.accList.length; ++i) {
|
|
14154
|
-
const code = _tables__WEBPACK_IMPORTED_MODULE_2__.Tables.accidentalCodes(this.accList[i].type);
|
|
14155
|
-
const glyph = new _element__WEBPACK_IMPORTED_MODULE_0__.Element(_typeguard__WEBPACK_IMPORTED_MODULE_3__.Category.KeySignature);
|
|
14156
|
-
glyph.setText(code);
|
|
14157
|
-
// Determine spacing between current accidental and the next accidental
|
|
14158
|
-
const extraWidth = 1;
|
|
14159
|
-
// Expand size of key signature
|
|
14160
|
-
this.width += glyph.getWidth() + extraWidth;
|
|
14161
|
-
}
|
|
14162
|
-
}
|
|
14163
|
-
}
|
|
14220
|
+
// Render the key signature
|
|
14164
14221
|
draw() {
|
|
14165
14222
|
const stave = this.checkStave();
|
|
14166
14223
|
const ctx = stave.checkContext();
|
|
14167
14224
|
if (!this.formatted)
|
|
14168
14225
|
this.format();
|
|
14169
14226
|
this.setRendered();
|
|
14170
|
-
this.applyStyle(ctx);
|
|
14171
14227
|
ctx.openGroup('keysignature', this.getAttribute('id'));
|
|
14172
|
-
for (let i = 0; i < this.
|
|
14173
|
-
const glyph = this.
|
|
14228
|
+
for (let i = 0; i < this.children.length; i++) {
|
|
14229
|
+
const glyph = this.children[i];
|
|
14174
14230
|
glyph.renderText(ctx, this.x, 0);
|
|
14175
14231
|
}
|
|
14176
14232
|
ctx.closeGroup();
|
|
14177
|
-
this.restoreStyle(ctx);
|
|
14178
14233
|
}
|
|
14179
14234
|
}
|
|
14180
14235
|
|
|
@@ -14226,7 +14281,7 @@ class KeySigNote extends _note__WEBPACK_IMPORTED_MODULE_1__.Note {
|
|
|
14226
14281
|
this.setRendered();
|
|
14227
14282
|
this.keySignature.setX(this.getAbsoluteX());
|
|
14228
14283
|
this.keySignature.setContext(ctx);
|
|
14229
|
-
this.keySignature.
|
|
14284
|
+
this.keySignature.drawWithStyle();
|
|
14230
14285
|
}
|
|
14231
14286
|
}
|
|
14232
14287
|
|
|
@@ -14247,13 +14302,43 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
14247
14302
|
// Copyright (c) 2023-present VexFlow contributors: https://github.com/vexflow/vexflow/graphs/contributors
|
|
14248
14303
|
class Metrics {
|
|
14249
14304
|
/** Use the provided key to look up a FontInfo in CommonMetrics. **/
|
|
14305
|
+
static clear(key) {
|
|
14306
|
+
if (key) {
|
|
14307
|
+
this.cacheFont.delete(key);
|
|
14308
|
+
this.cacheStyle.delete(key);
|
|
14309
|
+
}
|
|
14310
|
+
else {
|
|
14311
|
+
this.cacheFont.clear();
|
|
14312
|
+
this.cacheStyle.clear();
|
|
14313
|
+
}
|
|
14314
|
+
}
|
|
14250
14315
|
static getFontInfo(key) {
|
|
14251
|
-
|
|
14252
|
-
|
|
14253
|
-
|
|
14254
|
-
|
|
14255
|
-
|
|
14256
|
-
|
|
14316
|
+
let font = this.cacheFont.get(key);
|
|
14317
|
+
if (!font) {
|
|
14318
|
+
font = {
|
|
14319
|
+
family: Metrics.get(`${key}.fontFamily`),
|
|
14320
|
+
size: Metrics.get(`${key}.fontSize`) * Metrics.get(`${key}.fontScale`),
|
|
14321
|
+
weight: Metrics.get(`${key}.fontWeight`),
|
|
14322
|
+
style: Metrics.get(`${key}.fontStyle`),
|
|
14323
|
+
};
|
|
14324
|
+
this.cacheFont.set(key, font);
|
|
14325
|
+
}
|
|
14326
|
+
return structuredClone(font);
|
|
14327
|
+
}
|
|
14328
|
+
static getStyle(key) {
|
|
14329
|
+
let style = this.cacheStyle.get(key);
|
|
14330
|
+
if (!style) {
|
|
14331
|
+
style = {
|
|
14332
|
+
fillStyle: Metrics.get(`${key}.fillStyle`),
|
|
14333
|
+
strokeStyle: Metrics.get(`${key}.strokeStyle`),
|
|
14334
|
+
lineWidth: Metrics.get(`${key}.lineWidth`),
|
|
14335
|
+
lineDash: Metrics.get(`${key}.lineDash`),
|
|
14336
|
+
shadowBlur: Metrics.get(`${key}.shadowBlur`),
|
|
14337
|
+
shadowColor: Metrics.get(`${key}.shadowColor`),
|
|
14338
|
+
};
|
|
14339
|
+
this.cacheStyle.set(key, style);
|
|
14340
|
+
}
|
|
14341
|
+
return structuredClone(style);
|
|
14257
14342
|
}
|
|
14258
14343
|
/**
|
|
14259
14344
|
* Use the provided key to look up a value in CommonMetrics.
|
|
@@ -14290,6 +14375,8 @@ class Metrics {
|
|
|
14290
14375
|
return retVal;
|
|
14291
14376
|
}
|
|
14292
14377
|
}
|
|
14378
|
+
Metrics.cacheStyle = new Map();
|
|
14379
|
+
Metrics.cacheFont = new Map();
|
|
14293
14380
|
// eslint-disable-next-line
|
|
14294
14381
|
const MetricsDefaults = {
|
|
14295
14382
|
fontFamily: 'Bravura,Academico',
|
|
@@ -14302,7 +14389,7 @@ const MetricsDefaults = {
|
|
|
14302
14389
|
fontSize: 20,
|
|
14303
14390
|
},
|
|
14304
14391
|
grace: {
|
|
14305
|
-
fontSize:
|
|
14392
|
+
fontSize: 20,
|
|
14306
14393
|
},
|
|
14307
14394
|
noteheadAccidentalPadding: 1,
|
|
14308
14395
|
leftPadding: 2,
|
|
@@ -14313,6 +14400,10 @@ const MetricsDefaults = {
|
|
|
14313
14400
|
},
|
|
14314
14401
|
Bend: {
|
|
14315
14402
|
fontSize: 10,
|
|
14403
|
+
line: {
|
|
14404
|
+
strokeStyle: '#777777',
|
|
14405
|
+
lineWidth: 1,
|
|
14406
|
+
},
|
|
14316
14407
|
},
|
|
14317
14408
|
ChordSymbol: {
|
|
14318
14409
|
fontSize: 12,
|
|
@@ -14356,6 +14447,7 @@ const MetricsDefaults = {
|
|
|
14356
14447
|
},
|
|
14357
14448
|
},
|
|
14358
14449
|
Stave: {
|
|
14450
|
+
strokeStyle: '#999999',
|
|
14359
14451
|
fontSize: 8,
|
|
14360
14452
|
padding: 12,
|
|
14361
14453
|
endPaddingMax: 10,
|
|
@@ -14373,6 +14465,9 @@ const MetricsDefaults = {
|
|
|
14373
14465
|
StaveSection: {
|
|
14374
14466
|
fontSize: 10,
|
|
14375
14467
|
fontWeight: 'bold',
|
|
14468
|
+
lineWidth: 2,
|
|
14469
|
+
padding: 2,
|
|
14470
|
+
strokeStyle: 'black',
|
|
14376
14471
|
},
|
|
14377
14472
|
StaveTempo: {
|
|
14378
14473
|
fontSize: 14,
|
|
@@ -14389,6 +14484,9 @@ const MetricsDefaults = {
|
|
|
14389
14484
|
StaveTie: {
|
|
14390
14485
|
fontSize: 10,
|
|
14391
14486
|
},
|
|
14487
|
+
Stem: {
|
|
14488
|
+
strokeStyle: 'black',
|
|
14489
|
+
},
|
|
14392
14490
|
StringNumber: {
|
|
14393
14491
|
fontSize: 10,
|
|
14394
14492
|
fontWeight: 'bold',
|
|
@@ -14415,6 +14513,7 @@ const MetricsDefaults = {
|
|
|
14415
14513
|
fontWeight: 'bold',
|
|
14416
14514
|
},
|
|
14417
14515
|
TabStave: {
|
|
14516
|
+
strokeStyle: '#999999',
|
|
14418
14517
|
fontSize: 8,
|
|
14419
14518
|
},
|
|
14420
14519
|
TabTie: {
|
|
@@ -14432,6 +14531,10 @@ const MetricsDefaults = {
|
|
|
14432
14531
|
Tremolo: {
|
|
14433
14532
|
spacing: 7,
|
|
14434
14533
|
},
|
|
14534
|
+
Tuplet: {
|
|
14535
|
+
yOffset: 0,
|
|
14536
|
+
textYOffset: 2,
|
|
14537
|
+
},
|
|
14435
14538
|
Volta: {
|
|
14436
14539
|
fontSize: 9,
|
|
14437
14540
|
fontWeight: 'bold',
|
|
@@ -14617,12 +14720,14 @@ class Modifier extends _element__WEBPACK_IMPORTED_MODULE_0__.Element {
|
|
|
14617
14720
|
throw new _util__WEBPACK_IMPORTED_MODULE_2__.RuntimeError('NotImplemented', 'draw() not implemented for this modifier.');
|
|
14618
14721
|
}
|
|
14619
14722
|
// aligns sub notes of NoteSubGroup (or GraceNoteGroup) to the main note with correct x-offset
|
|
14620
|
-
alignSubNotesWithNote(subNotes, note) {
|
|
14723
|
+
alignSubNotesWithNote(subNotes, note, position = Modifier.Position.LEFT) {
|
|
14621
14724
|
// Shift over the tick contexts of each note
|
|
14622
14725
|
const tickContext = note.getTickContext();
|
|
14623
14726
|
const metrics = tickContext.getMetrics();
|
|
14624
14727
|
const stave = note.getStave();
|
|
14625
|
-
const subNoteXOffset =
|
|
14728
|
+
const subNoteXOffset = position === Modifier.Position.RIGHT
|
|
14729
|
+
? tickContext.getX() + this.getSpacingFromNextModifier() * subNotes.length + 10
|
|
14730
|
+
: tickContext.getX() - metrics.modLeftPx - metrics.modRightPx + this.getSpacingFromNextModifier();
|
|
14626
14731
|
subNotes.forEach((subNote) => {
|
|
14627
14732
|
const subTickContext = subNote.getTickContext();
|
|
14628
14733
|
if (stave)
|
|
@@ -15925,6 +16030,7 @@ class NoteHead extends _note__WEBPACK_IMPORTED_MODULE_0__.Note {
|
|
|
15925
16030
|
return _typeguard__WEBPACK_IMPORTED_MODULE_2__.Category.NoteHead;
|
|
15926
16031
|
}
|
|
15927
16032
|
constructor(noteStruct) {
|
|
16033
|
+
var _a;
|
|
15928
16034
|
super(noteStruct);
|
|
15929
16035
|
this.customGlyph = false;
|
|
15930
16036
|
// map notehead SMuFL codes to the corresponding SMuFL code with ledger line
|
|
@@ -15953,7 +16059,7 @@ class NoteHead extends _note__WEBPACK_IMPORTED_MODULE_0__.Note {
|
|
|
15953
16059
|
this.customGlyph = true;
|
|
15954
16060
|
this.text = noteStruct.customGlyphCode;
|
|
15955
16061
|
}
|
|
15956
|
-
this.setStyle(noteStruct.style);
|
|
16062
|
+
this.setStyle((_a = noteStruct.style) !== null && _a !== void 0 ? _a : {});
|
|
15957
16063
|
this.slashed = noteStruct.slashed || false;
|
|
15958
16064
|
this.renderOptions = Object.assign({}, this.renderOptions);
|
|
15959
16065
|
}
|
|
@@ -16004,11 +16110,15 @@ class NoteHead extends _note__WEBPACK_IMPORTED_MODULE_0__.Note {
|
|
|
16004
16110
|
}
|
|
16005
16111
|
/** Draw the notehead. */
|
|
16006
16112
|
draw() {
|
|
16113
|
+
var _a;
|
|
16007
16114
|
const ctx = this.checkContext();
|
|
16008
16115
|
this.setRendered();
|
|
16116
|
+
ctx.openGroup('notehead', this.getAttribute('id'));
|
|
16009
16117
|
L("Drawing note head '", this.noteType, this.duration, "' at", this.x, this.y);
|
|
16010
16118
|
this.x = this.getAbsoluteX();
|
|
16011
16119
|
this.renderText(ctx, 0, 0);
|
|
16120
|
+
(_a = this.parent) === null || _a === void 0 ? void 0 : _a.drawModifiers(this);
|
|
16121
|
+
ctx.closeGroup();
|
|
16012
16122
|
}
|
|
16013
16123
|
}
|
|
16014
16124
|
/** To enable logging for this class. Set `VexFlow.NoteHead.DEBUG` to `true`. */
|
|
@@ -16309,7 +16419,6 @@ class Ornament extends _modifier__WEBPACK_IMPORTED_MODULE_3__.Modifier {
|
|
|
16309
16419
|
const note = this.checkAttachedNote();
|
|
16310
16420
|
this.setRendered();
|
|
16311
16421
|
const stave = note.checkStave();
|
|
16312
|
-
this.applyStyle();
|
|
16313
16422
|
ctx.openGroup('ornament', this.getAttribute('id'));
|
|
16314
16423
|
// Get initial coordinates for the modifier position
|
|
16315
16424
|
const start = note.getModifierStartXY(this.position, this.index);
|
|
@@ -16365,7 +16474,6 @@ class Ornament extends _modifier__WEBPACK_IMPORTED_MODULE_3__.Modifier {
|
|
|
16365
16474
|
this.accidentalUpper.renderText(ctx, glyphX + this.xShift - this.accidentalUpper.getWidth() * 0.5, glyphY + this.yShift - this.accidentalUpper.getTextMetrics().actualBoundingBoxDescent);
|
|
16366
16475
|
}
|
|
16367
16476
|
ctx.closeGroup();
|
|
16368
|
-
this.restoreStyle();
|
|
16369
16477
|
}
|
|
16370
16478
|
}
|
|
16371
16479
|
/** To enable logging for this class. Set `VexFlow.Ornament.DEBUG` to `true`. */
|
|
@@ -16705,9 +16813,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
16705
16813
|
/* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./element */ "./src/element.ts");
|
|
16706
16814
|
/* harmony import */ var _glyphs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./glyphs */ "./src/glyphs.ts");
|
|
16707
16815
|
/* harmony import */ var _metrics__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./metrics */ "./src/metrics.ts");
|
|
16708
|
-
/* harmony import */ var
|
|
16709
|
-
/* harmony import */ var
|
|
16710
|
-
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./util */ "./src/util.ts");
|
|
16816
|
+
/* harmony import */ var _typeguard__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./typeguard */ "./src/typeguard.ts");
|
|
16817
|
+
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./util */ "./src/util.ts");
|
|
16711
16818
|
// Copyright (c) 2023-present VexFlow contributors: https://github.com/vexflow/vexflow/graphs/contributors
|
|
16712
16819
|
// MIT License
|
|
16713
16820
|
|
|
@@ -16715,22 +16822,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
16715
16822
|
|
|
16716
16823
|
|
|
16717
16824
|
|
|
16718
|
-
|
|
16719
16825
|
// eslint-disable-next-line
|
|
16720
16826
|
function L(...args) {
|
|
16721
16827
|
if (PedalMarking.DEBUG)
|
|
16722
|
-
(0,
|
|
16723
|
-
}
|
|
16724
|
-
/**
|
|
16725
|
-
* Draws a pedal glyph with the provided `name` on a rendering `context`
|
|
16726
|
-
* at the coordinates `x` and `y. Takes into account the glyph data
|
|
16727
|
-
* coordinate shifts.
|
|
16728
|
-
*/
|
|
16729
|
-
function drawPedalGlyph(name, ctx, x, y) {
|
|
16730
|
-
var _a;
|
|
16731
|
-
const glyph = new _element__WEBPACK_IMPORTED_MODULE_0__.Element(PedalMarking.CATEGORY);
|
|
16732
|
-
glyph.setText((_a = PedalMarking.GLYPHS[name]) !== null && _a !== void 0 ? _a : name);
|
|
16733
|
-
glyph.renderText(ctx, x - (glyph.getWidth() - _tables__WEBPACK_IMPORTED_MODULE_3__.Tables.STAVE_LINE_DISTANCE) / 2, y);
|
|
16828
|
+
(0,_util__WEBPACK_IMPORTED_MODULE_4__.log)('VexFlow.PedalMarking', args);
|
|
16734
16829
|
}
|
|
16735
16830
|
/**
|
|
16736
16831
|
* PedalMarking implements different types of pedal markings. These notation
|
|
@@ -16741,7 +16836,7 @@ function drawPedalGlyph(name, ctx, x, y) {
|
|
|
16741
16836
|
*/
|
|
16742
16837
|
class PedalMarking extends _element__WEBPACK_IMPORTED_MODULE_0__.Element {
|
|
16743
16838
|
static get CATEGORY() {
|
|
16744
|
-
return
|
|
16839
|
+
return _typeguard__WEBPACK_IMPORTED_MODULE_3__.Category.PedalMarking;
|
|
16745
16840
|
}
|
|
16746
16841
|
/**
|
|
16747
16842
|
* Create a sustain pedal marking. Returns the defaults PedalMarking.
|
|
@@ -16770,9 +16865,9 @@ class PedalMarking extends _element__WEBPACK_IMPORTED_MODULE_0__.Element {
|
|
|
16770
16865
|
this.notes = notes;
|
|
16771
16866
|
this.type = PedalMarking.type.TEXT;
|
|
16772
16867
|
this.line = 0;
|
|
16773
|
-
//
|
|
16774
|
-
this.
|
|
16775
|
-
this.
|
|
16868
|
+
// Text for the release/depress markings
|
|
16869
|
+
this.depressText = PedalMarking.GLYPHS.pedalDepress;
|
|
16870
|
+
this.releaseText = PedalMarking.GLYPHS.pedalRelease;
|
|
16776
16871
|
this.renderOptions = {
|
|
16777
16872
|
bracketHeight: 10,
|
|
16778
16873
|
textMarginRight: 6,
|
|
@@ -16793,8 +16888,9 @@ class PedalMarking extends _element__WEBPACK_IMPORTED_MODULE_0__.Element {
|
|
|
16793
16888
|
* set if the parameter is falsy.
|
|
16794
16889
|
*/
|
|
16795
16890
|
setCustomText(depress, release) {
|
|
16796
|
-
this.
|
|
16797
|
-
this.
|
|
16891
|
+
this.depressText = depress || '';
|
|
16892
|
+
this.releaseText = release || '';
|
|
16893
|
+
this.setFont(_metrics__WEBPACK_IMPORTED_MODULE_2__.Metrics.getFontInfo('PedalMarking.text'));
|
|
16798
16894
|
return this;
|
|
16799
16895
|
}
|
|
16800
16896
|
/** Set the staff line to render the markings on. */
|
|
@@ -16808,8 +16904,10 @@ class PedalMarking extends _element__WEBPACK_IMPORTED_MODULE_0__.Element {
|
|
|
16808
16904
|
let isPedalDepressed = false;
|
|
16809
16905
|
let prevX;
|
|
16810
16906
|
let prevY;
|
|
16907
|
+
let textWidth = 0;
|
|
16811
16908
|
// Iterate through each note
|
|
16812
16909
|
this.notes.forEach((note, index, notes) => {
|
|
16910
|
+
var _a, _b, _c, _d;
|
|
16813
16911
|
// Each note triggers the opposite pedal action
|
|
16814
16912
|
isPedalDepressed = !isPedalDepressed;
|
|
16815
16913
|
// Get the initial coordinates for the note
|
|
@@ -16817,7 +16915,7 @@ class PedalMarking extends _element__WEBPACK_IMPORTED_MODULE_0__.Element {
|
|
|
16817
16915
|
const y = note.checkStave().getYForBottomText(this.line + 3);
|
|
16818
16916
|
// Throw if current note is positioned before the previous note
|
|
16819
16917
|
if (x < prevX) {
|
|
16820
|
-
throw new
|
|
16918
|
+
throw new _util__WEBPACK_IMPORTED_MODULE_4__.RuntimeError('InvalidConfiguration', 'The notes provided must be in order of ascending x positions');
|
|
16821
16919
|
}
|
|
16822
16920
|
// Determine if the previous or next note are the same
|
|
16823
16921
|
// as the current note. We need to keep track of this for
|
|
@@ -16830,17 +16928,10 @@ class PedalMarking extends _element__WEBPACK_IMPORTED_MODULE_0__.Element {
|
|
|
16830
16928
|
xShift = prevNoteIsSame ? 5 : 0;
|
|
16831
16929
|
if (this.type === PedalMarking.type.MIXED && !prevNoteIsSame) {
|
|
16832
16930
|
// For MIXED style, start with text instead of bracket
|
|
16833
|
-
|
|
16834
|
-
|
|
16835
|
-
|
|
16836
|
-
|
|
16837
|
-
xShift = textWidth / 2 + this.renderOptions.textMarginRight;
|
|
16838
|
-
}
|
|
16839
|
-
else {
|
|
16840
|
-
// Render the Ped glyph in position
|
|
16841
|
-
drawPedalGlyph('pedalDepress', ctx, x, y);
|
|
16842
|
-
xShift = 20 + this.renderOptions.textMarginRight;
|
|
16843
|
-
}
|
|
16931
|
+
textWidth = ctx.measureText(this.depressText).width;
|
|
16932
|
+
ctx.fillText(this.depressText, x, y);
|
|
16933
|
+
// Adjust the xShift for the next note
|
|
16934
|
+
xShift = textWidth + this.renderOptions.textMarginRight;
|
|
16844
16935
|
}
|
|
16845
16936
|
else {
|
|
16846
16937
|
// Draw start bracket
|
|
@@ -16852,13 +16943,21 @@ class PedalMarking extends _element__WEBPACK_IMPORTED_MODULE_0__.Element {
|
|
|
16852
16943
|
}
|
|
16853
16944
|
}
|
|
16854
16945
|
else {
|
|
16855
|
-
//
|
|
16856
|
-
|
|
16946
|
+
// Get the current note index and the total notes in the associated voice
|
|
16947
|
+
const noteNdx = note.getVoice().getTickables().indexOf(note);
|
|
16948
|
+
const voiceNotes = note.getVoice().getTickables().length;
|
|
16949
|
+
// Get the absolute x position of the end of the current note
|
|
16950
|
+
const noteEndX = noteNdx + 1 < voiceNotes
|
|
16951
|
+
? // If the next note is in the same voice, use the x position of the next note
|
|
16952
|
+
note.getVoice().getTickables()[noteNdx + 1].getAbsoluteX()
|
|
16953
|
+
: // If this is the last note is the voice, use the x position of the next stave
|
|
16954
|
+
((_b = (_a = note.getStave()) === null || _a === void 0 ? void 0 : _a.getX()) !== null && _b !== void 0 ? _b : 0) + ((_d = (_c = note.getStave()) === null || _c === void 0 ? void 0 : _c.getWidth()) !== null && _d !== void 0 ? _d : 0);
|
|
16857
16955
|
// Draw end bracket
|
|
16858
16956
|
ctx.beginPath();
|
|
16859
16957
|
ctx.moveTo(prevX, prevY);
|
|
16860
|
-
ctx.lineTo(x
|
|
16861
|
-
|
|
16958
|
+
ctx.lineTo(nextNoteIsSame ? x - 5 : noteEndX - 5, y);
|
|
16959
|
+
// No shift if next note is the same
|
|
16960
|
+
ctx.lineTo(nextNoteIsSame ? x : noteEndX - 5, y - this.renderOptions.bracketHeight);
|
|
16862
16961
|
ctx.stroke();
|
|
16863
16962
|
ctx.closePath();
|
|
16864
16963
|
}
|
|
@@ -16874,30 +16973,29 @@ class PedalMarking extends _element__WEBPACK_IMPORTED_MODULE_0__.Element {
|
|
|
16874
16973
|
drawText() {
|
|
16875
16974
|
const ctx = this.checkContext();
|
|
16876
16975
|
let isPedalDepressed = false;
|
|
16976
|
+
let textWidth = 0;
|
|
16877
16977
|
// Iterate through each note, placing glyphs or custom text accordingly
|
|
16878
16978
|
this.notes.forEach((note) => {
|
|
16979
|
+
var _a, _b, _c, _d;
|
|
16879
16980
|
isPedalDepressed = !isPedalDepressed;
|
|
16880
16981
|
const stave = note.checkStave();
|
|
16881
16982
|
const x = note.getAbsoluteX();
|
|
16882
16983
|
const y = stave.getYForBottomText(this.line + 3);
|
|
16883
|
-
let textWidth = 0;
|
|
16884
16984
|
if (isPedalDepressed) {
|
|
16885
|
-
|
|
16886
|
-
|
|
16887
|
-
ctx.fillText(this.customDepressText, x - textWidth / 2, y);
|
|
16888
|
-
}
|
|
16889
|
-
else {
|
|
16890
|
-
drawPedalGlyph('pedalDepress', ctx, x, y);
|
|
16891
|
-
}
|
|
16985
|
+
textWidth = ctx.measureText(this.depressText).width;
|
|
16986
|
+
ctx.fillText(this.depressText, x, y);
|
|
16892
16987
|
}
|
|
16893
16988
|
else {
|
|
16894
|
-
|
|
16895
|
-
|
|
16896
|
-
|
|
16897
|
-
|
|
16898
|
-
|
|
16899
|
-
|
|
16900
|
-
|
|
16989
|
+
const noteNdx = note.getVoice().getTickables().indexOf(note);
|
|
16990
|
+
const voiceNotes = note.getVoice().getTickables().length;
|
|
16991
|
+
// Get the shift for the next note
|
|
16992
|
+
const noteEndX = noteNdx + 1 < voiceNotes
|
|
16993
|
+
? // If the next note is in the same voice, use the x position of the next note
|
|
16994
|
+
note.getVoice().getTickables()[noteNdx + 1].getAbsoluteX()
|
|
16995
|
+
: // If this is the last note is the voice, use the x position of the next stave
|
|
16996
|
+
((_b = (_a = note.getStave()) === null || _a === void 0 ? void 0 : _a.getX()) !== null && _b !== void 0 ? _b : 0) + ((_d = (_c = note.getStave()) === null || _c === void 0 ? void 0 : _c.getWidth()) !== null && _d !== void 0 ? _d : 0);
|
|
16997
|
+
textWidth = ctx.measureText(this.releaseText).width;
|
|
16998
|
+
ctx.fillText(this.releaseText, noteEndX - textWidth, y);
|
|
16901
16999
|
}
|
|
16902
17000
|
});
|
|
16903
17001
|
}
|
|
@@ -16905,10 +17003,9 @@ class PedalMarking extends _element__WEBPACK_IMPORTED_MODULE_0__.Element {
|
|
|
16905
17003
|
draw() {
|
|
16906
17004
|
const ctx = this.checkContext();
|
|
16907
17005
|
this.setRendered();
|
|
16908
|
-
ctx.save();
|
|
16909
17006
|
ctx.setStrokeStyle(this.renderOptions.color);
|
|
16910
17007
|
ctx.setFillStyle(this.renderOptions.color);
|
|
16911
|
-
ctx.setFont(
|
|
17008
|
+
ctx.setFont(this.font);
|
|
16912
17009
|
L('Rendering Pedal Marking');
|
|
16913
17010
|
if (this.type === PedalMarking.type.BRACKET || this.type === PedalMarking.type.MIXED) {
|
|
16914
17011
|
ctx.setLineWidth(this.renderOptions.bracketLineWidth);
|
|
@@ -16917,7 +17014,6 @@ class PedalMarking extends _element__WEBPACK_IMPORTED_MODULE_0__.Element {
|
|
|
16917
17014
|
else if (this.type === PedalMarking.type.TEXT) {
|
|
16918
17015
|
this.drawText();
|
|
16919
17016
|
}
|
|
16920
|
-
ctx.restore();
|
|
16921
17017
|
}
|
|
16922
17018
|
}
|
|
16923
17019
|
/** To enable logging for this class. Set `VexFlow.PedalMarking.DEBUG` to `true`. */
|
|
@@ -17391,7 +17487,7 @@ class Stave extends _element__WEBPACK_IMPORTED_MODULE_2__.Element {
|
|
|
17391
17487
|
this.measure = 0;
|
|
17392
17488
|
this.clef = 'treble';
|
|
17393
17489
|
this.endClef = undefined;
|
|
17394
|
-
this.options = Object.assign({ verticalBarWidth: 10, numLines: 5,
|
|
17490
|
+
this.options = Object.assign({ verticalBarWidth: 10, numLines: 5, leftBar: true, rightBar: true, spacingBetweenLinesPx: _tables__WEBPACK_IMPORTED_MODULE_12__.Tables.STAVE_LINE_DISTANCE, spaceAboveStaffLn: 4, spaceBelowStaffLn: 4, topTextPosition: 1, bottomTextPosition: 4, lineConfig: [] }, options);
|
|
17395
17491
|
this.bounds = { x: this.x, y: this.y, w: this.width, h: 0 };
|
|
17396
17492
|
this.defaultLedgerLineStyle = { strokeStyle: '#444', lineWidth: 1.4 };
|
|
17397
17493
|
this.resetLines();
|
|
@@ -17450,10 +17546,12 @@ class Stave extends _element__WEBPACK_IMPORTED_MODULE_2__.Element {
|
|
|
17450
17546
|
return this;
|
|
17451
17547
|
}
|
|
17452
17548
|
getTopLineTopY() {
|
|
17453
|
-
|
|
17549
|
+
var _a;
|
|
17550
|
+
return this.getYForLine(0) - ((_a = this.getStyle().lineWidth) !== null && _a !== void 0 ? _a : 1) / 2;
|
|
17454
17551
|
}
|
|
17455
17552
|
getBottomLineBottomY() {
|
|
17456
|
-
|
|
17553
|
+
var _a;
|
|
17554
|
+
return this.getYForLine(this.getNumLines() - 1) + ((_a = this.getStyle().lineWidth) !== null && _a !== void 0 ? _a : 1) / 2;
|
|
17457
17555
|
}
|
|
17458
17556
|
setX(x) {
|
|
17459
17557
|
const shift = x - this.x;
|
|
@@ -17475,9 +17573,6 @@ class Stave extends _element__WEBPACK_IMPORTED_MODULE_2__.Element {
|
|
|
17475
17573
|
// this.modifiers[1].setX(this.endX);
|
|
17476
17574
|
return this;
|
|
17477
17575
|
}
|
|
17478
|
-
getStyle() {
|
|
17479
|
-
return Object.assign({ fillStyle: this.options.fillStyle, strokeStyle: this.options.fillStyle, lineWidth: _tables__WEBPACK_IMPORTED_MODULE_12__.Tables.STAVE_LINE_THICKNESS }, super.getStyle());
|
|
17480
|
-
}
|
|
17481
17576
|
/**
|
|
17482
17577
|
* Set the measure number of this Stave.
|
|
17483
17578
|
*/
|
|
@@ -17529,11 +17624,11 @@ class Stave extends _element__WEBPACK_IMPORTED_MODULE_2__.Element {
|
|
|
17529
17624
|
}
|
|
17530
17625
|
// Section functions
|
|
17531
17626
|
setSection(section, y, xOffset = 0, fontSize, drawRect = true) {
|
|
17532
|
-
const staveSection = new _stavesection__WEBPACK_IMPORTED_MODULE_8__.StaveSection(section
|
|
17627
|
+
const staveSection = new _stavesection__WEBPACK_IMPORTED_MODULE_8__.StaveSection(section).setYShift(y).setXShift(xOffset).setDrawRect(drawRect);
|
|
17533
17628
|
if (fontSize) {
|
|
17534
17629
|
staveSection.setFontSize(fontSize);
|
|
17535
17630
|
}
|
|
17536
|
-
this.
|
|
17631
|
+
this.addModifier(staveSection);
|
|
17537
17632
|
return this;
|
|
17538
17633
|
}
|
|
17539
17634
|
// Tempo functions
|
|
@@ -17877,7 +17972,6 @@ class Stave extends _element__WEBPACK_IMPORTED_MODULE_2__.Element {
|
|
|
17877
17972
|
draw() {
|
|
17878
17973
|
const ctx = this.checkContext();
|
|
17879
17974
|
this.setRendered();
|
|
17880
|
-
this.applyStyle();
|
|
17881
17975
|
ctx.openGroup('stave', this.getAttribute('id'));
|
|
17882
17976
|
if (!this.formatted)
|
|
17883
17977
|
this.format();
|
|
@@ -17896,24 +17990,20 @@ class Stave extends _element__WEBPACK_IMPORTED_MODULE_2__.Element {
|
|
|
17896
17990
|
}
|
|
17897
17991
|
}
|
|
17898
17992
|
ctx.closeGroup();
|
|
17899
|
-
this.restoreStyle();
|
|
17900
17993
|
// Draw the modifiers (bar lines, coda, segno, repeat brackets, etc.)
|
|
17901
17994
|
for (let i = 0; i < this.modifiers.length; i++) {
|
|
17902
17995
|
const modifier = this.modifiers[i];
|
|
17903
|
-
modifier.
|
|
17904
|
-
modifier.
|
|
17905
|
-
modifier.
|
|
17996
|
+
modifier.setContext(ctx);
|
|
17997
|
+
modifier.setStave(this);
|
|
17998
|
+
modifier.drawWithStyle();
|
|
17906
17999
|
}
|
|
17907
18000
|
// Render measure numbers
|
|
17908
18001
|
if (this.measure > 0) {
|
|
17909
|
-
ctx.save();
|
|
17910
18002
|
ctx.setFont(this.fontInfo);
|
|
17911
18003
|
const textWidth = ctx.measureText('' + this.measure).width;
|
|
17912
18004
|
y = this.getYForTopText(0) + 3;
|
|
17913
18005
|
ctx.fillText('' + this.measure, this.x - textWidth / 2, y);
|
|
17914
|
-
ctx.restore();
|
|
17915
18006
|
}
|
|
17916
|
-
return this;
|
|
17917
18007
|
}
|
|
17918
18008
|
getVerticalBarWidth() {
|
|
17919
18009
|
return this.options.verticalBarWidth;
|
|
@@ -17960,7 +18050,6 @@ class Stave extends _element__WEBPACK_IMPORTED_MODULE_2__.Element {
|
|
|
17960
18050
|
}
|
|
17961
18051
|
// Make sure the defaults are present in case an incomplete set of
|
|
17962
18052
|
// configuration options were supplied.
|
|
17963
|
-
// eslint-disable-next-line
|
|
17964
18053
|
for (const lineConfig in linesConfiguration) {
|
|
17965
18054
|
// Allow '{}' to be used if the caller just wants the default for a particular node.
|
|
17966
18055
|
if (linesConfiguration[lineConfig].visible === undefined) {
|
|
@@ -18171,10 +18260,10 @@ class Barline extends _stavemodifier__WEBPACK_IMPORTED_MODULE_0__.StaveModifier
|
|
|
18171
18260
|
return this;
|
|
18172
18261
|
}
|
|
18173
18262
|
// Draw barlines
|
|
18174
|
-
draw(
|
|
18263
|
+
draw() {
|
|
18264
|
+
const stave = this.checkStave();
|
|
18175
18265
|
const ctx = stave.checkContext();
|
|
18176
18266
|
this.setRendered();
|
|
18177
|
-
this.applyStyle(ctx);
|
|
18178
18267
|
ctx.openGroup('stavebarline', this.getAttribute('id'));
|
|
18179
18268
|
switch (this.type) {
|
|
18180
18269
|
case BarlineType.SINGLE:
|
|
@@ -18206,7 +18295,6 @@ class Barline extends _stavemodifier__WEBPACK_IMPORTED_MODULE_0__.StaveModifier
|
|
|
18206
18295
|
break;
|
|
18207
18296
|
}
|
|
18208
18297
|
ctx.closeGroup();
|
|
18209
|
-
this.restoreStyle(ctx);
|
|
18210
18298
|
}
|
|
18211
18299
|
drawVerticalBar(stave, x, doubleBar) {
|
|
18212
18300
|
const staveCtx = stave.checkContext();
|
|
@@ -18567,7 +18655,7 @@ class StaveHairpin extends _element__WEBPACK_IMPORTED_MODULE_0__.Element {
|
|
|
18567
18655
|
.setContext(ctx)
|
|
18568
18656
|
.setRenderOptions(hairpinOptions)
|
|
18569
18657
|
.setPosition(position)
|
|
18570
|
-
.
|
|
18658
|
+
.drawWithStyle();
|
|
18571
18659
|
}
|
|
18572
18660
|
/**
|
|
18573
18661
|
* Create a new hairpin from the specified notes.
|
|
@@ -18880,7 +18968,6 @@ class StaveLine extends _element__WEBPACK_IMPORTED_MODULE_0__.Element {
|
|
|
18880
18968
|
const firstNote = this.firstNote;
|
|
18881
18969
|
const lastNote = this.lastNote;
|
|
18882
18970
|
const renderOptions = this.renderOptions;
|
|
18883
|
-
ctx.save();
|
|
18884
18971
|
this.applyLineStyle();
|
|
18885
18972
|
// Cycle through each set of indexes and draw lines
|
|
18886
18973
|
let startPosition = { x: 0, y: 0 };
|
|
@@ -18910,7 +18997,6 @@ class StaveLine extends _element__WEBPACK_IMPORTED_MODULE_0__.Element {
|
|
|
18910
18997
|
endPosition.y += upwardsSlope ? 2 : 0;
|
|
18911
18998
|
this.drawArrowLine(ctx, startPosition, endPosition);
|
|
18912
18999
|
});
|
|
18913
|
-
ctx.restore();
|
|
18914
19000
|
// Determine the x coordinate where to start the text
|
|
18915
19001
|
const textWidth = this.width;
|
|
18916
19002
|
const justification = renderOptions.textJustification;
|
|
@@ -18939,8 +19025,6 @@ class StaveLine extends _element__WEBPACK_IMPORTED_MODULE_0__.Element {
|
|
|
18939
19025
|
const color = renderOptions.color;
|
|
18940
19026
|
this.applyStyle(ctx, { fillStyle: color, strokeStyle: color });
|
|
18941
19027
|
this.renderText(ctx, x, y);
|
|
18942
|
-
this.restoreStyle(ctx);
|
|
18943
|
-
return this;
|
|
18944
19028
|
}
|
|
18945
19029
|
}
|
|
18946
19030
|
// Text Positioning
|
|
@@ -19027,10 +19111,6 @@ class StaveModifier extends _element__WEBPACK_IMPORTED_MODULE_0__.Element {
|
|
|
19027
19111
|
getLayoutMetrics() {
|
|
19028
19112
|
return this.layoutMetrics;
|
|
19029
19113
|
}
|
|
19030
|
-
// eslint-disable-next-line
|
|
19031
|
-
draw(...args) {
|
|
19032
|
-
// DO NOTHING.
|
|
19033
|
-
}
|
|
19034
19114
|
}
|
|
19035
19115
|
|
|
19036
19116
|
|
|
@@ -19432,7 +19512,7 @@ class StaveNote extends _stemmablenote__WEBPACK_IMPORTED_MODULE_7__.StemmableNot
|
|
|
19432
19512
|
}
|
|
19433
19513
|
// Builds a `Stem` for the note
|
|
19434
19514
|
buildStem() {
|
|
19435
|
-
this.setStem(new _stem__WEBPACK_IMPORTED_MODULE_6__.Stem({ hide:
|
|
19515
|
+
this.setStem(new _stem__WEBPACK_IMPORTED_MODULE_6__.Stem({ hide: this.isRest() }));
|
|
19436
19516
|
return this;
|
|
19437
19517
|
}
|
|
19438
19518
|
// Builds a `NoteHead` for each key in the note
|
|
@@ -19487,7 +19567,7 @@ class StaveNote extends _stemmablenote__WEBPACK_IMPORTED_MODULE_7__.StemmableNot
|
|
|
19487
19567
|
line: noteProps.line,
|
|
19488
19568
|
});
|
|
19489
19569
|
notehead.fontInfo = this.fontInfo;
|
|
19490
|
-
this.
|
|
19570
|
+
this.addChild(notehead);
|
|
19491
19571
|
this._noteHeads[this.sortedKeyProps[i].index] = notehead;
|
|
19492
19572
|
}
|
|
19493
19573
|
return this._noteHeads;
|
|
@@ -19532,7 +19612,8 @@ class StaveNote extends _stemmablenote__WEBPACK_IMPORTED_MODULE_7__.StemmableNot
|
|
|
19532
19612
|
lastLine = line;
|
|
19533
19613
|
}
|
|
19534
19614
|
else {
|
|
19535
|
-
|
|
19615
|
+
// < 1 means == 0.5 (second) or 0.0 (unison)
|
|
19616
|
+
if (Math.abs(lastLine - line) < 1) {
|
|
19536
19617
|
this.displaced = true;
|
|
19537
19618
|
props.displaced = true;
|
|
19538
19619
|
// Have to mark the previous note as
|
|
@@ -19559,18 +19640,16 @@ class StaveNote extends _stemmablenote__WEBPACK_IMPORTED_MODULE_7__.StemmableNot
|
|
|
19559
19640
|
boundingBox.mergeWith(notehead.getBoundingBox());
|
|
19560
19641
|
});
|
|
19561
19642
|
const { yTop, yBottom } = this.getNoteHeadBounds();
|
|
19562
|
-
// eslint-disable-next-line
|
|
19563
|
-
const noteStemHeight = this.stem.getHeight();
|
|
19564
|
-
const flagX = this.getStemX() - _tables__WEBPACK_IMPORTED_MODULE_8__.Tables.STEM_WIDTH / 2;
|
|
19565
|
-
const flagY = this.getStemDirection() === _stem__WEBPACK_IMPORTED_MODULE_6__.Stem.DOWN
|
|
19566
|
-
? yTop - noteStemHeight - this.flag.getTextMetrics().actualBoundingBoxDescent
|
|
19567
|
-
: yBottom - noteStemHeight + this.flag.getTextMetrics().actualBoundingBoxAscent;
|
|
19568
19643
|
if (!this.isRest() && this.hasStem()) {
|
|
19569
|
-
|
|
19644
|
+
const noteStemHeight = this.stem.getHeight();
|
|
19645
|
+
const stemY = this.getStemDirection() === _stem__WEBPACK_IMPORTED_MODULE_6__.Stem.DOWN
|
|
19646
|
+
? yTop - noteStemHeight - this.flag.getTextMetrics().actualBoundingBoxDescent
|
|
19647
|
+
: yBottom - noteStemHeight + this.flag.getTextMetrics().actualBoundingBoxAscent;
|
|
19648
|
+
boundingBox.mergeWith(new _boundingbox__WEBPACK_IMPORTED_MODULE_0__.BoundingBox(this.getAbsoluteX(), stemY, 0, 0));
|
|
19570
19649
|
}
|
|
19571
19650
|
if (this.hasFlag()) {
|
|
19572
19651
|
const bbFlag = this.flag.getBoundingBox();
|
|
19573
|
-
boundingBox.mergeWith(bbFlag
|
|
19652
|
+
boundingBox.mergeWith(bbFlag);
|
|
19574
19653
|
}
|
|
19575
19654
|
for (let i = 0; i < this.modifiers.length; i++) {
|
|
19576
19655
|
boundingBox.mergeWith(this.modifiers[i].getBoundingBox());
|
|
@@ -19760,10 +19839,10 @@ class StaveNote extends _stemmablenote__WEBPACK_IMPORTED_MODULE_7__.StemmableNot
|
|
|
19760
19839
|
return this.ledgerLineStyle;
|
|
19761
19840
|
}
|
|
19762
19841
|
setFlagStyle(style) {
|
|
19763
|
-
this.
|
|
19842
|
+
this.flag.setStyle(style);
|
|
19764
19843
|
}
|
|
19765
19844
|
getFlagStyle() {
|
|
19766
|
-
return this.
|
|
19845
|
+
return this.flag.getStyle();
|
|
19767
19846
|
}
|
|
19768
19847
|
/** Get the glyph width. */
|
|
19769
19848
|
getGlyphWidth() {
|
|
@@ -19931,6 +20010,7 @@ class StaveNote extends _stemmablenote__WEBPACK_IMPORTED_MODULE_7__.StemmableNot
|
|
|
19931
20010
|
ctx.stroke();
|
|
19932
20011
|
};
|
|
19933
20012
|
const style = Object.assign(Object.assign({}, stave.getDefaultLedgerLineStyle()), this.getLedgerLineStyle());
|
|
20013
|
+
ctx.save();
|
|
19934
20014
|
this.applyStyle(ctx, style);
|
|
19935
20015
|
// Draw ledger lines below the staff:
|
|
19936
20016
|
for (let line = 6; line <= highestLine; ++line) {
|
|
@@ -19944,7 +20024,7 @@ class StaveNote extends _stemmablenote__WEBPACK_IMPORTED_MODULE_7__.StemmableNot
|
|
|
19944
20024
|
const displaced = lowestDisplacedLine !== undefined && line >= lowestDisplacedLine;
|
|
19945
20025
|
drawLedgerLine(stave.getYForNote(line), normal, displaced);
|
|
19946
20026
|
}
|
|
19947
|
-
|
|
20027
|
+
ctx.restore();
|
|
19948
20028
|
}
|
|
19949
20029
|
// Draw all key modifiers
|
|
19950
20030
|
drawModifiers(noteheadParam) {
|
|
@@ -19954,11 +20034,8 @@ class StaveNote extends _stemmablenote__WEBPACK_IMPORTED_MODULE_7__.StemmableNot
|
|
|
19954
20034
|
const index = modifier.checkIndex();
|
|
19955
20035
|
const notehead = this._noteHeads[index];
|
|
19956
20036
|
if (notehead === noteheadParam) {
|
|
19957
|
-
const noteheadStyle = notehead.getStyle();
|
|
19958
|
-
notehead.applyStyle(ctx, noteheadStyle);
|
|
19959
20037
|
modifier.setContext(ctx);
|
|
19960
20038
|
modifier.drawWithStyle();
|
|
19961
|
-
notehead.restoreStyle(ctx, noteheadStyle);
|
|
19962
20039
|
}
|
|
19963
20040
|
}
|
|
19964
20041
|
}
|
|
@@ -19976,7 +20053,6 @@ class StaveNote extends _stemmablenote__WEBPACK_IMPORTED_MODULE_7__.StemmableNot
|
|
|
19976
20053
|
}
|
|
19977
20054
|
if (this.shouldDrawFlag()) {
|
|
19978
20055
|
const { yTop, yBottom } = this.getNoteHeadBounds();
|
|
19979
|
-
// eslint-disable-next-line
|
|
19980
20056
|
const noteStemHeight = this.stem.getHeight();
|
|
19981
20057
|
const flagX = this.getStemX() - _tables__WEBPACK_IMPORTED_MODULE_8__.Tables.STEM_WIDTH / 2;
|
|
19982
20058
|
const flagY = this.getStemDirection() === _stem__WEBPACK_IMPORTED_MODULE_6__.Stem.DOWN
|
|
@@ -19985,21 +20061,14 @@ class StaveNote extends _stemmablenote__WEBPACK_IMPORTED_MODULE_7__.StemmableNot
|
|
|
19985
20061
|
: // Up stems are above the note head and have flags on the right.
|
|
19986
20062
|
yBottom - noteStemHeight + this.flag.getTextMetrics().actualBoundingBoxAscent;
|
|
19987
20063
|
// Draw the Flag
|
|
19988
|
-
this.
|
|
19989
|
-
this.flag.renderText(ctx, flagX, flagY);
|
|
19990
|
-
this.restoreStyle(ctx, this.flagStyle);
|
|
20064
|
+
this.flag.setContext(ctx).setX(flagX).setY(flagY).drawWithStyle();
|
|
19991
20065
|
}
|
|
19992
20066
|
}
|
|
19993
20067
|
// Draw the NoteHeads
|
|
19994
20068
|
drawNoteHeads() {
|
|
19995
20069
|
const ctx = this.checkContext();
|
|
19996
20070
|
this._noteHeads.forEach((notehead) => {
|
|
19997
|
-
notehead.
|
|
19998
|
-
ctx.openGroup('notehead', notehead.getAttribute('id'));
|
|
19999
|
-
notehead.setContext(ctx).draw();
|
|
20000
|
-
this.drawModifiers(notehead);
|
|
20001
|
-
ctx.closeGroup();
|
|
20002
|
-
notehead.restoreStyle(ctx);
|
|
20071
|
+
notehead.setContext(ctx).drawWithStyle();
|
|
20003
20072
|
});
|
|
20004
20073
|
}
|
|
20005
20074
|
drawStem(stemOptions) {
|
|
@@ -20016,7 +20085,7 @@ class StaveNote extends _stemmablenote__WEBPACK_IMPORTED_MODULE_7__.StemmableNot
|
|
|
20016
20085
|
this.stem.adjustHeightForFlag();
|
|
20017
20086
|
}
|
|
20018
20087
|
if (this.stem) {
|
|
20019
|
-
this.stem.setContext(ctx).
|
|
20088
|
+
this.stem.setContext(ctx).drawWithStyle();
|
|
20020
20089
|
}
|
|
20021
20090
|
}
|
|
20022
20091
|
/**
|
|
@@ -20077,7 +20146,6 @@ class StaveNote extends _stemmablenote__WEBPACK_IMPORTED_MODULE_7__.StemmableNot
|
|
|
20077
20146
|
}
|
|
20078
20147
|
L('Rendering ', this.isChord() ? 'chord :' : 'note :', this.keys);
|
|
20079
20148
|
// Apply the overall style -- may be contradicted by local settings:
|
|
20080
|
-
this.applyStyle();
|
|
20081
20149
|
ctx.openGroup('stavenote', this.getAttribute('id'));
|
|
20082
20150
|
this.drawLedgerLines();
|
|
20083
20151
|
if (shouldRenderStem)
|
|
@@ -20087,7 +20155,6 @@ class StaveNote extends _stemmablenote__WEBPACK_IMPORTED_MODULE_7__.StemmableNot
|
|
|
20087
20155
|
const bb = this.getBoundingBox();
|
|
20088
20156
|
ctx.pointerRect(bb.getX(), bb.getY(), bb.getW(), bb.getH());
|
|
20089
20157
|
ctx.closeGroup();
|
|
20090
|
-
this.restoreStyle();
|
|
20091
20158
|
this.setRendered();
|
|
20092
20159
|
}
|
|
20093
20160
|
}
|
|
@@ -20135,7 +20202,9 @@ class Repetition extends _stavemodifier__WEBPACK_IMPORTED_MODULE_2__.StaveModifi
|
|
|
20135
20202
|
this.yShift = y;
|
|
20136
20203
|
return this;
|
|
20137
20204
|
}
|
|
20138
|
-
draw(
|
|
20205
|
+
draw() {
|
|
20206
|
+
const stave = this.checkStave();
|
|
20207
|
+
const x = stave.getModifierXShift(this.getPosition());
|
|
20139
20208
|
this.setRendered();
|
|
20140
20209
|
switch (this.symbolType) {
|
|
20141
20210
|
case Repetition.type.CODA_RIGHT:
|
|
@@ -20177,7 +20246,6 @@ class Repetition extends _stavemodifier__WEBPACK_IMPORTED_MODULE_2__.StaveModifi
|
|
|
20177
20246
|
default:
|
|
20178
20247
|
break;
|
|
20179
20248
|
}
|
|
20180
|
-
return this;
|
|
20181
20249
|
}
|
|
20182
20250
|
drawCodaFixed(stave, x) {
|
|
20183
20251
|
const y = stave.getYForTopText(stave.getNumLines());
|
|
@@ -20249,48 +20317,47 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
20249
20317
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
20250
20318
|
/* harmony export */ StaveSection: () => (/* binding */ StaveSection)
|
|
20251
20319
|
/* harmony export */ });
|
|
20252
|
-
/* harmony import */ var
|
|
20253
|
-
/* harmony import */ var
|
|
20320
|
+
/* harmony import */ var _metrics__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./metrics */ "./src/metrics.ts");
|
|
20321
|
+
/* harmony import */ var _stavemodifier__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./stavemodifier */ "./src/stavemodifier.ts");
|
|
20322
|
+
/* harmony import */ var _typeguard__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./typeguard */ "./src/typeguard.ts");
|
|
20254
20323
|
// Copyright (c) 2023-present VexFlow contributors: https://github.com/vexflow/vexflow/graphs/contributors
|
|
20255
20324
|
// @author: Larry Kuhns 2011
|
|
20256
20325
|
|
|
20257
20326
|
|
|
20258
|
-
|
|
20327
|
+
|
|
20328
|
+
class StaveSection extends _stavemodifier__WEBPACK_IMPORTED_MODULE_1__.StaveModifier {
|
|
20259
20329
|
static get CATEGORY() {
|
|
20260
|
-
return
|
|
20330
|
+
return _typeguard__WEBPACK_IMPORTED_MODULE_2__.Category.StaveSection;
|
|
20261
20331
|
}
|
|
20262
|
-
constructor(section, x, yShift, drawRect = true) {
|
|
20332
|
+
constructor(section, x = 0, yShift = 0, drawRect = true) {
|
|
20263
20333
|
super();
|
|
20264
|
-
this.
|
|
20334
|
+
this.setText(section);
|
|
20265
20335
|
this.x = x;
|
|
20266
20336
|
this.yShift = yShift;
|
|
20267
20337
|
this.drawRect = drawRect;
|
|
20338
|
+
this.padding = _metrics__WEBPACK_IMPORTED_MODULE_0__.Metrics.get('StaveSection.padding');
|
|
20268
20339
|
}
|
|
20269
|
-
|
|
20270
|
-
this.
|
|
20340
|
+
setDrawRect(drawRect) {
|
|
20341
|
+
this.drawRect = drawRect;
|
|
20271
20342
|
return this;
|
|
20272
20343
|
}
|
|
20273
|
-
draw(
|
|
20274
|
-
const
|
|
20275
|
-
const padding = 2;
|
|
20344
|
+
draw() {
|
|
20345
|
+
const stave = this.checkStave();
|
|
20276
20346
|
const ctx = stave.checkContext();
|
|
20277
20347
|
this.setRendered();
|
|
20278
|
-
|
|
20279
|
-
ctx.setLineWidth(borderWidth);
|
|
20348
|
+
this.x = stave.getX() + stave.getModifierXShift(this.getPosition());
|
|
20280
20349
|
const headroom = -1 * this.textMetrics.actualBoundingBoxDescent;
|
|
20281
|
-
const width = this.width + 2 * padding; // add left & right padding
|
|
20282
|
-
const height = this.height + 2 * padding; // add top & bottom padding
|
|
20350
|
+
const width = this.width + 2 * this.padding; // add left & right padding
|
|
20351
|
+
const height = this.height + 2 * this.padding; // add top & bottom padding
|
|
20283
20352
|
// Seems to be a good default y
|
|
20284
20353
|
const y = stave.getYForTopText(1.5) + this.yShift;
|
|
20285
|
-
const x = this.x + xShift;
|
|
20354
|
+
const x = this.x + this.xShift;
|
|
20286
20355
|
if (this.drawRect) {
|
|
20287
20356
|
ctx.beginPath();
|
|
20288
20357
|
ctx.rect(x, y - height + headroom, width, height);
|
|
20289
20358
|
ctx.stroke();
|
|
20290
20359
|
}
|
|
20291
|
-
this.renderText(ctx, xShift + padding, y - padding);
|
|
20292
|
-
ctx.restore();
|
|
20293
|
-
return this;
|
|
20360
|
+
this.renderText(ctx, this.xShift + this.padding, y - this.padding);
|
|
20294
20361
|
}
|
|
20295
20362
|
}
|
|
20296
20363
|
|
|
@@ -20366,7 +20433,9 @@ class StaveTempo extends _stavemodifier__WEBPACK_IMPORTED_MODULE_3__.StaveModifi
|
|
|
20366
20433
|
this.tempo = tempo;
|
|
20367
20434
|
return this;
|
|
20368
20435
|
}
|
|
20369
|
-
draw(
|
|
20436
|
+
draw() {
|
|
20437
|
+
const stave = this.checkStave();
|
|
20438
|
+
const shiftX = stave.getModifierXShift(this.getPosition());
|
|
20370
20439
|
const ctx = stave.checkContext();
|
|
20371
20440
|
this.setRendered();
|
|
20372
20441
|
const { name, duration, dots, bpm, duration2, dots2, parenthesis } = this.tempo;
|
|
@@ -20423,7 +20492,6 @@ class StaveTempo extends _stavemodifier__WEBPACK_IMPORTED_MODULE_3__.StaveModifi
|
|
|
20423
20492
|
elText.renderText(ctx, x + this.xShift, y + this.yShift);
|
|
20424
20493
|
}
|
|
20425
20494
|
}
|
|
20426
|
-
return this;
|
|
20427
20495
|
}
|
|
20428
20496
|
}
|
|
20429
20497
|
|
|
@@ -20463,7 +20531,8 @@ class StaveText extends _stavemodifier__WEBPACK_IMPORTED_MODULE_0__.StaveModifie
|
|
|
20463
20531
|
this.position = position;
|
|
20464
20532
|
this.justification = (_c = options.justification) !== null && _c !== void 0 ? _c : _textnote__WEBPACK_IMPORTED_MODULE_1__.TextNote.Justification.CENTER;
|
|
20465
20533
|
}
|
|
20466
|
-
draw(
|
|
20534
|
+
draw() {
|
|
20535
|
+
const stave = this.checkStave();
|
|
20467
20536
|
const ctx = stave.checkContext();
|
|
20468
20537
|
this.setRendered();
|
|
20469
20538
|
let x;
|
|
@@ -20499,7 +20568,6 @@ class StaveText extends _stavemodifier__WEBPACK_IMPORTED_MODULE_0__.StaveModifie
|
|
|
20499
20568
|
throw new _util__WEBPACK_IMPORTED_MODULE_3__.RuntimeError('InvalidPosition', 'Value Must be in Modifier.Position.');
|
|
20500
20569
|
}
|
|
20501
20570
|
this.renderText(ctx, x, y + 4);
|
|
20502
|
-
return this;
|
|
20503
20571
|
}
|
|
20504
20572
|
}
|
|
20505
20573
|
|
|
@@ -20629,11 +20697,8 @@ class StaveTie extends _element__WEBPACK_IMPORTED_MODULE_0__.Element {
|
|
|
20629
20697
|
const yShift = this.renderOptions.yShift * params.direction;
|
|
20630
20698
|
// setNotes(...) verified that firstIndexes and lastIndexes are not undefined.
|
|
20631
20699
|
// As a result, we use the ! non-null assertion operator here.
|
|
20632
|
-
// eslint-disable-next-line
|
|
20633
20700
|
const firstIndexes = this.notes.firstIndexes;
|
|
20634
|
-
// eslint-disable-next-line
|
|
20635
20701
|
const lastIndexes = this.notes.lastIndexes;
|
|
20636
|
-
this.applyStyle();
|
|
20637
20702
|
ctx.openGroup('stavetie', this.getAttribute('id'));
|
|
20638
20703
|
for (let i = 0; i < firstIndexes.length; ++i) {
|
|
20639
20704
|
const cpX = (params.lastX + lastXShift + (params.firstX + firstXShift)) / 2;
|
|
@@ -20653,7 +20718,6 @@ class StaveTie extends _element__WEBPACK_IMPORTED_MODULE_0__.Element {
|
|
|
20653
20718
|
ctx.fill();
|
|
20654
20719
|
}
|
|
20655
20720
|
ctx.closeGroup();
|
|
20656
|
-
this.restoreStyle();
|
|
20657
20721
|
}
|
|
20658
20722
|
/**
|
|
20659
20723
|
* @param firstX specified in pixels
|
|
@@ -20666,10 +20730,8 @@ class StaveTie extends _element__WEBPACK_IMPORTED_MODULE_0__.Element {
|
|
|
20666
20730
|
centerX -= ctx.measureText(this.text).width / 2;
|
|
20667
20731
|
const stave = (_b = (_a = this.notes.firstNote) === null || _a === void 0 ? void 0 : _a.checkStave()) !== null && _b !== void 0 ? _b : (_c = this.notes.lastNote) === null || _c === void 0 ? void 0 : _c.checkStave();
|
|
20668
20732
|
if (stave) {
|
|
20669
|
-
ctx.save();
|
|
20670
20733
|
ctx.setFont(this.fontInfo);
|
|
20671
20734
|
ctx.fillText(this.text, centerX + this.renderOptions.textShiftX, stave.getYForTopText() - 1);
|
|
20672
|
-
ctx.restore();
|
|
20673
20735
|
}
|
|
20674
20736
|
}
|
|
20675
20737
|
/**
|
|
@@ -20821,7 +20883,9 @@ class Volta extends _stavemodifier__WEBPACK_IMPORTED_MODULE_0__.StaveModifier {
|
|
|
20821
20883
|
this.yShift = yShift;
|
|
20822
20884
|
this.text = label;
|
|
20823
20885
|
}
|
|
20824
|
-
draw(
|
|
20886
|
+
draw() {
|
|
20887
|
+
const stave = this.checkStave();
|
|
20888
|
+
const x = stave.getModifierXShift(this.getPosition());
|
|
20825
20889
|
const ctx = stave.checkContext();
|
|
20826
20890
|
this.setRendered();
|
|
20827
20891
|
let width = stave.getWidth() - x; // don't include x (offset) for width
|
|
@@ -20848,7 +20912,6 @@ class Volta extends _stavemodifier__WEBPACK_IMPORTED_MODULE_0__.StaveModifier {
|
|
|
20848
20912
|
this.renderText(ctx, x + 5, topY - this.yShift + 15);
|
|
20849
20913
|
}
|
|
20850
20914
|
ctx.fillRect(this.x + x, topY, width, 1);
|
|
20851
|
-
return this;
|
|
20852
20915
|
}
|
|
20853
20916
|
}
|
|
20854
20917
|
|
|
@@ -21021,8 +21084,6 @@ class Stem extends _element__WEBPACK_IMPORTED_MODULE_0__.Element {
|
|
|
21021
21084
|
// The offset from the stem's base which is required fo satisfy the stemlet height
|
|
21022
21085
|
const stemletYOffset = this.isStemlet ? stemHeight - this.stemletHeight * this.stemDirection : 0;
|
|
21023
21086
|
// Draw the stem
|
|
21024
|
-
ctx.save();
|
|
21025
|
-
this.applyStyle();
|
|
21026
21087
|
ctx.openGroup('stem', this.getAttribute('id'));
|
|
21027
21088
|
ctx.beginPath();
|
|
21028
21089
|
ctx.setLineWidth(Stem.WIDTH);
|
|
@@ -21030,8 +21091,6 @@ class Stem extends _element__WEBPACK_IMPORTED_MODULE_0__.Element {
|
|
|
21030
21091
|
ctx.lineTo(stemX, stemY - stemHeight - this.renderHeightAdjustment * stemDirection);
|
|
21031
21092
|
ctx.stroke();
|
|
21032
21093
|
ctx.closeGroup();
|
|
21033
|
-
this.restoreStyle();
|
|
21034
|
-
ctx.restore();
|
|
21035
21094
|
}
|
|
21036
21095
|
}
|
|
21037
21096
|
/** To enable logging for this class. Set `VexFlow.Stem.DEBUG` to `true`. */
|
|
@@ -21050,7 +21109,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
21050
21109
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
21051
21110
|
/* harmony export */ StemmableNote: () => (/* binding */ StemmableNote)
|
|
21052
21111
|
/* harmony export */ });
|
|
21053
|
-
/* harmony import */ var
|
|
21112
|
+
/* harmony import */ var _flag__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./flag */ "./src/flag.ts");
|
|
21054
21113
|
/* harmony import */ var _glyphs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./glyphs */ "./src/glyphs.ts");
|
|
21055
21114
|
/* harmony import */ var _note__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./note */ "./src/note.ts");
|
|
21056
21115
|
/* harmony import */ var _stem__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./stem */ "./src/stem.ts");
|
|
@@ -21075,8 +21134,7 @@ class StemmableNote extends _note__WEBPACK_IMPORTED_MODULE_2__.Note {
|
|
|
21075
21134
|
}
|
|
21076
21135
|
constructor(noteStruct) {
|
|
21077
21136
|
super(noteStruct);
|
|
21078
|
-
this.flag = new
|
|
21079
|
-
this.flagStyle = {};
|
|
21137
|
+
this.flag = new _flag__WEBPACK_IMPORTED_MODULE_0__.Flag();
|
|
21080
21138
|
}
|
|
21081
21139
|
// Get and set the note's `Stem`
|
|
21082
21140
|
getStem() {
|
|
@@ -21090,7 +21148,7 @@ class StemmableNote extends _note__WEBPACK_IMPORTED_MODULE_2__.Note {
|
|
|
21090
21148
|
}
|
|
21091
21149
|
setStem(stem) {
|
|
21092
21150
|
this.stem = stem;
|
|
21093
|
-
this.
|
|
21151
|
+
this.addChild(stem);
|
|
21094
21152
|
return this;
|
|
21095
21153
|
}
|
|
21096
21154
|
// Builds and sets a new stem
|
|
@@ -21108,7 +21166,7 @@ class StemmableNote extends _note__WEBPACK_IMPORTED_MODULE_2__.Note {
|
|
|
21108
21166
|
// if codeFlagUp is undefined, codePoint will be 0
|
|
21109
21167
|
this.getStemDirection() === _stem__WEBPACK_IMPORTED_MODULE_3__.Stem.DOWN
|
|
21110
21168
|
? String.fromCodePoint(((_b = (_a = glyphProps.codeFlagUp) === null || _a === void 0 ? void 0 : _a.codePointAt(0)) !== null && _b !== void 0 ? _b : -1) + 1)
|
|
21111
|
-
: (_c = glyphProps.codeFlagUp) !== null && _c !== void 0 ? _c : _glyphs__WEBPACK_IMPORTED_MODULE_1__.Glyphs.null;
|
|
21169
|
+
: ((_c = glyphProps.codeFlagUp) !== null && _c !== void 0 ? _c : _glyphs__WEBPACK_IMPORTED_MODULE_1__.Glyphs.null);
|
|
21112
21170
|
this.flag.setText(flagCode);
|
|
21113
21171
|
this.flag.fontInfo = this.fontInfo;
|
|
21114
21172
|
}
|
|
@@ -21269,7 +21327,7 @@ class StemmableNote extends _note__WEBPACK_IMPORTED_MODULE_2__.Note {
|
|
|
21269
21327
|
this.checkContext();
|
|
21270
21328
|
this.setRendered();
|
|
21271
21329
|
this.setStem(new _stem__WEBPACK_IMPORTED_MODULE_3__.Stem(stemOptions));
|
|
21272
|
-
(_a = this.stem) === null || _a === void 0 ? void 0 : _a.setContext(this.getContext()).
|
|
21330
|
+
(_a = this.stem) === null || _a === void 0 ? void 0 : _a.setContext(this.getContext()).drawWithStyle();
|
|
21273
21331
|
}
|
|
21274
21332
|
}
|
|
21275
21333
|
|
|
@@ -21496,7 +21554,6 @@ class StringNumber extends _modifier__WEBPACK_IMPORTED_MODULE_1__.Modifier {
|
|
|
21496
21554
|
default:
|
|
21497
21555
|
throw new _util__WEBPACK_IMPORTED_MODULE_6__.RuntimeError('InvalidPosition', `The position ${this.position} is invalid`);
|
|
21498
21556
|
}
|
|
21499
|
-
ctx.save();
|
|
21500
21557
|
if (this.drawCircle) {
|
|
21501
21558
|
ctx.beginPath();
|
|
21502
21559
|
ctx.arc(dotX, dotY, this.radius, 0, Math.PI * 2, false);
|
|
@@ -21536,7 +21593,6 @@ class StringNumber extends _modifier__WEBPACK_IMPORTED_MODULE_1__.Modifier {
|
|
|
21536
21593
|
break;
|
|
21537
21594
|
}
|
|
21538
21595
|
}
|
|
21539
|
-
ctx.restore();
|
|
21540
21596
|
}
|
|
21541
21597
|
}
|
|
21542
21598
|
|
|
@@ -21996,8 +22052,6 @@ class SVGContext extends _rendercontext__WEBPACK_IMPORTED_MODULE_3__.RenderConte
|
|
|
21996
22052
|
while (this.svg.lastChild) {
|
|
21997
22053
|
this.svg.removeChild(this.svg.lastChild);
|
|
21998
22054
|
}
|
|
21999
|
-
// Replace the viewbox attribute we just removed.
|
|
22000
|
-
this.scale(this.state.scaleX, this.state.scaleY);
|
|
22001
22055
|
}
|
|
22002
22056
|
// ## Rectangles:
|
|
22003
22057
|
rect(x, y, width, height, attributes) {
|
|
@@ -23511,9 +23565,7 @@ class TabNote extends _stemmablenote__WEBPACK_IMPORTED_MODULE_5__.StemmableNote
|
|
|
23511
23565
|
: // Up stems are above the note head and have flags on the right.
|
|
23512
23566
|
this.getStemY() - this.checkStem().getHeight() + this.getStemExtension();
|
|
23513
23567
|
// Draw the Flag
|
|
23514
|
-
this.
|
|
23515
|
-
this.flag.renderText(context, flagX, flagY);
|
|
23516
|
-
this.restoreStyle(context, this.flagStyle);
|
|
23568
|
+
this.flag.setContext(context).setX(flagX).setY(flagY).drawWithStyle();
|
|
23517
23569
|
}
|
|
23518
23570
|
}
|
|
23519
23571
|
// Render the modifiers onto the context.
|
|
@@ -23539,7 +23591,6 @@ class TabNote extends _stemmablenote__WEBPACK_IMPORTED_MODULE_5__.StemmableNote
|
|
|
23539
23591
|
const stringsUsed = this.positions.map((position) => Number(position.str));
|
|
23540
23592
|
const unusedStrings = getUnusedStringGroups(numLines, stringsUsed);
|
|
23541
23593
|
const stemLines = getPartialStemLines(stemY, unusedStrings, this.checkStave(), this.getStemDirection());
|
|
23542
|
-
ctx.save();
|
|
23543
23594
|
ctx.setLineWidth(_stem__WEBPACK_IMPORTED_MODULE_4__.Stem.WIDTH);
|
|
23544
23595
|
stemLines.forEach((bounds) => {
|
|
23545
23596
|
if (bounds.length === 0)
|
|
@@ -23550,7 +23601,6 @@ class TabNote extends _stemmablenote__WEBPACK_IMPORTED_MODULE_5__.StemmableNote
|
|
|
23550
23601
|
ctx.stroke();
|
|
23551
23602
|
ctx.closePath();
|
|
23552
23603
|
});
|
|
23553
|
-
ctx.restore();
|
|
23554
23604
|
}
|
|
23555
23605
|
}
|
|
23556
23606
|
// Render the fret positions onto the context
|
|
@@ -23576,19 +23626,17 @@ class TabNote extends _stemmablenote__WEBPACK_IMPORTED_MODULE_5__.StemmableNote
|
|
|
23576
23626
|
}
|
|
23577
23627
|
this.setRendered();
|
|
23578
23628
|
const renderStem = this.beam === undefined && this.renderOptions.drawStem;
|
|
23579
|
-
this.applyStyle();
|
|
23580
23629
|
ctx.openGroup('tabnote', this.getAttribute('id'));
|
|
23581
23630
|
this.drawPositions();
|
|
23582
23631
|
this.drawStemThrough();
|
|
23583
23632
|
if (this.stem && renderStem) {
|
|
23584
23633
|
const stemX = this.getStemX();
|
|
23585
23634
|
this.stem.setNoteHeadXBounds(stemX, stemX);
|
|
23586
|
-
this.stem.setContext(ctx).
|
|
23635
|
+
this.stem.setContext(ctx).drawWithStyle();
|
|
23587
23636
|
}
|
|
23588
23637
|
this.drawFlag();
|
|
23589
23638
|
this.drawModifiers();
|
|
23590
23639
|
ctx.closeGroup();
|
|
23591
|
-
this.restoreStyle();
|
|
23592
23640
|
}
|
|
23593
23641
|
}
|
|
23594
23642
|
|
|
@@ -23689,7 +23737,6 @@ class TabSlide extends _tabtie__WEBPACK_IMPORTED_MODULE_0__.TabTie {
|
|
|
23689
23737
|
if (direction !== TabSlide.SLIDE_UP && direction !== TabSlide.SLIDE_DOWN) {
|
|
23690
23738
|
throw new _util__WEBPACK_IMPORTED_MODULE_2__.RuntimeError('BadSlide', 'Invalid slide direction');
|
|
23691
23739
|
}
|
|
23692
|
-
// eslint-disable-next-line
|
|
23693
23740
|
const firstIndexes = this.notes.firstIndexes;
|
|
23694
23741
|
for (let i = 0; i < firstIndexes.length; ++i) {
|
|
23695
23742
|
const slideY = firstYs[firstIndexes[i]] + this.renderOptions.yShift;
|
|
@@ -23926,8 +23973,6 @@ class TextBracket extends _element__WEBPACK_IMPORTED_MODULE_0__.Element {
|
|
|
23926
23973
|
const stop = { x: this.stop.getAbsoluteX(), y };
|
|
23927
23974
|
L('Rendering TextBracket: start:', start, 'stop:', stop, 'y:', y);
|
|
23928
23975
|
const bracketHeight = this.renderOptions.bracketHeight * this.position;
|
|
23929
|
-
ctx.save();
|
|
23930
|
-
this.applyStyle(ctx);
|
|
23931
23976
|
// Draw text
|
|
23932
23977
|
this.textElement.renderText(ctx, start.x, start.y);
|
|
23933
23978
|
// Get the width and height for the octave number
|
|
@@ -23976,7 +24021,6 @@ class TextBracket extends _element__WEBPACK_IMPORTED_MODULE_0__.Element {
|
|
|
23976
24021
|
ctx.stroke();
|
|
23977
24022
|
ctx.closePath();
|
|
23978
24023
|
}
|
|
23979
|
-
ctx.restore();
|
|
23980
24024
|
}
|
|
23981
24025
|
}
|
|
23982
24026
|
TextBracket.DEBUG = false;
|
|
@@ -24230,7 +24274,6 @@ class TextNote extends _note__WEBPACK_IMPORTED_MODULE_4__.Note {
|
|
|
24230
24274
|
x -= width;
|
|
24231
24275
|
}
|
|
24232
24276
|
const y = stave.getYForLine(this.line + -3);
|
|
24233
|
-
this.applyStyle(ctx);
|
|
24234
24277
|
this.renderText(ctx, x, y);
|
|
24235
24278
|
const height = this.getHeight();
|
|
24236
24279
|
if (this.superscript) {
|
|
@@ -24239,7 +24282,6 @@ class TextNote extends _note__WEBPACK_IMPORTED_MODULE_4__.Note {
|
|
|
24239
24282
|
if (this.subscript) {
|
|
24240
24283
|
this.subscript.renderText(ctx, x + this.width + 2, y + height / 2.2 - 1);
|
|
24241
24284
|
}
|
|
24242
|
-
this.restoreStyle(ctx);
|
|
24243
24285
|
}
|
|
24244
24286
|
}
|
|
24245
24287
|
TextNote.Justification = TextJustification;
|
|
@@ -24983,12 +25025,12 @@ class TimeSignature extends _stavemodifier__WEBPACK_IMPORTED_MODULE_2__.StaveMod
|
|
|
24983
25025
|
const stave = this.checkStave();
|
|
24984
25026
|
const ctx = stave.checkContext();
|
|
24985
25027
|
this.setRendered();
|
|
25028
|
+
ctx.openGroup('timesignature', this.getAttribute('id'));
|
|
24986
25029
|
this.drawAt(ctx, stave, this.x);
|
|
25030
|
+
ctx.closeGroup();
|
|
24987
25031
|
}
|
|
24988
25032
|
drawAt(ctx, stave, x) {
|
|
24989
25033
|
this.setRendered();
|
|
24990
|
-
this.applyStyle(ctx);
|
|
24991
|
-
ctx.openGroup('timesignature', this.getAttribute('id'));
|
|
24992
25034
|
if (this.isNumeric) {
|
|
24993
25035
|
let startX = x + this.topStartX;
|
|
24994
25036
|
let y = 0;
|
|
@@ -25004,8 +25046,6 @@ class TimeSignature extends _stavemodifier__WEBPACK_IMPORTED_MODULE_2__.StaveMod
|
|
|
25004
25046
|
else {
|
|
25005
25047
|
this.renderText(ctx, x - this.x, stave.getYForLine(this.line));
|
|
25006
25048
|
}
|
|
25007
|
-
ctx.closeGroup();
|
|
25008
|
-
this.restoreStyle(ctx);
|
|
25009
25049
|
}
|
|
25010
25050
|
}
|
|
25011
25051
|
|
|
@@ -25055,7 +25095,9 @@ class TimeSigNote extends _note__WEBPACK_IMPORTED_MODULE_0__.Note {
|
|
|
25055
25095
|
const stave = this.checkStave();
|
|
25056
25096
|
const ctx = this.checkContext();
|
|
25057
25097
|
this.setRendered();
|
|
25098
|
+
ctx.openGroup('timesignote', this.getAttribute('id'));
|
|
25058
25099
|
this.timeSig.drawAt(ctx, stave, this.getAbsoluteX());
|
|
25100
|
+
ctx.closeGroup();
|
|
25059
25101
|
}
|
|
25060
25102
|
}
|
|
25061
25103
|
|
|
@@ -25221,10 +25263,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
25221
25263
|
/* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./element */ "./src/element.ts");
|
|
25222
25264
|
/* harmony import */ var _formatter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./formatter */ "./src/formatter.ts");
|
|
25223
25265
|
/* harmony import */ var _glyphs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./glyphs */ "./src/glyphs.ts");
|
|
25224
|
-
/* harmony import */ var
|
|
25225
|
-
/* harmony import */ var
|
|
25226
|
-
/* harmony import */ var
|
|
25227
|
-
/* harmony import */ var
|
|
25266
|
+
/* harmony import */ var _metrics__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./metrics */ "./src/metrics.ts");
|
|
25267
|
+
/* harmony import */ var _stem__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./stem */ "./src/stem.ts");
|
|
25268
|
+
/* harmony import */ var _tables__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./tables */ "./src/tables.ts");
|
|
25269
|
+
/* harmony import */ var _typeguard__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./typeguard */ "./src/typeguard.ts");
|
|
25270
|
+
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./util */ "./src/util.ts");
|
|
25228
25271
|
// Copyright (c) 2023-present VexFlow contributors: https://github.com/vexflow/vexflow/graphs/contributors
|
|
25229
25272
|
/**
|
|
25230
25273
|
* ## Description
|
|
@@ -25276,6 +25319,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
25276
25319
|
|
|
25277
25320
|
|
|
25278
25321
|
|
|
25322
|
+
|
|
25279
25323
|
var TupletLocation;
|
|
25280
25324
|
(function (TupletLocation) {
|
|
25281
25325
|
TupletLocation[TupletLocation["BOTTOM"] = -1] = "BOTTOM";
|
|
@@ -25283,7 +25327,7 @@ var TupletLocation;
|
|
|
25283
25327
|
})(TupletLocation || (TupletLocation = {}));
|
|
25284
25328
|
class Tuplet extends _element__WEBPACK_IMPORTED_MODULE_0__.Element {
|
|
25285
25329
|
static get CATEGORY() {
|
|
25286
|
-
return
|
|
25330
|
+
return _typeguard__WEBPACK_IMPORTED_MODULE_6__.Category.Tuplet;
|
|
25287
25331
|
}
|
|
25288
25332
|
static get LOCATION_TOP() {
|
|
25289
25333
|
return TupletLocation.TOP;
|
|
@@ -25297,22 +25341,27 @@ class Tuplet extends _element__WEBPACK_IMPORTED_MODULE_0__.Element {
|
|
|
25297
25341
|
constructor(notes, options = {}) {
|
|
25298
25342
|
super();
|
|
25299
25343
|
if (!notes || !notes.length) {
|
|
25300
|
-
throw new
|
|
25344
|
+
throw new _util__WEBPACK_IMPORTED_MODULE_7__.RuntimeError('BadArguments', 'No notes provided for tuplet.');
|
|
25301
25345
|
}
|
|
25302
|
-
this.options = options;
|
|
25303
25346
|
this.notes = notes;
|
|
25304
|
-
|
|
25305
|
-
|
|
25306
|
-
|
|
25307
|
-
|
|
25308
|
-
|
|
25309
|
-
|
|
25310
|
-
|
|
25311
|
-
|
|
25312
|
-
|
|
25313
|
-
|
|
25347
|
+
const numNotes = options.numNotes !== undefined ? options.numNotes : notes.length;
|
|
25348
|
+
const notesOccupied = options.notesOccupied || 2;
|
|
25349
|
+
const bracketed = options.bracketed !== undefined ? options.bracketed : notes.some((note) => !note.hasBeam());
|
|
25350
|
+
const ratioed = options.ratioed !== undefined ? options.ratioed : Math.abs(notesOccupied - numNotes) > 1;
|
|
25351
|
+
const location = options.location || Tuplet.LOCATION_TOP;
|
|
25352
|
+
const yOffset = options.yOffset || _metrics__WEBPACK_IMPORTED_MODULE_3__.Metrics.get('Tuplet.yOffset');
|
|
25353
|
+
const textYOffset = options.textYOffset || _metrics__WEBPACK_IMPORTED_MODULE_3__.Metrics.get('Tuplet.textYOffset');
|
|
25354
|
+
this.options = {
|
|
25355
|
+
bracketed,
|
|
25356
|
+
location,
|
|
25357
|
+
notesOccupied,
|
|
25358
|
+
numNotes,
|
|
25359
|
+
ratioed,
|
|
25360
|
+
yOffset,
|
|
25361
|
+
textYOffset,
|
|
25362
|
+
};
|
|
25314
25363
|
this.textElement = new _element__WEBPACK_IMPORTED_MODULE_0__.Element('Tuplet');
|
|
25315
|
-
this.setTupletLocation(
|
|
25364
|
+
this.setTupletLocation(location || Tuplet.LOCATION_TOP);
|
|
25316
25365
|
_formatter__WEBPACK_IMPORTED_MODULE_1__.Formatter.AlignRestsToNotes(notes, true, true);
|
|
25317
25366
|
this.resolveGlyphs();
|
|
25318
25367
|
this.attach();
|
|
@@ -25333,14 +25382,14 @@ class Tuplet extends _element__WEBPACK_IMPORTED_MODULE_0__.Element {
|
|
|
25333
25382
|
* Set whether or not the bracket is drawn.
|
|
25334
25383
|
*/
|
|
25335
25384
|
setBracketed(bracketed) {
|
|
25336
|
-
this.bracketed =
|
|
25385
|
+
this.options.bracketed = bracketed;
|
|
25337
25386
|
return this;
|
|
25338
25387
|
}
|
|
25339
25388
|
/**
|
|
25340
25389
|
* Set whether or not the ratio is shown.
|
|
25341
25390
|
*/
|
|
25342
25391
|
setRatioed(ratioed) {
|
|
25343
|
-
this.ratioed =
|
|
25392
|
+
this.options.ratioed = ratioed;
|
|
25344
25393
|
return this;
|
|
25345
25394
|
}
|
|
25346
25395
|
/**
|
|
@@ -25352,34 +25401,34 @@ class Tuplet extends _element__WEBPACK_IMPORTED_MODULE_0__.Element {
|
|
|
25352
25401
|
console.warn(`Invalid tuplet location [${location}]. Using Tuplet.LOCATION_TOP.`);
|
|
25353
25402
|
location = Tuplet.LOCATION_TOP;
|
|
25354
25403
|
}
|
|
25355
|
-
this.location = location;
|
|
25404
|
+
this.options.location = location;
|
|
25356
25405
|
return this;
|
|
25357
25406
|
}
|
|
25358
25407
|
getNotes() {
|
|
25359
25408
|
return this.notes;
|
|
25360
25409
|
}
|
|
25361
25410
|
getNoteCount() {
|
|
25362
|
-
return this.numNotes;
|
|
25411
|
+
return this.options.numNotes;
|
|
25363
25412
|
}
|
|
25364
25413
|
getNotesOccupied() {
|
|
25365
|
-
return this.notesOccupied;
|
|
25414
|
+
return this.options.notesOccupied;
|
|
25366
25415
|
}
|
|
25367
25416
|
setNotesOccupied(notes) {
|
|
25368
25417
|
this.detach();
|
|
25369
|
-
this.notesOccupied = notes;
|
|
25418
|
+
this.options.notesOccupied = notes;
|
|
25370
25419
|
this.resolveGlyphs();
|
|
25371
25420
|
this.attach();
|
|
25372
25421
|
}
|
|
25373
25422
|
resolveGlyphs() {
|
|
25374
25423
|
let numerator = '';
|
|
25375
25424
|
let denominator = '';
|
|
25376
|
-
let n = this.numNotes;
|
|
25425
|
+
let n = this.options.numNotes;
|
|
25377
25426
|
while (n >= 1) {
|
|
25378
25427
|
numerator = String.fromCharCode(0xe880 /* tuplet0 */ + (n % 10)) + numerator;
|
|
25379
25428
|
n = Math.floor(n / 10);
|
|
25380
25429
|
}
|
|
25381
|
-
if (this.ratioed) {
|
|
25382
|
-
n = this.notesOccupied;
|
|
25430
|
+
if (this.options.ratioed) {
|
|
25431
|
+
n = this.options.notesOccupied;
|
|
25383
25432
|
while (n >= 1) {
|
|
25384
25433
|
denominator = String.fromCharCode(0xe880 /* tuplet0 */ + (n % 10)) + denominator;
|
|
25385
25434
|
n = Math.floor(n / 10);
|
|
@@ -25392,14 +25441,14 @@ class Tuplet extends _element__WEBPACK_IMPORTED_MODULE_0__.Element {
|
|
|
25392
25441
|
// on the same side (above/below), to calculate a y
|
|
25393
25442
|
// offset for this tuplet:
|
|
25394
25443
|
getNestedTupletCount() {
|
|
25395
|
-
const location = this.
|
|
25444
|
+
const { location } = this.options;
|
|
25396
25445
|
const firstNote = this.notes[0];
|
|
25397
25446
|
let maxTupletCount = countTuplets(firstNote, location);
|
|
25398
25447
|
let minTupletCount = countTuplets(firstNote, location);
|
|
25399
25448
|
// Count the tuplets that are on the same side (above/below)
|
|
25400
25449
|
// as this tuplet:
|
|
25401
25450
|
function countTuplets(note, location) {
|
|
25402
|
-
return note.getTupletStack().filter((tuplet) => tuplet.location === location).length;
|
|
25451
|
+
return note.getTupletStack().filter((tuplet) => tuplet.options.location === location).length;
|
|
25403
25452
|
}
|
|
25404
25453
|
this.notes.forEach((note) => {
|
|
25405
25454
|
const tupletCount = countTuplets(note, location);
|
|
@@ -25413,15 +25462,15 @@ class Tuplet extends _element__WEBPACK_IMPORTED_MODULE_0__.Element {
|
|
|
25413
25462
|
var _a;
|
|
25414
25463
|
// offset the tuplet for any nested tuplets between
|
|
25415
25464
|
// it and the notes:
|
|
25416
|
-
const nestedTupletYOffset = this.getNestedTupletCount() * Tuplet.NESTING_OFFSET * -this.location;
|
|
25465
|
+
const nestedTupletYOffset = this.getNestedTupletCount() * Tuplet.NESTING_OFFSET * -this.options.location;
|
|
25417
25466
|
// offset the tuplet for any manual yOffset:
|
|
25418
25467
|
const yOffset = (_a = this.options.yOffset) !== null && _a !== void 0 ? _a : 0;
|
|
25419
25468
|
// now iterate through the notes and find our highest
|
|
25420
25469
|
// or lowest locations, to form a base yPosition
|
|
25421
25470
|
const firstNote = this.notes[0];
|
|
25422
25471
|
let yPosition;
|
|
25423
|
-
if (this.location === Tuplet.LOCATION_TOP) {
|
|
25424
|
-
yPosition = firstNote.checkStave().getYForLine(0) - 1.5 *
|
|
25472
|
+
if (this.options.location === Tuplet.LOCATION_TOP) {
|
|
25473
|
+
yPosition = firstNote.checkStave().getYForLine(0) - 1.5 * _tables__WEBPACK_IMPORTED_MODULE_5__.Tables.STAVE_LINE_DISTANCE;
|
|
25425
25474
|
// check modifiers above note to see if they will collide with tuplet beam
|
|
25426
25475
|
for (let i = 0; i < this.notes.length; ++i) {
|
|
25427
25476
|
const note = this.notes[i];
|
|
@@ -25430,11 +25479,11 @@ class Tuplet extends _element__WEBPACK_IMPORTED_MODULE_0__.Element {
|
|
|
25430
25479
|
if (mc) {
|
|
25431
25480
|
modLines = Math.max(modLines, mc.getState().topTextLine);
|
|
25432
25481
|
}
|
|
25433
|
-
const modY = note.getYForTopText(modLines) - 2 *
|
|
25482
|
+
const modY = note.getYForTopText(modLines) - 2 * _tables__WEBPACK_IMPORTED_MODULE_5__.Tables.STAVE_LINE_DISTANCE;
|
|
25434
25483
|
if (note.hasStem() || note.isRest()) {
|
|
25435
|
-
const topY = note.getStemDirection() ===
|
|
25436
|
-
? note.getStemExtents().topY -
|
|
25437
|
-
: note.getStemExtents().baseY - 2 *
|
|
25484
|
+
const topY = note.getStemDirection() === _stem__WEBPACK_IMPORTED_MODULE_4__.Stem.UP
|
|
25485
|
+
? note.getStemExtents().topY - _tables__WEBPACK_IMPORTED_MODULE_5__.Tables.STAVE_LINE_DISTANCE
|
|
25486
|
+
: note.getStemExtents().baseY - 2 * _tables__WEBPACK_IMPORTED_MODULE_5__.Tables.STAVE_LINE_DISTANCE;
|
|
25438
25487
|
yPosition = Math.min(topY, yPosition);
|
|
25439
25488
|
if (modLines > 0) {
|
|
25440
25489
|
yPosition = Math.min(modY, yPosition);
|
|
@@ -25451,12 +25500,12 @@ class Tuplet extends _element__WEBPACK_IMPORTED_MODULE_0__.Element {
|
|
|
25451
25500
|
lineCheck = Math.max(lineCheck, mc.getState().textLine + 1);
|
|
25452
25501
|
}
|
|
25453
25502
|
});
|
|
25454
|
-
yPosition = firstNote.checkStave().getYForLine(lineCheck) + 2 *
|
|
25503
|
+
yPosition = firstNote.checkStave().getYForLine(lineCheck) + 2 * _tables__WEBPACK_IMPORTED_MODULE_5__.Tables.STAVE_LINE_DISTANCE;
|
|
25455
25504
|
for (let i = 0; i < this.notes.length; ++i) {
|
|
25456
25505
|
if (this.notes[i].hasStem() || this.notes[i].isRest()) {
|
|
25457
|
-
const bottomY = this.notes[i].getStemDirection() ===
|
|
25458
|
-
? this.notes[i].getStemExtents().baseY + 2 *
|
|
25459
|
-
: this.notes[i].getStemExtents().topY +
|
|
25506
|
+
const bottomY = this.notes[i].getStemDirection() === _stem__WEBPACK_IMPORTED_MODULE_4__.Stem.UP
|
|
25507
|
+
? this.notes[i].getStemExtents().baseY + 2 * _tables__WEBPACK_IMPORTED_MODULE_5__.Tables.STAVE_LINE_DISTANCE
|
|
25508
|
+
: this.notes[i].getStemExtents().topY + _tables__WEBPACK_IMPORTED_MODULE_5__.Tables.STAVE_LINE_DISTANCE;
|
|
25460
25509
|
if (bottomY > yPosition) {
|
|
25461
25510
|
yPosition = bottomY;
|
|
25462
25511
|
}
|
|
@@ -25466,6 +25515,7 @@ class Tuplet extends _element__WEBPACK_IMPORTED_MODULE_0__.Element {
|
|
|
25466
25515
|
return yPosition + nestedTupletYOffset + yOffset;
|
|
25467
25516
|
}
|
|
25468
25517
|
draw() {
|
|
25518
|
+
const { location, bracketed, textYOffset } = this.options;
|
|
25469
25519
|
const ctx = this.checkContext();
|
|
25470
25520
|
let xPos = 0;
|
|
25471
25521
|
let yPos = 0;
|
|
@@ -25473,7 +25523,7 @@ class Tuplet extends _element__WEBPACK_IMPORTED_MODULE_0__.Element {
|
|
|
25473
25523
|
// determine x value of left bound of tuplet
|
|
25474
25524
|
const firstNote = this.notes[0];
|
|
25475
25525
|
const lastNote = this.notes[this.notes.length - 1];
|
|
25476
|
-
if (!
|
|
25526
|
+
if (!bracketed) {
|
|
25477
25527
|
xPos = firstNote.getStemX();
|
|
25478
25528
|
this.width = lastNote.getStemX() - xPos;
|
|
25479
25529
|
}
|
|
@@ -25486,18 +25536,18 @@ class Tuplet extends _element__WEBPACK_IMPORTED_MODULE_0__.Element {
|
|
|
25486
25536
|
const notationCenterX = xPos + this.width / 2;
|
|
25487
25537
|
const notationStartX = notationCenterX - this.textElement.getWidth() / 2;
|
|
25488
25538
|
// draw bracket if the tuplet is not beamed
|
|
25489
|
-
if (
|
|
25539
|
+
if (bracketed) {
|
|
25490
25540
|
const lineWidth = this.width / 2 - this.textElement.getWidth() / 2 - 5;
|
|
25491
25541
|
// only draw the bracket if it has positive length
|
|
25492
25542
|
if (lineWidth > 0) {
|
|
25493
25543
|
ctx.fillRect(xPos, yPos, lineWidth, 1);
|
|
25494
25544
|
ctx.fillRect(xPos + this.width / 2 + this.textElement.getWidth() / 2 + 5, yPos, lineWidth, 1);
|
|
25495
|
-
ctx.fillRect(xPos, yPos + (
|
|
25496
|
-
ctx.fillRect(xPos + this.width, yPos + (
|
|
25545
|
+
ctx.fillRect(xPos, yPos + (location === Tuplet.LOCATION_BOTTOM ? 1 : 0), 1, location * 10);
|
|
25546
|
+
ctx.fillRect(xPos + this.width, yPos + (location === Tuplet.LOCATION_BOTTOM ? 1 : 0), 1, location * 10);
|
|
25497
25547
|
}
|
|
25498
25548
|
}
|
|
25499
25549
|
// draw text
|
|
25500
|
-
this.textElement.renderText(ctx, notationStartX, yPos + this.textElement.getHeight() / 2);
|
|
25550
|
+
this.textElement.renderText(ctx, notationStartX, yPos + this.textElement.getHeight() / 2 + (location === Tuplet.LOCATION_TOP ? -1 : 1) * textYOffset);
|
|
25501
25551
|
}
|
|
25502
25552
|
}
|
|
25503
25553
|
|
|
@@ -25592,6 +25642,7 @@ var Category;
|
|
|
25592
25642
|
Category["Curve"] = "Curve";
|
|
25593
25643
|
Category["Dot"] = "Dot";
|
|
25594
25644
|
Category["Element"] = "Element";
|
|
25645
|
+
Category["Flag"] = "Flag";
|
|
25595
25646
|
Category["Fraction"] = "Fraction";
|
|
25596
25647
|
Category["FretHandFinger"] = "FretHandFinger";
|
|
25597
25648
|
Category["GhostNote"] = "GhostNote";
|
|
@@ -25768,7 +25819,6 @@ function sumArray(arr) {
|
|
|
25768
25819
|
* Take `arr` and return a new array consisting of the sorted, unique'd,
|
|
25769
25820
|
* contents of arr. Does not modify `arr`.
|
|
25770
25821
|
*/
|
|
25771
|
-
// eslint-disable-next-line
|
|
25772
25822
|
/*
|
|
25773
25823
|
static sortAndUnique(arr: any[], cmp: any, eq: any): any[] {
|
|
25774
25824
|
if (arr.length > 1) {
|
|
@@ -26058,6 +26108,7 @@ class VexFlow {
|
|
|
26058
26108
|
static setFonts(...fontNames) {
|
|
26059
26109
|
// Convert the array of font names into an array of Font objects.
|
|
26060
26110
|
_metrics__WEBPACK_IMPORTED_MODULE_30__.MetricsDefaults.fontFamily = fontNames.join(',');
|
|
26111
|
+
_metrics__WEBPACK_IMPORTED_MODULE_30__.Metrics.clear();
|
|
26061
26112
|
}
|
|
26062
26113
|
static getFonts() {
|
|
26063
26114
|
return _metrics__WEBPACK_IMPORTED_MODULE_30__.Metrics.get('fontFamily').split(',');
|
|
@@ -26111,10 +26162,13 @@ class VexFlow {
|
|
|
26111
26162
|
_tables__WEBPACK_IMPORTED_MODULE_63__.Tables.STAVE_LINE_DISTANCE = value;
|
|
26112
26163
|
}
|
|
26113
26164
|
static get STAVE_LINE_THICKNESS() {
|
|
26114
|
-
return
|
|
26165
|
+
return _metrics__WEBPACK_IMPORTED_MODULE_30__.MetricsDefaults.Stave.lineWidth;
|
|
26115
26166
|
}
|
|
26116
26167
|
static set STAVE_LINE_THICKNESS(value) {
|
|
26117
|
-
|
|
26168
|
+
_metrics__WEBPACK_IMPORTED_MODULE_30__.MetricsDefaults.Stave.lineWidth = value;
|
|
26169
|
+
_metrics__WEBPACK_IMPORTED_MODULE_30__.MetricsDefaults.TabStave.lineWidth = value;
|
|
26170
|
+
_metrics__WEBPACK_IMPORTED_MODULE_30__.Metrics.clear('Stave');
|
|
26171
|
+
_metrics__WEBPACK_IMPORTED_MODULE_30__.Metrics.clear('TabStave');
|
|
26118
26172
|
}
|
|
26119
26173
|
static get STEM_HEIGHT() {
|
|
26120
26174
|
return _tables__WEBPACK_IMPORTED_MODULE_63__.Tables.STEM_HEIGHT;
|
|
@@ -26825,8 +26879,6 @@ function isHTMLDiv(element) {
|
|
|
26825
26879
|
/******/
|
|
26826
26880
|
/************************************************************************/
|
|
26827
26881
|
var __webpack_exports__ = {};
|
|
26828
|
-
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
|
|
26829
|
-
(() => {
|
|
26830
26882
|
/*!********************************!*\
|
|
26831
26883
|
!*** ./entry/vexflow-debug.ts ***!
|
|
26832
26884
|
\********************************/
|
|
@@ -26863,6 +26915,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
26863
26915
|
/* harmony export */ EasyScoreGrammar: () => (/* reexport safe */ _src_index__WEBPACK_IMPORTED_MODULE_8__.EasyScoreGrammar),
|
|
26864
26916
|
/* harmony export */ Element: () => (/* reexport safe */ _src_index__WEBPACK_IMPORTED_MODULE_8__.Element),
|
|
26865
26917
|
/* harmony export */ Factory: () => (/* reexport safe */ _src_index__WEBPACK_IMPORTED_MODULE_8__.Factory),
|
|
26918
|
+
/* harmony export */ Flag: () => (/* reexport safe */ _src_index__WEBPACK_IMPORTED_MODULE_8__.Flag),
|
|
26866
26919
|
/* harmony export */ Font: () => (/* reexport safe */ _src_index__WEBPACK_IMPORTED_MODULE_8__.Font),
|
|
26867
26920
|
/* harmony export */ FontStyle: () => (/* reexport safe */ _src_index__WEBPACK_IMPORTED_MODULE_8__.FontStyle),
|
|
26868
26921
|
/* harmony export */ FontWeight: () => (/* reexport safe */ _src_index__WEBPACK_IMPORTED_MODULE_8__.FontWeight),
|
|
@@ -27025,8 +27078,6 @@ Promise.allSettled(fontLoadPromises).then(() => {
|
|
|
27025
27078
|
|
|
27026
27079
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_src_vexflow__WEBPACK_IMPORTED_MODULE_0__.VexFlow);
|
|
27027
27080
|
|
|
27028
|
-
})();
|
|
27029
|
-
|
|
27030
27081
|
__webpack_exports__ = __webpack_exports__["default"];
|
|
27031
27082
|
/******/ return __webpack_exports__;
|
|
27032
27083
|
/******/ })()
|