vexflow 4.0.1-beta.1 → 4.0.1-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/vexflow-bravura.js +2 -2
- package/build/cjs/vexflow-bravura.js.map +1 -1
- package/build/cjs/vexflow-core.js +2 -2
- package/build/cjs/vexflow-core.js.map +1 -1
- package/build/cjs/vexflow-debug-with-tests.js +92 -24
- package/build/cjs/vexflow-debug-with-tests.js.map +1 -1
- package/build/cjs/vexflow-debug.js +38 -16
- package/build/cjs/vexflow-debug.js.map +1 -1
- package/build/cjs/vexflow-font-gonville.js +1 -1
- package/build/cjs/vexflow-font-gonville.js.map +1 -1
- package/build/cjs/vexflow-gonville.js +2 -2
- package/build/cjs/vexflow-gonville.js.map +1 -1
- package/build/cjs/vexflow-petaluma.js +2 -2
- package/build/cjs/vexflow-petaluma.js.map +1 -1
- package/build/cjs/vexflow.js +2 -2
- package/build/cjs/vexflow.js.map +1 -1
- package/build/esm/entry/vexflow-bravura.js +11 -0
- package/build/esm/entry/vexflow-core.js +54 -0
- package/build/esm/entry/vexflow-debug-with-tests.js +4 -0
- package/build/esm/entry/vexflow-debug.js +3 -0
- package/build/esm/entry/vexflow-font-bravura.js +7 -0
- package/build/esm/entry/vexflow-font-custom.js +7 -0
- package/build/esm/entry/vexflow-font-gonville.js +7 -0
- package/build/esm/entry/vexflow-font-petaluma.js +7 -0
- package/build/esm/entry/vexflow-gonville.js +11 -0
- package/build/esm/entry/vexflow-petaluma.js +11 -0
- package/build/esm/entry/vexflow.js +9 -0
- package/build/esm/src/accidental.js +348 -0
- package/build/esm/src/annotation.js +232 -0
- package/build/esm/src/articulation.js +267 -0
- package/build/esm/src/barnote.js +58 -0
- package/build/esm/src/beam.js +632 -0
- package/build/esm/src/bend.js +202 -0
- package/build/esm/src/boundingbox.js +59 -0
- package/build/esm/src/boundingboxcomputation.js +107 -0
- package/build/esm/src/canvascontext.js +202 -0
- package/build/esm/src/chordsymbol.js +578 -0
- package/build/esm/src/clef.js +153 -0
- package/build/esm/src/clefnote.js +65 -0
- package/build/esm/src/crescendo.js +77 -0
- package/build/esm/src/curve.js +118 -0
- package/build/esm/src/dot.js +137 -0
- package/build/esm/src/easyscore.js +374 -0
- package/build/esm/src/element.js +216 -0
- package/build/esm/src/factory.js +440 -0
- package/build/esm/src/flow.js +275 -0
- package/build/esm/src/font.js +264 -0
- package/build/esm/src/fonts/bravura_glyphs.js +3239 -0
- package/build/esm/src/fonts/bravura_metrics.js +507 -0
- package/build/esm/src/fonts/custom_glyphs.js +78 -0
- package/build/esm/src/fonts/custom_metrics.js +5 -0
- package/build/esm/src/fonts/gonville_glyphs.js +828 -0
- package/build/esm/src/fonts/gonville_metrics.js +421 -0
- package/build/esm/src/fonts/load_all.js +10 -0
- package/build/esm/src/fonts/load_bravura.js +6 -0
- package/build/esm/src/fonts/load_custom.js +6 -0
- package/build/esm/src/fonts/load_gonville.js +6 -0
- package/build/esm/src/fonts/load_petaluma.js +6 -0
- package/build/esm/src/fonts/petaluma_glyphs.js +1335 -0
- package/build/esm/src/fonts/petaluma_metrics.js +536 -0
- package/build/esm/src/fonts/petalumascript_glyphs.js +863 -0
- package/build/esm/src/fonts/robotoslab_glyphs.js +863 -0
- package/build/esm/src/fonts/textfonts.js +44 -0
- package/build/esm/src/formatter.js +568 -0
- package/build/esm/src/fraction.js +171 -0
- package/build/esm/src/frethandfinger.js +156 -0
- package/build/esm/src/ghostnote.js +50 -0
- package/build/esm/src/glyph.js +331 -0
- package/build/esm/src/glyphnote.js +55 -0
- package/build/esm/src/gracenote.js +133 -0
- package/build/esm/src/gracenotegroup.js +128 -0
- package/build/esm/src/gracetabnote.js +12 -0
- package/build/esm/src/index.js +91 -0
- package/build/esm/src/keymanager.js +99 -0
- package/build/esm/src/keysignature.js +250 -0
- package/build/esm/src/keysignote.js +28 -0
- package/build/esm/src/modifier.js +128 -0
- package/build/esm/src/modifiercontext.js +110 -0
- package/build/esm/src/multimeasurerest.js +173 -0
- package/build/esm/src/music.js +322 -0
- package/build/esm/src/note.js +371 -0
- package/build/esm/src/notehead.js +169 -0
- package/build/esm/src/notesubgroup.js +59 -0
- package/build/esm/src/ornament.js +206 -0
- package/build/esm/src/parenthesis.js +76 -0
- package/build/esm/src/parser.js +164 -0
- package/build/esm/src/pedalmarking.js +192 -0
- package/build/esm/src/registry.js +81 -0
- package/build/esm/src/rendercontext.js +24 -0
- package/build/esm/src/renderer.js +112 -0
- package/build/esm/src/repeatnote.js +22 -0
- package/build/esm/src/stave.js +547 -0
- package/build/esm/src/stavebarline.js +182 -0
- package/build/esm/src/staveconnector.js +196 -0
- package/build/esm/src/stavehairpin.js +120 -0
- package/build/esm/src/staveline.js +218 -0
- package/build/esm/src/stavemodifier.js +77 -0
- package/build/esm/src/stavenote.js +855 -0
- package/build/esm/src/staverepetition.js +155 -0
- package/build/esm/src/stavesection.js +58 -0
- package/build/esm/src/stavetempo.js +91 -0
- package/build/esm/src/stavetext.js +82 -0
- package/build/esm/src/stavetie.js +141 -0
- package/build/esm/src/stavevolta.js +67 -0
- package/build/esm/src/stem.js +131 -0
- package/build/esm/src/stemmablenote.js +193 -0
- package/build/esm/src/stringnumber.js +231 -0
- package/build/esm/src/strokes.js +200 -0
- package/build/esm/src/svgcontext.js +414 -0
- package/build/esm/src/system.js +116 -0
- package/build/esm/src/tables.js +1102 -0
- package/build/esm/src/tabnote.js +299 -0
- package/build/esm/src/tabslide.js +76 -0
- package/build/esm/src/tabstave.js +17 -0
- package/build/esm/src/tabtie.js +19 -0
- package/build/esm/src/textbracket.js +144 -0
- package/build/esm/src/textdynamics.js +81 -0
- package/build/esm/src/textformatter.js +177 -0
- package/build/esm/src/textnote.js +176 -0
- package/build/esm/src/tickable.js +214 -0
- package/build/esm/src/tickcontext.js +170 -0
- package/build/esm/src/timesigglyph.js +85 -0
- package/build/esm/src/timesignature.js +89 -0
- package/build/esm/src/timesignote.js +32 -0
- package/build/esm/src/tremolo.js +47 -0
- package/build/esm/src/tuning.js +54 -0
- package/build/esm/src/tuplet.js +240 -0
- package/build/esm/src/typeguard.js +30 -0
- package/build/esm/src/util.js +58 -0
- package/build/esm/src/version.js +3 -3
- package/build/esm/src/vex.js +51 -0
- package/build/esm/src/vibrato.js +100 -0
- package/build/esm/src/vibratobracket.js +50 -0
- package/build/esm/src/voice.js +187 -0
- package/build/esm/src/web.js +15 -0
- package/build/esm/tests/accidental_tests.js +974 -0
- package/build/esm/tests/annotation_tests.js +377 -0
- package/build/esm/tests/articulation_tests.js +365 -0
- package/build/esm/tests/auto_beam_formatting_tests.js +548 -0
- package/build/esm/tests/bach_tests.js +335 -0
- package/build/esm/tests/barline_tests.js +52 -0
- package/build/esm/tests/beam_tests.js +595 -0
- package/build/esm/tests/bend_tests.js +215 -0
- package/build/esm/tests/boundingbox_tests.js +53 -0
- package/build/esm/tests/boundingboxcomputation_tests.js +183 -0
- package/build/esm/tests/chordsymbol_tests.js +320 -0
- package/build/esm/tests/clef_tests.js +131 -0
- package/build/esm/tests/curve_tests.js +118 -0
- package/build/esm/tests/dot_tests.js +123 -0
- package/build/esm/tests/easyscore_tests.js +459 -0
- package/build/esm/tests/factory_tests.js +44 -0
- package/build/esm/tests/font_tests.js +135 -0
- package/build/esm/tests/formatter/framestack.js +61 -0
- package/build/esm/tests/formatter/tests.js +203 -0
- package/build/esm/tests/formatter_tests.js +669 -0
- package/build/esm/tests/fraction_tests.js +72 -0
- package/build/esm/tests/ghostnote_tests.js +77 -0
- package/build/esm/tests/glyphnote_tests.js +113 -0
- package/build/esm/tests/gracenote_tests.js +413 -0
- package/build/esm/tests/gracetabnote_tests.js +79 -0
- package/build/esm/tests/index.js +68 -0
- package/build/esm/tests/key_clef_tests.js +103 -0
- package/build/esm/tests/keymanager_tests.js +68 -0
- package/build/esm/tests/keysignature_tests.js +308 -0
- package/build/esm/tests/mocks.js +71 -0
- package/build/esm/tests/modifier_tests.js +24 -0
- package/build/esm/tests/multimeasurerest_tests.js +141 -0
- package/build/esm/tests/music_tests.js +161 -0
- package/build/esm/tests/notehead_tests.js +137 -0
- package/build/esm/tests/notesubgroup_tests.js +149 -0
- package/build/esm/tests/offscreencanvas_tests.js +47 -0
- package/build/esm/tests/ornament_tests.js +298 -0
- package/build/esm/tests/parser_tests.js +122 -0
- package/build/esm/tests/pedalmarking_tests.js +64 -0
- package/build/esm/tests/percussion_tests.js +180 -0
- package/build/esm/tests/registry_tests.js +64 -0
- package/build/esm/tests/renderer_tests.js +113 -0
- package/build/esm/tests/rests_tests.js +248 -0
- package/build/esm/tests/rhythm_tests.js +357 -0
- package/build/esm/tests/stave_tests.js +560 -0
- package/build/esm/tests/staveconnector_tests.js +402 -0
- package/build/esm/tests/stavehairpin_tests.js +90 -0
- package/build/esm/tests/staveline_tests.js +122 -0
- package/build/esm/tests/stavemodifier_tests.js +51 -0
- package/build/esm/tests/stavenote_tests.js +867 -0
- package/build/esm/tests/stavetie_tests.js +108 -0
- package/build/esm/tests/stringnumber_tests.js +259 -0
- package/build/esm/tests/strokes_tests.js +275 -0
- package/build/esm/tests/style_tests.js +98 -0
- package/build/esm/tests/support/qunit.js +2765 -0
- package/build/esm/tests/tabnote_tests.js +474 -0
- package/build/esm/tests/tabslide_tests.js +135 -0
- package/build/esm/tests/tabstave_tests.js +23 -0
- package/build/esm/tests/tabtie_tests.js +173 -0
- package/build/esm/tests/textbracket_tests.js +100 -0
- package/build/esm/tests/textformatter_tests.js +24 -0
- package/build/esm/tests/textnote_tests.js +215 -0
- package/build/esm/tests/threevoice_tests.js +132 -0
- package/build/esm/tests/tickcontext_tests.js +36 -0
- package/build/esm/tests/timesignature_tests.js +134 -0
- package/build/esm/tests/tremolo_tests.js +75 -0
- package/build/esm/tests/tuning_tests.js +56 -0
- package/build/esm/tests/tuplet_tests.js +450 -0
- package/build/esm/tests/typeguard_tests.js +82 -0
- package/build/esm/tests/vexflow_test_helpers.js +266 -0
- package/build/esm/tests/vf_prefix_tests.js +115 -0
- package/build/esm/tests/vibrato_tests.js +92 -0
- package/build/esm/tests/vibratobracket_tests.js +45 -0
- package/build/esm/tests/voice_tests.js +69 -0
- package/build/types/entry/vexflow-bravura.d.ts +3 -0
- package/build/types/entry/vexflow-core.d.ts +3 -0
- package/build/types/entry/vexflow-debug.d.ts +3 -0
- package/build/types/entry/vexflow-font-bravura.d.ts +3771 -0
- package/build/types/entry/vexflow-font-custom.d.ts +86 -0
- package/build/types/entry/vexflow-font-gonville.d.ts +1267 -0
- package/build/types/entry/vexflow-font-petaluma.d.ts +1896 -0
- package/build/types/entry/vexflow-gonville.d.ts +3 -0
- package/build/types/entry/vexflow-petaluma.d.ts +3 -0
- package/build/types/entry/vexflow.d.ts +3 -0
- package/build/types/src/accidental.d.ts +66 -0
- package/build/types/src/annotation.d.ts +60 -0
- package/build/types/src/articulation.d.ts +62 -0
- package/build/types/src/barnote.d.ts +29 -0
- package/build/types/src/beam.d.ts +124 -0
- package/build/types/src/bend.d.ts +73 -0
- package/build/types/src/boundingbox.d.ts +42 -0
- package/build/types/src/boundingboxcomputation.d.ts +33 -0
- package/build/types/src/canvascontext.d.ts +89 -0
- package/build/types/src/chordsymbol.d.ts +149 -0
- package/build/types/src/clef.d.ts +48 -0
- package/build/types/src/clefnote.d.ts +25 -0
- package/build/types/src/crescendo.d.ts +27 -0
- package/build/types/src/curve.d.ts +41 -0
- package/build/types/src/dot.d.ts +20 -0
- package/build/types/src/easyscore.d.ts +148 -0
- package/build/types/src/element.d.ts +202 -0
- package/build/types/src/factory.d.ts +271 -0
- package/build/types/src/flow.d.ts +245 -0
- package/build/types/src/font.d.ts +181 -0
- package/build/types/src/fonts/bravura_glyphs.d.ts +3239 -0
- package/build/types/src/fonts/bravura_metrics.d.ts +533 -0
- package/build/types/src/fonts/custom_glyphs.d.ts +78 -0
- package/build/types/src/fonts/custom_metrics.d.ts +5 -0
- package/build/types/src/fonts/gonville_glyphs.d.ts +828 -0
- package/build/types/src/fonts/gonville_metrics.d.ts +440 -0
- package/build/types/src/fonts/load_all.d.ts +1 -0
- package/build/types/src/fonts/load_bravura.d.ts +1 -0
- package/build/types/src/fonts/load_custom.d.ts +1 -0
- package/build/types/src/fonts/load_gonville.d.ts +1 -0
- package/build/types/src/fonts/load_petaluma.d.ts +1 -0
- package/build/types/src/fonts/petaluma_glyphs.d.ts +1335 -0
- package/build/types/src/fonts/petaluma_metrics.d.ts +562 -0
- package/build/types/src/fonts/petalumascript_glyphs.d.ts +863 -0
- package/build/types/src/fonts/robotoslab_glyphs.d.ts +863 -0
- package/build/types/src/fonts/textfonts.d.ts +1 -0
- package/build/types/src/formatter.d.ts +203 -0
- package/build/types/src/fraction.d.ts +62 -0
- package/build/types/src/frethandfinger.d.ts +22 -0
- package/build/types/src/ghostnote.d.ts +16 -0
- package/build/types/src/glyph.d.ts +139 -0
- package/build/types/src/glyphnote.d.ts +17 -0
- package/build/types/src/gracenote.d.ts +19 -0
- package/build/types/src/gracenotegroup.d.ts +33 -0
- package/build/types/src/gracetabnote.d.ts +5 -0
- package/build/types/src/index.d.ts +91 -0
- package/build/types/src/keymanager.d.ts +25 -0
- package/build/types/src/keysignature.d.ts +50 -0
- package/build/types/src/keysignote.d.ts +11 -0
- package/build/types/src/modifier.d.ts +97 -0
- package/build/types/src/modifiercontext.d.ts +45 -0
- package/build/types/src/multimeasurerest.d.ts +61 -0
- package/build/types/src/music.d.ts +91 -0
- package/build/types/src/note.d.ts +231 -0
- package/build/types/src/notehead.d.ts +70 -0
- package/build/types/src/notesubgroup.d.ts +18 -0
- package/build/types/src/ornament.d.ts +76 -0
- package/build/types/src/parenthesis.d.ts +22 -0
- package/build/types/src/parser.d.ts +45 -0
- package/build/types/src/pedalmarking.d.ts +69 -0
- package/build/types/src/registry.d.ts +40 -0
- package/build/types/src/rendercontext.d.ts +64 -0
- package/build/types/src/renderer.d.ts +35 -0
- package/build/types/src/repeatnote.d.ts +6 -0
- package/build/types/src/stave.d.ts +186 -0
- package/build/types/src/stavebarline.d.ts +28 -0
- package/build/types/src/staveconnector.d.ts +67 -0
- package/build/types/src/stavehairpin.d.ts +56 -0
- package/build/types/src/staveline.d.ts +57 -0
- package/build/types/src/stavemodifier.d.ts +44 -0
- package/build/types/src/stavenote.d.ts +154 -0
- package/build/types/src/staverepetition.d.ts +32 -0
- package/build/types/src/stavesection.d.ts +15 -0
- package/build/types/src/stavetempo.d.ts +25 -0
- package/build/types/src/stavetext.d.ts +25 -0
- package/build/types/src/stavetie.d.ts +59 -0
- package/build/types/src/stavevolta.d.ts +21 -0
- package/build/types/src/stem.d.ts +58 -0
- package/build/types/src/stemmablenote.d.ts +39 -0
- package/build/types/src/stringnumber.d.ts +27 -0
- package/build/types/src/strokes.d.ts +33 -0
- package/build/types/src/svgcontext.d.ts +131 -0
- package/build/types/src/system.d.ts +92 -0
- package/build/types/src/tables.d.ts +96 -0
- package/build/types/src/tabnote.d.ts +44 -0
- package/build/types/src/tabslide.d.ts +34 -0
- package/build/types/src/tabstave.d.ts +7 -0
- package/build/types/src/tabtie.d.ts +18 -0
- package/build/types/src/textbracket.d.ts +55 -0
- package/build/types/src/textdynamics.d.ts +39 -0
- package/build/types/src/textformatter.d.ts +109 -0
- package/build/types/src/textnote.d.ts +49 -0
- package/build/types/src/tickable.d.ts +140 -0
- package/build/types/src/tickcontext.d.ts +82 -0
- package/build/types/src/timesigglyph.d.ts +14 -0
- package/build/types/src/timesignature.d.ts +26 -0
- package/build/types/src/timesignote.d.ts +11 -0
- package/build/types/src/tremolo.d.ts +17 -0
- package/build/types/src/tuning.d.ts +23 -0
- package/build/types/src/tuplet.d.ts +105 -0
- package/build/types/src/typeguard.d.ts +99 -0
- package/build/types/src/util.d.ts +27 -0
- package/build/types/src/version.d.ts +3 -0
- package/build/types/src/vex.d.ts +18 -0
- package/build/types/src/vibrato.d.ts +29 -0
- package/build/types/src/vibratobracket.d.ts +33 -0
- package/build/types/src/voice.d.ts +108 -0
- package/build/types/src/web.d.ts +2 -0
- package/package.json +1 -1
- package/src/annotation.ts +27 -6
- package/src/articulation.ts +8 -2
- package/src/fonts/gonville_glyphs.ts +4 -4
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { Element } from './element';
|
|
2
|
+
import { Fraction } from './fraction';
|
|
3
|
+
import { Modifier } from './modifier';
|
|
4
|
+
import { ModifierContext } from './modifiercontext';
|
|
5
|
+
import { Stave } from './stave';
|
|
6
|
+
import { TickContext } from './tickcontext';
|
|
7
|
+
import { Tuplet } from './tuplet';
|
|
8
|
+
import { Voice } from './voice';
|
|
9
|
+
/** Formatter metrics interface */
|
|
10
|
+
export interface FormatterMetrics {
|
|
11
|
+
duration: string;
|
|
12
|
+
freedom: {
|
|
13
|
+
left: number;
|
|
14
|
+
right: number;
|
|
15
|
+
};
|
|
16
|
+
iterations: number;
|
|
17
|
+
space: {
|
|
18
|
+
used: number;
|
|
19
|
+
mean: number;
|
|
20
|
+
deviation: number;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Tickable represents a element that sit on a score and
|
|
25
|
+
* has a duration, i.e., Tickables occupy space in the musical rendering dimension.
|
|
26
|
+
*/
|
|
27
|
+
export declare abstract class Tickable extends Element {
|
|
28
|
+
static get CATEGORY(): string;
|
|
29
|
+
protected ignore_ticks: boolean;
|
|
30
|
+
protected tupletStack: Tuplet[];
|
|
31
|
+
protected tuplet?: Tuplet;
|
|
32
|
+
protected ticks: Fraction;
|
|
33
|
+
protected center_x_shift: number;
|
|
34
|
+
protected voice?: Voice;
|
|
35
|
+
protected width: number;
|
|
36
|
+
protected x_shift: number;
|
|
37
|
+
protected modifierContext?: ModifierContext;
|
|
38
|
+
protected tickContext?: TickContext;
|
|
39
|
+
protected modifiers: Modifier[];
|
|
40
|
+
protected tickMultiplier: Fraction;
|
|
41
|
+
protected formatterMetrics: FormatterMetrics;
|
|
42
|
+
protected intrinsicTicks: number;
|
|
43
|
+
protected align_center: boolean;
|
|
44
|
+
private _preFormatted;
|
|
45
|
+
private _postFormatted;
|
|
46
|
+
constructor();
|
|
47
|
+
/** Reset the Tickable, this function will be overloaded. */
|
|
48
|
+
reset(): this;
|
|
49
|
+
/** Return the ticks. */
|
|
50
|
+
getTicks(): Fraction;
|
|
51
|
+
/** Check if it ignores the ticks. */
|
|
52
|
+
shouldIgnoreTicks(): boolean;
|
|
53
|
+
/** Ignore the ticks. */
|
|
54
|
+
setIgnoreTicks(flag: boolean): this;
|
|
55
|
+
/** Set width of note. Used by the formatter for positioning. */
|
|
56
|
+
setWidth(width: number): void;
|
|
57
|
+
/** Get width of note. Used by the formatter for positioning. */
|
|
58
|
+
getWidth(): number;
|
|
59
|
+
/** Displace note by `x` pixels. Used by the formatter. */
|
|
60
|
+
setXShift(x: number): this;
|
|
61
|
+
/** Get the `x` displaced pixels of the note. */
|
|
62
|
+
getXShift(): number;
|
|
63
|
+
/** Get `x` position of this tick context. */
|
|
64
|
+
getX(): number;
|
|
65
|
+
/** Return the formatterMetrics. */
|
|
66
|
+
getFormatterMetrics(): FormatterMetrics;
|
|
67
|
+
/** Return the center `x` shift. */
|
|
68
|
+
getCenterXShift(): number;
|
|
69
|
+
/** Set the center `x` shift. */
|
|
70
|
+
setCenterXShift(centerXShift: number): this;
|
|
71
|
+
isCenterAligned(): boolean;
|
|
72
|
+
setCenterAlignment(align_center: boolean): this;
|
|
73
|
+
/**
|
|
74
|
+
* Return the associated voice. Every tickable must be associated with a voice.
|
|
75
|
+
* This allows formatters and preFormatter to associate them with the right modifierContexts.
|
|
76
|
+
*/
|
|
77
|
+
getVoice(): Voice;
|
|
78
|
+
/** Set the associated voice. */
|
|
79
|
+
setVoice(voice: Voice): void;
|
|
80
|
+
/** Get the tuplet. */
|
|
81
|
+
getTuplet(): Tuplet | undefined;
|
|
82
|
+
/** Return the intrinsic ticks. */
|
|
83
|
+
getTupletStack(): Tuplet[];
|
|
84
|
+
/**
|
|
85
|
+
* Reset the specific Tuplet if this is not provided, all tuplets are reset.
|
|
86
|
+
* Remove any prior tuplets from the tick calculation and
|
|
87
|
+
* reset the intrinsic tick value.
|
|
88
|
+
*/
|
|
89
|
+
resetTuplet(tuplet?: Tuplet): this;
|
|
90
|
+
/** Attach to new tuplet. */
|
|
91
|
+
setTuplet(tuplet: Tuplet): this;
|
|
92
|
+
/**
|
|
93
|
+
* Add self to the provided ModifierContext `mc`.
|
|
94
|
+
* If this tickable has modifiers, set modifierContext.
|
|
95
|
+
* @returns this
|
|
96
|
+
*/
|
|
97
|
+
addToModifierContext(mc: ModifierContext): this;
|
|
98
|
+
/**
|
|
99
|
+
* Optional, if tickable has modifiers, associate a Modifier.
|
|
100
|
+
* @param mod the modifier
|
|
101
|
+
*/
|
|
102
|
+
addModifier(modifier: Modifier, index?: number): this;
|
|
103
|
+
/** Get the list of associated modifiers. */
|
|
104
|
+
getModifiers(): Modifier[];
|
|
105
|
+
/** Set the Tick Context. */
|
|
106
|
+
setTickContext(tc: TickContext): void;
|
|
107
|
+
checkTickContext(message?: string): TickContext;
|
|
108
|
+
/** Preformat the Tickable. */
|
|
109
|
+
preFormat(): void;
|
|
110
|
+
/** Set preformatted status. */
|
|
111
|
+
set preFormatted(value: boolean);
|
|
112
|
+
get preFormatted(): boolean;
|
|
113
|
+
/** Postformat the Tickable. */
|
|
114
|
+
postFormat(): this;
|
|
115
|
+
/** Set postformatted status. */
|
|
116
|
+
set postFormatted(value: boolean);
|
|
117
|
+
get postFormatted(): boolean;
|
|
118
|
+
/** Return the intrinsic ticks. */
|
|
119
|
+
getIntrinsicTicks(): number;
|
|
120
|
+
/** Set the intrinsic ticks. */
|
|
121
|
+
setIntrinsicTicks(intrinsicTicks: number): void;
|
|
122
|
+
/** Get the tick multiplier. */
|
|
123
|
+
getTickMultiplier(): Fraction;
|
|
124
|
+
/** Apply a tick multiplier. */
|
|
125
|
+
applyTickMultiplier(numerator: number, denominator: number): void;
|
|
126
|
+
/** Set the duration. */
|
|
127
|
+
setDuration(duration: Fraction): void;
|
|
128
|
+
getAbsoluteX(): number;
|
|
129
|
+
/** Attach this note to a modifier context. */
|
|
130
|
+
setModifierContext(mc?: ModifierContext): this;
|
|
131
|
+
/** Get `ModifierContext`. */
|
|
132
|
+
getModifierContext(): ModifierContext | undefined;
|
|
133
|
+
/** Check and get `ModifierContext`. */
|
|
134
|
+
checkModifierContext(): ModifierContext;
|
|
135
|
+
/** Get the target stave. */
|
|
136
|
+
abstract getStave(): Stave | undefined;
|
|
137
|
+
/** Set the target stave. */
|
|
138
|
+
abstract setStave(stave: Stave): this;
|
|
139
|
+
abstract getMetrics(): any;
|
|
140
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { Fraction } from './fraction';
|
|
2
|
+
import { NoteMetrics } from './note';
|
|
3
|
+
import { Tickable } from './tickable';
|
|
4
|
+
export interface TickContextMetrics extends NoteMetrics {
|
|
5
|
+
totalLeftPx: number;
|
|
6
|
+
totalRightPx: number;
|
|
7
|
+
}
|
|
8
|
+
export interface TickContextOptions {
|
|
9
|
+
tickID: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* TickContext formats abstract tickable objects, such as notes, chords, tabs, etc.
|
|
13
|
+
*/
|
|
14
|
+
export declare class TickContext {
|
|
15
|
+
protected readonly tickID: number;
|
|
16
|
+
protected readonly tickables: Tickable[];
|
|
17
|
+
protected readonly tickablesByVoice: Record<string, Tickable>;
|
|
18
|
+
protected currentTick: Fraction;
|
|
19
|
+
protected maxTicks: Fraction;
|
|
20
|
+
protected padding: number;
|
|
21
|
+
protected xBase: number;
|
|
22
|
+
protected x: number;
|
|
23
|
+
protected xOffset: number;
|
|
24
|
+
protected notePx: number;
|
|
25
|
+
protected glyphPx: number;
|
|
26
|
+
protected leftDisplacedHeadPx: number;
|
|
27
|
+
protected rightDisplacedHeadPx: number;
|
|
28
|
+
protected modLeftPx: number;
|
|
29
|
+
protected modRightPx: number;
|
|
30
|
+
protected totalLeftPx: number;
|
|
31
|
+
protected totalRightPx: number;
|
|
32
|
+
protected maxTickable?: Tickable;
|
|
33
|
+
protected minTicks?: Fraction;
|
|
34
|
+
protected minTickable?: Tickable;
|
|
35
|
+
tContexts: TickContext[];
|
|
36
|
+
protected preFormatted: boolean;
|
|
37
|
+
protected postFormatted: boolean;
|
|
38
|
+
protected width: number;
|
|
39
|
+
protected formatterMetrics: {
|
|
40
|
+
freedom: {
|
|
41
|
+
left: number;
|
|
42
|
+
right: number;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
static getNextContext(tContext: TickContext): TickContext | undefined;
|
|
46
|
+
constructor(options?: TickContextOptions);
|
|
47
|
+
getTickID(): number;
|
|
48
|
+
getX(): number;
|
|
49
|
+
setX(x: number): this;
|
|
50
|
+
getXBase(): number;
|
|
51
|
+
setXBase(xBase: number): void;
|
|
52
|
+
getXOffset(): number;
|
|
53
|
+
setXOffset(xOffset: number): void;
|
|
54
|
+
getWidth(): number;
|
|
55
|
+
setPadding(padding: number): this;
|
|
56
|
+
getMaxTicks(): Fraction;
|
|
57
|
+
getMinTicks(): Fraction | undefined;
|
|
58
|
+
getMaxTickable(): Tickable | undefined;
|
|
59
|
+
getMinTickable(): Tickable | undefined;
|
|
60
|
+
getTickables(): Tickable[];
|
|
61
|
+
/**
|
|
62
|
+
* Introduced on 2020-04-17 as getTickablesForVoice(voiceIndex).
|
|
63
|
+
* https://github.com/0xfe/vexflow/blame/dc97b0cc5bb93171c0038638c34362dc958222ca/src/tickcontext.js#L63
|
|
64
|
+
* Renamed on 2021-08-05 to getTickableForVoice(voiceIndex). Method renamed to singular, since it returns one Tickable.
|
|
65
|
+
*/
|
|
66
|
+
getTickableForVoice(voiceIndex: number): Tickable;
|
|
67
|
+
getTickablesByVoice(): Record<string, Tickable>;
|
|
68
|
+
getCenterAlignedTickables(): Tickable[];
|
|
69
|
+
/** Gets widths context, note and left/right modifiers for formatting. */
|
|
70
|
+
getMetrics(): TickContextMetrics;
|
|
71
|
+
getCurrentTick(): Fraction;
|
|
72
|
+
setCurrentTick(tick: Fraction): void;
|
|
73
|
+
addTickable(tickable: Tickable, voiceIndex?: number): this;
|
|
74
|
+
preFormat(): this;
|
|
75
|
+
postFormat(): this;
|
|
76
|
+
getFormatterMetrics(): {
|
|
77
|
+
freedom: {
|
|
78
|
+
left: number;
|
|
79
|
+
right: number;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Glyph, GlyphMetrics } from './glyph';
|
|
2
|
+
import { TimeSignature } from './timesignature';
|
|
3
|
+
export declare class TimeSignatureGlyph extends Glyph {
|
|
4
|
+
timeSignature: TimeSignature;
|
|
5
|
+
topStartX: number;
|
|
6
|
+
botStartX: number;
|
|
7
|
+
width: number;
|
|
8
|
+
xMin: number;
|
|
9
|
+
constructor(timeSignature: TimeSignature, topDigits: string, botDigits: string, code: string, point: number, options?: {
|
|
10
|
+
category: string;
|
|
11
|
+
});
|
|
12
|
+
getMetrics(): GlyphMetrics;
|
|
13
|
+
renderToStave(x: number): void;
|
|
14
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Glyph } from './glyph';
|
|
2
|
+
import { StaveModifier } from './stavemodifier';
|
|
3
|
+
export interface TimeSignatureInfo {
|
|
4
|
+
glyph: Glyph;
|
|
5
|
+
line?: number;
|
|
6
|
+
num: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare class TimeSignature extends StaveModifier {
|
|
9
|
+
static get CATEGORY(): string;
|
|
10
|
+
static get glyphs(): Record<string, {
|
|
11
|
+
code: string;
|
|
12
|
+
point: number;
|
|
13
|
+
line: number;
|
|
14
|
+
}>;
|
|
15
|
+
point: number;
|
|
16
|
+
bottomLine: number;
|
|
17
|
+
topLine: number;
|
|
18
|
+
protected info: TimeSignatureInfo;
|
|
19
|
+
protected validate_args: boolean;
|
|
20
|
+
constructor(timeSpec?: string, customPadding?: number, validate_args?: boolean);
|
|
21
|
+
parseTimeSpec(timeSpec: string): TimeSignatureInfo;
|
|
22
|
+
makeTimeSignatureGlyph(topDigits: string, botDigits: string): Glyph;
|
|
23
|
+
getInfo(): TimeSignatureInfo;
|
|
24
|
+
setTimeSig(timeSpec: string): this;
|
|
25
|
+
draw(): void;
|
|
26
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ModifierContext } from './modifiercontext';
|
|
2
|
+
import { Note } from './note';
|
|
3
|
+
import { TimeSignatureInfo } from './timesignature';
|
|
4
|
+
export declare class TimeSigNote extends Note {
|
|
5
|
+
static get CATEGORY(): string;
|
|
6
|
+
protected timeSigInfo: TimeSignatureInfo;
|
|
7
|
+
constructor(timeSpec: string, customPadding?: number);
|
|
8
|
+
addToModifierContext(mc: ModifierContext): this;
|
|
9
|
+
preFormat(): this;
|
|
10
|
+
draw(): void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Modifier } from './modifier';
|
|
2
|
+
/** Tremolo implements tremolo notation. */
|
|
3
|
+
export declare class Tremolo extends Modifier {
|
|
4
|
+
static get CATEGORY(): string;
|
|
5
|
+
protected readonly code: string;
|
|
6
|
+
protected readonly num: number;
|
|
7
|
+
/** Extra spacing required for big strokes. */
|
|
8
|
+
y_spacing_scale: number;
|
|
9
|
+
/** Font scaling for big strokes. */
|
|
10
|
+
extra_stroke_scale: number;
|
|
11
|
+
/**
|
|
12
|
+
* @param num number of bars
|
|
13
|
+
*/
|
|
14
|
+
constructor(num: number);
|
|
15
|
+
/** Draw the tremolo on the rendering context. */
|
|
16
|
+
draw(): void;
|
|
17
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** `Tuning` implements varies types of tunings for tablature. */
|
|
2
|
+
export declare class Tuning {
|
|
3
|
+
protected tuningValues: number[];
|
|
4
|
+
static get names(): Record<string, string>;
|
|
5
|
+
/**
|
|
6
|
+
* Constructor.
|
|
7
|
+
* @param tuningString tuning name (eg. 'dagdad') or comma separated note strings
|
|
8
|
+
*/
|
|
9
|
+
constructor(tuningString?: string);
|
|
10
|
+
/** Return the note number associated to the note string. */
|
|
11
|
+
noteToInteger(noteString: string): number;
|
|
12
|
+
/**
|
|
13
|
+
* Set tuning identified by tuning name (eg. 'dagdad')
|
|
14
|
+
* @param tuningString tuning name (eg. 'dagdad') or comma separated note strings
|
|
15
|
+
*/
|
|
16
|
+
setTuning(tuningString: string): void;
|
|
17
|
+
/** Return the note number associated with a tablature string. */
|
|
18
|
+
getValueForString(stringNum: string | number): number;
|
|
19
|
+
/** Return the note number associated with a tablature string and fret. */
|
|
20
|
+
getValueForFret(fretNum: string | number, stringNum: string | number): number;
|
|
21
|
+
/** Return the note string associated with tablature string and fret. */
|
|
22
|
+
getNoteForFret(fretNum: string | number, stringNum: string | number): string;
|
|
23
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
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.num_notes must be set.
|
|
7
|
+
*
|
|
8
|
+
* @constructor
|
|
9
|
+
* @param {Array.<Vex.Flow.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
|
+
* num_notes: fit this many notes into...
|
|
15
|
+
* notes_occupied: ...the space of this many notes
|
|
16
|
+
*
|
|
17
|
+
* Together, these two properties make up the tuplet ratio
|
|
18
|
+
* in the form of num_notes : notes_occupied.
|
|
19
|
+
* num_notes 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
|
+
* notes_occupied 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 num_notes and
|
|
37
|
+
* notes_occupied is greater than 1.
|
|
38
|
+
*
|
|
39
|
+
* y_offset: int, default 0
|
|
40
|
+
* manually offset a tuplet, for instance to avoid collisions
|
|
41
|
+
* with articulations, etc...
|
|
42
|
+
* }
|
|
43
|
+
*/
|
|
44
|
+
import { Element } from './element';
|
|
45
|
+
import { Glyph } from './glyph';
|
|
46
|
+
import { Note } from './note';
|
|
47
|
+
export interface TupletOptions {
|
|
48
|
+
beats_occupied?: number;
|
|
49
|
+
bracketed?: boolean;
|
|
50
|
+
location?: number;
|
|
51
|
+
notes_occupied?: number;
|
|
52
|
+
num_notes?: number;
|
|
53
|
+
ratioed?: boolean;
|
|
54
|
+
y_offset?: number;
|
|
55
|
+
}
|
|
56
|
+
export declare const enum TupletLocation {
|
|
57
|
+
BOTTOM = -1,
|
|
58
|
+
TOP = 1
|
|
59
|
+
}
|
|
60
|
+
export declare class Tuplet extends Element {
|
|
61
|
+
static get CATEGORY(): string;
|
|
62
|
+
notes: Note[];
|
|
63
|
+
protected options: TupletOptions;
|
|
64
|
+
protected num_notes: number;
|
|
65
|
+
protected point: number;
|
|
66
|
+
protected bracketed: boolean;
|
|
67
|
+
protected y_pos: number;
|
|
68
|
+
protected x_pos: number;
|
|
69
|
+
protected width: number;
|
|
70
|
+
protected location: number;
|
|
71
|
+
protected notes_occupied: number;
|
|
72
|
+
protected ratioed: boolean;
|
|
73
|
+
protected numerator_glyphs: Glyph[];
|
|
74
|
+
protected denom_glyphs: Glyph[];
|
|
75
|
+
static get LOCATION_TOP(): number;
|
|
76
|
+
static get LOCATION_BOTTOM(): number;
|
|
77
|
+
static get NESTING_OFFSET(): number;
|
|
78
|
+
static get metrics(): any;
|
|
79
|
+
constructor(notes: Note[], options?: TupletOptions);
|
|
80
|
+
attach(): void;
|
|
81
|
+
detach(): void;
|
|
82
|
+
/**
|
|
83
|
+
* Set whether or not the bracket is drawn.
|
|
84
|
+
*/
|
|
85
|
+
setBracketed(bracketed: boolean): this;
|
|
86
|
+
/**
|
|
87
|
+
* Set whether or not the ratio is shown.
|
|
88
|
+
*/
|
|
89
|
+
setRatioed(ratioed: boolean): this;
|
|
90
|
+
/**
|
|
91
|
+
* Set the tuplet indicator to be displayed either on the top or bottom of the stave.
|
|
92
|
+
*/
|
|
93
|
+
setTupletLocation(location: number): this;
|
|
94
|
+
getNotes(): Note[];
|
|
95
|
+
getNoteCount(): number;
|
|
96
|
+
beatsOccupiedDeprecationWarning(): void;
|
|
97
|
+
getBeatsOccupied(): number;
|
|
98
|
+
setBeatsOccupied(beats: number): void;
|
|
99
|
+
getNotesOccupied(): number;
|
|
100
|
+
setNotesOccupied(notes: number): void;
|
|
101
|
+
resolveGlyphs(): void;
|
|
102
|
+
getNestedTupletCount(): number;
|
|
103
|
+
getYPosition(): number;
|
|
104
|
+
draw(): void;
|
|
105
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { Accidental } from './accidental';
|
|
2
|
+
import { Annotation } from './annotation';
|
|
3
|
+
import { Dot } from './dot';
|
|
4
|
+
import { GraceNote } from './gracenote';
|
|
5
|
+
import { GraceNoteGroup } from './gracenotegroup';
|
|
6
|
+
import { Note } from './note';
|
|
7
|
+
import { RenderContext } from './rendercontext.js';
|
|
8
|
+
import { Barline } from './stavebarline';
|
|
9
|
+
import { StaveNote } from './stavenote';
|
|
10
|
+
import { StemmableNote } from './stemmablenote';
|
|
11
|
+
import { TabNote } from './tabnote';
|
|
12
|
+
/**
|
|
13
|
+
* Use instead of `instanceof` as a more flexible type guard.
|
|
14
|
+
* @param obj check if this object's CATEGORY matches the provided category.
|
|
15
|
+
* @param category a string representing a category of VexFlow objects.
|
|
16
|
+
* @param checkAncestors defaults to `true`, so we walk up the prototype chain to look for a matching `CATEGORY`.
|
|
17
|
+
* If `false`, we do not check the superclass or other ancestors.
|
|
18
|
+
* @returns true if `obj` has a static `CATEGORY` property that matches `category`.
|
|
19
|
+
*/
|
|
20
|
+
export declare function isCategory<T>(obj: any, category: string, checkAncestors?: boolean): obj is T;
|
|
21
|
+
export declare const isAccidental: (obj: unknown) => obj is Accidental;
|
|
22
|
+
export declare const isAnnotation: (obj: unknown) => obj is Annotation;
|
|
23
|
+
export declare const isBarline: (obj: unknown) => obj is Barline;
|
|
24
|
+
export declare const isDot: (obj: unknown) => obj is Dot;
|
|
25
|
+
export declare const isGraceNote: (obj: unknown) => obj is GraceNote;
|
|
26
|
+
export declare const isGraceNoteGroup: (obj: unknown) => obj is GraceNoteGroup;
|
|
27
|
+
export declare const isNote: (obj: unknown) => obj is Note;
|
|
28
|
+
export declare const isRenderContext: (obj: unknown) => obj is RenderContext;
|
|
29
|
+
export declare const isStaveNote: (obj: unknown) => obj is StaveNote;
|
|
30
|
+
export declare const isStemmableNote: (obj: unknown) => obj is StemmableNote;
|
|
31
|
+
export declare const isTabNote: (obj: unknown) => obj is TabNote;
|
|
32
|
+
export declare const enum Category {
|
|
33
|
+
Accidental = "Accidental",
|
|
34
|
+
Annotation = "Annotation",
|
|
35
|
+
Articulation = "Articulation",
|
|
36
|
+
Barline = "Barline",
|
|
37
|
+
BarNote = "BarNote",
|
|
38
|
+
Beam = "Beam",
|
|
39
|
+
Bend = "Bend",
|
|
40
|
+
ChordSymbol = "ChordSymbol",
|
|
41
|
+
Clef = "Clef",
|
|
42
|
+
ClefNote = "ClefNote",
|
|
43
|
+
Crescendo = "Crescendo",
|
|
44
|
+
Curve = "Curve",
|
|
45
|
+
Dot = "Dot",
|
|
46
|
+
Element = "Element",
|
|
47
|
+
Fraction = "Fraction",
|
|
48
|
+
FretHandFinger = "FretHandFinger",
|
|
49
|
+
GhostNote = "GhostNote",
|
|
50
|
+
Glyph = "Glyph",
|
|
51
|
+
GlyphNote = "GlyphNote",
|
|
52
|
+
GraceNote = "GraceNote",
|
|
53
|
+
GraceNoteGroup = "GraceNoteGroup",
|
|
54
|
+
GraceTabNote = "GraceTabNote",
|
|
55
|
+
KeySignature = "KeySignature",
|
|
56
|
+
KeySigNote = "KeySigNote",
|
|
57
|
+
Modifier = "Modifier",
|
|
58
|
+
MultiMeasureRest = "MultiMeasureRest",
|
|
59
|
+
Note = "Note",
|
|
60
|
+
NoteHead = "NoteHead",
|
|
61
|
+
NoteSubGroup = "NoteSubGroup",
|
|
62
|
+
Ornament = "Ornament",
|
|
63
|
+
Parenthesis = "Parenthesis",
|
|
64
|
+
PedalMarking = "PedalMarking",
|
|
65
|
+
RenderContext = "RenderContext",
|
|
66
|
+
RepeatNote = "RepeatNote",
|
|
67
|
+
Repetition = "Repetition",
|
|
68
|
+
Stave = "Stave",
|
|
69
|
+
StaveConnector = "StaveConnector",
|
|
70
|
+
StaveHairpin = "StaveHairpin",
|
|
71
|
+
StaveLine = "StaveLine",
|
|
72
|
+
StaveModifier = "StaveModifier",
|
|
73
|
+
StaveNote = "StaveNote",
|
|
74
|
+
StaveSection = "StaveSection",
|
|
75
|
+
StaveTempo = "StaveTempo",
|
|
76
|
+
StaveText = "StaveText",
|
|
77
|
+
StaveTie = "StaveTie",
|
|
78
|
+
Stem = "Stem",
|
|
79
|
+
StemmableNote = "StemmableNote",
|
|
80
|
+
StringNumber = "StringNumber",
|
|
81
|
+
Stroke = "Stroke",
|
|
82
|
+
System = "System",
|
|
83
|
+
TabNote = "TabNote",
|
|
84
|
+
TabSlide = "TabSlide",
|
|
85
|
+
TabStave = "TabStave",
|
|
86
|
+
TabTie = "TabTie",
|
|
87
|
+
TextBracket = "TextBracket",
|
|
88
|
+
TextDynamics = "TextDynamics",
|
|
89
|
+
TextNote = "TextNote",
|
|
90
|
+
Tickable = "Tickable",
|
|
91
|
+
TimeSignature = "TimeSignature",
|
|
92
|
+
TimeSigNote = "TimeSigNote",
|
|
93
|
+
Tremolo = "Tremolo",
|
|
94
|
+
Tuplet = "Tuplet",
|
|
95
|
+
Vibrato = "Vibrato",
|
|
96
|
+
VibratoBracket = "VibratoBracket",
|
|
97
|
+
Voice = "Voice",
|
|
98
|
+
Volta = "Volta"
|
|
99
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** `RuntimeError` will be thrown by VexFlow classes in case of error. */
|
|
2
|
+
export declare class RuntimeError extends Error {
|
|
3
|
+
code: string;
|
|
4
|
+
constructor(code: string, message?: string);
|
|
5
|
+
}
|
|
6
|
+
/** VexFlow can be used outside of the browser (e.g., Node) where `window` may not be defined. */
|
|
7
|
+
export declare function globalObject(): typeof globalThis & any;
|
|
8
|
+
/**
|
|
9
|
+
* Check that `x` is of type `T` and not `undefined`.
|
|
10
|
+
* If `x` is `undefined`, throw a RuntimeError with the optionally provided error code and message.
|
|
11
|
+
*/
|
|
12
|
+
export declare function defined<T>(x?: T, code?: string, message?: string): T;
|
|
13
|
+
/** Default log function sends all arguments to console. */
|
|
14
|
+
export declare function log(block: string, ...args: any[]): void;
|
|
15
|
+
/** Dump warning to console. */
|
|
16
|
+
export declare function warn(...args: any[]): void;
|
|
17
|
+
/** Locate the mid point between stave lines. Returns a fractional line if a space. */
|
|
18
|
+
export declare function midLine(a: number, b: number): number;
|
|
19
|
+
/**
|
|
20
|
+
* Used by various classes (e.g., SVGContext) to provide a
|
|
21
|
+
* unique prefix to element names (or other keys in shared namespaces).
|
|
22
|
+
*/
|
|
23
|
+
export declare function prefix(text: string): string;
|
|
24
|
+
/**
|
|
25
|
+
* Convert an arbitrary angle in radians to the equivalent one in the range [0, pi).
|
|
26
|
+
*/
|
|
27
|
+
export declare function normalizeAngle(a: number): number;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Flow } from './flow';
|
|
2
|
+
import { RuntimeError } from './util';
|
|
3
|
+
export declare class Vex {
|
|
4
|
+
static Flow: typeof Flow;
|
|
5
|
+
/**
|
|
6
|
+
* Take `arr` and return a new list consisting of the sorted, unique,
|
|
7
|
+
* contents of arr. Does not modify `arr`.
|
|
8
|
+
*/
|
|
9
|
+
static sortAndUnique(arr: any[], cmp: any, eq: any): any[];
|
|
10
|
+
/** Check if array `arr` contains `obj`. */
|
|
11
|
+
static contains(arr: any[], obj: any): boolean;
|
|
12
|
+
static getCanvasContext(canvasSelector: string): RenderingContext;
|
|
13
|
+
/** Benchmark. Run function `f` once and report time elapsed shifted by `s` milliseconds. */
|
|
14
|
+
static benchmark(s: any, f: any): void;
|
|
15
|
+
static stackTrace(): string | undefined;
|
|
16
|
+
static RERR: RuntimeError;
|
|
17
|
+
static RuntimeError: RuntimeError;
|
|
18
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Modifier } from './modifier';
|
|
2
|
+
import { ModifierContext, ModifierContextState } from './modifiercontext';
|
|
3
|
+
import { RenderContext } from './rendercontext';
|
|
4
|
+
export interface VibratoRenderOptions {
|
|
5
|
+
wave_height: number;
|
|
6
|
+
wave_girth: number;
|
|
7
|
+
vibrato_width: number;
|
|
8
|
+
harsh: boolean;
|
|
9
|
+
wave_width: number;
|
|
10
|
+
}
|
|
11
|
+
/** `Vibrato` implements diverse vibratos. */
|
|
12
|
+
export declare class Vibrato extends Modifier {
|
|
13
|
+
static get CATEGORY(): string;
|
|
14
|
+
render_options: VibratoRenderOptions;
|
|
15
|
+
/** Arrange vibratos inside a `ModifierContext`. */
|
|
16
|
+
static format(vibratos: Vibrato[], state: ModifierContextState, context: ModifierContext): boolean;
|
|
17
|
+
constructor();
|
|
18
|
+
/** Set harsh vibrato. */
|
|
19
|
+
setHarsh(harsh: boolean): this;
|
|
20
|
+
/** Set vibrato width in pixels. */
|
|
21
|
+
setVibratoWidth(width: number): this;
|
|
22
|
+
/** Draw the vibrato on the rendering context. */
|
|
23
|
+
draw(): void;
|
|
24
|
+
/**
|
|
25
|
+
* Static rendering method that can be called from
|
|
26
|
+
* other classes (e.g. VibratoBracket).
|
|
27
|
+
*/
|
|
28
|
+
static renderVibrato(ctx: RenderContext, x: number, y: number, opts: VibratoRenderOptions): void;
|
|
29
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Element } from './element';
|
|
2
|
+
import { Note } from './note';
|
|
3
|
+
/** `VibratoBracket` renders vibrato effect between two notes. */
|
|
4
|
+
export declare class VibratoBracket extends Element {
|
|
5
|
+
/** To enable logging for this class. Set `Vex.Flow.VibratoBracket.DEBUG` to `true`. */
|
|
6
|
+
static DEBUG: boolean;
|
|
7
|
+
static get CATEGORY(): string;
|
|
8
|
+
protected line: number;
|
|
9
|
+
protected start?: Note;
|
|
10
|
+
protected stop?: Note;
|
|
11
|
+
render_options: {
|
|
12
|
+
vibrato_width: number;
|
|
13
|
+
wave_height: number;
|
|
14
|
+
wave_girth: number;
|
|
15
|
+
harsh: boolean;
|
|
16
|
+
wave_width: number;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Either the stop or start note must be set, or both of them.
|
|
20
|
+
* An undefined value for the start or stop note indicates that the vibrato
|
|
21
|
+
* is drawn from the beginning or until the end of the stave accordingly.
|
|
22
|
+
*/
|
|
23
|
+
constructor(bracket_data: {
|
|
24
|
+
stop?: Note | null;
|
|
25
|
+
start?: Note | null;
|
|
26
|
+
});
|
|
27
|
+
/** Set line position of the vibrato bracket. */
|
|
28
|
+
setLine(line: number): this;
|
|
29
|
+
/** Set harsh vibrato bracket. */
|
|
30
|
+
setHarsh(harsh: boolean): this;
|
|
31
|
+
/** Draw the vibrato bracket on the rendering context. */
|
|
32
|
+
draw(): void;
|
|
33
|
+
}
|