vexflow-native 1.7.0 → 1.9.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 +33 -348
- package/lib/module/base/FontManager.js +0 -0
- package/lib/module/base/FontManager.js.map +1 -1
- package/lib/module/base/VexflowRecordingContext.js +2 -0
- package/lib/module/base/VexflowRecordingContext.js.map +1 -1
- package/lib/module/base/index.js +1 -0
- package/lib/module/base/index.js.map +1 -1
- package/lib/module/musicxml/MusicXmlParser/MeasureParser.js +24 -7
- package/lib/module/musicxml/MusicXmlParser/MeasureParser.js.map +1 -1
- package/lib/module/musicxml/MusicXmlParser/MusicXmlDirections.js +11 -3
- package/lib/module/musicxml/MusicXmlParser/MusicXmlDirections.js.map +1 -1
- package/lib/module/musicxml/MusicXmlParser/Spanners.js +21 -5
- package/lib/module/musicxml/MusicXmlParser/Spanners.js.map +1 -1
- package/lib/module/musicxml/MusicXmlParser/mappers.js +1 -1
- package/lib/module/musicxml/MusicXmlParser/mappers.js.map +1 -1
- package/lib/module/percussion/index.js +8 -0
- package/lib/module/percussion/index.js.map +1 -0
- package/lib/module/renderer/ScoreRenderer/ScoreRenderer.js +4 -0
- package/lib/module/renderer/ScoreRenderer/ScoreRenderer.js.map +1 -1
- package/lib/module/renderer/fixedNoteSpacing.js +56 -0
- package/lib/module/renderer/fixedNoteSpacing.js.map +1 -0
- package/lib/module/renderer/index.js +1 -0
- package/lib/module/renderer/index.js.map +1 -1
- package/lib/module/renderer/itemLayout.js +108 -0
- package/lib/module/renderer/itemLayout.js.map +1 -0
- package/lib/module/renderer/measure.js +31 -102
- package/lib/module/renderer/measure.js.map +1 -1
- package/lib/module/renderer/measureBounds.js +73 -0
- package/lib/module/renderer/measureBounds.js.map +1 -0
- package/lib/module/renderer/measureModifiers.js +99 -0
- package/lib/module/renderer/measureModifiers.js.map +1 -0
- package/lib/module/renderer/noteModifiers.js +212 -0
- package/lib/module/renderer/noteModifiers.js.map +1 -0
- package/lib/module/renderer/render.js +34 -115
- package/lib/module/renderer/render.js.map +1 -1
- package/lib/module/renderer/scale.js +16 -2
- package/lib/module/renderer/scale.js.map +1 -1
- package/lib/module/renderer/scoreParsing.js +37 -188
- package/lib/module/renderer/scoreParsing.js.map +1 -1
- package/lib/module/renderer/stave.js +37 -0
- package/lib/module/renderer/stave.js.map +1 -0
- package/lib/module/renderer/useScoreRecording.js +10 -3
- package/lib/module/renderer/useScoreRecording.js.map +1 -1
- package/lib/module/renderer/vfKeys.js +72 -0
- package/lib/module/renderer/vfKeys.js.map +1 -0
- package/lib/module/state/index.js +1 -0
- package/lib/module/state/index.js.map +1 -1
- package/lib/typescript/src/base/FontManager.d.ts +7 -0
- package/lib/typescript/src/base/FontManager.d.ts.map +1 -1
- package/lib/typescript/src/base/VexflowRecordingContext.d.ts +1 -0
- package/lib/typescript/src/base/VexflowRecordingContext.d.ts.map +1 -1
- package/lib/typescript/src/base/index.d.ts +1 -0
- package/lib/typescript/src/base/index.d.ts.map +1 -1
- package/lib/typescript/src/musicxml/MusicXmlParser/InternalTypes.d.ts +4 -2
- package/lib/typescript/src/musicxml/MusicXmlParser/InternalTypes.d.ts.map +1 -1
- package/lib/typescript/src/musicxml/MusicXmlParser/MeasureParser.d.ts.map +1 -1
- package/lib/typescript/src/musicxml/MusicXmlParser/MusicXmlDirections.d.ts +6 -1
- package/lib/typescript/src/musicxml/MusicXmlParser/MusicXmlDirections.d.ts.map +1 -1
- package/lib/typescript/src/musicxml/MusicXmlParser/Spanners.d.ts +6 -1
- package/lib/typescript/src/musicxml/MusicXmlParser/Spanners.d.ts.map +1 -1
- package/lib/typescript/src/musicxml/MusicXmlParser/mappers.d.ts.map +1 -1
- package/lib/typescript/src/musicxml/index.d.ts +1 -0
- package/lib/typescript/src/musicxml/index.d.ts.map +1 -1
- package/lib/typescript/src/percussion/index.d.ts +4 -0
- package/lib/typescript/src/percussion/index.d.ts.map +1 -0
- package/lib/typescript/src/renderer/ScoreRenderer/ScoreRenderer.d.ts.map +1 -1
- package/lib/typescript/src/renderer/fixedNoteSpacing.d.ts +17 -0
- package/lib/typescript/src/renderer/fixedNoteSpacing.d.ts.map +1 -0
- package/lib/typescript/src/renderer/index.d.ts +2 -0
- package/lib/typescript/src/renderer/index.d.ts.map +1 -1
- package/lib/typescript/src/renderer/itemLayout.d.ts +23 -0
- package/lib/typescript/src/renderer/itemLayout.d.ts.map +1 -0
- package/lib/typescript/src/renderer/layout.d.ts +1 -1
- package/lib/typescript/src/renderer/layout.d.ts.map +1 -1
- package/lib/typescript/src/renderer/measure.d.ts +3 -6
- package/lib/typescript/src/renderer/measure.d.ts.map +1 -1
- package/lib/typescript/src/renderer/measureBounds.d.ts +13 -0
- package/lib/typescript/src/renderer/measureBounds.d.ts.map +1 -0
- package/lib/typescript/src/renderer/measureModifiers.d.ts +20 -0
- package/lib/typescript/src/renderer/measureModifiers.d.ts.map +1 -0
- package/lib/typescript/src/renderer/noteModifiers.d.ts +29 -0
- package/lib/typescript/src/renderer/noteModifiers.d.ts.map +1 -0
- package/lib/typescript/src/renderer/render.d.ts +2 -27
- package/lib/typescript/src/renderer/render.d.ts.map +1 -1
- package/lib/typescript/src/renderer/scale.d.ts.map +1 -1
- package/lib/typescript/src/renderer/scoreParsing.d.ts +14 -40
- package/lib/typescript/src/renderer/scoreParsing.d.ts.map +1 -1
- package/lib/typescript/src/renderer/stave.d.ts +11 -0
- package/lib/typescript/src/renderer/stave.d.ts.map +1 -0
- package/lib/typescript/src/renderer/types.d.ts +53 -4
- package/lib/typescript/src/renderer/types.d.ts.map +1 -1
- package/lib/typescript/src/renderer/useScoreRecording.d.ts +2 -2
- package/lib/typescript/src/renderer/useScoreRecording.d.ts.map +1 -1
- package/lib/typescript/src/renderer/vfKeys.d.ts +17 -0
- package/lib/typescript/src/renderer/vfKeys.d.ts.map +1 -0
- package/lib/typescript/src/state/index.d.ts +1 -0
- package/lib/typescript/src/state/index.d.ts.map +1 -1
- package/lib/typescript/src/state/types.d.ts +39 -6
- package/lib/typescript/src/state/types.d.ts.map +1 -1
- package/package.json +15 -5
- package/src/base/FontManager.ts +0 -0
- package/src/base/VexflowRecordingContext.ts +1 -0
- package/src/base/index.ts +1 -0
- package/src/musicxml/MusicXmlParser/InternalTypes.ts +5 -2
- package/src/musicxml/MusicXmlParser/MeasureParser.ts +36 -7
- package/src/musicxml/MusicXmlParser/MusicXmlDirections.ts +25 -8
- package/src/musicxml/MusicXmlParser/Spanners.ts +27 -4
- package/src/musicxml/MusicXmlParser/mappers.ts +7 -0
- package/src/musicxml/index.ts +1 -0
- package/src/percussion/index.ts +7 -0
- package/src/renderer/Layout/VerticalSpacing.ts +1 -1
- package/src/renderer/ScoreRenderer/ScoreRenderer.tsx +4 -0
- package/src/renderer/fixedNoteSpacing.ts +78 -0
- package/src/renderer/index.ts +8 -0
- package/src/renderer/itemLayout.ts +137 -0
- package/src/renderer/layout.ts +1 -1
- package/src/renderer/measure.tsx +85 -182
- package/src/renderer/measureBounds.ts +109 -0
- package/src/renderer/measureModifiers.ts +133 -0
- package/src/renderer/noteModifiers.ts +298 -0
- package/src/renderer/render.tsx +66 -171
- package/src/renderer/scale.ts +21 -1
- package/src/renderer/scoreParsing.tsx +78 -262
- package/src/renderer/stave.ts +44 -0
- package/src/renderer/types.ts +67 -4
- package/src/renderer/useScoreRecording.ts +11 -3
- package/src/renderer/vfKeys.ts +88 -0
- package/src/state/index.ts +1 -0
- package/src/state/types.ts +48 -5
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type Stave } from 'vexflow';
|
|
2
|
+
import type { Barline, KeySignature, Measure } from '../state';
|
|
3
|
+
import type { ResolvedMeasureState } from './scoreParsing';
|
|
4
|
+
export interface ResolvedMeasureModifiers {
|
|
5
|
+
showClef: boolean;
|
|
6
|
+
showMeter: boolean;
|
|
7
|
+
showKeySignature: boolean;
|
|
8
|
+
startBarline: Barline;
|
|
9
|
+
endBarline: Barline;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Resolves the tri-state measure modifiers: `true` shows, `false` hides,
|
|
13
|
+
* `undefined` falls back to the default (clef on the first measure only,
|
|
14
|
+
* meter and key signature hidden, single barlines).
|
|
15
|
+
*/
|
|
16
|
+
export declare function resolveMeasureModifiers(measure: Pick<Measure, 'leftModifiers' | 'rightModifiers'>, measureIndex: number): ResolvedMeasureModifiers;
|
|
17
|
+
export declare function applyMeasureModifiers(stave: Stave, modifiers: ResolvedMeasureModifiers, resolvedState: ResolvedMeasureState): Stave;
|
|
18
|
+
/** Major-key VexFlow spec for the key's accidentals, respelt enharmonically beyond 7 sharps/flats. */
|
|
19
|
+
export declare function keySignatureToVFSpec(keySignature: KeySignature): string;
|
|
20
|
+
//# sourceMappingURL=measureModifiers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"measureModifiers.d.ts","sourceRoot":"","sources":["../../../../src/renderer/measureModifiers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,KAAK,EAAyB,MAAM,SAAS,CAAC;AAEzE,OAAO,KAAK,EAAE,OAAO,EAAW,YAAY,EAAE,OAAO,EAAQ,MAAM,UAAU,CAAC;AAC9E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAE3D,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;IACnB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,YAAY,EAAE,OAAO,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;CACrB;AAwDD;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,eAAe,GAAG,gBAAgB,CAAC,EAC1D,YAAY,EAAE,MAAM,GACnB,wBAAwB,CAU1B;AAED,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,wBAAwB,EACnC,aAAa,EAAE,oBAAoB,GAClC,KAAK,CA+BP;AAED,sGAAsG;AACtG,wBAAgB,oBAAoB,CAAC,YAAY,EAAE,YAAY,GAAG,MAAM,CAOvE"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { StaveNote } from 'vexflow';
|
|
2
|
+
import type { StemmableNote } from 'vexflow';
|
|
3
|
+
import type { Articulation, Clef, Direction, DurationValue, NoteAttachment, Pitch } from '../state';
|
|
4
|
+
/**
|
|
5
|
+
* Maps library articulation names to VexFlow articulation codes.
|
|
6
|
+
*/
|
|
7
|
+
export declare const ARTICULATION_TO_VF_CODE: Record<Articulation, string>;
|
|
8
|
+
/** `GhostNote`s have no glyphs, so their element box is the origin. */
|
|
9
|
+
export declare function hasNoteHeads(note: StemmableNote): note is StaveNote;
|
|
10
|
+
/**
|
|
11
|
+
* Applies the requested number of augmentation dots to a note.
|
|
12
|
+
*/
|
|
13
|
+
export declare function applyDots(note: StaveNote, dots?: 0 | 1 | 2 | 3): void;
|
|
14
|
+
export declare function decorateStaveNote(note: StaveNote, pitches: readonly Pitch[], duration: DurationValue): void;
|
|
15
|
+
/** Every attachment a rest can carry: grace notes need a pitched owner. */
|
|
16
|
+
export declare function restAttachments(attachments: NoteAttachment[] | undefined): NoteAttachment[] | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Attaches the owner's marks to a VexFlow note in a fixed order regardless of
|
|
19
|
+
* the attachments' order: articulations, annotations, dynamics, lyrics (by
|
|
20
|
+
* verse), grace notes. Same-side marks stack outward in that order.
|
|
21
|
+
*/
|
|
22
|
+
export declare function applyNoteModifiers(note: StaveNote, clef: Clef, attachments: NoteAttachment[] | undefined): void;
|
|
23
|
+
/**
|
|
24
|
+
* Draws each text direction of a measure on the voice's first drawn item,
|
|
25
|
+
* after that item's own marks; a voice of spacers draws none. Tempo
|
|
26
|
+
* directions are not drawn.
|
|
27
|
+
*/
|
|
28
|
+
export declare function applyMeasureDirections(notes: readonly StemmableNote[], directions: readonly Direction[] | undefined): void;
|
|
29
|
+
//# sourceMappingURL=noteModifiers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"noteModifiers.d.ts","sourceRoot":"","sources":["../../../../src/renderer/noteModifiers.ts"],"names":[],"mappings":"AAAA,OAAO,EAUL,SAAS,EAEV,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,OAAO,KAAK,EACV,YAAY,EACZ,IAAI,EACJ,SAAS,EACT,aAAa,EAIb,cAAc,EACd,KAAK,EACN,MAAM,UAAU,CAAC;AAGlB;;GAEG;AACH,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAShE,CAAC;AA0CF,uEAAuE;AACvE,wBAAgB,YAAY,CAAC,IAAI,EAAE,aAAa,GAAG,IAAI,IAAI,SAAS,CAEnE;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,QAI9D;AAoCD,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,SAAS,EACf,OAAO,EAAE,SAAS,KAAK,EAAE,EACzB,QAAQ,EAAE,aAAa,QAKxB;AAED,2EAA2E;AAC3E,wBAAgB,eAAe,CAC7B,WAAW,EAAE,cAAc,EAAE,GAAG,SAAS,GACxC,cAAc,EAAE,GAAG,SAAS,CAE9B;AAYD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,SAAS,EACf,IAAI,EAAE,IAAI,EACV,WAAW,EAAE,cAAc,EAAE,GAAG,SAAS,QA8D1C;AAsCD;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,SAAS,aAAa,EAAE,EAC/B,UAAU,EAAE,SAAS,SAAS,EAAE,GAAG,SAAS,QAyB7C"}
|
|
@@ -1,35 +1,10 @@
|
|
|
1
|
-
import { Formatter, Stave, Voice as VFVoice } from 'vexflow';
|
|
2
1
|
import type { VexflowRecordingContext } from '../base';
|
|
3
2
|
import type { Score } from '../state';
|
|
4
3
|
import type { ScoreLayoutPlan } from './layout';
|
|
5
|
-
import type { ScoreItemsLayout, ScoreOptions } from './types';
|
|
6
|
-
import type { VFVoiceNote } from './scoreParsing';
|
|
4
|
+
import type { ScoreItemHooks, ScoreItemsLayout, ScoreOptions } from './types';
|
|
7
5
|
/**
|
|
8
6
|
* Renders the score from a precomputed layout plan and returns the formatted
|
|
9
7
|
* geometry of every rendered item and measure.
|
|
10
8
|
*/
|
|
11
|
-
export declare function renderScore(ctx: VexflowRecordingContext, score: Score, layoutPlan: ScoreLayoutPlan, options: ScoreOptions): ScoreItemsLayout;
|
|
12
|
-
/**
|
|
13
|
-
* Re-positions every tick context at its time-proportional x inside the note
|
|
14
|
-
* area, overriding the formatter's duration-weighted spacing. Runs after
|
|
15
|
-
* `formatToStave` (the same post-format `setX` mechanism the formatter's own
|
|
16
|
-
* tuning uses), so beams, tuplets and modifiers pick the final positions up
|
|
17
|
-
* at draw time. The lattice follows VexFlow's own convention for its first
|
|
18
|
-
* tick: it starts at that context's left-modifier width (`totalLeftPx`), so a
|
|
19
|
-
* grace group or accidental on beat 1 hangs inside the note area instead of
|
|
20
|
-
* over the clef. The proportional span is clamped only by that inset and the
|
|
21
|
-
* LAST context's width — with a spacer voice on the lattice the latter is
|
|
22
|
-
* constant, so the mapping stays a pure function of time and of what hangs
|
|
23
|
-
* left of beat 1.
|
|
24
|
-
*/
|
|
25
|
-
export declare function applyFixedNoteSpacing(formatter: Formatter, voices: VFVoice[], stave: Stave): void;
|
|
26
|
-
/**
|
|
27
|
-
* Center of a formatted note's visual notehead span. When the getters are
|
|
28
|
-
* missing (GhostNotes) the fallback is the center of a NOTIONAL notehead at
|
|
29
|
-
* the block's left edge, capped by the block width — so a `spacer` rest
|
|
30
|
-
* anchors where a real note's head would sit on the same tick, and external
|
|
31
|
-
* UI aligned to it does not hop when the note appears. Zero-width `hidden`
|
|
32
|
-
* rests keep anchoring at their tick x.
|
|
33
|
-
*/
|
|
34
|
-
export declare function resolveItemHeadCenterX(note: VFVoiceNote, x: number, width: number): number;
|
|
9
|
+
export declare function renderScore(ctx: VexflowRecordingContext, score: Score, layoutPlan: ScoreLayoutPlan, options: ScoreOptions, hooks?: ScoreItemHooks): ScoreItemsLayout;
|
|
35
10
|
//# sourceMappingURL=render.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../../../src/renderer/render.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../../../src/renderer/render.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AACvD,OAAO,KAAK,EAEV,KAAK,EAGN,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAGV,eAAe,EAChB,MAAM,UAAU,CAAC;AAUlB,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAG9E;;;GAGG;AACH,wBAAgB,WAAW,CACzB,GAAG,EAAE,uBAAuB,EAC5B,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,eAAe,EAC3B,OAAO,EAAE,YAAY,EACrB,KAAK,GAAE,cAAmB,GACzB,gBAAgB,CA4ClB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scale.d.ts","sourceRoot":"","sources":["../../../../src/renderer/scale.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"scale.d.ts","sourceRoot":"","sources":["../../../../src/renderer/scale.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,YAAY,EAEZ,gBAAgB,EACjB,MAAM,SAAS,CAAC;AAEjB;;;;;;GAMG;AAEH;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,CAAC,EAAE;IACvC,MAAM,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC7B,GAAG,MAAM,CAMT;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,YAAY,EACtB,KAAK,EAAE,MAAM,GACZ,YAAY,CAWd;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,GAAG,YAAY,CAS1E;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CACzC,WAAW,EAAE,gBAAgB,EAC7B,KAAK,EAAE,MAAM,GACZ,gBAAgB,CAqClB"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Beam, Fraction as VFFraction, StaveNote, Tuplet, Voice as VFVoice } from 'vexflow';
|
|
2
2
|
import type { StemmableNote } from 'vexflow';
|
|
3
|
-
import type {
|
|
3
|
+
import type { Clef, Direction, KeySignature, Meter, NoteAttachment, Score, Staff, StaffGroup, StemDirection, Tempo, TupletGroup, Voice, VoiceItem, VoiceTimingMode } from '../state';
|
|
4
|
+
import type { DecorateItem } from './types';
|
|
4
5
|
export type StaffGroupLookup = {
|
|
5
6
|
groupId: string;
|
|
6
7
|
staffGroup?: StaffGroup;
|
|
@@ -20,49 +21,21 @@ export interface MakeVFVoiceOptions {
|
|
|
20
21
|
* rebuilding it on every call.
|
|
21
22
|
*/
|
|
22
23
|
attachmentsByOwner?: Map<string, NoteAttachment[]>;
|
|
24
|
+
/** Owning staff; on a one-line staff auto stems point up. */
|
|
25
|
+
staff?: Staff;
|
|
26
|
+
/** Measure directions drawn on this voice's first drawn item. */
|
|
27
|
+
directions?: Direction[];
|
|
28
|
+
itemContext?: {
|
|
29
|
+
decorateItem: DecorateItem;
|
|
30
|
+
staff: Staff;
|
|
31
|
+
measureIndex: number;
|
|
32
|
+
};
|
|
23
33
|
}
|
|
24
|
-
|
|
25
|
-
* Maps library notehead names to VexFlow key glyph codes.
|
|
26
|
-
*/
|
|
27
|
-
export declare const NOTEHEAD_TO_VF_CODE: Record<Notehead, string>;
|
|
28
|
-
/**
|
|
29
|
-
* Maps library articulation names to VexFlow articulation codes.
|
|
30
|
-
*/
|
|
31
|
-
export declare const ARTICULATION_TO_VF_CODE: Record<Articulation, string>;
|
|
34
|
+
type ItemDecorator = (item: VoiceItem, note: StaveNote, attachments: readonly NoteAttachment[]) => void;
|
|
32
35
|
/**
|
|
33
36
|
* Maps the library stem direction to the numeric VexFlow value.
|
|
34
37
|
*/
|
|
35
38
|
export declare function toVFStemDirection(dir?: StemDirection): number | undefined;
|
|
36
|
-
/**
|
|
37
|
-
* Converts an internal pitch into the VexFlow key string format.
|
|
38
|
-
*/
|
|
39
|
-
export declare function pitchToVFKey(pitch: Pitch): string;
|
|
40
|
-
/**
|
|
41
|
-
* Converts a duration into the VexFlow duration token, including rests.
|
|
42
|
-
*/
|
|
43
|
-
export declare function durationToVF(duration: DurationValue, isRest?: boolean): string;
|
|
44
|
-
/**
|
|
45
|
-
* Applies the requested number of augmentation dots to a note.
|
|
46
|
-
*/
|
|
47
|
-
export declare function applyDots(note: StaveNote, dots?: 0 | 1 | 2 | 3): void;
|
|
48
|
-
/**
|
|
49
|
-
* Adds pitch accidentals to the matching keys in a VexFlow note.
|
|
50
|
-
*/
|
|
51
|
-
export declare function addPitchAccidentals(note: StaveNote, pitches: readonly Pitch[]): void;
|
|
52
|
-
/**
|
|
53
|
-
* Wraps each ghost pitch of a note in parentheses.
|
|
54
|
-
*/
|
|
55
|
-
export declare function applyGhostParentheses(note: StaveNote, pitches: readonly Pitch[]): void;
|
|
56
|
-
/**
|
|
57
|
-
* Draws one accent above a note whose pitches carry the `accent` flag, unless
|
|
58
|
-
* the owner already has an accent attachment.
|
|
59
|
-
*/
|
|
60
|
-
export declare function applyPitchAccent(note: StaveNote, pitches: readonly Pitch[], attachments?: NoteAttachment[]): void;
|
|
61
|
-
/**
|
|
62
|
-
* Attaches the owner's articulation and grace-note modifiers to a VexFlow
|
|
63
|
-
* note; dynamics and lyrics are drawn elsewhere.
|
|
64
|
-
*/
|
|
65
|
-
export declare function applyNoteModifiers(note: StaveNote, clef: Clef, attachments: NoteAttachment[] | undefined): void;
|
|
66
39
|
export declare function indexAttachmentsByOwner(score: Score): Map<string, NoteAttachment[]>;
|
|
67
40
|
/**
|
|
68
41
|
* Width a `spacer` rest reserves on its tick: an up-stem flagged note
|
|
@@ -78,7 +51,7 @@ export declare function noteheadWidth(): number;
|
|
|
78
51
|
/**
|
|
79
52
|
* Builds a VexFlow stave note from a score voice item and clef.
|
|
80
53
|
*/
|
|
81
|
-
export declare function voiceItemToStaveNote(item: VoiceItem, clef: Clef, attachments?: NoteAttachment[]): VFVoiceNote;
|
|
54
|
+
export declare function voiceItemToStaveNote(item: VoiceItem, clef: Clef, attachments?: NoteAttachment[], decorate?: ItemDecorator): VFVoiceNote;
|
|
82
55
|
/**
|
|
83
56
|
* Beam groups for a meter: its explicit `beamGroups`, otherwise VexFlow's
|
|
84
57
|
* conventional grouping for the time signature (quarters in x/4, dotted
|
|
@@ -114,4 +87,5 @@ export declare function buildMeasurementGroups(score: Score): StaffGroupLookup[]
|
|
|
114
87
|
* Resolves a staff group lookup into the existing ordered score staves.
|
|
115
88
|
*/
|
|
116
89
|
export declare function resolveGroupStaves(score: Score, group: StaffGroupLookup): Staff[];
|
|
90
|
+
export {};
|
|
117
91
|
//# sourceMappingURL=scoreParsing.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scoreParsing.d.ts","sourceRoot":"","sources":["../../../../src/renderer/scoreParsing.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"scoreParsing.d.ts","sourceRoot":"","sources":["../../../../src/renderer/scoreParsing.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EAEJ,QAAQ,IAAI,UAAU,EAEtB,SAAS,EAET,MAAM,EACN,KAAK,IAAI,OAAO,EACjB,MAAM,S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B,kBAAkB,CAChC,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,gBAAgB,GACtB,KAAK,EAAE,CAIT"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Stave } from 'vexflow';
|
|
2
|
+
import type { StaffLines } from '../state';
|
|
3
|
+
/**
|
|
4
|
+
* Hides the outer lines of a 5-line stave so `lines` stay visible around the
|
|
5
|
+
* middle one. Must run after construction: the constructor resets the line
|
|
6
|
+
* config.
|
|
7
|
+
*/
|
|
8
|
+
export declare function applyStaffLines(stave: Stave, lines?: StaffLines): Stave;
|
|
9
|
+
/** Stroke centre y of every drawn line of a rendered stave, top to bottom. */
|
|
10
|
+
export declare function visibleLineYs(stave: Stave, lines?: StaffLines): number[];
|
|
11
|
+
//# sourceMappingURL=stave.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stave.d.ts","sourceRoot":"","sources":["../../../../src/renderer/stave.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAe3C;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,UAAU,GAAG,KAAK,CAcvE;AAED,8EAA8E;AAC9E,wBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,UAAU,GAAG,MAAM,EAAE,CAIxE"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { SkTypefaceFontProvider } from '@shopify/react-native-skia';
|
|
2
2
|
import type { SharedValue } from 'react-native-reanimated';
|
|
3
|
+
import type { RenderContext, StaveNote } from 'vexflow';
|
|
3
4
|
import type { VexflowStyleOverride } from '../base';
|
|
4
|
-
import type { Score } from '../state';
|
|
5
|
+
import type { Clef, NoteAttachment, Score, Staff, VoiceItem } from '../state';
|
|
5
6
|
import type { ScoreColorScheme } from './colorScheme';
|
|
6
7
|
export type RendererType = 'infiniteScore' | 'document' | 'documentEven';
|
|
7
8
|
export type ScoreItemStyleOverride = VexflowStyleOverride;
|
|
@@ -40,7 +41,35 @@ export interface ScoreScrollGeometry {
|
|
|
40
41
|
contentSize: RendererSize;
|
|
41
42
|
maxScroll: number;
|
|
42
43
|
}
|
|
43
|
-
|
|
44
|
+
/** Where a voice item sits when its VexFlow note is built. */
|
|
45
|
+
export interface ScoreItemContext {
|
|
46
|
+
clef: Clef;
|
|
47
|
+
staff: Staff;
|
|
48
|
+
measureIndex: number;
|
|
49
|
+
/** For rests, the rest-eligible subset (everything but grace). */
|
|
50
|
+
attachments: readonly NoteAttachment[];
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Called once per drawable item (not hidden/spacer rests) in BOTH the
|
|
54
|
+
* measurement and the drawing pass, after the item's own attachments are
|
|
55
|
+
* applied, before measure directions and before formatting, so added
|
|
56
|
+
* modifiers count in width and vertical bounds. Must be deterministic in its
|
|
57
|
+
* inputs; `note` is rebuilt on every pass.
|
|
58
|
+
*/
|
|
59
|
+
export type DecorateItem = (item: VoiceItem, note: StaveNote, context: ScoreItemContext) => void;
|
|
60
|
+
/**
|
|
61
|
+
* Called in the drawing pass only, right after the note and its modifiers
|
|
62
|
+
* are drawn, inside the item's color group. `layout` is the item's geometry
|
|
63
|
+
* in content space — the space `ctx` draws in (VexFlow units before
|
|
64
|
+
* `render.scale`); `onItemsLayout` receives the same entry scaled to view
|
|
65
|
+
* space.
|
|
66
|
+
*/
|
|
67
|
+
export type DrawItem = (ctx: RenderContext, item: VoiceItem, note: StaveNote, layout: Readonly<ScoreItemLayout>) => void;
|
|
68
|
+
export interface ScoreItemHooks {
|
|
69
|
+
decorateItem?: DecorateItem;
|
|
70
|
+
onDrawItem?: DrawItem;
|
|
71
|
+
}
|
|
72
|
+
export interface ScoreRendererProps extends ScoreItemHooks {
|
|
44
73
|
score: Score;
|
|
45
74
|
defaultFont: string;
|
|
46
75
|
fontManager: SkTypefaceFontProvider;
|
|
@@ -144,6 +173,18 @@ export interface ScoreItemLayout {
|
|
|
144
173
|
*/
|
|
145
174
|
headCenterX: number;
|
|
146
175
|
measureIndex: number;
|
|
176
|
+
/**
|
|
177
|
+
* Union box of the item's drawn modifiers (articulations, annotations,
|
|
178
|
+
* dynamics, lyrics, grace notes, parentheses, accidentals, dots), in the
|
|
179
|
+
* same space as `x`. undefined when the item has no modifiers.
|
|
180
|
+
*/
|
|
181
|
+
modifierBounds?: ScoreItemBounds;
|
|
182
|
+
}
|
|
183
|
+
export interface ScoreItemBounds {
|
|
184
|
+
left: number;
|
|
185
|
+
right: number;
|
|
186
|
+
top: number;
|
|
187
|
+
bottom: number;
|
|
147
188
|
}
|
|
148
189
|
/**
|
|
149
190
|
* Geometry of one rendered stave of a measure. Entries of the same measure
|
|
@@ -167,10 +208,18 @@ export interface ScoreMeasureItemsLayout {
|
|
|
167
208
|
y: number;
|
|
168
209
|
/** Height of the measure's system block. */
|
|
169
210
|
height: number;
|
|
170
|
-
/** Top edge of this stave's top staff line. */
|
|
211
|
+
/** Top edge of this stave's top staff line (hidden lines included). */
|
|
171
212
|
staveLineTopY: number;
|
|
172
|
-
/** Bottom edge of this stave's bottom staff line. */
|
|
213
|
+
/** Bottom edge of this stave's bottom staff line (hidden lines included). */
|
|
173
214
|
staveLineBottomY: number;
|
|
215
|
+
/**
|
|
216
|
+
* Stroke centre y of each drawn line, top to bottom (5, 3 or 1 entries).
|
|
217
|
+
* On a five-line staff `visibleLineYs[0] === staveLineTopY` and the last
|
|
218
|
+
* entry is `staveLineBottomY - lineWidth`; with hidden lines
|
|
219
|
+
* `staveLineTopY`/`staveLineBottomY` still span the five-line geometry, so
|
|
220
|
+
* read the drawn line from here. Always emitted by the renderer.
|
|
221
|
+
*/
|
|
222
|
+
visibleLineYs?: number[];
|
|
174
223
|
}
|
|
175
224
|
/**
|
|
176
225
|
* Geometry of all rendered items keyed by item id, plus per-stave measure
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/renderer/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/renderer/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAExD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,KAAK,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC9E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEtD,MAAM,MAAM,YAAY,GAAG,eAAe,GAAG,UAAU,GAAG,cAAc,CAAC;AACzE,MAAM,MAAM,sBAAsB,GAAG,oBAAoB,CAAC;AAC1D,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAC;AAE7E;2CAC2C;AAC3C,MAAM,MAAM,UAAU,GAAG,YAAY,GAAG,UAAU,CAAC;AAEnD;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,8EAA8E;AAC9E,MAAM,WAAW,kBAAkB;IACjC,0DAA0D;IAC1D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kDAAkD;IAClD,KAAK,CAAC,EAAE,MAA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,CAAC;CAC3B;AAED,MAAM,WAAW,aAAa;IAC5B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,YAAa,SAAQ,aAAa,EAAE,YAAY;CAAG;AAEpE,MAAM,WAAW,eAAgB,SAAQ,YAAY;CAAG"}
|
|
@@ -4,7 +4,7 @@ import { type VexflowRecordingGroupIndex } from '../base/VexflowRecordingIndex';
|
|
|
4
4
|
import type { Score } from '../state';
|
|
5
5
|
import { type ScoreLayoutPlan } from './layout';
|
|
6
6
|
import type { ResolvedScoreColorScheme } from './colorScheme';
|
|
7
|
-
import type { RendererRect, RendererType, ScoreItemsLayout, ScoreOptions } from './types';
|
|
7
|
+
import type { RendererRect, RendererType, ScoreItemHooks, ScoreItemsLayout, ScoreOptions } from './types';
|
|
8
8
|
export interface ScoreRecording {
|
|
9
9
|
/** Recorded draw commands, content-space coordinates. */
|
|
10
10
|
commands: readonly VexflowRecordingCommand[];
|
|
@@ -21,7 +21,7 @@ export interface ScoreRecording {
|
|
|
21
21
|
/** Emitted geometry, already converted to view space. */
|
|
22
22
|
itemsLayout: ScoreItemsLayout;
|
|
23
23
|
}
|
|
24
|
-
export declare function useScoreRecording({ defaultFont, enabled, fontManager, colorScheme, options, rendererType, score, viewport, }: {
|
|
24
|
+
export declare function useScoreRecording({ decorateItem, defaultFont, enabled, fontManager, colorScheme, onDrawItem, options, rendererType, score, viewport, }: ScoreItemHooks & {
|
|
25
25
|
defaultFont: string;
|
|
26
26
|
enabled?: boolean;
|
|
27
27
|
fontManager: SkTypefaceFontProvider;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useScoreRecording.d.ts","sourceRoot":"","sources":["../../../../src/renderer/useScoreRecording.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE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ACZ,YAAY,EACZ,cAAc,EACd,gBAAgB,EAChB,YAAY,EACb,MAAM,SAAS,CAAC;AAEjB,MAAM,WAAW,cAAc;IAC7B,yDAAyD;IACzD,QAAQ,EAAE,SAAS,uBAAuB,EAAE,CAAC;IAC7C;;;OAGG;IACH,UAAU,EAAE,0BAA0B,CAAC;IACvC;;;OAGG;IACH,UAAU,EAAE,eAAe,CAAC;IAC5B,yDAAyD;IACzD,WAAW,EAAE,gBAAgB,CAAC;CAC/B;AAED,wBAAgB,iBAAiB,CAAC,EAChC,YAAY,EACZ,WAAW,EACX,OAAc,EACd,WAAW,EACX,WAAW,EACX,UAAU,EACV,OAAO,EACP,YAAY,EACZ,KAAK,EACL,QAAQ,GACT,EAAE,cAAc,GAAG;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,sBAAsB,CAAC;IACpC,WAAW,EAAE,wBAAwB,CAAC;IACtC,OAAO,EAAE,YAAY,CAAC;IACtB,YAAY,EAAE,YAAY,CAAC;IAC3B,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,YAAY,CAAC;CACxB,GAAG,cAAc,CAmFjB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Clef, DurationValue, Pitch, Rest } from '../state';
|
|
2
|
+
/**
|
|
3
|
+
* Converts an internal pitch into the VexFlow key string format.
|
|
4
|
+
*/
|
|
5
|
+
export declare function pitchToVFKey(pitch: Pitch): string;
|
|
6
|
+
/**
|
|
7
|
+
* VexFlow key placing a rest on `staffLine` (0 = bottom line … 4 = top line,
|
|
8
|
+
* undefined = middle line) under `clef`. VexFlow lines are pitch-based per
|
|
9
|
+
* clef, so the key is the treble pitch of the line minus the clef's shift,
|
|
10
|
+
* counting diatonic steps from c/4 (the ledger line below a treble staff).
|
|
11
|
+
*/
|
|
12
|
+
export declare function restKeyForStaffLine(clef: Clef, staffLine: Rest['staffLine']): string;
|
|
13
|
+
/**
|
|
14
|
+
* Converts a duration into the VexFlow duration token, including rests.
|
|
15
|
+
*/
|
|
16
|
+
export declare function durationToVF(duration: DurationValue, isRest?: boolean): string;
|
|
17
|
+
//# sourceMappingURL=vfKeys.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vfKeys.d.ts","sourceRoot":"","sources":["../../../../src/renderer/vfKeys.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,aAAa,EAAY,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAgB3E;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAejD;AAqBD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,IAAI,CAAC,WAAW,CAAC,GAC3B,MAAM,CAOR;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,aAAa,EAAE,MAAM,UAAQ,GAAG,MAAM,CAW5E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/state/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/state/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,cAAc,SAAS,CAAC"}
|
|
@@ -7,7 +7,7 @@ export type StemDirection = 'up' | 'down' | 'auto';
|
|
|
7
7
|
export type Notehead = 'x' | 'circle-x' | 'diamond' | 'circle' | 'square' | 'triangle' | 'triangle-down' | 'slash';
|
|
8
8
|
export type Barline = 'single' | 'double' | 'end' | 'repeat-begin' | 'repeat-end' | 'final';
|
|
9
9
|
export type Articulation = 'staccato' | 'tenuto' | 'accent' | 'marcato' | 'staccatissimo' | 'fermata' | 'open' | 'stopped';
|
|
10
|
-
export type Dynamic = 'ppp' | 'pp' | 'p' | 'mp' | 'mf' | 'f' | 'ff' | 'fff' | 'sfz';
|
|
10
|
+
export type Dynamic = 'ppp' | 'pp' | 'p' | 'mp' | 'mf' | 'f' | 'ff' | 'fff' | 'fp' | 'sf' | 'sfp' | 'sfz' | 'rf' | 'rfz' | 'fz' | 'n';
|
|
11
11
|
export type KeyMode = 'major' | 'minor' | 'dorian' | 'phrygian' | 'lydian' | 'mixolydian' | 'locrian';
|
|
12
12
|
export type VoiceTimingMode = 'strict' | 'soft' | 'free';
|
|
13
13
|
export type StaffGroupRole = 'grandStaff' | 'choir' | 'section' | 'custom';
|
|
@@ -21,9 +21,8 @@ export interface Pitch {
|
|
|
21
21
|
octave: number;
|
|
22
22
|
accidental?: Accidental;
|
|
23
23
|
notehead?: Notehead;
|
|
24
|
-
ghost
|
|
25
|
-
|
|
26
|
-
accent?: boolean;
|
|
24
|
+
/** Draws the notehead in parentheses (a ghost note). */
|
|
25
|
+
parenthesized?: boolean;
|
|
27
26
|
}
|
|
28
27
|
export interface DurationValue {
|
|
29
28
|
length: NoteLength;
|
|
@@ -37,6 +36,7 @@ export interface KeySignature {
|
|
|
37
36
|
export interface Meter {
|
|
38
37
|
beats: number;
|
|
39
38
|
beatUnit: number;
|
|
39
|
+
/** Omitted = VexFlow's default for the meter: numerators divisible by 3 group in threes, else 2/beatUnit above a quarter (5/8 → 2/8), else 1/beatUnit (5/4 → 1/4). */
|
|
40
40
|
beamGroups?: Fraction[];
|
|
41
41
|
}
|
|
42
42
|
export interface Tempo {
|
|
@@ -60,7 +60,11 @@ export interface Rest {
|
|
|
60
60
|
voiceId: Id;
|
|
61
61
|
targetStaffId?: Id;
|
|
62
62
|
kind?: 'visible' | 'spacer' | 'hidden';
|
|
63
|
-
|
|
63
|
+
/**
|
|
64
|
+
* 0 = bottom line … 4 = top line of the five-line geometry; undefined = the
|
|
65
|
+
* middle line.
|
|
66
|
+
*/
|
|
67
|
+
staffLine?: 0 | 1 | 2 | 3 | 4;
|
|
64
68
|
}
|
|
65
69
|
export interface Chord {
|
|
66
70
|
id: Id;
|
|
@@ -86,20 +90,28 @@ export interface MeasureState {
|
|
|
86
90
|
tempo?: Tempo;
|
|
87
91
|
}
|
|
88
92
|
export interface MeasureLeftModifiers {
|
|
93
|
+
/** undefined = shown on the first measure only; false hides it there too. */
|
|
89
94
|
showClef?: boolean;
|
|
95
|
+
/** undefined = hidden. */
|
|
90
96
|
showMeter?: boolean;
|
|
97
|
+
/** undefined = hidden; never drawn on a percussion clef. */
|
|
91
98
|
showKeySignature?: boolean;
|
|
99
|
+
/** undefined = 'single'; only 'single' and 'repeat-begin' render here. */
|
|
92
100
|
startBarline?: Barline;
|
|
93
101
|
}
|
|
94
102
|
export interface MeasureRightModifiers {
|
|
103
|
+
/** undefined = 'single'; 'repeat-begin' draws as a single line. */
|
|
95
104
|
endBarline?: Barline;
|
|
96
105
|
}
|
|
97
106
|
export interface TextDirection {
|
|
98
107
|
id: Id;
|
|
99
108
|
type: 'text';
|
|
100
109
|
text: string;
|
|
110
|
+
/** undefined = 'above'; drawn on the measure's first drawn item of its
|
|
111
|
+
* first voice. */
|
|
101
112
|
placement?: 'above' | 'below';
|
|
102
113
|
}
|
|
114
|
+
/** Not drawn; the tempo reaches the renderer through `MeasureState`. */
|
|
103
115
|
export interface TempoDirection {
|
|
104
116
|
id: Id;
|
|
105
117
|
type: 'tempo';
|
|
@@ -116,12 +128,19 @@ export interface Measure {
|
|
|
116
128
|
directions?: Direction[];
|
|
117
129
|
voices: Voice[];
|
|
118
130
|
}
|
|
131
|
+
export type StaffLines = 1 | 3 | 5;
|
|
119
132
|
export interface Staff {
|
|
120
133
|
id: Id;
|
|
121
134
|
name?: string;
|
|
122
135
|
shortName?: string;
|
|
123
136
|
order: number;
|
|
124
137
|
defaultClef: Clef;
|
|
138
|
+
/**
|
|
139
|
+
* Visible staff lines (default 5). Fewer lines hide the outer lines
|
|
140
|
+
* symmetrically around the middle one while notes keep the 5-line pitch
|
|
141
|
+
* geometry, so a one-line staff's line is `ONE_LINE_STAFF_PITCH`.
|
|
142
|
+
*/
|
|
143
|
+
lines?: StaffLines;
|
|
125
144
|
transposition?: number;
|
|
126
145
|
measures: Measure[];
|
|
127
146
|
}
|
|
@@ -151,18 +170,32 @@ export interface AttachmentBase {
|
|
|
151
170
|
export interface ArticulationAttachment extends AttachmentBase {
|
|
152
171
|
type: 'articulation';
|
|
153
172
|
articulation: Articulation;
|
|
173
|
+
/** undefined = 'above'. */
|
|
154
174
|
placement?: 'above' | 'below';
|
|
175
|
+
/** Chord pitches the mark belongs to, as indices into `Chord.pitches`;
|
|
176
|
+
* undefined = the whole owner. Engraved once per owner either way; indices
|
|
177
|
+
* on a `note` owner or out of range are tolerated and ignored. */
|
|
178
|
+
pitchIndices?: number[];
|
|
155
179
|
}
|
|
156
180
|
export interface DynamicAttachment extends AttachmentBase {
|
|
157
181
|
type: 'dynamic';
|
|
158
182
|
dynamic: Dynamic;
|
|
183
|
+
/** undefined = 'below'. */
|
|
159
184
|
placement?: 'above' | 'below';
|
|
160
185
|
}
|
|
161
186
|
export interface LyricAttachment extends AttachmentBase {
|
|
162
187
|
type: 'lyric';
|
|
163
188
|
text: string;
|
|
189
|
+
/** Verse order below the owner, ascending; undefined sorts first. */
|
|
164
190
|
verse?: number;
|
|
165
191
|
}
|
|
192
|
+
/** Free text drawn above or below the owner (a note, chord or rest), e.g. a
|
|
193
|
+
* sticking letter or a fingering. */
|
|
194
|
+
export interface AnnotationAttachment extends AttachmentBase {
|
|
195
|
+
type: 'annotation';
|
|
196
|
+
text: string;
|
|
197
|
+
placement?: 'above' | 'below';
|
|
198
|
+
}
|
|
166
199
|
export interface GraceNote {
|
|
167
200
|
pitch: Pitch;
|
|
168
201
|
duration: DurationValue;
|
|
@@ -174,7 +207,7 @@ export interface GraceNoteAttachment extends AttachmentBase {
|
|
|
174
207
|
/** Acciaccatura slash through the (first) stem. */
|
|
175
208
|
slash?: boolean;
|
|
176
209
|
}
|
|
177
|
-
export type NoteAttachment = ArticulationAttachment | DynamicAttachment | LyricAttachment | GraceNoteAttachment;
|
|
210
|
+
export type NoteAttachment = ArticulationAttachment | DynamicAttachment | LyricAttachment | AnnotationAttachment | GraceNoteAttachment;
|
|
178
211
|
export interface Tie {
|
|
179
212
|
id: Id;
|
|
180
213
|
fromNoteId: Id;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/state/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,EAAE,GAAG,MAAM,CAAC;AAExB,MAAM,MAAM,IAAI,GACZ,QAAQ,GACR,MAAM,GACN,MAAM,GACN,OAAO,GACP,SAAS,GACT,eAAe,GACf,YAAY,GACZ,YAAY,GACZ,SAAS,GACT,QAAQ,GACR,YAAY,GACZ,KAAK,CAAC;AAEV,MAAM,MAAM,IAAI,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;AAE3D,MAAM,MAAM,UAAU,GAClB,IAAI,GACJ,GAAG,GACH,GAAG,GACH,GAAG,GACH,IAAI,GACJ,GAAG,GACH,cAAc,GACd,eAAe,CAAC;AAEpB,MAAM,MAAM,UAAU,GAClB,MAAM,GACN,OAAO,GACP,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,KAAK,CAAC;AAEV,MAAM,MAAM,aAAa,GAAG,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC;AAEnD,MAAM,MAAM,QAAQ,GAChB,GAAG,GACH,UAAU,GACV,SAAS,GACT,QAAQ,GACR,QAAQ,GACR,UAAU,GACV,eAAe,GACf,OAAO,CAAC;AAEZ,MAAM,MAAM,OAAO,GACf,QAAQ,GACR,QAAQ,GACR,KAAK,GACL,cAAc,GACd,YAAY,GACZ,OAAO,CAAC;AAEZ,MAAM,MAAM,YAAY,GAC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CAAC;IACP,OAAO,EAAE,EAAE,CAAC;IACZ,OAAO,EAAE,EAAE,EAAE,CAAC;IACd,KAAK,EAAE,QAAQ,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;CAC/B;AAED,MAAM,WAAW,KAAK;IACpB,EAAE,EAAE,EAAE,CAAC;IACP,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,QAAQ,EAAE,aAAa,CAAC;IACxB,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,WAAW,CAAC,EAAE,UAAU,EAAE,CAAC;IAC3B,WAAW,CAAC,EAAE,cAAc,EAAE,CAAC;IAC/B,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;IACb,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf,OAAO,CAAC,EAAE,WAAW,EAAE,CAAC;CACzB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vexflow-native",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.0",
|
|
4
4
|
"description": "React native backend for rendering music notation using @shopify/react-native-skia",
|
|
5
5
|
"main": "./lib/module/base/index.js",
|
|
6
6
|
"types": "./lib/typescript/src/base/index.d.ts",
|
|
@@ -25,6 +25,11 @@
|
|
|
25
25
|
"types": "./lib/typescript/src/musicxml/index.d.ts",
|
|
26
26
|
"default": "./lib/module/musicxml/index.js"
|
|
27
27
|
},
|
|
28
|
+
"./percussion": {
|
|
29
|
+
"source": "./src/percussion/index.ts",
|
|
30
|
+
"types": "./lib/typescript/src/percussion/index.d.ts",
|
|
31
|
+
"default": "./lib/module/percussion/index.js"
|
|
32
|
+
},
|
|
28
33
|
"./package.json": "./package.json"
|
|
29
34
|
},
|
|
30
35
|
"files": [
|
|
@@ -49,8 +54,9 @@
|
|
|
49
54
|
"typecheck": "tsc",
|
|
50
55
|
"lint": "eslint src example --ext .js,.ts,.tsx",
|
|
51
56
|
"lint:fix": "yarn lint --fix",
|
|
52
|
-
"format": "prettier --write README.md package.json \"src/**/*.{ts,tsx}\"",
|
|
57
|
+
"format": "prettier --write README.md package.json \"docs/*.md\" \"src/**/*.{ts,tsx}\"",
|
|
53
58
|
"test": "jest",
|
|
59
|
+
"docs:api": "typedoc",
|
|
54
60
|
"release": "release-it --only-version"
|
|
55
61
|
},
|
|
56
62
|
"keywords": [
|
|
@@ -98,6 +104,7 @@
|
|
|
98
104
|
"react-native-worklets": "^0.7.4",
|
|
99
105
|
"release-it": "^19.0.4",
|
|
100
106
|
"turbo": "^2.5.6",
|
|
107
|
+
"typedoc": "0.28.20",
|
|
101
108
|
"typescript": "^5.9.2",
|
|
102
109
|
"vexflow": "^5.0.0"
|
|
103
110
|
},
|
|
@@ -113,7 +120,7 @@
|
|
|
113
120
|
"workspaces": [
|
|
114
121
|
"example"
|
|
115
122
|
],
|
|
116
|
-
"packageManager": "yarn@4.
|
|
123
|
+
"packageManager": "yarn@4.18.0",
|
|
117
124
|
"react-native-builder-bob": {
|
|
118
125
|
"source": "src",
|
|
119
126
|
"output": "lib",
|
|
@@ -141,6 +148,9 @@
|
|
|
141
148
|
},
|
|
142
149
|
"jest": {
|
|
143
150
|
"preset": "react-native",
|
|
151
|
+
"testMatch": [
|
|
152
|
+
"**/__tests__/**/*.test.[jt]s?(x)"
|
|
153
|
+
],
|
|
144
154
|
"modulePathIgnorePatterns": [
|
|
145
155
|
"<rootDir>/example/node_modules",
|
|
146
156
|
"<rootDir>/lib/",
|
|
@@ -162,10 +172,10 @@
|
|
|
162
172
|
"tagName": "v${version}"
|
|
163
173
|
},
|
|
164
174
|
"npm": {
|
|
165
|
-
"publish":
|
|
175
|
+
"publish": false
|
|
166
176
|
},
|
|
167
177
|
"github": {
|
|
168
|
-
"release":
|
|
178
|
+
"release": false
|
|
169
179
|
},
|
|
170
180
|
"plugins": {
|
|
171
181
|
"@release-it/conventional-changelog": {
|
package/src/base/FontManager.ts
CHANGED
|
Binary file
|