vexflow 5.2.0 → 5.4.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 +2 -0
- 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 +6502 -1708
- package/build/cjs/vexflow-debug-with-tests.js.map +1 -1
- package/build/cjs/vexflow-debug.js +5622 -1618
- 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/accidental.js +10 -3
- package/build/esm/src/alternatingtremolo.js +68 -0
- package/build/esm/src/annotation.js +19 -3
- package/build/esm/src/articulation.js +28 -6
- package/build/esm/src/beam.js +171 -28
- package/build/esm/src/bend.js +79 -23
- package/build/esm/src/clef.js +3 -0
- package/build/esm/src/continuouslayout.js +681 -0
- package/build/esm/src/continuousspan.js +159 -0
- package/build/esm/src/curve.js +48 -55
- package/build/esm/src/dot.js +13 -4
- package/build/esm/src/easyscore/composition.js +52 -2
- package/build/esm/src/easyscore/policies.js +39 -8
- package/build/esm/src/element.js +4 -0
- package/build/esm/src/engravinggeometry.js +157 -0
- package/build/esm/src/engravingprofile.js +44 -0
- package/build/esm/src/factory.js +31 -11
- package/build/esm/src/font.js +9 -1
- package/build/esm/src/formatter.js +9 -1
- package/build/esm/src/fretdiagram.js +77 -0
- package/build/esm/src/gracenote.js +43 -38
- package/build/esm/src/gracenotegroup.js +53 -56
- package/build/esm/src/guitargesture.js +33 -0
- package/build/esm/src/guitarmodifiers.js +26 -0
- package/build/esm/src/index.js +10 -0
- package/build/esm/src/instrumentprofile.js +123 -0
- package/build/esm/src/keysignature.js +24 -2
- package/build/esm/src/modifiercontext.js +11 -0
- package/build/esm/src/notationspelling.js +73 -0
- package/build/esm/src/note.js +3 -0
- package/build/esm/src/notehead.js +11 -6
- package/build/esm/src/ornament.js +43 -18
- package/build/esm/src/pagebreaks.js +58 -0
- package/build/esm/src/pedalmarking.js +39 -17
- package/build/esm/src/phraselayout.js +503 -0
- package/build/esm/src/phraseribbon.js +28 -0
- package/build/esm/src/proportionalformatter.js +54 -6
- package/build/esm/src/publication.js +402 -0
- package/build/esm/src/publicationview.js +114 -0
- package/build/esm/src/scorenavigation.js +172 -0
- package/build/esm/src/sheet.js +14 -2
- package/build/esm/src/stave.js +33 -16
- package/build/esm/src/stavebarline.js +5 -7
- package/build/esm/src/staveconnector.js +1 -0
- package/build/esm/src/stavehairpin.js +53 -27
- package/build/esm/src/stavenote.js +134 -116
- package/build/esm/src/stavetie.js +66 -9
- package/build/esm/src/stem.js +26 -11
- package/build/esm/src/strokes.js +4 -0
- package/build/esm/src/system.js +19 -4
- package/build/esm/src/systembreaks.js +42 -0
- package/build/esm/src/tabnote.js +6 -1
- package/build/esm/src/textbracket.js +24 -5
- package/build/esm/src/tickcontext.js +19 -0
- package/build/esm/src/timesignature.js +20 -6
- package/build/esm/src/tuplet.js +58 -17
- package/build/esm/src/version.js +3 -3
- package/build/esm/src/vexflow.js +20 -0
- package/build/esm/src/voice.js +7 -3
- package/build/esm/tests/bend_tests.js +14 -1
- package/build/esm/tests/curve_tests.js +14 -4
- package/build/esm/tests/demo_repertoire_tests.js +27 -0
- package/build/esm/tests/demos/drums.js +54 -0
- package/build/esm/tests/demos/electric.js +63 -0
- package/build/esm/tests/demos/greensleeves.js +90 -0
- package/build/esm/tests/demos/joy.js +61 -0
- package/build/esm/tests/demos/kesh.js +80 -0
- package/build/esm/tests/demos/prelude.js +59 -0
- package/build/esm/tests/demos/quartertones.js +50 -0
- package/build/esm/tests/demos/saints.js +65 -0
- package/build/esm/tests/engraving/continuous-studies.mjs +140 -0
- package/build/esm/tests/engraving/instrument-studies.mjs +273 -0
- package/build/esm/tests/engraving/phrase-studies.mjs +63 -0
- package/build/esm/tests/engraving/publication-studies.mjs +87 -0
- package/build/esm/tests/engraving/score-layout.mjs +75 -0
- package/build/esm/tests/engraving/score-persistence.mjs +262 -0
- package/build/esm/tests/engraving/specialist-studies.mjs +347 -0
- package/build/esm/tests/engraving/studies.mjs +367 -0
- package/build/esm/tests/formatter_tests.js +10 -1
- package/build/esm/tests/index.js +1 -0
- package/build/esm/tests/node/audit-dependencies-tests.mjs +42 -0
- package/build/esm/tests/node/continuous-score-tests.mjs +282 -0
- package/build/esm/tests/node/easyscore-tests.mjs +71 -0
- package/build/esm/tests/node/engraving-layout-tests.mjs +449 -0
- package/build/esm/tests/node/instrument-profile-tests.mjs +224 -0
- package/build/esm/tests/node/local-engraving-tests.mjs +128 -0
- package/build/esm/tests/node/phrase-layout-tests.mjs +281 -0
- package/build/esm/tests/node/proportional-spacing-tests.mjs +64 -0
- package/build/esm/tests/node/publication-tests.mjs +219 -0
- package/build/esm/tests/node/rendering-tests.mjs +6 -2
- package/build/esm/tests/threevoice_tests.js +11 -1
- package/build/esm/tests/vexflow_test_helpers.js +19 -10
- package/build/esm/tools/audit-dependencies.mjs +61 -0
- package/build/esm/tools/easyscore-structure.mjs +1 -1
- package/build/esm/tools/explorer/catalog/entries.mjs +2 -1
- package/build/esm/tools/explorer/catalog/expression.mjs +14 -9
- package/build/esm/tools/explorer/catalog/guitar.mjs +238 -0
- package/build/esm/tools/explorer/catalog/layout.mjs +8 -6
- package/build/esm/tools/explorer/catalog/notes.mjs +16 -14
- package/build/esm/tools/explorer/catalog/staves.mjs +12 -6
- package/build/esm/tools/explorer/catalog/strings.mjs +10 -7
- package/build/esm/tools/score-fixtures.mjs +23 -6
- package/build/types/src/accidental.d.ts +4 -0
- package/build/types/src/alternatingtremolo.d.ts +13 -0
- package/build/types/src/annotation.d.ts +9 -0
- package/build/types/src/articulation.d.ts +9 -1
- package/build/types/src/beam.d.ts +16 -0
- package/build/types/src/bend.d.ts +8 -0
- package/build/types/src/clef.d.ts +3 -0
- package/build/types/src/continuouslayout.d.ts +103 -0
- package/build/types/src/continuousspan.d.ts +60 -0
- package/build/types/src/curve.d.ts +20 -0
- package/build/types/src/dot.d.ts +5 -0
- package/build/types/src/easyscore/composition.d.ts +27 -0
- package/build/types/src/easyscore/policies.d.ts +1 -1
- package/build/types/src/element.d.ts +2 -0
- package/build/types/src/engravinggeometry.d.ts +31 -0
- package/build/types/src/engravingprofile.d.ts +20 -0
- package/build/types/src/factory.d.ts +6 -1
- package/build/types/src/formatter.d.ts +3 -3
- package/build/types/src/fretdiagram.d.ts +23 -0
- package/build/types/src/gracenote.d.ts +7 -0
- package/build/types/src/gracenotegroup.d.ts +7 -2
- package/build/types/src/guitargesture.d.ts +26 -0
- package/build/types/src/guitarmodifiers.d.ts +3 -0
- package/build/types/src/index.d.ts +12 -0
- package/build/types/src/instrumentprofile.d.ts +124 -0
- package/build/types/src/keysignature.d.ts +9 -0
- package/build/types/src/modifiercontext.d.ts +4 -0
- package/build/types/src/notationspelling.d.ts +25 -0
- package/build/types/src/note.d.ts +15 -0
- package/build/types/src/notehead.d.ts +5 -0
- package/build/types/src/ornament.d.ts +10 -1
- package/build/types/src/pagebreaks.d.ts +26 -0
- package/build/types/src/pedalmarking.d.ts +9 -0
- package/build/types/src/phraselayout.d.ts +87 -0
- package/build/types/src/phraseribbon.d.ts +7 -0
- package/build/types/src/proportionalformatter.d.ts +11 -2
- package/build/types/src/publication.d.ts +61 -0
- package/build/types/src/publicationview.d.ts +27 -0
- package/build/types/src/scorenavigation.d.ts +33 -0
- package/build/types/src/sheet.d.ts +5 -0
- package/build/types/src/stave.d.ts +13 -0
- package/build/types/src/stavehairpin.d.ts +18 -0
- package/build/types/src/stavenote.d.ts +20 -2
- package/build/types/src/stavetie.d.ts +9 -0
- package/build/types/src/stem.d.ts +10 -1
- package/build/types/src/system.d.ts +8 -1
- package/build/types/src/systembreaks.d.ts +9 -0
- package/build/types/src/textbracket.d.ts +7 -0
- package/build/types/src/tickcontext.d.ts +5 -0
- package/build/types/src/timesignature.d.ts +6 -0
- package/build/types/src/tuplet.d.ts +5 -48
- package/build/types/src/vexflow.d.ts +20 -0
- package/build/types/src/voice.d.ts +2 -0
- package/changelog/CHANGELOG.md +25 -0
- package/package.json +15 -3
- package/tests/all.html +277 -0
- package/tests/demo_petzold_tests.ts +435 -0
- package/tests/demos/drums.ts +55 -0
- package/tests/demos/drums.webp +0 -0
- package/tests/demos/electric.ts +70 -0
- package/tests/demos/electric.webp +0 -0
- package/tests/demos/greensleeves.ts +97 -0
- package/tests/demos/greensleeves.webp +0 -0
- package/tests/demos/joy.ts +65 -0
- package/tests/demos/joy.webp +0 -0
- package/tests/demos/kesh.ts +86 -0
- package/tests/demos/kesh.webp +0 -0
- package/tests/demos/prelude.ts +65 -0
- package/tests/demos/prelude.webp +0 -0
- package/tests/demos/quartertones.ts +51 -0
- package/tests/demos/quartertones.webp +0 -0
- package/tests/demos/saints.ts +70 -0
- package/tests/demos/saints.webp +0 -0
- package/tests/flow.html +550 -239
- package/tests/fonts.css +493 -0
- package/tests/minuet.webp +0 -0
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { Beam } from './beam';
|
|
2
2
|
import { BoundingBox } from './boundingbox';
|
|
3
3
|
import { ElementStyle } from './element';
|
|
4
|
+
import { EngravingProfile } from './engravingprofile';
|
|
4
5
|
import { ModifierContextState } from './modifiercontext';
|
|
5
6
|
import { Note, NoteStruct } from './note';
|
|
6
7
|
import { NoteHead } from './notehead';
|
|
7
8
|
import { Stave } from './stave';
|
|
8
|
-
import { StemOptions } from './stem';
|
|
9
|
+
import { Stem, StemOptions } from './stem';
|
|
9
10
|
import { StemmableNote } from './stemmablenote';
|
|
10
11
|
export interface StaveNoteHeadBounds {
|
|
11
12
|
yTop: number;
|
|
@@ -32,6 +33,9 @@ export interface StaveNoteFormatSettings {
|
|
|
32
33
|
note: StaveNote;
|
|
33
34
|
}
|
|
34
35
|
export interface StaveNoteStruct extends NoteStruct {
|
|
36
|
+
/** Override the music glyph family for this note, its heads and its flag. */
|
|
37
|
+
musicFont?: string;
|
|
38
|
+
engraving?: EngravingProfile;
|
|
35
39
|
/** `Stem.UP` or `Stem.DOWN`. */
|
|
36
40
|
stemDirection?: number;
|
|
37
41
|
autoStem?: boolean;
|
|
@@ -54,9 +58,11 @@ export declare class StaveNote extends StemmableNote {
|
|
|
54
58
|
protected displaced: boolean;
|
|
55
59
|
protected dotShiftY: number;
|
|
56
60
|
protected useDefaultHeadX: boolean;
|
|
61
|
+
private extraHeadColumns;
|
|
57
62
|
protected ledgerLineStyle: ElementStyle;
|
|
58
63
|
private _noteHeads;
|
|
59
64
|
private sortedKeyProps;
|
|
65
|
+
readonly engraving?: EngravingProfile;
|
|
60
66
|
constructor(noteStruct: StaveNoteStruct);
|
|
61
67
|
reset(): this;
|
|
62
68
|
setBeam(beam: Beam): this;
|
|
@@ -65,6 +71,12 @@ export declare class StaveNote extends StemmableNote {
|
|
|
65
71
|
autoStem(): void;
|
|
66
72
|
calculateOptimalStemDirection(): number;
|
|
67
73
|
calculateKeyProps(): void;
|
|
74
|
+
/** Absolute ink of each head after formatting, independent of previous draws. */
|
|
75
|
+
getHeadInk(): BoundingBox[];
|
|
76
|
+
/** Absolute flag ink; beamed notes and rests have no flag. */
|
|
77
|
+
getFlagInk(): BoundingBox | undefined;
|
|
78
|
+
/** Resolve the rendered stem before its parent writes the drawing coordinates. */
|
|
79
|
+
getStemSegment(): ReturnType<Stem['getSegment']> | undefined;
|
|
68
80
|
getBoundingBox(includeModifiers?: boolean): BoundingBox;
|
|
69
81
|
getLineNumber(isTopNote?: boolean): number;
|
|
70
82
|
/**
|
|
@@ -132,10 +144,16 @@ export declare class StaveNote extends StemmableNote {
|
|
|
132
144
|
* Get the staff line and y value for the highest & lowest noteheads
|
|
133
145
|
* @returns {noteHeadBounds}
|
|
134
146
|
*/
|
|
135
|
-
getNoteHeadBounds(): StaveNoteHeadBounds;
|
|
147
|
+
getNoteHeadBounds(layoutX?: boolean): StaveNoteHeadBounds;
|
|
136
148
|
getNoteHeadBeginX(): number;
|
|
137
149
|
getNoteHeadEndX(): number;
|
|
138
150
|
get noteHeads(): NoteHead[];
|
|
151
|
+
/** Shared ledger segments after formatting, in renderer pixels. */
|
|
152
|
+
getLedgerLines(): {
|
|
153
|
+
x: number;
|
|
154
|
+
y: number;
|
|
155
|
+
width: number;
|
|
156
|
+
}[];
|
|
139
157
|
drawLedgerLines(): void;
|
|
140
158
|
drawModifiers(noteheadParam: NoteHead): void;
|
|
141
159
|
shouldDrawFlag(): boolean;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { BoundingBox } from './boundingbox';
|
|
1
2
|
import { Element } from './element';
|
|
2
3
|
import { Note } from './note';
|
|
3
4
|
export interface TieNotes {
|
|
@@ -55,6 +56,14 @@ export declare class StaveTie extends Element {
|
|
|
55
56
|
* @param params.firstX is specified in pixels.
|
|
56
57
|
* @param params.lastX is specified in pixels.
|
|
57
58
|
*/
|
|
59
|
+
private tieCurves;
|
|
60
|
+
private layoutRise;
|
|
61
|
+
/** Fit the tied head pairs together without changing their pitch or authored offsets. */
|
|
62
|
+
setLayoutRise(rise: number): void;
|
|
63
|
+
hasManualControls(): boolean;
|
|
64
|
+
getRouteParts(): BoundingBox[];
|
|
65
|
+
/** Conservative convex hull of filled ribbons, excluding optional tie text. */
|
|
66
|
+
getRibbonBounds(): BoundingBox;
|
|
58
67
|
renderTie(params: {
|
|
59
68
|
direction: number;
|
|
60
69
|
firstX: number;
|
|
@@ -45,14 +45,23 @@ export declare class Stem extends Element {
|
|
|
45
45
|
getExtension(): number;
|
|
46
46
|
setYBounds(yTop: number, yBottom: number): void;
|
|
47
47
|
getHeight(): number;
|
|
48
|
-
getBoundingBox(): BoundingBox;
|
|
49
48
|
getExtents(): {
|
|
50
49
|
topY: number;
|
|
51
50
|
baseY: number;
|
|
52
51
|
};
|
|
52
|
+
/** Whether this segment contributes ink. */
|
|
53
|
+
isVisible(): boolean;
|
|
53
54
|
setVisibility(isVisible: boolean): this;
|
|
54
55
|
setStemlet(isStemlet: boolean, stemletHeight: number): this;
|
|
55
56
|
adjustHeightForFlag(): void;
|
|
56
57
|
adjustHeightForBeam(): void;
|
|
58
|
+
/** Endpoints of the visible segment, including stemlets and flag shortening. */
|
|
59
|
+
getSegment(x?: number, adjustment?: number): {
|
|
60
|
+
x: number;
|
|
61
|
+
baseY: number;
|
|
62
|
+
tipY: number;
|
|
63
|
+
};
|
|
64
|
+
/** Bounds of the stroked segment. A hidden stem contributes no area. */
|
|
65
|
+
getBoundingBox(): BoundingBox;
|
|
57
66
|
draw(): void;
|
|
58
67
|
}
|
|
@@ -2,6 +2,7 @@ import { BoundingBox } from './boundingbox';
|
|
|
2
2
|
import { Element } from './element';
|
|
3
3
|
import { Factory } from './factory';
|
|
4
4
|
import { FormatParams, Formatter, FormatterOptions } from './formatter';
|
|
5
|
+
import { PhraseLayout } from './phraselayout';
|
|
5
6
|
import { RenderContext } from './rendercontext';
|
|
6
7
|
import { Stave, StaveOptions } from './stave';
|
|
7
8
|
import { StaveConnector, StaveConnectorType } from './staveconnector';
|
|
@@ -115,8 +116,14 @@ export declare class System extends Element {
|
|
|
115
116
|
* Add voices to the system with stave already assigned.
|
|
116
117
|
*/
|
|
117
118
|
addVoices(voices: Voice[]): void;
|
|
119
|
+
private phrase?;
|
|
120
|
+
/** Opt in to local phrase placement on this system and register its verses and spans. */
|
|
121
|
+
getPhraseLayout(): PhraseLayout;
|
|
118
122
|
/** Format the system. */
|
|
119
|
-
format(
|
|
123
|
+
format(row?: {
|
|
124
|
+
staffOffsets?: readonly number[];
|
|
125
|
+
endPadding?: number;
|
|
126
|
+
}): void;
|
|
120
127
|
/** Get the boundingBox. */
|
|
121
128
|
getBoundingBox(): BoundingBox;
|
|
122
129
|
/** Render the system. */
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** One drawable measure or one compressed rest, with its extra width at a row boundary. */
|
|
2
|
+
export interface BreakUnit {
|
|
3
|
+
width: number;
|
|
4
|
+
start: number;
|
|
5
|
+
end: number;
|
|
6
|
+
breakBefore?: 'force' | 'keep';
|
|
7
|
+
}
|
|
8
|
+
/** Both modes use identical reservations. An inseparable oversized group occupies a row by itself. */
|
|
9
|
+
export declare function chooseSystemBreaks(units: BreakUnit[], width: number, gap: number, indent: (first: number) => number, mode: 'balanced' | 'greedy'): number[][];
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { BoundingBox } from './boundingbox';
|
|
1
2
|
import { Element } from './element';
|
|
2
3
|
import { Note } from './note';
|
|
3
4
|
import { RenderContext } from './rendercontext';
|
|
@@ -41,5 +42,11 @@ export declare class TextBracket extends Element {
|
|
|
41
42
|
applyStyle(ctx: RenderContext): this;
|
|
42
43
|
setDashed(dashed: boolean, dash?: number[]): this;
|
|
43
44
|
setLine(line: number): this;
|
|
45
|
+
private layoutBaseline?;
|
|
46
|
+
/** Shared baseline for automatic ottava placement. */
|
|
47
|
+
setLayoutBaseline(y?: number): void;
|
|
48
|
+
private geometry;
|
|
49
|
+
/** Text, superscript, horizontal line and hook share the same placement as drawing. */
|
|
50
|
+
getBoundingBox(): BoundingBox;
|
|
44
51
|
draw(): void;
|
|
45
52
|
}
|
|
@@ -36,6 +36,11 @@ export declare class TickContext {
|
|
|
36
36
|
protected minTicks?: Fraction;
|
|
37
37
|
protected minTickable?: Tickable;
|
|
38
38
|
tContexts: TickContext[];
|
|
39
|
+
private nextAttack?;
|
|
40
|
+
/** Link musical order independently of the legacy per-voice insertion order. */
|
|
41
|
+
static linkTimeline(contexts: TickContext[]): void;
|
|
42
|
+
/** Visit only the attacks inside this beam, including interleaved voices. */
|
|
43
|
+
through(last: TickContext): Iterable<TickContext>;
|
|
39
44
|
protected preFormatted: boolean;
|
|
40
45
|
protected postFormatted: boolean;
|
|
41
46
|
protected width: number;
|
|
@@ -29,6 +29,8 @@ export declare class TimeSignature extends StaveModifier {
|
|
|
29
29
|
protected botStartX: number;
|
|
30
30
|
protected lineShift: number;
|
|
31
31
|
constructor(timeSpec?: string, customPadding?: number, validateArgs?: boolean);
|
|
32
|
+
/** Apply one family to common-time glyphs and both numeric rows, then remeasure. */
|
|
33
|
+
setMusicFont(family: string): this;
|
|
32
34
|
static getTimeSigCode(key: string, smallSig?: boolean): string;
|
|
33
35
|
/**
|
|
34
36
|
* Returns a new TimeSignatureGlyph (a Glyph subclass that knows how to draw both
|
|
@@ -71,5 +73,9 @@ export declare class TimeSignature extends StaveModifier {
|
|
|
71
73
|
*/
|
|
72
74
|
draw(): void;
|
|
73
75
|
drawAt(ctx: RenderContext, stave: Stave, x: number): void;
|
|
76
|
+
/** Compute the top row baseline for fractional and single-row numeric meters. */
|
|
77
|
+
private topBaseline;
|
|
78
|
+
/** Positioned ink before drawing, including additive meters and cut time. */
|
|
79
|
+
getInkBounds(): BoundingBox;
|
|
74
80
|
getBoundingBox(): BoundingBox;
|
|
75
81
|
}
|
|
@@ -1,50 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ## Description
|
|
3
|
-
*
|
|
4
|
-
* Create a new tuplet from the specified notes. The notes must
|
|
5
|
-
* be part of the same voice. If they are of different rhythmic
|
|
6
|
-
* values, then options.numNotes must be set.
|
|
7
|
-
*
|
|
8
|
-
* @constructor
|
|
9
|
-
* @param {Array.<VexFlow.StaveNote>} A set of notes: staveNotes,
|
|
10
|
-
* notes, etc... any class that inherits stemmableNote at some
|
|
11
|
-
* point in its prototype chain.
|
|
12
|
-
* @param options: object {
|
|
13
|
-
*
|
|
14
|
-
* numNotes: fit this many notes into...
|
|
15
|
-
* notesOccupied: ...the space of this many notes
|
|
16
|
-
*
|
|
17
|
-
* Together, these two properties make up the tuplet ratio
|
|
18
|
-
* in the form of numNotes : notesOccupied.
|
|
19
|
-
* numNotes defaults to the number of notes passed in, so
|
|
20
|
-
* it is important that if you omit this property, all of
|
|
21
|
-
* the notes passed should be of the same note value.
|
|
22
|
-
* notesOccupied defaults to 2 -- so you should almost
|
|
23
|
-
* certainly pass this parameter for anything other than
|
|
24
|
-
* a basic triplet.
|
|
25
|
-
*
|
|
26
|
-
* location:
|
|
27
|
-
* default 1, which is above the notes: ┌─── 3 ───┐
|
|
28
|
-
* -1 is below the notes └─── 3 ───┘
|
|
29
|
-
*
|
|
30
|
-
* bracketed: boolean, draw a bracket around the tuplet number
|
|
31
|
-
* when true: ┌─── 3 ───┐ when false: 3
|
|
32
|
-
* defaults to true if notes are not beamed, false otherwise
|
|
33
|
-
*
|
|
34
|
-
* ratioed: boolean
|
|
35
|
-
* when true: ┌─── 7:8 ───┐, when false: ┌─── 7 ───┐
|
|
36
|
-
* defaults to true if the difference between numNotes and
|
|
37
|
-
* notesOccupied is greater than 1.
|
|
38
|
-
*
|
|
39
|
-
* yOffset: int, default 0
|
|
40
|
-
* manually offset a tuplet, for instance to avoid collisions
|
|
41
|
-
* with articulations, etc...
|
|
42
|
-
*
|
|
43
|
-
* suffix: string
|
|
44
|
-
* suffix to show after ratio.
|
|
45
|
-
* NOTE: any of the Glyphs.met... work well for note glyphs
|
|
46
|
-
* }
|
|
47
|
-
*/
|
|
48
1
|
import { BoundingBox } from './boundingbox';
|
|
49
2
|
import { Element } from './element';
|
|
50
3
|
import { Note } from './note';
|
|
@@ -54,6 +7,8 @@ export interface TupletOptions {
|
|
|
54
7
|
notesOccupied?: number;
|
|
55
8
|
numNotes?: number;
|
|
56
9
|
ratioed?: boolean;
|
|
10
|
+
/** Engraved numerator and denominator, independent of the duration multiplier. */
|
|
11
|
+
displayRatio?: readonly [number, number];
|
|
57
12
|
yOffset?: number;
|
|
58
13
|
textYOffset?: number;
|
|
59
14
|
suffix?: string;
|
|
@@ -65,7 +20,7 @@ export declare const enum TupletLocation {
|
|
|
65
20
|
export declare class Tuplet extends Element {
|
|
66
21
|
static get CATEGORY(): string;
|
|
67
22
|
notes: Note[];
|
|
68
|
-
protected options: Required<TupletOptions>;
|
|
23
|
+
protected options: Required<Omit<TupletOptions, 'displayRatio'>> & Pick<TupletOptions, 'displayRatio'>;
|
|
69
24
|
protected textElement: Element;
|
|
70
25
|
protected suffixElement: Element;
|
|
71
26
|
static get LOCATION_TOP(): number;
|
|
@@ -93,6 +48,8 @@ export declare class Tuplet extends Element {
|
|
|
93
48
|
resolveGlyphs(): void;
|
|
94
49
|
getNestedTupletCount(): number;
|
|
95
50
|
getYPosition(): number;
|
|
51
|
+
/** Position the bracket and label from the current layout, including retained reflow. */
|
|
52
|
+
private positionElements;
|
|
96
53
|
draw(): void;
|
|
97
54
|
getBoundingBox(): BoundingBox;
|
|
98
55
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Accidental } from './accidental';
|
|
2
|
+
import { AlternatingTremolo } from './alternatingtremolo';
|
|
2
3
|
import { Annotation, AnnotationHorizontalJustify, AnnotationVerticalJustify } from './annotation';
|
|
3
4
|
import { Articulation } from './articulation';
|
|
4
5
|
import { BarNote } from './barnote';
|
|
@@ -14,10 +15,13 @@ import { Curve, CurvePosition } from './curve';
|
|
|
14
15
|
import { Dot } from './dot';
|
|
15
16
|
import { EasyScore, EasyScoreError } from './easyscore';
|
|
16
17
|
import { Element } from './element';
|
|
18
|
+
import { measureEngraving } from './engravinggeometry';
|
|
19
|
+
import { EngravingProfile } from './engravingprofile';
|
|
17
20
|
import { Factory } from './factory';
|
|
18
21
|
import { Font, FontStyle, FontWeight } from './font';
|
|
19
22
|
import { Formatter } from './formatter';
|
|
20
23
|
import { Fraction } from './fraction';
|
|
24
|
+
import { FretDiagram } from './fretdiagram';
|
|
21
25
|
import { FretHandFinger } from './frethandfinger';
|
|
22
26
|
import { GhostNote } from './ghostnote';
|
|
23
27
|
import { GlyphNote } from './glyphnote';
|
|
@@ -25,6 +29,7 @@ import { Glyphs } from './glyphs';
|
|
|
25
29
|
import { GraceNote } from './gracenote';
|
|
26
30
|
import { GraceNoteGroup } from './gracenotegroup';
|
|
27
31
|
import { GraceTabNote } from './gracetabnote';
|
|
32
|
+
import { FrettedInstrument, PercussionMap } from './instrumentprofile';
|
|
28
33
|
import { KeyManager } from './keymanager';
|
|
29
34
|
import { KeySignature } from './keysignature';
|
|
30
35
|
import { KeySigNote } from './keysignote';
|
|
@@ -32,6 +37,7 @@ import { Modifier, ModifierPosition } from './modifier';
|
|
|
32
37
|
import { ModifierContext } from './modifiercontext';
|
|
33
38
|
import { MultiMeasureRest } from './multimeasurerest';
|
|
34
39
|
import { Music } from './music';
|
|
40
|
+
import { NotationSpelling, WrittenAccidentalState } from './notationspelling';
|
|
35
41
|
import { Note } from './note';
|
|
36
42
|
import { NoteHead } from './notehead';
|
|
37
43
|
import { NoteSubGroup } from './notesubgroup';
|
|
@@ -39,10 +45,13 @@ import { Ornament } from './ornament';
|
|
|
39
45
|
import { Parenthesis } from './parenthesis';
|
|
40
46
|
import { Parser } from './parser';
|
|
41
47
|
import { PedalMarking } from './pedalmarking';
|
|
48
|
+
import { PhraseLayout } from './phraselayout';
|
|
49
|
+
import { Publication } from './publication';
|
|
42
50
|
import { Registry } from './registry';
|
|
43
51
|
import { RenderContext } from './rendercontext';
|
|
44
52
|
import { Renderer, RendererBackends, RendererLineEndType } from './renderer';
|
|
45
53
|
import { RepeatNote } from './repeatnote';
|
|
54
|
+
import { ScoreNavigation } from './scorenavigation';
|
|
46
55
|
import { Sheet } from './sheet';
|
|
47
56
|
import { Stave } from './stave';
|
|
48
57
|
import { Barline, BarlineType, RepeatBracketType } from './stavebarline';
|
|
@@ -85,6 +94,9 @@ export declare class VexFlow {
|
|
|
85
94
|
DATE: string;
|
|
86
95
|
INFO: string;
|
|
87
96
|
};
|
|
97
|
+
static measureEngraving: typeof measureEngraving;
|
|
98
|
+
static PhraseLayout: typeof PhraseLayout;
|
|
99
|
+
static EngravingProfile: typeof EngravingProfile;
|
|
88
100
|
static Accidental: typeof Accidental;
|
|
89
101
|
static Annotation: typeof Annotation;
|
|
90
102
|
static Articulation: typeof Articulation;
|
|
@@ -146,7 +158,15 @@ export declare class VexFlow {
|
|
|
146
158
|
static Stroke: typeof Stroke;
|
|
147
159
|
static SVGContext: typeof SVGContext;
|
|
148
160
|
static System: typeof System;
|
|
161
|
+
static ScoreNavigation: typeof ScoreNavigation;
|
|
149
162
|
static Sheet: typeof Sheet;
|
|
163
|
+
static FrettedInstrument: typeof FrettedInstrument;
|
|
164
|
+
static PercussionMap: typeof PercussionMap;
|
|
165
|
+
static FretDiagram: typeof FretDiagram;
|
|
166
|
+
static AlternatingTremolo: typeof AlternatingTremolo;
|
|
167
|
+
static WrittenAccidentalState: typeof WrittenAccidentalState;
|
|
168
|
+
static NotationSpelling: typeof NotationSpelling;
|
|
169
|
+
static Publication: typeof Publication;
|
|
150
170
|
static TabNote: typeof TabNote;
|
|
151
171
|
static TabSlide: typeof TabSlide;
|
|
152
172
|
static TabStave: typeof TabStave;
|
|
@@ -103,6 +103,8 @@ export declare class Voice extends Element {
|
|
|
103
103
|
/** Preformat the voice by applying the voice's stave to each note. */
|
|
104
104
|
preFormat(): this;
|
|
105
105
|
checkStave(): Stave;
|
|
106
|
+
/** Preserve per-event cross-staff assignments when drawing a continuous score. */
|
|
107
|
+
preserveStaveAssignments: boolean;
|
|
106
108
|
/**
|
|
107
109
|
* Render the voice onto the canvas `context` and an optional `stave`.
|
|
108
110
|
* If `stave` is omitted, it is expected that the notes have staves
|
package/changelog/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,28 @@
|
|
|
1
|
+
# 5.4.0
|
|
2
|
+
|
|
3
|
+
- Lay out lyrics, curves, and markings across a system. Break continuous scores into systems, then paginate full scores and individual parts for print.
|
|
4
|
+
- Add instrument profiles and playable reference scores. The guitar studies show how to lay out bends, slides, and other gestures in tablature.
|
|
5
|
+
- Expose a renderer-independent score reader for accessible navigation. Qualify web rendering in Chromium, Firefox, and WebKit.
|
|
6
|
+
- Learn VexFlow through progressive, editable examples in the [user guide](https://vexflow.com/guide/). Experiment in the [Explorer](https://vexflow.com/explorer/) or browse the [visual tests and example scores](https://vexflow.com/tests/).
|
|
7
|
+
- Read the [illustrated history of changes since VexFlow 5.0](https://vexflow.com/reports/ai2026) and the [5.4.0 code quality report](https://vexflow.com/reports/5.4.0/).
|
|
8
|
+
|
|
9
|
+
# 5.3.0
|
|
10
|
+
|
|
11
|
+
## Engraving
|
|
12
|
+
|
|
13
|
+
- Add score-local engraving profiles for SMuFL stem anchors, beam thickness, and clearance.
|
|
14
|
+
- Expose positioned glyph and beam bounds through `measureEngraving()`.
|
|
15
|
+
- Add opt-in optical spacing and contour-aware beam slopes. Improve beam clearance in multi-voice passages.
|
|
16
|
+
- Separate overlapping voices and altered unison noteheads, keeping accidentals, dots, and ledger lines with their notes.
|
|
17
|
+
- Improve grace-note spacing and slur endpoints. EasyScore can track accidentals in the order of before-graces, host notes, and after-graces.
|
|
18
|
+
- Let tuplets display a ratio independently of playback timing. Improve bracket clearance around ornaments and articulations.
|
|
19
|
+
- Correct slur opening directions and separate simultaneous guitar bends on different strings.
|
|
20
|
+
|
|
21
|
+
## Visual test gallery
|
|
22
|
+
|
|
23
|
+
- Open the gallery on a module index with nine example scores. Each score links to its live rendering and source.
|
|
24
|
+
- Load previews as readers move through the carousel. Run individual test modules from the index or the full suite at `tests/all.html`.
|
|
25
|
+
|
|
1
26
|
# 5.2.0
|
|
2
27
|
|
|
3
28
|
## EasyScore
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vexflow",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.4.0",
|
|
4
4
|
"description": "A JavaScript library for rendering music notation and guitar tablature.",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -41,7 +41,11 @@
|
|
|
41
41
|
"build/types",
|
|
42
42
|
"changelog/CHANGELOG.md",
|
|
43
43
|
"tests/flow.html",
|
|
44
|
-
"tests/
|
|
44
|
+
"tests/all.html",
|
|
45
|
+
"tests/minuet.webp",
|
|
46
|
+
"tests/demos",
|
|
47
|
+
"tests/demo_petzold_tests.ts",
|
|
48
|
+
"tests/fonts.css",
|
|
45
49
|
"tests/qunit/qunit.css",
|
|
46
50
|
"tests/qunit/qunit.js",
|
|
47
51
|
"AUTHORS.md"
|
|
@@ -101,6 +105,7 @@
|
|
|
101
105
|
"grunt-contrib-qunit": "11.0.0",
|
|
102
106
|
"grunt-eslint": "^25.0.0",
|
|
103
107
|
"grunt-webpack": "^7.0.0",
|
|
108
|
+
"istanbul-lib-instrument": "6.0.3",
|
|
104
109
|
"jsdom": "^26.1.0",
|
|
105
110
|
"jspdf": "^4.0.0",
|
|
106
111
|
"opener": "^1.5.2",
|
|
@@ -129,6 +134,7 @@
|
|
|
129
134
|
"generate:reference": "grunt generate:reference",
|
|
130
135
|
"diff:reference": "grunt diff:reference",
|
|
131
136
|
"lint": "grunt eslint",
|
|
137
|
+
"audit:ci": "node tools/audit-dependencies.mjs",
|
|
132
138
|
"explorer": "node tools/explorer/cli.mjs serve",
|
|
133
139
|
"explorer:build": "node tools/explorer/cli.mjs build",
|
|
134
140
|
"explorer:test": "node tools/explorer/test.mjs",
|
|
@@ -140,7 +146,13 @@
|
|
|
140
146
|
"guide": "node guide/cli.mjs serve",
|
|
141
147
|
"guide:build": "node guide/cli.mjs build",
|
|
142
148
|
"guide:test": "node guide/test.mjs",
|
|
143
|
-
"guide:upload": "node guide/cli.mjs upload"
|
|
149
|
+
"guide:upload": "node guide/cli.mjs upload",
|
|
150
|
+
"improvements:upload": "node tools/improvements/upload.mjs",
|
|
151
|
+
"report": "node tools/reports/cli.mjs build",
|
|
152
|
+
"report:upload": "node tools/reports/cli.mjs upload",
|
|
153
|
+
"report:release": "node tools/reports/cli.mjs release",
|
|
154
|
+
"release:github": "node tools/reports/cli.mjs github",
|
|
155
|
+
"report:test": "node --test tools/reports/report.test.mjs"
|
|
144
156
|
},
|
|
145
157
|
"homepage": "https://vexflow.com/",
|
|
146
158
|
"keywords": [
|