vexflow 4.0.1-beta.0 → 4.0.1-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +126 -26
- package/build/cjs/vexflow-debug-with-tests.js.map +1 -1
- package/build/cjs/vexflow-debug.js +94 -26
- package/build/cjs/vexflow-debug.js.map +1 -1
- package/build/cjs/vexflow-gonville.js +2 -2
- package/build/cjs/vexflow-gonville.js.map +1 -1
- package/build/cjs/vexflow-petaluma.js +2 -2
- package/build/cjs/vexflow-petaluma.js.map +1 -1
- package/build/cjs/vexflow.js +2 -2
- package/build/cjs/vexflow.js.map +1 -1
- package/build/esm/src/version.js +3 -3
- package/package.json +1 -1
- package/src/note.ts +2 -2
- package/src/stavenote.ts +80 -16
- package/build/esm/entry/vexflow-bravura.js +0 -11
- package/build/esm/entry/vexflow-core.js +0 -54
- package/build/esm/entry/vexflow-debug-with-tests.js +0 -4
- package/build/esm/entry/vexflow-debug.js +0 -3
- package/build/esm/entry/vexflow-font-bravura.js +0 -7
- package/build/esm/entry/vexflow-font-custom.js +0 -7
- package/build/esm/entry/vexflow-font-gonville.js +0 -7
- package/build/esm/entry/vexflow-font-petaluma.js +0 -7
- package/build/esm/entry/vexflow-gonville.js +0 -11
- package/build/esm/entry/vexflow-petaluma.js +0 -11
- package/build/esm/entry/vexflow.js +0 -9
- package/build/esm/src/accidental.js +0 -348
- package/build/esm/src/annotation.js +0 -213
- package/build/esm/src/articulation.js +0 -264
- package/build/esm/src/barnote.js +0 -58
- package/build/esm/src/beam.js +0 -632
- package/build/esm/src/bend.js +0 -202
- package/build/esm/src/boundingbox.js +0 -59
- package/build/esm/src/boundingboxcomputation.js +0 -107
- package/build/esm/src/canvascontext.js +0 -202
- package/build/esm/src/chordsymbol.js +0 -578
- package/build/esm/src/clef.js +0 -153
- package/build/esm/src/clefnote.js +0 -65
- package/build/esm/src/crescendo.js +0 -77
- package/build/esm/src/curve.js +0 -118
- package/build/esm/src/dot.js +0 -137
- package/build/esm/src/easyscore.js +0 -374
- package/build/esm/src/element.js +0 -216
- package/build/esm/src/factory.js +0 -440
- package/build/esm/src/flow.js +0 -275
- package/build/esm/src/font.js +0 -264
- package/build/esm/src/fonts/bravura_glyphs.js +0 -3239
- package/build/esm/src/fonts/bravura_metrics.js +0 -507
- package/build/esm/src/fonts/custom_glyphs.js +0 -78
- package/build/esm/src/fonts/custom_metrics.js +0 -5
- package/build/esm/src/fonts/gonville_glyphs.js +0 -828
- package/build/esm/src/fonts/gonville_metrics.js +0 -421
- package/build/esm/src/fonts/load_all.js +0 -10
- package/build/esm/src/fonts/load_bravura.js +0 -6
- package/build/esm/src/fonts/load_custom.js +0 -6
- package/build/esm/src/fonts/load_gonville.js +0 -6
- package/build/esm/src/fonts/load_petaluma.js +0 -6
- package/build/esm/src/fonts/petaluma_glyphs.js +0 -1335
- package/build/esm/src/fonts/petaluma_metrics.js +0 -536
- package/build/esm/src/fonts/petalumascript_glyphs.js +0 -863
- package/build/esm/src/fonts/robotoslab_glyphs.js +0 -863
- package/build/esm/src/fonts/textfonts.js +0 -44
- package/build/esm/src/formatter.js +0 -568
- package/build/esm/src/fraction.js +0 -171
- package/build/esm/src/frethandfinger.js +0 -156
- package/build/esm/src/ghostnote.js +0 -50
- package/build/esm/src/glyph.js +0 -331
- package/build/esm/src/glyphnote.js +0 -55
- package/build/esm/src/gracenote.js +0 -133
- package/build/esm/src/gracenotegroup.js +0 -128
- package/build/esm/src/gracetabnote.js +0 -12
- package/build/esm/src/index.js +0 -91
- package/build/esm/src/keymanager.js +0 -99
- package/build/esm/src/keysignature.js +0 -250
- package/build/esm/src/keysignote.js +0 -28
- package/build/esm/src/modifier.js +0 -128
- package/build/esm/src/modifiercontext.js +0 -110
- package/build/esm/src/multimeasurerest.js +0 -173
- package/build/esm/src/music.js +0 -322
- package/build/esm/src/note.js +0 -371
- package/build/esm/src/notehead.js +0 -169
- package/build/esm/src/notesubgroup.js +0 -59
- package/build/esm/src/ornament.js +0 -206
- package/build/esm/src/parenthesis.js +0 -76
- package/build/esm/src/parser.js +0 -164
- package/build/esm/src/pedalmarking.js +0 -192
- package/build/esm/src/registry.js +0 -81
- package/build/esm/src/rendercontext.js +0 -24
- package/build/esm/src/renderer.js +0 -112
- package/build/esm/src/repeatnote.js +0 -22
- package/build/esm/src/stave.js +0 -547
- package/build/esm/src/stavebarline.js +0 -182
- package/build/esm/src/staveconnector.js +0 -196
- package/build/esm/src/stavehairpin.js +0 -120
- package/build/esm/src/staveline.js +0 -218
- package/build/esm/src/stavemodifier.js +0 -77
- package/build/esm/src/stavenote.js +0 -799
- package/build/esm/src/staverepetition.js +0 -155
- package/build/esm/src/stavesection.js +0 -58
- package/build/esm/src/stavetempo.js +0 -91
- package/build/esm/src/stavetext.js +0 -82
- package/build/esm/src/stavetie.js +0 -141
- package/build/esm/src/stavevolta.js +0 -67
- package/build/esm/src/stem.js +0 -131
- package/build/esm/src/stemmablenote.js +0 -193
- package/build/esm/src/stringnumber.js +0 -231
- package/build/esm/src/strokes.js +0 -200
- package/build/esm/src/svgcontext.js +0 -414
- package/build/esm/src/system.js +0 -116
- package/build/esm/src/tables.js +0 -1102
- package/build/esm/src/tabnote.js +0 -299
- package/build/esm/src/tabslide.js +0 -76
- package/build/esm/src/tabstave.js +0 -17
- package/build/esm/src/tabtie.js +0 -19
- package/build/esm/src/textbracket.js +0 -144
- package/build/esm/src/textdynamics.js +0 -81
- package/build/esm/src/textformatter.js +0 -177
- package/build/esm/src/textnote.js +0 -176
- package/build/esm/src/tickable.js +0 -214
- package/build/esm/src/tickcontext.js +0 -170
- package/build/esm/src/timesigglyph.js +0 -85
- package/build/esm/src/timesignature.js +0 -89
- package/build/esm/src/timesignote.js +0 -32
- package/build/esm/src/tremolo.js +0 -47
- package/build/esm/src/tuning.js +0 -54
- package/build/esm/src/tuplet.js +0 -240
- package/build/esm/src/typeguard.js +0 -30
- package/build/esm/src/util.js +0 -58
- package/build/esm/src/vex.js +0 -51
- package/build/esm/src/vibrato.js +0 -100
- package/build/esm/src/vibratobracket.js +0 -50
- package/build/esm/src/voice.js +0 -187
- package/build/esm/src/web.js +0 -15
- package/build/esm/tests/accidental_tests.js +0 -974
- package/build/esm/tests/annotation_tests.js +0 -377
- package/build/esm/tests/articulation_tests.js +0 -365
- package/build/esm/tests/auto_beam_formatting_tests.js +0 -548
- package/build/esm/tests/bach_tests.js +0 -335
- package/build/esm/tests/barline_tests.js +0 -52
- package/build/esm/tests/beam_tests.js +0 -595
- package/build/esm/tests/bend_tests.js +0 -215
- package/build/esm/tests/boundingbox_tests.js +0 -53
- package/build/esm/tests/boundingboxcomputation_tests.js +0 -183
- package/build/esm/tests/chordsymbol_tests.js +0 -320
- package/build/esm/tests/clef_tests.js +0 -131
- package/build/esm/tests/curve_tests.js +0 -118
- package/build/esm/tests/dot_tests.js +0 -123
- package/build/esm/tests/easyscore_tests.js +0 -459
- package/build/esm/tests/factory_tests.js +0 -44
- package/build/esm/tests/font_tests.js +0 -135
- package/build/esm/tests/formatter/framestack.js +0 -61
- package/build/esm/tests/formatter/tests.js +0 -203
- package/build/esm/tests/formatter_tests.js +0 -669
- package/build/esm/tests/fraction_tests.js +0 -72
- package/build/esm/tests/ghostnote_tests.js +0 -77
- package/build/esm/tests/glyphnote_tests.js +0 -113
- package/build/esm/tests/gracenote_tests.js +0 -370
- package/build/esm/tests/gracetabnote_tests.js +0 -79
- package/build/esm/tests/index.js +0 -68
- package/build/esm/tests/key_clef_tests.js +0 -103
- package/build/esm/tests/keymanager_tests.js +0 -68
- package/build/esm/tests/keysignature_tests.js +0 -308
- package/build/esm/tests/mocks.js +0 -71
- package/build/esm/tests/modifier_tests.js +0 -24
- package/build/esm/tests/multimeasurerest_tests.js +0 -141
- package/build/esm/tests/music_tests.js +0 -161
- package/build/esm/tests/notehead_tests.js +0 -137
- package/build/esm/tests/notesubgroup_tests.js +0 -149
- package/build/esm/tests/offscreencanvas_tests.js +0 -47
- package/build/esm/tests/ornament_tests.js +0 -298
- package/build/esm/tests/parser_tests.js +0 -122
- package/build/esm/tests/pedalmarking_tests.js +0 -64
- package/build/esm/tests/percussion_tests.js +0 -180
- package/build/esm/tests/registry_tests.js +0 -64
- package/build/esm/tests/renderer_tests.js +0 -113
- package/build/esm/tests/rests_tests.js +0 -248
- package/build/esm/tests/rhythm_tests.js +0 -357
- package/build/esm/tests/stave_tests.js +0 -560
- package/build/esm/tests/staveconnector_tests.js +0 -402
- package/build/esm/tests/stavehairpin_tests.js +0 -90
- package/build/esm/tests/staveline_tests.js +0 -122
- package/build/esm/tests/stavemodifier_tests.js +0 -51
- package/build/esm/tests/stavenote_tests.js +0 -835
- package/build/esm/tests/stavetie_tests.js +0 -108
- package/build/esm/tests/stringnumber_tests.js +0 -259
- package/build/esm/tests/strokes_tests.js +0 -275
- package/build/esm/tests/style_tests.js +0 -98
- package/build/esm/tests/support/qunit.js +0 -2765
- package/build/esm/tests/tabnote_tests.js +0 -474
- package/build/esm/tests/tabslide_tests.js +0 -135
- package/build/esm/tests/tabstave_tests.js +0 -23
- package/build/esm/tests/tabtie_tests.js +0 -173
- package/build/esm/tests/textbracket_tests.js +0 -100
- package/build/esm/tests/textformatter_tests.js +0 -24
- package/build/esm/tests/textnote_tests.js +0 -215
- package/build/esm/tests/threevoice_tests.js +0 -132
- package/build/esm/tests/tickcontext_tests.js +0 -36
- package/build/esm/tests/timesignature_tests.js +0 -134
- package/build/esm/tests/tremolo_tests.js +0 -75
- package/build/esm/tests/tuning_tests.js +0 -56
- package/build/esm/tests/tuplet_tests.js +0 -450
- package/build/esm/tests/typeguard_tests.js +0 -82
- package/build/esm/tests/vexflow_test_helpers.js +0 -266
- package/build/esm/tests/vf_prefix_tests.js +0 -115
- package/build/esm/tests/vibrato_tests.js +0 -92
- package/build/esm/tests/vibratobracket_tests.js +0 -45
- package/build/esm/tests/voice_tests.js +0 -69
- package/build/types/entry/vexflow-bravura.d.ts +0 -3
- package/build/types/entry/vexflow-core.d.ts +0 -3
- package/build/types/entry/vexflow-debug.d.ts +0 -3
- package/build/types/entry/vexflow-font-bravura.d.ts +0 -3771
- package/build/types/entry/vexflow-font-custom.d.ts +0 -86
- package/build/types/entry/vexflow-font-gonville.d.ts +0 -1267
- package/build/types/entry/vexflow-font-petaluma.d.ts +0 -1896
- package/build/types/entry/vexflow-gonville.d.ts +0 -3
- package/build/types/entry/vexflow-petaluma.d.ts +0 -3
- package/build/types/entry/vexflow.d.ts +0 -3
- package/build/types/src/accidental.d.ts +0 -66
- package/build/types/src/annotation.d.ts +0 -60
- package/build/types/src/articulation.d.ts +0 -62
- package/build/types/src/barnote.d.ts +0 -29
- package/build/types/src/beam.d.ts +0 -124
- package/build/types/src/bend.d.ts +0 -73
- package/build/types/src/boundingbox.d.ts +0 -42
- package/build/types/src/boundingboxcomputation.d.ts +0 -33
- package/build/types/src/canvascontext.d.ts +0 -89
- package/build/types/src/chordsymbol.d.ts +0 -149
- package/build/types/src/clef.d.ts +0 -48
- package/build/types/src/clefnote.d.ts +0 -25
- package/build/types/src/crescendo.d.ts +0 -27
- package/build/types/src/curve.d.ts +0 -41
- package/build/types/src/dot.d.ts +0 -20
- package/build/types/src/easyscore.d.ts +0 -148
- package/build/types/src/element.d.ts +0 -202
- package/build/types/src/factory.d.ts +0 -271
- package/build/types/src/flow.d.ts +0 -245
- package/build/types/src/font.d.ts +0 -181
- package/build/types/src/fonts/bravura_glyphs.d.ts +0 -3239
- package/build/types/src/fonts/bravura_metrics.d.ts +0 -533
- package/build/types/src/fonts/custom_glyphs.d.ts +0 -78
- package/build/types/src/fonts/custom_metrics.d.ts +0 -5
- package/build/types/src/fonts/gonville_glyphs.d.ts +0 -828
- package/build/types/src/fonts/gonville_metrics.d.ts +0 -440
- package/build/types/src/fonts/load_all.d.ts +0 -1
- package/build/types/src/fonts/load_bravura.d.ts +0 -1
- package/build/types/src/fonts/load_custom.d.ts +0 -1
- package/build/types/src/fonts/load_gonville.d.ts +0 -1
- package/build/types/src/fonts/load_petaluma.d.ts +0 -1
- package/build/types/src/fonts/petaluma_glyphs.d.ts +0 -1335
- package/build/types/src/fonts/petaluma_metrics.d.ts +0 -562
- package/build/types/src/fonts/petalumascript_glyphs.d.ts +0 -863
- package/build/types/src/fonts/robotoslab_glyphs.d.ts +0 -863
- package/build/types/src/fonts/textfonts.d.ts +0 -1
- package/build/types/src/formatter.d.ts +0 -203
- package/build/types/src/fraction.d.ts +0 -62
- package/build/types/src/frethandfinger.d.ts +0 -22
- package/build/types/src/ghostnote.d.ts +0 -16
- package/build/types/src/glyph.d.ts +0 -139
- package/build/types/src/glyphnote.d.ts +0 -17
- package/build/types/src/gracenote.d.ts +0 -19
- package/build/types/src/gracenotegroup.d.ts +0 -33
- package/build/types/src/gracetabnote.d.ts +0 -5
- package/build/types/src/index.d.ts +0 -91
- package/build/types/src/keymanager.d.ts +0 -25
- package/build/types/src/keysignature.d.ts +0 -50
- package/build/types/src/keysignote.d.ts +0 -11
- package/build/types/src/modifier.d.ts +0 -97
- package/build/types/src/modifiercontext.d.ts +0 -45
- package/build/types/src/multimeasurerest.d.ts +0 -61
- package/build/types/src/music.d.ts +0 -91
- package/build/types/src/note.d.ts +0 -230
- package/build/types/src/notehead.d.ts +0 -70
- package/build/types/src/notesubgroup.d.ts +0 -18
- package/build/types/src/ornament.d.ts +0 -76
- package/build/types/src/parenthesis.d.ts +0 -22
- package/build/types/src/parser.d.ts +0 -45
- package/build/types/src/pedalmarking.d.ts +0 -69
- package/build/types/src/registry.d.ts +0 -40
- package/build/types/src/rendercontext.d.ts +0 -64
- package/build/types/src/renderer.d.ts +0 -35
- package/build/types/src/repeatnote.d.ts +0 -6
- package/build/types/src/stave.d.ts +0 -186
- package/build/types/src/stavebarline.d.ts +0 -28
- package/build/types/src/staveconnector.d.ts +0 -67
- package/build/types/src/stavehairpin.d.ts +0 -56
- package/build/types/src/staveline.d.ts +0 -57
- package/build/types/src/stavemodifier.d.ts +0 -44
- package/build/types/src/stavenote.d.ts +0 -154
- package/build/types/src/staverepetition.d.ts +0 -32
- package/build/types/src/stavesection.d.ts +0 -15
- package/build/types/src/stavetempo.d.ts +0 -25
- package/build/types/src/stavetext.d.ts +0 -25
- package/build/types/src/stavetie.d.ts +0 -59
- package/build/types/src/stavevolta.d.ts +0 -21
- package/build/types/src/stem.d.ts +0 -58
- package/build/types/src/stemmablenote.d.ts +0 -39
- package/build/types/src/stringnumber.d.ts +0 -27
- package/build/types/src/strokes.d.ts +0 -33
- package/build/types/src/svgcontext.d.ts +0 -131
- package/build/types/src/system.d.ts +0 -92
- package/build/types/src/tables.d.ts +0 -96
- package/build/types/src/tabnote.d.ts +0 -44
- package/build/types/src/tabslide.d.ts +0 -34
- package/build/types/src/tabstave.d.ts +0 -7
- package/build/types/src/tabtie.d.ts +0 -18
- package/build/types/src/textbracket.d.ts +0 -55
- package/build/types/src/textdynamics.d.ts +0 -39
- package/build/types/src/textformatter.d.ts +0 -109
- package/build/types/src/textnote.d.ts +0 -49
- package/build/types/src/tickable.d.ts +0 -140
- package/build/types/src/tickcontext.d.ts +0 -82
- package/build/types/src/timesigglyph.d.ts +0 -14
- package/build/types/src/timesignature.d.ts +0 -26
- package/build/types/src/timesignote.d.ts +0 -11
- package/build/types/src/tremolo.d.ts +0 -17
- package/build/types/src/tuning.d.ts +0 -23
- package/build/types/src/tuplet.d.ts +0 -105
- package/build/types/src/typeguard.d.ts +0 -99
- package/build/types/src/util.d.ts +0 -27
- package/build/types/src/version.d.ts +0 -3
- package/build/types/src/vex.d.ts +0 -18
- package/build/types/src/vibrato.d.ts +0 -29
- package/build/types/src/vibratobracket.d.ts +0 -33
- package/build/types/src/voice.d.ts +0 -108
- package/build/types/src/web.d.ts +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* VexFlow 4.0.1-beta.
|
|
2
|
+
* VexFlow 4.0.1-beta.1 2022-02-20T12:29:14.512Z ae783aca83e30a36759a9a134a1abfc9302c3b77
|
|
3
3
|
* Copyright (c) 2010 Mohit Muthanna Cheppudira <mohit@muthanna.com>
|
|
4
4
|
* https://www.vexflow.com https://github.com/0xfe/vexflow
|
|
5
5
|
*/
|
|
@@ -29,9 +29,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
29
29
|
/* harmony export */ "ID": () => (/* binding */ ID),
|
|
30
30
|
/* harmony export */ "DATE": () => (/* binding */ DATE)
|
|
31
31
|
/* harmony export */ });
|
|
32
|
-
const VERSION = '4.0.1-beta.
|
|
33
|
-
const ID = '
|
|
34
|
-
const DATE = '2022-02-
|
|
32
|
+
const VERSION = '4.0.1-beta.1';
|
|
33
|
+
const ID = 'ae783aca83e30a36759a9a134a1abfc9302c3b77';
|
|
34
|
+
const DATE = '2022-02-20T12:29:14.512Z';
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
/***/ }),
|
|
@@ -20014,9 +20014,9 @@ class Note extends _tickable__WEBPACK_IMPORTED_MODULE_3__.Tickable {
|
|
|
20014
20014
|
super.addModifier(modifier);
|
|
20015
20015
|
return this;
|
|
20016
20016
|
}
|
|
20017
|
-
|
|
20017
|
+
/** Get all modifiers of a specific type in `this.modifiers`. */
|
|
20018
20018
|
getModifiersByType(type) {
|
|
20019
|
-
return this.
|
|
20019
|
+
return this.modifiers.filter((modifier) => modifier.getCategory() === type);
|
|
20020
20020
|
}
|
|
20021
20021
|
/** Get the coordinates for where modifiers begin. */
|
|
20022
20022
|
// eslint-disable-next-line
|
|
@@ -23616,7 +23616,7 @@ class StaveNote extends _stemmablenote__WEBPACK_IMPORTED_MODULE_4__.StemmableNot
|
|
|
23616
23616
|
let xShift = 0;
|
|
23617
23617
|
// Test for two voice note intersection
|
|
23618
23618
|
if (voices === 2) {
|
|
23619
|
-
const lineSpacing = noteU.stemDirection === noteL.stemDirection ? 0.0 : 0.5;
|
|
23619
|
+
const lineSpacing = noteU.note.hasStem() && noteL.note.hasStem() && noteU.stemDirection === noteL.stemDirection ? 0.0 : 0.5;
|
|
23620
23620
|
if (noteU.minLine <= noteL.maxLine + lineSpacing) {
|
|
23621
23621
|
if (noteU.isrest) {
|
|
23622
23622
|
// shift rest up
|
|
@@ -23626,15 +23626,80 @@ class StaveNote extends _stemmablenote__WEBPACK_IMPORTED_MODULE_4__.StemmableNot
|
|
|
23626
23626
|
// shift rest down
|
|
23627
23627
|
shiftRestVertical(noteL, noteU, -1);
|
|
23628
23628
|
}
|
|
23629
|
-
else if (noteU.stemDirection === noteL.stemDirection) {
|
|
23630
|
-
// upper voice is middle voice, so shift it right
|
|
23631
|
-
xShift = voiceXShift + 2;
|
|
23632
|
-
noteU.note.setXShift(xShift);
|
|
23633
|
-
}
|
|
23634
23629
|
else {
|
|
23635
|
-
//
|
|
23636
|
-
|
|
23637
|
-
|
|
23630
|
+
//Instead of shifting notes, remove the appropriate flag
|
|
23631
|
+
//If we are sharing a line, switch one notes stem direction.
|
|
23632
|
+
//If we are sharing a line and in the same voice, only then offset one note
|
|
23633
|
+
const lineDiff = Math.abs(noteU.line - noteL.line);
|
|
23634
|
+
if (noteU.note.hasStem() && noteL.note.hasStem()) {
|
|
23635
|
+
//If we have different dot values, must offset
|
|
23636
|
+
//Or If we have a white mixed with a black notehead, must offset
|
|
23637
|
+
let whiteNoteHeadCount = 0;
|
|
23638
|
+
let blackNoteHeadCount = 0;
|
|
23639
|
+
if (_tables__WEBPACK_IMPORTED_MODULE_5__.Tables.durationToNumber(noteU.note.duration) === 2) {
|
|
23640
|
+
whiteNoteHeadCount++;
|
|
23641
|
+
}
|
|
23642
|
+
else if (_tables__WEBPACK_IMPORTED_MODULE_5__.Tables.durationToNumber(noteU.note.duration) > 2) {
|
|
23643
|
+
blackNoteHeadCount++;
|
|
23644
|
+
}
|
|
23645
|
+
if (_tables__WEBPACK_IMPORTED_MODULE_5__.Tables.durationToNumber(noteL.note.duration) === 2) {
|
|
23646
|
+
whiteNoteHeadCount++;
|
|
23647
|
+
}
|
|
23648
|
+
else if (_tables__WEBPACK_IMPORTED_MODULE_5__.Tables.durationToNumber(noteL.note.duration) > 2) {
|
|
23649
|
+
blackNoteHeadCount++;
|
|
23650
|
+
}
|
|
23651
|
+
if ((whiteNoteHeadCount !== 2 && blackNoteHeadCount !== 2) ||
|
|
23652
|
+
noteU.note.getModifiersByType(_typeguard__WEBPACK_IMPORTED_MODULE_6__.Category.Dot).length !== noteL.note.getModifiersByType(_typeguard__WEBPACK_IMPORTED_MODULE_6__.Category.Dot).length) {
|
|
23653
|
+
xShift = voiceXShift + 2;
|
|
23654
|
+
if (noteU.stemDirection === noteL.stemDirection) {
|
|
23655
|
+
// upper voice is middle voice, so shift it right
|
|
23656
|
+
noteU.note.setXShift(xShift);
|
|
23657
|
+
}
|
|
23658
|
+
else {
|
|
23659
|
+
// shift lower voice right
|
|
23660
|
+
noteL.note.setXShift(xShift);
|
|
23661
|
+
}
|
|
23662
|
+
}
|
|
23663
|
+
else if (lineDiff < 1 && lineDiff > 0) {
|
|
23664
|
+
//if the notes are quite close but not on the same line, shift
|
|
23665
|
+
xShift = voiceXShift + 2;
|
|
23666
|
+
if (noteU.stemDirection === noteL.stemDirection) {
|
|
23667
|
+
// upper voice is middle voice, so shift it right
|
|
23668
|
+
noteU.note.setXShift(xShift);
|
|
23669
|
+
}
|
|
23670
|
+
else {
|
|
23671
|
+
// shift lower voice right
|
|
23672
|
+
noteL.note.setXShift(xShift);
|
|
23673
|
+
}
|
|
23674
|
+
}
|
|
23675
|
+
else if (noteU.note.voice !== noteL.note.voice) {
|
|
23676
|
+
//If we are not in the same voice
|
|
23677
|
+
if (noteU.stemDirection === noteL.stemDirection) {
|
|
23678
|
+
if (noteU.line != noteL.line) {
|
|
23679
|
+
xShift = voiceXShift + 2;
|
|
23680
|
+
noteU.note.setXShift(xShift);
|
|
23681
|
+
}
|
|
23682
|
+
else {
|
|
23683
|
+
//same line, swap stem direction for one note
|
|
23684
|
+
if (noteL.stemDirection === 1) {
|
|
23685
|
+
noteL.stemDirection = -1;
|
|
23686
|
+
noteL.note.setStemDirection(-1);
|
|
23687
|
+
}
|
|
23688
|
+
}
|
|
23689
|
+
}
|
|
23690
|
+
} //Very close whole notes
|
|
23691
|
+
}
|
|
23692
|
+
else {
|
|
23693
|
+
xShift = voiceXShift + 2;
|
|
23694
|
+
if (noteU.stemDirection === noteL.stemDirection) {
|
|
23695
|
+
// upper voice is middle voice, so shift it right
|
|
23696
|
+
noteU.note.setXShift(xShift);
|
|
23697
|
+
}
|
|
23698
|
+
else {
|
|
23699
|
+
// shift lower voice right
|
|
23700
|
+
noteL.note.setXShift(xShift);
|
|
23701
|
+
}
|
|
23702
|
+
}
|
|
23638
23703
|
}
|
|
23639
23704
|
}
|
|
23640
23705
|
// format complete
|
|
@@ -24067,15 +24132,16 @@ class StaveNote extends _stemmablenote__WEBPACK_IMPORTED_MODULE_4__.StemmableNot
|
|
|
24067
24132
|
// Sets the style of the complete StaveNote, including all keys
|
|
24068
24133
|
// and the stem.
|
|
24069
24134
|
setStyle(style) {
|
|
24070
|
-
var _a;
|
|
24071
24135
|
super.setStyle(style);
|
|
24072
24136
|
this._noteHeads.forEach((notehead) => notehead.setStyle(style));
|
|
24073
|
-
(
|
|
24137
|
+
if (this.stem)
|
|
24138
|
+
this.stem.setStyle(style);
|
|
24074
24139
|
return this;
|
|
24075
24140
|
}
|
|
24076
24141
|
setStemStyle(style) {
|
|
24077
24142
|
const stem = this.getStem();
|
|
24078
|
-
|
|
24143
|
+
if (stem)
|
|
24144
|
+
stem.setStyle(style);
|
|
24079
24145
|
return this;
|
|
24080
24146
|
}
|
|
24081
24147
|
getStemStyle() {
|
|
@@ -24345,7 +24411,6 @@ class StaveNote extends _stemmablenote__WEBPACK_IMPORTED_MODULE_4__.StemmableNot
|
|
|
24345
24411
|
});
|
|
24346
24412
|
}
|
|
24347
24413
|
drawStem(stemOptions) {
|
|
24348
|
-
var _a;
|
|
24349
24414
|
// GCR TODO: I can't find any context in which this is called with the stemStruct
|
|
24350
24415
|
// argument in the codebase or tests. Nor can I find a case where super.drawStem
|
|
24351
24416
|
// is called at all. Perhaps these should be removed?
|
|
@@ -24358,9 +24423,11 @@ class StaveNote extends _stemmablenote__WEBPACK_IMPORTED_MODULE_4__.StemmableNot
|
|
|
24358
24423
|
if (this.shouldDrawFlag() && this.stem) {
|
|
24359
24424
|
this.stem.adjustHeightForFlag();
|
|
24360
24425
|
}
|
|
24361
|
-
|
|
24362
|
-
|
|
24363
|
-
|
|
24426
|
+
if (this.stem) {
|
|
24427
|
+
ctx.openGroup('stem', undefined, { pointerBBox: true });
|
|
24428
|
+
this.stem.setContext(ctx).draw();
|
|
24429
|
+
ctx.closeGroup();
|
|
24430
|
+
}
|
|
24364
24431
|
}
|
|
24365
24432
|
/** Primarily used as the scaling factor for grace notes, GraceNote will return the required scale. */
|
|
24366
24433
|
getStaveNoteScale() {
|
|
@@ -24407,7 +24474,6 @@ class StaveNote extends _stemmablenote__WEBPACK_IMPORTED_MODULE_4__.StemmableNot
|
|
|
24407
24474
|
}
|
|
24408
24475
|
// Draws all the `StaveNote` parts. This is the main drawing method.
|
|
24409
24476
|
draw() {
|
|
24410
|
-
var _a;
|
|
24411
24477
|
if (this.ys.length === 0) {
|
|
24412
24478
|
throw new _util__WEBPACK_IMPORTED_MODULE_7__.RuntimeError('NoYValues', "Can't draw note without Y values.");
|
|
24413
24479
|
}
|
|
@@ -24416,9 +24482,11 @@ class StaveNote extends _stemmablenote__WEBPACK_IMPORTED_MODULE_4__.StemmableNot
|
|
|
24416
24482
|
const shouldRenderStem = this.hasStem() && !this.beam;
|
|
24417
24483
|
// Format note head x positions
|
|
24418
24484
|
this._noteHeads.forEach((notehead) => notehead.setX(xBegin));
|
|
24419
|
-
|
|
24420
|
-
|
|
24421
|
-
|
|
24485
|
+
if (this.stem) {
|
|
24486
|
+
// Format stem x positions
|
|
24487
|
+
const stemX = this.getStemX();
|
|
24488
|
+
this.stem.setNoteHeadXBounds(stemX, stemX);
|
|
24489
|
+
}
|
|
24422
24490
|
L('Rendering ', this.isChord() ? 'chord :' : 'note :', this.keys);
|
|
24423
24491
|
// Apply the overall style -- may be contradicted by local settings:
|
|
24424
24492
|
this.applyStyle();
|