vexflow 5.1.2 → 5.3.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 +7 -6
- package/build/cjs/vexflow-bravura.js +2 -2
- package/build/cjs/vexflow-bravura.js.map +1 -1
- package/build/cjs/vexflow-core.js +2 -2
- package/build/cjs/vexflow-core.js.map +1 -1
- package/build/cjs/vexflow-debug-with-tests.js +5325 -1730
- package/build/cjs/vexflow-debug-with-tests.js.map +1 -1
- package/build/cjs/vexflow-debug.js +4228 -1545
- 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 +13 -3
- package/build/esm/src/articulation.js +51 -20
- package/build/esm/src/beam.js +170 -30
- package/build/esm/src/bend.js +24 -19
- package/build/esm/src/clef.js +3 -0
- package/build/esm/src/clefnote.js +5 -1
- package/build/esm/src/curve.js +27 -53
- package/build/esm/src/dot.js +14 -5
- package/build/esm/src/easyscore/composition.js +336 -0
- package/build/esm/src/easyscore/elementindex.js +81 -0
- package/build/esm/src/easyscore/elements.js +324 -0
- package/build/esm/src/easyscore/policies.js +97 -0
- package/build/esm/src/easyscore/rhythm.js +42 -0
- package/build/esm/src/easyscore.js +448 -26
- package/build/esm/src/element.js +17 -2
- package/build/esm/src/engravinggeometry.js +150 -0
- package/build/esm/src/engravingprofile.js +44 -0
- package/build/esm/src/factory.js +268 -64
- package/build/esm/src/formatter.js +40 -4
- package/build/esm/src/gracenote.js +43 -38
- package/build/esm/src/gracenotegroup.js +53 -56
- package/build/esm/src/index.js +2 -0
- package/build/esm/src/keysignature.js +10 -2
- package/build/esm/src/keysignote.js +2 -2
- package/build/esm/src/modifiercontext.js +11 -0
- package/build/esm/src/note.js +5 -0
- package/build/esm/src/notehead.js +11 -6
- package/build/esm/src/ornament.js +38 -18
- package/build/esm/src/parenthesis.js +1 -1
- package/build/esm/src/parser.js +6 -1
- package/build/esm/src/proportionalformatter.js +234 -0
- package/build/esm/src/registry.js +27 -0
- package/build/esm/src/sheet.js +20 -3
- package/build/esm/src/stave.js +9 -2
- package/build/esm/src/stavenote.js +140 -127
- package/build/esm/src/stavetie.js +39 -7
- package/build/esm/src/stem.js +26 -11
- package/build/esm/src/stemmablenote.js +6 -1
- package/build/esm/src/tickable.js +5 -0
- package/build/esm/src/tickcontext.js +19 -0
- package/build/esm/src/timesignature.js +5 -0
- package/build/esm/src/tuplet.js +60 -19
- package/build/esm/src/version.js +3 -3
- package/build/esm/src/vexflow.js +6 -1
- package/build/esm/tests/beam_tests.js +35 -0
- 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/easyscore_tests.js +40 -0
- package/build/esm/tests/easyscore_types.js +65 -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/studies.mjs +279 -0
- package/build/esm/tests/formatter_tests.js +51 -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/easyscore-rendering-tests.mjs +332 -0
- package/build/esm/tests/node/easyscore-tests.mjs +1024 -0
- package/build/esm/tests/node/engraving-layout-tests.mjs +449 -0
- package/build/esm/tests/node/local-engraving-tests.mjs +128 -0
- package/build/esm/tests/node/proportional-spacing-tests.mjs +278 -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-api-audit.mjs +58 -0
- package/build/esm/tools/easyscore-composition.mjs +62 -0
- package/build/esm/tools/easyscore-example.mjs +16 -0
- package/build/esm/tools/easyscore-families.mjs +61 -0
- package/build/esm/tools/easyscore-references-example.mjs +26 -0
- package/build/esm/tools/easyscore-rhythm.mjs +58 -0
- package/build/esm/tools/easyscore-structure.mjs +88 -0
- package/build/esm/tools/explorer/catalog/entries.mjs +6 -0
- package/build/esm/tools/explorer/catalog/expression.mjs +68 -0
- package/build/esm/tools/explorer/catalog/helpers.mjs +29 -0
- package/build/esm/tools/explorer/catalog/layout.mjs +109 -0
- package/build/esm/tools/explorer/catalog/notes.mjs +61 -0
- package/build/esm/tools/explorer/catalog/staves.mjs +85 -0
- package/build/esm/tools/explorer/catalog/strings.mjs +25 -0
- package/build/esm/tools/explorer/catalog.mjs +14 -0
- package/build/esm/tools/score-fixtures.mjs +23 -6
- package/build/types/src/accidental.d.ts +6 -0
- package/build/types/src/articulation.d.ts +12 -1
- package/build/types/src/beam.d.ts +16 -0
- package/build/types/src/clef.d.ts +2 -0
- package/build/types/src/curve.d.ts +9 -0
- package/build/types/src/dot.d.ts +5 -0
- package/build/types/src/easyscore/composition.d.ts +126 -0
- package/build/types/src/easyscore/elementindex.d.ts +30 -0
- package/build/types/src/easyscore/elements.d.ts +156 -0
- package/build/types/src/easyscore/policies.d.ts +12 -0
- package/build/types/src/easyscore/rhythm.d.ts +9 -0
- package/build/types/src/easyscore.d.ts +153 -11
- package/build/types/src/element.d.ts +7 -1
- 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 +97 -9
- package/build/types/src/formatter.d.ts +7 -1
- package/build/types/src/gracenote.d.ts +7 -0
- package/build/types/src/gracenotegroup.d.ts +7 -2
- package/build/types/src/index.d.ts +2 -0
- package/build/types/src/keysignature.d.ts +3 -0
- package/build/types/src/keysignote.d.ts +1 -1
- package/build/types/src/modifiercontext.d.ts +4 -0
- package/build/types/src/note.d.ts +2 -0
- package/build/types/src/notehead.d.ts +5 -0
- package/build/types/src/ornament.d.ts +7 -0
- package/build/types/src/parser.d.ts +5 -0
- package/build/types/src/proportionalformatter.d.ts +39 -0
- package/build/types/src/registry.d.ts +4 -0
- package/build/types/src/stave.d.ts +2 -0
- package/build/types/src/stavenote.d.ts +21 -3
- package/build/types/src/stavetie.d.ts +4 -0
- package/build/types/src/stem.d.ts +10 -1
- package/build/types/src/stemmablenote.d.ts +6 -1
- package/build/types/src/tickable.d.ts +2 -0
- package/build/types/src/tickcontext.d.ts +5 -0
- package/build/types/src/timesignature.d.ts +2 -0
- package/build/types/src/tuplet.d.ts +5 -48
- package/build/types/src/vexflow.d.ts +6 -1
- package/changelog/CHANGELOG.md +52 -0
- package/package.json +13 -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
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { example as e, number, select, setup, staff } from './helpers.mjs';
|
|
2
|
+
const group = 'Strings & tablature';
|
|
3
|
+
function tab(modifications = '', after = '') {
|
|
4
|
+
return `${setup}
|
|
5
|
+
const notes = [3, 5, 7, 8].map(fret => factory.TabNote({ positions: [{ str: params.string ?? 2, fret }], duration: 'q' }));
|
|
6
|
+
${modifications}
|
|
7
|
+
const stave = factory.TabStave({ x: 30, y: 60, width: width - 60 }).addClef('tab');
|
|
8
|
+
const voice = factory.Voice().setStave(stave).addTickables(notes);
|
|
9
|
+
// Align the voice to the available space between the stave margins.
|
|
10
|
+
factory.Formatter().joinVoices([voice]).formatToStave([voice], stave);
|
|
11
|
+
factory.draw();
|
|
12
|
+
${after ? '\n// Draw the connection after the fret positions have been calculated.\n' + after : ''}`.trim();
|
|
13
|
+
}
|
|
14
|
+
export const strings = [
|
|
15
|
+
e('tablature', 'Tablature', group, 'Render fret numbers on a six-string tablature staff.', 'TabNote TabStave', tab(), [number('string', 'String', 2, 1, 6)]),
|
|
16
|
+
e('bends', 'Bends', group, 'Bend a string up to a target pitch, then release it.', 'Bend', tab("notes[0].addModifier(new VF.Bend([{ type: VF.Bend.UP, text: 'Full' }, { type: VF.Bend.DOWN, text: '' }]), 0);")),
|
|
17
|
+
e('vibrato', 'Vibrato', group, 'Attach a vibrato mark to a tablature note and adjust its width.', 'Vibrato', tab('notes[1].addModifier(new VF.Vibrato().setVibratoWidth(params.length), 0);'), [number('length', 'Wave length', 45, 15, 90)]),
|
|
18
|
+
e('tab-slides', 'Tab slides', group, 'Connect frets with an ascending slide.', 'TabSlide', tab('', `new VF.TabSlide({ firstNote: notes[0], lastNote: notes[1], firstIndexes: [0], lastIndexes: [0] }, 1)
|
|
19
|
+
.setContext(factory.getContext()).setStyle({ strokeStyle: ink }).drawWithStyle();`)),
|
|
20
|
+
e('tab-ties', 'Hammer-ons & pull-offs', group, 'Label a tablature tie as a hammer-on or pull-off.', 'TabTie', tab('', `new VF.TabTie({ firstNote: notes[0], lastNote: notes[1], firstIndexes: [0], lastIndexes: [0] }, params.label)
|
|
21
|
+
.setContext(factory.getContext()).setStyle({ fillStyle: ink, strokeStyle: ink }).drawWithStyle();`), [select('label', 'Gesture', 'H', ['H', 'P'])]),
|
|
22
|
+
e('grace-tab', 'Grace tablature', group, 'Lead into a fretted note with a small grace-note group.', 'GraceTabNote GraceNoteGroup', tab("const grace = new VF.GraceTabNote({ positions: [{ str: 2, fret: 2 }], duration: '8' });\nnotes[0].addModifier(new VF.GraceNoteGroup([grace], true), 0);")),
|
|
23
|
+
e('string-numbers', 'String numbers', group, 'Circled string numbers sit beside pitches on a conventional staff.', 'StringNumber', staff("score.notes('C5/q, D5, E5, G5')", "notes.forEach((note, i) => note.addModifier(factory.StringNumber({ number: String(i + 1), position: 'above' }), 0));")),
|
|
24
|
+
e('strokes', 'Arpeggios & brush strokes', group, 'Spread the notes of a chord with a directional stroke.', 'Stroke', staff("score.notes('(C4 E4 G4 C5)/h, (D4 F4 A4 D5)')", 'notes.forEach(note => note.addModifier(new VF.Stroke(params.type), 0));'), [select('type', 'Stroke type', 3, [1, 2, 3, 4, 5, 6])]),
|
|
25
|
+
];
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { entries } from './catalog/entries.mjs';
|
|
2
|
+
export const groups = [
|
|
3
|
+
'Notes & rhythm',
|
|
4
|
+
'Staves & structure',
|
|
5
|
+
'Marks & expression',
|
|
6
|
+
'Strings & tablature',
|
|
7
|
+
'Layout & composition',
|
|
8
|
+
];
|
|
9
|
+
export const examples = [...entries].sort((a, b) => groups.indexOf(a.group) - groups.indexOf(b.group));
|
|
10
|
+
export const defaults = (example) => Object.fromEntries(example.controls.map((control) => [control.key, control.value]));
|
|
11
|
+
export const searchExamples = (query) => {
|
|
12
|
+
const words = query.toLowerCase().trim().split(/\s+/);
|
|
13
|
+
return examples.filter((example) => words.every((word) => `${example.title} ${example.group} ${example.description} ${example.api.join(' ')}`.toLowerCase().includes(word)));
|
|
14
|
+
};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
export const scoreKinds = ['chorale', 'piano', 'chamber', 'lead-sheet', 'percussion', 'tab'];
|
|
1
2
|
export function renderScore({ kind = 'chorale', systems = 4, containerId = 'score' } = {}) {
|
|
2
3
|
var _a;
|
|
3
4
|
const VF = globalThis.VexFlow;
|
|
4
5
|
document.documentElement.style.cssText = 'background:white;color:black;color-scheme:light';
|
|
5
6
|
const container = document.getElementById(containerId);
|
|
6
7
|
container.replaceChildren();
|
|
7
|
-
const
|
|
8
|
+
const singleStaff = ['lead-sheet', 'percussion', 'tab'].includes(kind);
|
|
9
|
+
const staffCount = singleStaff ? 1 : kind === 'chamber' ? 3 : 2;
|
|
8
10
|
const systemHeight = staffCount * 150 + 40;
|
|
9
11
|
const renderer = new VF.Renderer(container, VF.Renderer.Backends.SVG);
|
|
10
12
|
renderer.resize(1100, systems * systemHeight);
|
|
@@ -16,8 +18,13 @@ export function renderScore({ kind = 'chorale', systems = 4, containerId = 'scor
|
|
|
16
18
|
for (let system = 0; system < systems; system++) {
|
|
17
19
|
for (let bar = 0; bar < 4; bar++) {
|
|
18
20
|
for (let staff = 0; staff < staffCount; staff++) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
let clef = !singleStaff && staff === staffCount - 1 ? 'bass' : 'treble';
|
|
22
|
+
if (kind === 'percussion')
|
|
23
|
+
clef = 'percussion';
|
|
24
|
+
if (kind === 'tab')
|
|
25
|
+
clef = 'tab';
|
|
26
|
+
const Staff = kind === 'tab' ? VF.TabStave : VF.Stave;
|
|
27
|
+
const stave = new Staff(15 + bar * 267, system * systemHeight + staff * 150 + 35, 267);
|
|
21
28
|
if (bar === 0)
|
|
22
29
|
stave.addClef(clef).addTimeSignature('4/4');
|
|
23
30
|
const voices = [];
|
|
@@ -25,11 +32,21 @@ export function renderScore({ kind = 'chorale', systems = 4, containerId = 'scor
|
|
|
25
32
|
const tuplets = [];
|
|
26
33
|
const ties = [];
|
|
27
34
|
const notes = [];
|
|
28
|
-
const count = kind === 'chorale' ? 4 : kind === '
|
|
35
|
+
const count = kind === 'chorale' ? 4 : kind === 'chamber' ? 12 : 8;
|
|
29
36
|
for (let beat = 0; beat < count; beat++) {
|
|
30
37
|
const key = clef === 'bass' ? ['c/3', 'g/2', 'a/2', 'f/2'][(bar + beat) % 4] : melody[(bar + beat) % 8];
|
|
31
38
|
const keys = kind === 'piano' && staff === 1 ? [key, 'e/3', 'g/3'] : [key];
|
|
32
|
-
|
|
39
|
+
let note;
|
|
40
|
+
if (kind === 'tab') {
|
|
41
|
+
note = new VF.TabNote({ positions: [{ str: 1 + (beat % 3), fret: (beat + bar) % 8 }], duration: '8' }, true);
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
const pitches = kind === 'percussion' ? (beat % 2 ? ['g/5/x2'] : ['c/5', 'g/5/x2']) : keys;
|
|
45
|
+
note = new VF.StaveNote({ keys: pitches, clef, duration: count === 4 ? 'q' : '8', stemDirection: 1 });
|
|
46
|
+
}
|
|
47
|
+
if (kind === 'lead-sheet' && beat === 0) {
|
|
48
|
+
note.addModifier(new VF.ChordSymbol().addText(['Cmaj7', 'Am7', 'Dm7', 'G7'][bar]), 0);
|
|
49
|
+
}
|
|
33
50
|
if (kind === 'chorale' && staff === 0) {
|
|
34
51
|
const lyric = new VF.Annotation(['Sing', 'with', 'gentle', 'voices'][beat]).setVerticalJustification(VF.Annotation.VerticalJustify.BOTTOM);
|
|
35
52
|
(_a = lyric.setTextBaseline) === null || _a === void 0 ? void 0 : _a.call(lyric, system * systemHeight + 162);
|
|
@@ -44,7 +61,7 @@ export function renderScore({ kind = 'chorale', systems = 4, containerId = 'scor
|
|
|
44
61
|
}
|
|
45
62
|
notes[0].addModifier(new VF.Ornament('tr'), 0);
|
|
46
63
|
}
|
|
47
|
-
else if (kind === 'piano') {
|
|
64
|
+
else if (kind === 'piano' || singleStaff) {
|
|
48
65
|
for (let i = 0; i < notes.length; i += 4)
|
|
49
66
|
beams.push(new VF.Beam(notes.slice(i, i + 4)));
|
|
50
67
|
}
|
|
@@ -54,7 +54,13 @@ export declare class Accidental extends Modifier {
|
|
|
54
54
|
setNote(note: Note): this;
|
|
55
55
|
/** If called, draws parenthesis around accidental. */
|
|
56
56
|
setAsCautionary(): this;
|
|
57
|
+
/** Identify explicit cautionary signs without inspecting protected engraving state. */
|
|
58
|
+
isCautionary(): boolean;
|
|
57
59
|
/** Render accidental onto canvas. */
|
|
60
|
+
/** Place the glyph using the same coordinates for measurement and drawing. */
|
|
61
|
+
private positionGlyph;
|
|
62
|
+
/** Visible glyph after formatting, including cautionary or authored shifts. */
|
|
63
|
+
getInkBounds(): import("./boundingbox").BoundingBox;
|
|
58
64
|
draw(): void;
|
|
59
65
|
}
|
|
60
66
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { BoundingBox } from './boundingbox';
|
|
1
2
|
import { Builder } from './easyscore';
|
|
2
3
|
import { Modifier } from './modifier';
|
|
3
4
|
import { ModifierContextState } from './modifiercontext';
|
|
@@ -58,6 +59,12 @@ export declare class Articulation extends Modifier {
|
|
|
58
59
|
* is far from this ideal.
|
|
59
60
|
*/
|
|
60
61
|
static format(articulations: Articulation[], state: ModifierContextState): boolean;
|
|
62
|
+
/** Resolve EasyScore aliases, native codes, or named SMuFL glyphs without constructing a modifier. */
|
|
63
|
+
static parseEasyScore(articulations: string): {
|
|
64
|
+
type: string;
|
|
65
|
+
position?: number;
|
|
66
|
+
}[];
|
|
67
|
+
/** Attach validated EasyScore articulations once, after note construction. */
|
|
61
68
|
static easyScoreHook({ articulations }: {
|
|
62
69
|
articulations: string;
|
|
63
70
|
}, note: StemmableNote, builder: Builder): void;
|
|
@@ -70,9 +77,13 @@ export declare class Articulation extends Modifier {
|
|
|
70
77
|
* - Odd codes will be positioned BELOW
|
|
71
78
|
*/
|
|
72
79
|
constructor(type: string);
|
|
80
|
+
private betweenLinesOverride?;
|
|
73
81
|
protected reset(): void;
|
|
74
82
|
/** Set if articulation should be rendered between lines. */
|
|
75
83
|
setBetweenLines(betweenLines?: boolean): this;
|
|
76
|
-
/**
|
|
84
|
+
/** Resolve the glyph origin after its owner and modifier context have been formatted. */
|
|
85
|
+
private getPlacement;
|
|
86
|
+
/** Get visible glyph ink without mutating its alignment or drawing coordinates. */
|
|
87
|
+
getInkBounds(): BoundingBox;
|
|
77
88
|
draw(): void;
|
|
78
89
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { BoundingBox } from './boundingbox';
|
|
1
2
|
import { Element } from './element';
|
|
2
3
|
import { Fraction } from './fraction';
|
|
3
4
|
import { RenderContext } from './rendercontext';
|
|
@@ -18,6 +19,8 @@ export declare class Beam extends Element {
|
|
|
18
19
|
beamWidth: number;
|
|
19
20
|
maxSlope: number;
|
|
20
21
|
minSlope: number;
|
|
22
|
+
/** Keep automatic slope in the endpoint contour and align level in-staff beams to a half-space. */
|
|
23
|
+
contourSlope?: boolean;
|
|
21
24
|
slopeIterations: number;
|
|
22
25
|
slopeCost: number;
|
|
23
26
|
stemletExtension: number;
|
|
@@ -30,6 +33,9 @@ export declare class Beam extends Element {
|
|
|
30
33
|
private readonly _stemDirection;
|
|
31
34
|
private readonly _ticks;
|
|
32
35
|
protected yShift: number;
|
|
36
|
+
/** Derived extensions must be removed before formatting the next width. */
|
|
37
|
+
private fittedStems;
|
|
38
|
+
private flatOffset?;
|
|
33
39
|
private breakOnIndexes;
|
|
34
40
|
private _beamCount;
|
|
35
41
|
private unbeamable?;
|
|
@@ -86,6 +92,8 @@ export declare class Beam extends Element {
|
|
|
86
92
|
secondaryBreaks?: string;
|
|
87
93
|
showStemlets?: boolean;
|
|
88
94
|
maintainStemDirections?: boolean;
|
|
95
|
+
/** Optional facade policy. Omitted preserves the native generator's historical behavior. */
|
|
96
|
+
stemPolicy?: 'auto' | 'explicit' | 'preserve';
|
|
89
97
|
beamMiddleOnly?: boolean;
|
|
90
98
|
beamRests?: boolean;
|
|
91
99
|
groups?: Fraction[];
|
|
@@ -126,6 +134,8 @@ export declare class Beam extends Element {
|
|
|
126
134
|
getSlopeY(x: number, firstX: number, firstY: number, slope: number): number;
|
|
127
135
|
/** Calculate the best possible slope for the provided notes. */
|
|
128
136
|
calculateSlope(): void;
|
|
137
|
+
/** Shorten stems together when a beam cuts through an outer voice at or between attacks. */
|
|
138
|
+
private clearOtherVoiceHeads;
|
|
129
139
|
/** Calculate a slope and y-shift for flat beams. */
|
|
130
140
|
calculateFlatSlope(): void;
|
|
131
141
|
/** Return the Beam y offset. */
|
|
@@ -144,7 +154,13 @@ export declare class Beam extends Element {
|
|
|
144
154
|
}[];
|
|
145
155
|
/** Render the stems for each note. */
|
|
146
156
|
protected drawStems(ctx: RenderContext): void;
|
|
157
|
+
/** Each filled strip has two sloping edges separated by a signed thickness. */
|
|
158
|
+
private getStrips;
|
|
159
|
+
/** Bounds of the beam strips alone. The note geometry owns the stem segments. */
|
|
160
|
+
getBoundingBox(): BoundingBox;
|
|
147
161
|
protected drawBeamLines(ctx: RenderContext): void;
|
|
162
|
+
/** Release only the adjustments from the last fit. Preserve intervening native edits. */
|
|
163
|
+
resetLayout(): void;
|
|
148
164
|
/** Pre-format the beam. */
|
|
149
165
|
preFormat(): this;
|
|
150
166
|
/**
|
|
@@ -27,6 +27,8 @@ export declare class Clef extends StaveModifier {
|
|
|
27
27
|
}>;
|
|
28
28
|
/** Create a new clef. */
|
|
29
29
|
constructor(type: string, size?: string, annotation?: string);
|
|
30
|
+
/** Return the named clef so staff attachments can retain musical state. */
|
|
31
|
+
getType(): string;
|
|
30
32
|
/** Set clef type, size and annotation. */
|
|
31
33
|
setType(type: string, size?: string, annotation?: string): this;
|
|
32
34
|
/** Get point for clefs. */
|
|
@@ -15,6 +15,10 @@ export interface CurveOptions {
|
|
|
15
15
|
invert?: boolean;
|
|
16
16
|
openingDirection?: 'up' | 'down' | 'auto';
|
|
17
17
|
}
|
|
18
|
+
type Point = {
|
|
19
|
+
x: number;
|
|
20
|
+
y: number;
|
|
21
|
+
};
|
|
18
22
|
interface CurveRenderParams {
|
|
19
23
|
firstX: number;
|
|
20
24
|
firstY: number;
|
|
@@ -54,6 +58,11 @@ export declare class Curve extends Element {
|
|
|
54
58
|
* The box is exact: it is fitted to the extrema of the bezier curves, not to their control points.
|
|
55
59
|
*/
|
|
56
60
|
getBoundingBox(): BoundingBox;
|
|
61
|
+
/** Endpoints on the rendered curve after authored shifts. */
|
|
62
|
+
getAnchors(): {
|
|
63
|
+
start: Point;
|
|
64
|
+
end: Point;
|
|
65
|
+
};
|
|
57
66
|
draw(): boolean;
|
|
58
67
|
}
|
|
59
68
|
export {};
|
package/build/types/src/dot.d.ts
CHANGED
|
@@ -14,6 +14,11 @@ export declare class Dot extends Modifier {
|
|
|
14
14
|
static format(dots: Dot[], state: ModifierContextState): boolean;
|
|
15
15
|
constructor();
|
|
16
16
|
setNote(note: Note): this;
|
|
17
|
+
private restShiftY;
|
|
17
18
|
setDotShiftY(y: number): this;
|
|
19
|
+
/** Place the glyph using the same coordinates for measurement and drawing. */
|
|
20
|
+
private positionGlyph;
|
|
21
|
+
/** Visible glyph after formatting, including cautionary or authored shifts. */
|
|
22
|
+
getInkBounds(): import("./boundingbox").BoundingBox;
|
|
18
23
|
draw(): void;
|
|
19
24
|
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import type { EasyScore, EasyScoreVoiceOptions } from '../easyscore';
|
|
2
|
+
import type { Element } from '../element';
|
|
3
|
+
import { Factory } from '../factory';
|
|
4
|
+
import { GraceNoteStruct } from '../gracenote';
|
|
5
|
+
import { Note } from '../note';
|
|
6
|
+
import { Sheet, SheetOptions } from '../sheet';
|
|
7
|
+
import { Stave, StaveOptions } from '../stave';
|
|
8
|
+
import { StaveNoteStruct } from '../stavenote';
|
|
9
|
+
import { System, SystemOptions } from '../system';
|
|
10
|
+
import { TabNoteStruct } from '../tabnote';
|
|
11
|
+
import { Tickable } from '../tickable';
|
|
12
|
+
import { TupletOptions } from '../tuplet';
|
|
13
|
+
import { Voice, VoiceTime } from '../voice';
|
|
14
|
+
import { EasyScoreAutoBeamOptions } from './rhythm';
|
|
15
|
+
/** Written pitches stay literal, even when a key signature is displayed. */
|
|
16
|
+
export interface EasyScoreStaffState {
|
|
17
|
+
clef?: string;
|
|
18
|
+
key?: string;
|
|
19
|
+
time?: string;
|
|
20
|
+
}
|
|
21
|
+
/** Explicit signs survive key-aware generation, including cautionaries and microtones. */
|
|
22
|
+
interface GracePitchSpec extends GraceNoteStruct {
|
|
23
|
+
accidentals?: readonly {
|
|
24
|
+
index: number;
|
|
25
|
+
type: string;
|
|
26
|
+
cautionary?: boolean;
|
|
27
|
+
}[];
|
|
28
|
+
}
|
|
29
|
+
interface GraceGroupSpec {
|
|
30
|
+
side: 'before' | 'after';
|
|
31
|
+
notes: readonly GracePitchSpec[];
|
|
32
|
+
slur?: boolean;
|
|
33
|
+
beam?: boolean;
|
|
34
|
+
}
|
|
35
|
+
/** Typed wrappers add IDs and cross-staff assignment without changing native note fields. */
|
|
36
|
+
export type EasyScoreContent = string | StaveNoteStruct | Tickable | {
|
|
37
|
+
note: StaveNoteStruct;
|
|
38
|
+
id?: string;
|
|
39
|
+
stave?: string;
|
|
40
|
+
grace?: GraceGroupSpec;
|
|
41
|
+
} | {
|
|
42
|
+
tab: TabNoteStruct;
|
|
43
|
+
id?: string;
|
|
44
|
+
stave?: string;
|
|
45
|
+
drawStem?: boolean;
|
|
46
|
+
} | {
|
|
47
|
+
change: EasyScoreStaffState;
|
|
48
|
+
};
|
|
49
|
+
/** Tuplet indexes count timed notes, excluding inline signatures and barlines. */
|
|
50
|
+
export interface EasyScoreVoiceSpec {
|
|
51
|
+
notes: string | readonly EasyScoreContent[];
|
|
52
|
+
stem?: 'auto' | 'up' | 'down';
|
|
53
|
+
options?: Omit<EasyScoreVoiceOptions, 'time' | 'mode'>;
|
|
54
|
+
tuplets?: readonly {
|
|
55
|
+
start: number;
|
|
56
|
+
count: number;
|
|
57
|
+
options?: TupletOptions;
|
|
58
|
+
}[];
|
|
59
|
+
autoBeam?: boolean | EasyScoreAutoBeamOptions;
|
|
60
|
+
}
|
|
61
|
+
/** span is the actual duration of a pickup; time remains its displayed meter. */
|
|
62
|
+
export interface EasyScoreMeasureSpec extends EasyScoreStaffState {
|
|
63
|
+
voices: readonly EasyScoreVoiceSpec[];
|
|
64
|
+
span?: VoiceTime | string;
|
|
65
|
+
}
|
|
66
|
+
/** Staves have aligned measure arrays. Missing or uneven measures are errors. */
|
|
67
|
+
export interface EasyScoreStaveSpec extends EasyScoreStaffState {
|
|
68
|
+
id: string;
|
|
69
|
+
kind?: 'stave' | 'tab';
|
|
70
|
+
options?: StaveOptions;
|
|
71
|
+
spaceAbove?: number;
|
|
72
|
+
spaceBelow?: number;
|
|
73
|
+
measures: readonly EasyScoreMeasureSpec[];
|
|
74
|
+
}
|
|
75
|
+
/** IDs resolve only after all notes exist. Native handles remain available afterward. */
|
|
76
|
+
export type EasyScoreSpanSpec = {
|
|
77
|
+
kind: 'tie';
|
|
78
|
+
from?: string;
|
|
79
|
+
to?: string;
|
|
80
|
+
firstIndexes?: number[];
|
|
81
|
+
lastIndexes?: number[];
|
|
82
|
+
text?: string;
|
|
83
|
+
} | {
|
|
84
|
+
kind: 'curve';
|
|
85
|
+
from?: string;
|
|
86
|
+
to?: string;
|
|
87
|
+
options?: Parameters<Factory['Curve']>[0]['options'];
|
|
88
|
+
} | {
|
|
89
|
+
kind: 'hairpin';
|
|
90
|
+
from: string;
|
|
91
|
+
to: string;
|
|
92
|
+
type: number;
|
|
93
|
+
options?: Parameters<Factory['StaveHairpin']>[0]['options'];
|
|
94
|
+
};
|
|
95
|
+
/** Layout policies are explicit. Sheet does not split spans or repeat signatures at row starts. */
|
|
96
|
+
export interface EasyScoreCompositionSpec {
|
|
97
|
+
staves: readonly EasyScoreStaveSpec[];
|
|
98
|
+
sheet?: Omit<SheetOptions, 'factory'>;
|
|
99
|
+
system?: Omit<SystemOptions, 'factory' | 'width' | 'autoWidth' | 'noJustification'>;
|
|
100
|
+
accidentals?: 'literal' | 'key-aware';
|
|
101
|
+
/** Include written grace pitches in key-aware state at their host onset. */
|
|
102
|
+
graceAccidentals?: 'explicit' | 'ordered';
|
|
103
|
+
signatures?: 'changes' | 'every-measure';
|
|
104
|
+
spans?: readonly EasyScoreSpanSpec[];
|
|
105
|
+
crossMeasureSpans?: 'reject' | 'manual';
|
|
106
|
+
}
|
|
107
|
+
/** Structured warnings identify deliberate native layout limitations. */
|
|
108
|
+
export interface EasyScoreCompositionDiagnostic {
|
|
109
|
+
code: 'ManualSpan' | 'SignaturePolicy';
|
|
110
|
+
message: string;
|
|
111
|
+
}
|
|
112
|
+
/** Arrays are measure-first, then stave, then voice. Layout remains mutable through native objects. */
|
|
113
|
+
export interface EasyScoreComposition {
|
|
114
|
+
sheet: Sheet;
|
|
115
|
+
systems: System[];
|
|
116
|
+
staves: Stave[][];
|
|
117
|
+
voices: Voice[][][];
|
|
118
|
+
notes: Tickable[][][][];
|
|
119
|
+
spans: Element[];
|
|
120
|
+
diagnostics: EasyScoreCompositionDiagnostic[];
|
|
121
|
+
getElement: (id: string) => Element | undefined;
|
|
122
|
+
getNote: (id: string) => Note;
|
|
123
|
+
}
|
|
124
|
+
/** Compose aligned measure arrays atomically. Formatting and drawing remain explicit native operations. */
|
|
125
|
+
export declare function compose(score: EasyScore, spec: EasyScoreCompositionSpec): EasyScoreComposition;
|
|
126
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { EasyScoreSourceSpan } from '../easyscore';
|
|
2
|
+
import type { Element } from '../element';
|
|
3
|
+
/** Original notation input and its UTF-16, end-exclusive range. Measures are one-based. */
|
|
4
|
+
export interface EasyScoreSource extends EasyScoreSourceSpan {
|
|
5
|
+
input: string;
|
|
6
|
+
measure?: number;
|
|
7
|
+
}
|
|
8
|
+
/** One index per EasyScore. Weak provenance also lets visual debuggers inspect an element directly. */
|
|
9
|
+
export declare class EasyScoreReferences {
|
|
10
|
+
private static sources;
|
|
11
|
+
private ids;
|
|
12
|
+
private entries;
|
|
13
|
+
private scopes;
|
|
14
|
+
/** Return a copy so tools cannot change the stored source range. */
|
|
15
|
+
static sourceOf(element: Element): EasyScoreSource | undefined;
|
|
16
|
+
/** Missing IDs are ordinary lookup misses, including after reset. */
|
|
17
|
+
get(id: string): Element | undefined;
|
|
18
|
+
/** Only members of this score have instance-local source metadata. */
|
|
19
|
+
getSource(element: Element): EasyScoreSource | undefined;
|
|
20
|
+
/** Reject empty or duplicate IDs before registration or native ID mutation. */
|
|
21
|
+
private validate;
|
|
22
|
+
/** Repeated registration is harmless. Native ID changes keep the index synchronized. */
|
|
23
|
+
add<T extends Element>(element: T, source?: EasyScoreSource): T;
|
|
24
|
+
/** Release exactly this score's subscription and provenance. */
|
|
25
|
+
private remove;
|
|
26
|
+
/** Preserve references across draw(); reset explicitly ends the editing session. */
|
|
27
|
+
clear(): void;
|
|
28
|
+
/** Nested failed construction releases subscriptions as well as visible references. */
|
|
29
|
+
transaction<T>(build: () => T): T;
|
|
30
|
+
}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { Articulation } from '../articulation';
|
|
2
|
+
import type { Element } from '../element';
|
|
3
|
+
import type { Factory } from '../factory';
|
|
4
|
+
import { Note } from '../note';
|
|
5
|
+
import { StaveNote, StaveNoteStruct } from '../stavenote';
|
|
6
|
+
import { StemmableNote } from '../stemmablenote';
|
|
7
|
+
import { TabNote, TabNoteStruct } from '../tabnote';
|
|
8
|
+
import type { TupletOptions } from '../tuplet';
|
|
9
|
+
/** Tab relationships narrow native note endpoints while preserving partial spans and chord indexes. */
|
|
10
|
+
export interface EasyScoreTabSpan extends Omit<Parameters<Factory['TabTie']>[0], 'firstNote' | 'lastNote'> {
|
|
11
|
+
firstNote?: TabNote | null;
|
|
12
|
+
lastNote?: TabNote | null;
|
|
13
|
+
}
|
|
14
|
+
/** Internal bridge avoids a runtime import cycle back to the facade. */
|
|
15
|
+
export interface EasyScoreElementHost {
|
|
16
|
+
factory: () => Factory;
|
|
17
|
+
manage: <T extends Element>(construct: () => T) => T;
|
|
18
|
+
owned: (element: Element) => void;
|
|
19
|
+
checkIndex: (note: Note, index: number) => void;
|
|
20
|
+
noteDefaults: () => Partial<StaveNoteStruct>;
|
|
21
|
+
beamStems: (notes: StemmableNote[]) => boolean;
|
|
22
|
+
}
|
|
23
|
+
/** Explicit methods keep native constructor signatures visible in editor completion. */
|
|
24
|
+
export declare class EasyScoreElements {
|
|
25
|
+
private host;
|
|
26
|
+
constructor(host: EasyScoreElementHost);
|
|
27
|
+
private get factory();
|
|
28
|
+
/** Construct a native Stave; attach staff modifiers with attachToStave(). */
|
|
29
|
+
stave(...args: Parameters<Factory['Stave']>): import("..").Stave;
|
|
30
|
+
/** Construct a native TabStave; attach staff modifiers with attachToStave(). */
|
|
31
|
+
tabStave(...args: Parameters<Factory['TabStave']>): import("..").TabStave;
|
|
32
|
+
/** Construct a native GlyphNote; attach staff modifiers with attachToStave(). */
|
|
33
|
+
glyphNote(...args: Parameters<Factory['GlyphNote']>): import("..").GlyphNote;
|
|
34
|
+
/** Construct a native RepeatNote; attach staff modifiers with attachToStave(). */
|
|
35
|
+
repeatNote(...args: Parameters<Factory['RepeatNote']>): import("..").RepeatNote;
|
|
36
|
+
/** Construct a native BarNote; attach staff modifiers with attachToStave(). */
|
|
37
|
+
barNote(...args: Parameters<Factory['BarNote']>): import("..").BarNote;
|
|
38
|
+
/** Construct a native ClefNote; attach staff modifiers with attachToStave(). */
|
|
39
|
+
clefNote(...args: Parameters<Factory['ClefNote']>): import("..").ClefNote;
|
|
40
|
+
/** Construct a native KeySigNote; attach staff modifiers with attachToStave(). */
|
|
41
|
+
keySigNote(...args: Parameters<Factory['KeySigNote']>): import("..").KeySigNote;
|
|
42
|
+
/** Construct a native TimeSigNote; attach staff modifiers with attachToStave(). */
|
|
43
|
+
timeSigNote(...args: Parameters<Factory['TimeSigNote']>): import("..").TimeSigNote;
|
|
44
|
+
/** Construct a native Clef; attach staff modifiers with attachToStave(). */
|
|
45
|
+
clef(...args: Parameters<Factory['Clef']>): import("..").Clef;
|
|
46
|
+
/** Construct a native KeySignature; attach staff modifiers with attachToStave(). */
|
|
47
|
+
keySignature(...args: Parameters<Factory['KeySignature']>): import("..").KeySignature;
|
|
48
|
+
/** Construct a native TimeSignature; attach staff modifiers with attachToStave(). */
|
|
49
|
+
timeSignature(...args: Parameters<Factory['TimeSignature']>): import("..").TimeSignature;
|
|
50
|
+
/** Construct a native Barline; attach staff modifiers with attachToStave(). */
|
|
51
|
+
barline(...args: Parameters<Factory['Barline']>): import("..").Barline;
|
|
52
|
+
/** Construct a native Repetition; attach staff modifiers with attachToStave(). */
|
|
53
|
+
repetition(...args: Parameters<Factory['Repetition']>): import("..").Repetition;
|
|
54
|
+
/** Construct a native Volta; attach staff modifiers with attachToStave(). */
|
|
55
|
+
volta(...args: Parameters<Factory['Volta']>): import("..").Volta;
|
|
56
|
+
/** Construct a native StaveSection; attach staff modifiers with attachToStave(). */
|
|
57
|
+
section(...args: Parameters<Factory['StaveSection']>): import("..").StaveSection;
|
|
58
|
+
/** Construct a native StaveTempo; attach staff modifiers with attachToStave(). */
|
|
59
|
+
tempo(...args: Parameters<Factory['StaveTempo']>): import("..").StaveTempo;
|
|
60
|
+
/** Construct a native StaveText; attach staff modifiers with attachToStave(). */
|
|
61
|
+
staveText(...args: Parameters<Factory['StaveText']>): import("..").StaveText;
|
|
62
|
+
/** Preserve native fret text and arbitrary string counts; reject invalid positions early. */
|
|
63
|
+
private tabPositions;
|
|
64
|
+
/** Construct tablature with all native note fields. */
|
|
65
|
+
tabNote(options: TabNoteStruct, drawStem?: boolean): TabNote;
|
|
66
|
+
/** Grace tablature shares the same group ownership as pitched grace notes. */
|
|
67
|
+
graceTabNote(options: TabNoteStruct): import("..").GraceTabNote;
|
|
68
|
+
/** Preserve the complete native bend phrase, including custom widths. */
|
|
69
|
+
bend(...args: Parameters<Factory['Bend']>): import("..").Bend;
|
|
70
|
+
/** Validate tab endpoint types and head indexes before native span construction. */
|
|
71
|
+
private tabEndpoints;
|
|
72
|
+
/** Tab ties support native hammer-on/pull-off text and explicit partial endpoints. */
|
|
73
|
+
tabTie(...args: [notes: EasyScoreTabSpan, text?: string]): import("..").TabTie;
|
|
74
|
+
/** A partial slide needs an explicit direction; there are not two frets to compare. */
|
|
75
|
+
tabSlide(...args: [notes: EasyScoreTabSpan, direction?: number]): import("..").TabSlide;
|
|
76
|
+
/** Connect owned staves without introducing another layout owner. */
|
|
77
|
+
connector(params: Parameters<Factory['StaveConnector']>[0]): import("..").StaveConnector;
|
|
78
|
+
/** Multi-measure rests are standalone drawables; set their stave explicitly. */
|
|
79
|
+
multiMeasureRest(params: Parameters<Factory['MultiMeasureRest']>[0]): import("..").MultiMeasureRest;
|
|
80
|
+
/** Typed notes inherit score clef/stem defaults; explicit native fields win. */
|
|
81
|
+
note(options: StaveNoteStruct): StaveNote;
|
|
82
|
+
/** Construct a native Annotation; its options and setters remain available. */
|
|
83
|
+
annotation(...args: Parameters<Factory['Annotation']>): import("..").Annotation;
|
|
84
|
+
/** Construct a native GhostNote; its options and setters remain available. */
|
|
85
|
+
ghostNote(...args: Parameters<Factory['GhostNote']>): import("..").GhostNote;
|
|
86
|
+
/** Construct a native GraceNote; its options and setters remain available. */
|
|
87
|
+
graceNote(options: Parameters<Factory['GraceNote']>[0]): import("..").GraceNote;
|
|
88
|
+
/** Construct a native Accidental; its options and setters remain available. */
|
|
89
|
+
accidental(...args: Parameters<Factory['Accidental']>): import("..").Accidental;
|
|
90
|
+
/** Construct a native Articulation; its options and setters remain available. */
|
|
91
|
+
articulation(options?: Parameters<Factory['Articulation']>[0]): Articulation;
|
|
92
|
+
/** Construct a native Ornament; its options and setters remain available. */
|
|
93
|
+
ornament(...args: Parameters<Factory['Ornament']>): import("..").Ornament;
|
|
94
|
+
/** Construct a native Dot; its options and setters remain available. */
|
|
95
|
+
dot(...args: Parameters<Factory['Dot']>): import("..").Dot;
|
|
96
|
+
/** Construct a native Parenthesis; its options and setters remain available. */
|
|
97
|
+
parenthesis(...args: Parameters<Factory['Parenthesis']>): import("..").Parenthesis;
|
|
98
|
+
/** Construct a native Stroke; its options and setters remain available. */
|
|
99
|
+
stroke(...args: Parameters<Factory['Stroke']>): import("..").Stroke;
|
|
100
|
+
/** Construct a native Tremolo; its options and setters remain available. */
|
|
101
|
+
tremolo(...args: Parameters<Factory['Tremolo']>): import("..").Tremolo;
|
|
102
|
+
/** Construct a native Vibrato; its options and setters remain available. */
|
|
103
|
+
vibrato(...args: Parameters<Factory['Vibrato']>): import("..").Vibrato;
|
|
104
|
+
/** Construct a native ChordSymbol; its options and setters remain available. */
|
|
105
|
+
chordSymbol(...args: Parameters<Factory['ChordSymbol']>): import("..").ChordSymbol;
|
|
106
|
+
/** Construct a native TextNote; its options and setters remain available. */
|
|
107
|
+
textNote(...args: Parameters<Factory['TextNote']>): import("..").TextNote;
|
|
108
|
+
/** Construct a native Fingering; its options and setters remain available. */
|
|
109
|
+
fingering(...args: Parameters<Factory['Fingering']>): import("..").FretHandFinger;
|
|
110
|
+
/** Construct a native StringNumber; its options and setters remain available. */
|
|
111
|
+
stringNumber(...args: Parameters<Factory['StringNumber']>): import("..").StringNumber;
|
|
112
|
+
/** Grace children are owned by one modifier and are removed from the standalone draw queue. */
|
|
113
|
+
graceNoteGroup(options: Parameters<Factory['GraceNoteGroup']>[0]): import("..").GraceNoteGroup;
|
|
114
|
+
/** Group inline notation or other subnotes before inserting the parent into a voice. */
|
|
115
|
+
noteSubGroup(options: {
|
|
116
|
+
notes: Note[];
|
|
117
|
+
}): import("..").NoteSubGroup;
|
|
118
|
+
/** Ties validate ownership and chord-head indexes before construction. */
|
|
119
|
+
tie(options: Parameters<Factory['StaveTie']>[0]): import("..").StaveTie;
|
|
120
|
+
/** Validate complete or explicitly partial spans before native constructors run. */
|
|
121
|
+
private endpoints;
|
|
122
|
+
/** Return a beam handle while preserving EasyScore's automatic/explicit stem policy. */
|
|
123
|
+
beam(params: Parameters<Factory['Beam']>[0]): import("..").Beam;
|
|
124
|
+
/** Reject non-integer and out-of-range note indices before native mutation. */
|
|
125
|
+
private noteIndex;
|
|
126
|
+
/** Tuplets change rational timing before voice insertion. Nested tuplets retain native behavior. */
|
|
127
|
+
tuplet(params: {
|
|
128
|
+
notes: Note[];
|
|
129
|
+
options?: TupletOptions;
|
|
130
|
+
}): import("../tuplet").Tuplet;
|
|
131
|
+
/** Native curves support explicit partial spans at stave boundaries. */
|
|
132
|
+
curve(params: {
|
|
133
|
+
from?: Note;
|
|
134
|
+
to?: Note;
|
|
135
|
+
options?: Parameters<Factory['Curve']>[0]['options'];
|
|
136
|
+
}): import("..").Curve;
|
|
137
|
+
/** Hairpins require two endpoints; native render offsets remain editable. */
|
|
138
|
+
hairpin(params: Parameters<Factory['StaveHairpin']>[0]): import("..").StaveHairpin;
|
|
139
|
+
/** Lines require two staff-note endpoints and matched chord-head indexes. */
|
|
140
|
+
line(params: Parameters<Factory['StaveLine']>[0]): import("..").StaveLine;
|
|
141
|
+
/** Text brackets have two complete endpoints; use explicit segments at row breaks. */
|
|
142
|
+
textBracket(params: Parameters<Factory['TextBracket']>[0]): import("..").TextBracket;
|
|
143
|
+
/** Vibrato brackets accept native partial endpoints. */
|
|
144
|
+
vibratoBracket(params: Parameters<Factory['VibratoBracket']>[0]): import("..").VibratoBracket;
|
|
145
|
+
/** Pedal points are explicit ordered staff-note events, including repeated depress/release points. */
|
|
146
|
+
pedalMarking(params: {
|
|
147
|
+
notes: StaveNote[];
|
|
148
|
+
options?: {
|
|
149
|
+
style: 'text' | 'bracket' | 'mixed';
|
|
150
|
+
};
|
|
151
|
+
}): import("..").PedalMarking;
|
|
152
|
+
/** Timed dynamics retain all native text-note fields. */
|
|
153
|
+
textDynamics(params?: Parameters<Factory['TextDynamics']>[0]): import("..").TextDynamics;
|
|
154
|
+
/** Timed crescendo notes expose their native direction and height setters. */
|
|
155
|
+
crescendo(...args: Parameters<Factory['Crescendo']>): import("..").Crescendo;
|
|
156
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Accidental } from '../accidental';
|
|
2
|
+
import type { EasyScore } from '../easyscore';
|
|
3
|
+
import { Fraction } from '../fraction';
|
|
4
|
+
import { Stave } from '../stave';
|
|
5
|
+
import { Voice } from '../voice';
|
|
6
|
+
/** Inline signature changes use exact tick onsets shared by all voices on a stave. */
|
|
7
|
+
export interface KeyChange {
|
|
8
|
+
at: Fraction;
|
|
9
|
+
key: string;
|
|
10
|
+
}
|
|
11
|
+
/** Each onset is evaluated against one prior state, so voice ordering cannot change accidental output. */
|
|
12
|
+
export declare function applyCompositionAccidentals(score: EasyScore, voices: Voice[], key: string, changes: KeyChange[], generated: Set<Accidental>, stave: Stave, includeGrace?: boolean): void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Beam } from '../beam';
|
|
2
|
+
import type { EasyScore } from '../easyscore';
|
|
3
|
+
import { StemmableNote } from '../stemmablenote';
|
|
4
|
+
/** Native grouping/render options, with the same stem override used by EasyScore.beam(). */
|
|
5
|
+
export type EasyScoreAutoBeamOptions = Omit<NonNullable<Parameters<typeof Beam.generateBeams>[1]>, 'stemPolicy'> & {
|
|
6
|
+
autoStem?: boolean;
|
|
7
|
+
};
|
|
8
|
+
/** Validate every setting before native grouping mutates existing notes or tuplets. */
|
|
9
|
+
export declare function autoBeam(score: EasyScore, notes: StemmableNote[], options: EasyScoreAutoBeamOptions): Beam[];
|