smoosic 2.0.3 → 2.0.5
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/smoosic.js +408 -69
- package/changes.md +95 -0
- package/package.json +19 -1
- package/release/smoosic.js +408 -69
- package/specs/032-split-multimeasure-rests/checklists/requirements.md +40 -0
- package/specs/032-split-multimeasure-rests/contracts/grouping-contract.md +53 -0
- package/specs/032-split-multimeasure-rests/data-model.md +70 -0
- package/specs/032-split-multimeasure-rests/plan.md +81 -0
- package/specs/032-split-multimeasure-rests/quickstart.md +46 -0
- package/specs/032-split-multimeasure-rests/research.md +63 -0
- package/specs/032-split-multimeasure-rests/spec.md +127 -0
- package/specs/032-split-multimeasure-rests/tasks.md +174 -0
- package/specs/033-key-distance-transposition/checklists/requirements.md +35 -0
- package/specs/033-key-distance-transposition/contracts/spelling-api.md +36 -0
- package/specs/033-key-distance-transposition/data-model.md +49 -0
- package/specs/033-key-distance-transposition/plan.md +87 -0
- package/specs/033-key-distance-transposition/quickstart.md +40 -0
- package/specs/033-key-distance-transposition/research.md +82 -0
- package/specs/033-key-distance-transposition/spec.md +132 -0
- package/specs/033-key-distance-transposition/tasks.md +139 -0
- package/specs/034-smz-compressed-scores/checklists/requirements.md +35 -0
- package/specs/034-smz-compressed-scores/contracts/archive-api.md +30 -0
- package/specs/034-smz-compressed-scores/data-model.md +48 -0
- package/specs/034-smz-compressed-scores/plan.md +89 -0
- package/specs/034-smz-compressed-scores/quickstart.md +44 -0
- package/specs/034-smz-compressed-scores/research.md +86 -0
- package/specs/034-smz-compressed-scores/spec.md +137 -0
- package/specs/034-smz-compressed-scores/tasks.md +148 -0
- package/specs/035-paste-special/checklists/requirements.md +35 -0
- package/specs/035-paste-special/contracts/paste-special-api.md +50 -0
- package/specs/035-paste-special/data-model.md +47 -0
- package/specs/035-paste-special/plan.md +83 -0
- package/specs/035-paste-special/quickstart.md +51 -0
- package/specs/035-paste-special/research.md +97 -0
- package/specs/035-paste-special/spec.md +170 -0
- package/specs/035-paste-special/tasks.md +149 -0
- package/specs/036-autosave-recovery/checklists/requirements.md +36 -0
- package/specs/036-autosave-recovery/contracts/autosave-api.md +111 -0
- package/specs/036-autosave-recovery/data-model.md +70 -0
- package/specs/036-autosave-recovery/plan.md +87 -0
- package/specs/036-autosave-recovery/quickstart.md +65 -0
- package/specs/036-autosave-recovery/research.md +105 -0
- package/specs/036-autosave-recovery/spec.md +143 -0
- package/specs/036-autosave-recovery/tasks.md +165 -0
- package/specs/037-fix-new-part-dialog/checklists/requirements.md +38 -0
- package/specs/037-fix-new-part-dialog/contracts/create-part-api.md +84 -0
- package/specs/037-fix-new-part-dialog/data-model.md +68 -0
- package/specs/037-fix-new-part-dialog/plan.md +83 -0
- package/specs/037-fix-new-part-dialog/quickstart.md +58 -0
- package/specs/037-fix-new-part-dialog/research.md +86 -0
- package/specs/037-fix-new-part-dialog/spec.md +144 -0
- package/specs/037-fix-new-part-dialog/tasks.md +174 -0
- package/specs/038-per-measure-beam-groups/checklists/requirements.md +36 -0
- package/specs/038-per-measure-beam-groups/contracts/beam-groups-api.md +74 -0
- package/specs/038-per-measure-beam-groups/data-model.md +75 -0
- package/specs/038-per-measure-beam-groups/plan.md +84 -0
- package/specs/038-per-measure-beam-groups/quickstart.md +53 -0
- package/specs/038-per-measure-beam-groups/research.md +72 -0
- package/specs/038-per-measure-beam-groups/spec.md +146 -0
- package/specs/038-per-measure-beam-groups/tasks.md +132 -0
- package/specs/039-measure-fill-submenu/checklists/requirements.md +35 -0
- package/specs/039-measure-fill-submenu/contracts/measure-fill-api.md +56 -0
- package/specs/039-measure-fill-submenu/data-model.md +79 -0
- package/specs/039-measure-fill-submenu/plan.md +81 -0
- package/specs/039-measure-fill-submenu/quickstart.md +62 -0
- package/specs/039-measure-fill-submenu/research.md +68 -0
- package/specs/039-measure-fill-submenu/spec.md +153 -0
- package/specs/039-measure-fill-submenu/tasks.md +121 -0
- package/specs/040-dynamics-dialog-cleanup/checklists/requirements.md +36 -0
- package/specs/040-dynamics-dialog-cleanup/contracts/dynamics-dialog.md +52 -0
- package/specs/040-dynamics-dialog-cleanup/data-model.md +48 -0
- package/specs/040-dynamics-dialog-cleanup/plan.md +89 -0
- package/specs/040-dynamics-dialog-cleanup/quickstart.md +69 -0
- package/specs/040-dynamics-dialog-cleanup/research.md +80 -0
- package/specs/040-dynamics-dialog-cleanup/spec.md +120 -0
- package/specs/040-dynamics-dialog-cleanup/tasks.md +114 -0
- package/specs/041-delete-special/checklists/requirements.md +35 -0
- package/specs/041-delete-special/contracts/delete-special-api.md +41 -0
- package/specs/041-delete-special/data-model.md +40 -0
- package/specs/041-delete-special/plan.md +93 -0
- package/specs/041-delete-special/quickstart.md +41 -0
- package/specs/041-delete-special/research.md +75 -0
- package/specs/041-delete-special/spec.md +136 -0
- package/specs/041-delete-special/tasks.md +106 -0
- package/specs/042-preserve-music-time-signature/checklists/requirements.md +35 -0
- package/specs/042-preserve-music-time-signature/contracts/rebar-api.md +66 -0
- package/specs/042-preserve-music-time-signature/data-model.md +73 -0
- package/specs/042-preserve-music-time-signature/plan.md +93 -0
- package/specs/042-preserve-music-time-signature/quickstart.md +37 -0
- package/specs/042-preserve-music-time-signature/research.md +102 -0
- package/specs/042-preserve-music-time-signature/spec.md +153 -0
- package/specs/042-preserve-music-time-signature/tasks.md +104 -0
- package/src/application/application.ts +13 -2
- package/src/application/exports.ts +402 -395
- package/src/application/generateVexTests.ts +2 -2
- package/src/render/sui/NoteEntryCaret.ts +117 -16
- package/src/render/sui/autosave.ts +265 -0
- package/src/render/sui/formatter.ts +12 -2
- package/src/render/sui/renderState.ts +4 -4
- package/src/render/sui/scoreChangeState.ts +8 -3
- package/src/render/sui/scoreView.ts +47 -2
- package/src/render/sui/scoreViewOperations.ts +2761 -2555
- package/src/render/sui/staffLineGeometry.ts +82 -0
- package/src/render/sui/tracker.ts +18 -23
- package/src/render/vex/vxMeasure.ts +22 -8
- package/src/render/vex/vxNote.ts +2 -4
- package/src/smo/data/measure.ts +58 -1
- package/src/smo/data/measureModifiers.ts +81 -1
- package/src/smo/data/music.ts +169 -359
- package/src/smo/data/note.ts +1 -1
- package/src/smo/data/noteModifiers.ts +12 -0
- package/src/smo/data/score.ts +179 -7
- package/src/smo/data/scoreModifiers.ts +46 -1
- package/src/smo/data/systemStaff.ts +43 -0
- package/src/smo/xform/beamers.ts +80 -6
- package/src/smo/xform/copypaste.ts +207 -47
- package/src/smo/xform/measureFill.ts +89 -0
- package/src/smo/xform/operations.ts +452 -61
- package/src/smo/xform/rebar.ts +490 -0
- package/src/smo/xform/selections.ts +73 -0
- package/src/ui/components/dialogs/beamGroups.vue +106 -0
- package/src/ui/components/dialogs/deleteSpecial.vue +38 -0
- package/src/ui/components/dialogs/dynamics.vue +16 -3
- package/src/ui/components/dialogs/fileUpload.vue +2 -2
- package/src/ui/components/dialogs/hairpin.vue +3 -3
- package/src/ui/components/dialogs/newPart.vue +148 -184
- package/src/ui/components/dialogs/pasteSpecial.vue +49 -0
- package/src/ui/components/dialogs/recovery.vue +66 -0
- package/src/ui/components/dialogs/save.vue +11 -4
- package/src/ui/components/dialogs/scorePreferences.vue +23 -1
- package/src/ui/components/dialogs/slur.vue +6 -6
- package/src/ui/components/dialogs/tempo.vue +11 -3
- package/src/ui/components/dialogs/timeSignature.vue +18 -3
- package/src/ui/components/dialogs/volta.vue +3 -3
- package/src/ui/dialogs/annotationVue.ts +1 -1
- package/src/ui/dialogs/beamGroupsVue.ts +69 -0
- package/src/ui/dialogs/createPartHelpers.ts +68 -0
- package/src/ui/dialogs/deleteSpecial.ts +57 -0
- package/src/ui/dialogs/dynamicsVue.ts +87 -60
- package/src/ui/dialogs/factory.ts +0 -2
- package/src/ui/dialogs/fileDialogs.ts +63 -22
- package/src/ui/dialogs/instrument.ts +37 -30
- package/src/ui/dialogs/pasteSpecial.ts +59 -0
- package/src/ui/dialogs/preferences.ts +41 -40
- package/src/ui/dialogs/recovery.ts +49 -0
- package/src/ui/dialogs/timeSignature.ts +27 -39
- package/src/ui/fileio/fileInput.ts +12 -3
- package/src/ui/fileio/scoreArchive.ts +151 -0
- package/src/ui/fileio/xhrLoader.ts +26 -0
- package/src/ui/i18n/language.ts +1 -1
- package/src/ui/menus/beams.ts +181 -112
- package/src/ui/menus/edit.ts +44 -6
- package/src/ui/menus/file.ts +21 -1
- package/src/ui/menus/measure.ts +40 -1
- package/tests/autosave.ts +332 -0
- package/tests/beamDotted.ts +56 -0
- package/tests/beamGroups.ts +338 -0
- package/tests/createPart.ts +292 -0
- package/tests/deleteSpecial.ts +350 -0
- package/tests/dynamicsFontSize.ts +132 -0
- package/tests/keyDistanceTransposition.ts +351 -0
- package/tests/measureFill.ts +295 -0
- package/tests/movePart.ts +94 -0
- package/tests/multimeasureRest.ts +338 -0
- package/tests/pasteIntoMeasure.ts +103 -0
- package/tests/pasteSpecial.ts +541 -0
- package/tests/quickBeam.ts +126 -0
- package/tests/rebarMeasures.ts +492 -0
- package/tests/scoreArchive.ts +218 -0
- package/tests/scoreChangeState.ts +2 -0
- package/tests/staffLineGeometry.ts +179 -0
- package/tests/timeRangeSelect.ts +111 -0
- package/tests/timeSignatureDisplay.ts +58 -0
- package/tools/smoosic-schema.json +37 -0
- package/typedoc.ts +2 -1
- package/types/src/application/exports.d.ts +454 -447
- package/types/src/common/promiseHelpers.d.ts +30 -30
- package/types/src/common/vex.d.ts +224 -224
- package/types/src/render/sui/NoteEntryCaret.d.ts +107 -107
- package/types/src/render/sui/autosave.d.ts +99 -0
- package/types/src/render/sui/scoreView.d.ts +23 -0
- package/types/src/render/sui/scoreViewOperations.d.ts +776 -639
- package/types/src/render/sui/svgHelpers.d.ts +88 -88
- package/types/src/render/sui/svgPageMap.d.ts +344 -344
- package/types/src/render/sui/textEdit.d.ts +96 -96
- package/types/src/render/sui/textRender.d.ts +199 -199
- package/types/src/render/vex/smoAdapter.d.ts +47 -47
- package/types/src/render/vex/vxMeasure.d.ts +97 -97
- package/types/src/render/vex/vxNote.d.ts +56 -56
- package/types/src/render/vex/vxSystem.d.ts +71 -71
- package/types/src/smo/data/measure.d.ts +30 -0
- package/types/src/smo/data/measureModifiers.d.ts +568 -513
- package/types/src/smo/data/music.d.ts +74 -32
- package/types/src/smo/data/note.d.ts +498 -498
- package/types/src/smo/data/noteModifiers.d.ts +615 -606
- package/types/src/smo/data/score.d.ts +479 -421
- package/types/src/smo/data/scoreModifiers.d.ts +30 -0
- package/types/src/smo/data/scoreText.d.ts +334 -334
- package/types/src/smo/data/systemStaff.d.ts +14 -0
- package/types/src/smo/xform/beamers.d.ts +23 -1
- package/types/src/smo/xform/copypaste.d.ts +138 -2
- package/types/src/smo/xform/measureFill.d.ts +21 -0
- package/types/src/smo/xform/operations.d.ts +269 -129
- package/types/src/smo/xform/rebar.d.ts +53 -0
- package/types/src/smo/xform/selections.d.ts +168 -154
- package/types/src/smo/xform/undo.d.ts +142 -142
- package/types/src/ui/buttons/button.d.ts +100 -100
- package/types/src/ui/buttons/ribbon.d.ts +70 -70
- package/types/src/ui/common.d.ts +76 -76
- package/types/src/ui/components/dialogs/chordText.d.ts +28 -28
- package/types/src/ui/components/dialogs/textBlockAtomNode.d.ts +20 -20
- package/types/src/ui/components/dialogs/textGroupHtml.d.ts +29 -29
- package/types/src/ui/composable/draggable.d.ts +15 -15
- package/types/src/ui/dialogs/adapter.d.ts +120 -120
- package/types/src/ui/dialogs/annotationVue.d.ts +9 -9
- package/types/src/ui/dialogs/audioSettings.d.ts +32 -32
- package/types/src/ui/dialogs/beamGroupsVue.d.ts +20 -0
- package/types/src/ui/dialogs/chordChangeVue.d.ts +8 -8
- package/types/src/ui/dialogs/createPartHelpers.d.ts +29 -0
- package/types/src/ui/dialogs/customTupletsVue.d.ts +9 -9
- package/types/src/ui/dialogs/deleteSpecial.d.ts +8 -0
- package/types/src/ui/dialogs/dialog.d.ts +203 -203
- package/types/src/ui/dialogs/dynamicsVue.d.ts +10 -10
- package/types/src/ui/dialogs/factory.d.ts +15 -15
- package/types/src/ui/dialogs/fileDialogs.d.ts +4 -4
- package/types/src/ui/dialogs/hairpin.d.ts +35 -35
- package/types/src/ui/dialogs/hairpinVue.d.ts +7 -7
- package/types/src/ui/dialogs/instrument.d.ts +3 -3
- package/types/src/ui/dialogs/keySignatureVue.d.ts +7 -7
- package/types/src/ui/dialogs/libraryVue.d.ts +15 -15
- package/types/src/ui/dialogs/lyricVue.d.ts +8 -8
- package/types/src/ui/dialogs/pasteSpecial.d.ts +8 -0
- package/types/src/ui/dialogs/pedalMarkingVue.d.ts +7 -7
- package/types/src/ui/dialogs/recovery.d.ts +8 -0
- package/types/src/ui/dialogs/rehearsalMark.d.ts +25 -25
- package/types/src/ui/dialogs/rehearsalMarkVue.d.ts +7 -7
- package/types/src/ui/dialogs/slur.d.ts +57 -57
- package/types/src/ui/dialogs/slurVue.d.ts +7 -7
- package/types/src/ui/dialogs/tempo.d.ts +50 -50
- package/types/src/ui/dialogs/tempoVue.d.ts +10 -10
- package/types/src/ui/dialogs/textBlockVue.d.ts +8 -8
- package/types/src/ui/dialogs/textBracket.d.ts +35 -35
- package/types/src/ui/dialogs/textBracketVue.d.ts +7 -7
- package/types/src/ui/dialogs/tie.d.ts +41 -41
- package/types/src/ui/dialogs/volta.d.ts +40 -40
- package/types/src/ui/dialogs/voltaVue.d.ts +7 -7
- package/types/src/ui/fileio/fileInput.d.ts +7 -1
- package/types/src/ui/fileio/library.d.ts +40 -40
- package/types/src/ui/fileio/scoreArchive.d.ts +55 -0
- package/types/src/ui/fileio/xhrLoader.d.ts +7 -0
- package/types/src/ui/menus/file.d.ts +8 -8
- package/types/src/ui/menus/language.d.ts +7 -7
- package/types/src/ui/menus/manager.d.ts +58 -58
- package/types/src/ui/menus/menu.d.ts +159 -159
- package/types/src/ui/menus/partSelection.d.ts +14 -14
- package/types/src/ui/menus/score.d.ts +8 -8
- package/types/src/ui/menus/staffModifier.d.ts +17 -17
- package/types/typedoc.d.ts +148 -147
- package/src/ui/dialogs/dynamics.ts +0 -141
- package/types/src/ui/dialogs/dynamics.d.ts +0 -37
|
@@ -1,129 +1,269 @@
|
|
|
1
|
-
import { Pitch } from '../data/common';
|
|
2
|
-
import { SmoNote } from '../data/note';
|
|
3
|
-
import { SmoScore } from '../data/score';
|
|
4
|
-
import { SmoSystemStaff, SmoSystemStaffParams } from '../data/systemStaff';
|
|
5
|
-
import { SmoGraceNote, SmoDynamicText, SmoTabNote } from '../data/noteModifiers';
|
|
6
|
-
import { SmoRehearsalMark, SmoMeasureText, SmoVolta, SmoMeasureFormat, SmoTempo, SmoBarline, SmoTimeSignature, SmoRepeatSymbol } from '../data/measureModifiers';
|
|
7
|
-
import { SmoStaffHairpin, SmoSlur, SmoTie, StaffModifierBase, SmoInstrument, SmoSlurParams, SmoStaffTextBracket, SmoTabStave } from '../data/staffModifiers';
|
|
8
|
-
import { SmoSystemGroup } from '../data/scoreModifiers';
|
|
9
|
-
import { SmoTextGroup } from '../data/scoreText';
|
|
10
|
-
import { SmoSelection, SmoSelector, ModifierTab } from './selections';
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
*
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
static
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
static
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
static
|
|
69
|
-
static
|
|
70
|
-
static
|
|
71
|
-
static
|
|
72
|
-
static
|
|
73
|
-
static
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
static
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
static
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
static
|
|
96
|
-
static
|
|
97
|
-
static
|
|
98
|
-
static
|
|
99
|
-
static
|
|
100
|
-
static
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
*
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
static
|
|
128
|
-
static
|
|
129
|
-
|
|
1
|
+
import { Pitch } from '../data/common';
|
|
2
|
+
import { SmoNote } from '../data/note';
|
|
3
|
+
import { SmoScore } from '../data/score';
|
|
4
|
+
import { SmoSystemStaff, SmoSystemStaffParams } from '../data/systemStaff';
|
|
5
|
+
import { SmoGraceNote, SmoDynamicText, SmoTabNote } from '../data/noteModifiers';
|
|
6
|
+
import { SmoRehearsalMark, SmoMeasureText, SmoVolta, SmoMeasureFormat, SmoTempo, SmoBarline, SmoTimeSignature, SmoRepeatSymbol } from '../data/measureModifiers';
|
|
7
|
+
import { SmoStaffHairpin, SmoSlur, SmoTie, StaffModifierBase, SmoInstrument, SmoSlurParams, SmoStaffTextBracket, SmoTabStave } from '../data/staffModifiers';
|
|
8
|
+
import { SmoSystemGroup } from '../data/scoreModifiers';
|
|
9
|
+
import { SmoTextGroup } from '../data/scoreText';
|
|
10
|
+
import { SmoSelection, SmoSelector, ModifierTab } from './selections';
|
|
11
|
+
import { MeasureFillType } from './measureFill';
|
|
12
|
+
import { RebarResult } from './rebar';
|
|
13
|
+
/**
|
|
14
|
+
* supported operations for {@link SmoOperation.batchSelectionOperation} to change a note's duration
|
|
15
|
+
*/
|
|
16
|
+
export type BatchSelectionOperation = 'dotDuration' | 'undotDuration' | 'doubleDuration' | 'halveDuration' | 'doubleGraceNoteDuration' | 'halveGraceNoteDuration';
|
|
17
|
+
export interface MakeTupletOperation {
|
|
18
|
+
numNotes: number;
|
|
19
|
+
notesOccupied: number;
|
|
20
|
+
ratioed: boolean;
|
|
21
|
+
bracketed: boolean;
|
|
22
|
+
}
|
|
23
|
+
export type createStaffModifierType<T> = (fromSelection: SmoSelection, toSelection: SmoSelection) => T;
|
|
24
|
+
/**
|
|
25
|
+
* SmoOperation is a collection of static methods that operate on/change/transform the music. Most methods
|
|
26
|
+
* take the score, a selection or selection array, and the parameters of the operation.
|
|
27
|
+
* @category SmoTransform
|
|
28
|
+
*/
|
|
29
|
+
/**
|
|
30
|
+
* What is needed to create a part: where it goes, its instrument, and what it is called.
|
|
31
|
+
* @category SmoOperation
|
|
32
|
+
*/
|
|
33
|
+
export interface AddPartParams {
|
|
34
|
+
/** where the new part goes, counting from 1; N + 1 is after the last of N staves */
|
|
35
|
+
location: number;
|
|
36
|
+
/** the sound, clef, staff lines and transposition of the (first) staff */
|
|
37
|
+
instrument: SmoInstrument;
|
|
38
|
+
/** add a second staff to the part, with the opposite clef */
|
|
39
|
+
twoStaves: boolean;
|
|
40
|
+
/** the name as typed. If it is blank, instrumentLabel is the name */
|
|
41
|
+
name: string;
|
|
42
|
+
/** the display name of the instrument, e.g. 'Bb Trumpet' */
|
|
43
|
+
instrumentLabel: string;
|
|
44
|
+
/** the abbreviation as typed; blank for none */
|
|
45
|
+
abbreviation: string;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* The kinds of marking attached to notes that Delete Special can remove on their own
|
|
49
|
+
* @category SmoTransform
|
|
50
|
+
*/
|
|
51
|
+
export type DeleteAttributeKind = 'dynamics' | 'lyrics' | 'annotations' | 'chords' | 'articulations' | 'ornaments' | 'graceNotes' | 'arpeggios' | 'microtones';
|
|
52
|
+
export declare class SmoOperation {
|
|
53
|
+
/** All the kinds Delete Special can remove, in the order of its dialog */
|
|
54
|
+
static readonly deleteAttributeKinds: DeleteAttributeKind[];
|
|
55
|
+
/**
|
|
56
|
+
* How many markings of the given kinds are on the notes of the selections. Reads only. Selections with
|
|
57
|
+
* no note are skipped, and kinds that are not known are ignored.
|
|
58
|
+
* @param selections the selected notes
|
|
59
|
+
* @param kinds the kinds of marking to count
|
|
60
|
+
*/
|
|
61
|
+
static countNoteAttributes(selections: SmoSelection[], kinds: DeleteAttributeKind[]): number;
|
|
62
|
+
/**
|
|
63
|
+
* Remove every marking of the given kinds from the notes of the selections. Pitches, durations, ties and
|
|
64
|
+
* the kinds not listed are not changed. Kinds that are not known are ignored.
|
|
65
|
+
* @param selections the selected notes
|
|
66
|
+
* @param kinds the kinds of marking to remove
|
|
67
|
+
*/
|
|
68
|
+
static deleteNoteAttributes(selections: SmoSelection[], kinds: DeleteAttributeKind[]): void;
|
|
69
|
+
private static deleteHandlersFor;
|
|
70
|
+
static setMeasureFormat(score: SmoScore, selection: SmoSelection, value: SmoMeasureFormat): void;
|
|
71
|
+
static addKeySignature(score: SmoScore, selection: SmoSelection, keySignature: string): void;
|
|
72
|
+
static addConnectorDown(score: SmoScore, selections: SmoSelection[], parameters: SmoSystemGroup): void;
|
|
73
|
+
static setActiveVoice(score: SmoScore, voiceIx: number): void;
|
|
74
|
+
/**
|
|
75
|
+
* The staves that make up the part containing the given staff. A multi-staff part is
|
|
76
|
+
* kept together.
|
|
77
|
+
* @returns the index of the first staff of the part, and the number of staves in it
|
|
78
|
+
*/
|
|
79
|
+
static getPartBlock(score: SmoScore, staffIndex: number): {
|
|
80
|
+
start: number;
|
|
81
|
+
length: number;
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* Swap the part starting at `start` with the part just before it, keeping the staves
|
|
85
|
+
* of each part together and in order.
|
|
86
|
+
*/
|
|
87
|
+
private static swapPartWithPrevious;
|
|
88
|
+
/**
|
|
89
|
+
* Move a part up or down one. A part with 2 staves moves as a unit, so a single-staff part
|
|
90
|
+
* that it passes moves by 2. If last down, move to first. If first up, move to last
|
|
91
|
+
* @param score
|
|
92
|
+
* @param selection
|
|
93
|
+
* @param index direction to move, -1 for up and 1 for down
|
|
94
|
+
*/
|
|
95
|
+
static moveStaffUpDown(score: SmoScore, selection: SmoSelection, index: number): void;
|
|
96
|
+
static depopulateVoice(selection: SmoSelection, voiceIx: number): void;
|
|
97
|
+
static populateVoice(selection: SmoSelection, voiceIx: number): void;
|
|
98
|
+
static swapVoice(selections: SmoSelection[], voice1: number, voice2: number): void;
|
|
99
|
+
static setTabStave(score: SmoScore, tabStave: SmoTabStave): void;
|
|
100
|
+
static removeTabStave(score: SmoScore, tabStaves: SmoTabStave[]): void;
|
|
101
|
+
/**
|
|
102
|
+
* Re-bar the music of measures firstMeasure to lastMeasure (all staves) into a new time signature, adding
|
|
103
|
+
* measures if the new one holds less time. See {@link rebarMeasures}. Unlike {@link setTimeSignature}, no
|
|
104
|
+
* music is lost.
|
|
105
|
+
* @param score the score to change
|
|
106
|
+
* @param firstMeasure the first measure of the range
|
|
107
|
+
* @param lastMeasure the last measure of the range
|
|
108
|
+
* @param timeSignature the new time signature
|
|
109
|
+
*/
|
|
110
|
+
static rebarMeasures(score: SmoScore, firstMeasure: number, lastMeasure: number, timeSignature: SmoTimeSignature): RebarResult;
|
|
111
|
+
/**
|
|
112
|
+
* Would setting this time signature on measures firstMeasure to lastMeasure change anything? True if any
|
|
113
|
+
* of those measures, in any staff, has a time signature that is not equal to this one, display options included.
|
|
114
|
+
* Reads only.
|
|
115
|
+
*/
|
|
116
|
+
static timeSignatureChanges(score: SmoScore, firstMeasure: number, lastMeasure: number, timeSignature: SmoTimeSignature): boolean;
|
|
117
|
+
/**
|
|
118
|
+
* Is every measure in the range, in every staff, already as long as the new time signature would make it?
|
|
119
|
+
* (2/2 for 4/4, or only a display option changed). If so the music does not need to move. The measure
|
|
120
|
+
* k places after the first has part k of a time signature that has several parts. Reads only.
|
|
121
|
+
*/
|
|
122
|
+
static timeSignatureKeepsLength(score: SmoScore, firstMeasure: number, lastMeasure: number, timeSignature: SmoTimeSignature): boolean;
|
|
123
|
+
private static rangeMeasures;
|
|
124
|
+
static setTimeSignature(score: SmoScore, selections: SmoSelection[], timeSignature: SmoTimeSignature): void;
|
|
125
|
+
static batchSelectionOperation(score: SmoScore, selections: SmoSelection[], operation: BatchSelectionOperation): void;
|
|
126
|
+
static doubleDuration(selection: SmoSelection): boolean;
|
|
127
|
+
static halveDuration(selection: SmoSelection): boolean;
|
|
128
|
+
static makeTuplet(selection: SmoSelection, params: MakeTupletOperation): void;
|
|
129
|
+
static addStaffModifier(selection: SmoSelection, modifier: StaffModifierBase): void;
|
|
130
|
+
static toggleRest(selection: SmoSelection): void;
|
|
131
|
+
static toggleSlash(selection: SmoSelection): void;
|
|
132
|
+
static makeRest(selection: SmoSelection): void;
|
|
133
|
+
static makeNote(selection: SmoSelection): void;
|
|
134
|
+
static setNoteHead(selections: SmoSelection[], noteHead: string): void;
|
|
135
|
+
static addGraceNote(selection: SmoSelection, g: SmoGraceNote, offset: number): void;
|
|
136
|
+
static removeGraceNote(selection: SmoSelection, offset: number): void;
|
|
137
|
+
static doubleGraceNoteDuration(selection: SmoSelection, modifiers: SmoGraceNote[]): void;
|
|
138
|
+
static halveGraceNoteDuration(selection: SmoSelection, modifiers: SmoGraceNote[]): void;
|
|
139
|
+
static toggleGraceNoteCourtesy(selection: any, modifiers: SmoGraceNote[]): void;
|
|
140
|
+
static toggleGraceNoteEnharmonic(selection: SmoSelection, modifiers: SmoGraceNote[]): void;
|
|
141
|
+
static transposeGraceNotes(selection: SmoSelection, modifiers: SmoGraceNote[], offset: number): void;
|
|
142
|
+
static slashGraceNotes(selections: ModifierTab[] | ModifierTab): void;
|
|
143
|
+
static unmakeTuplet(selection: SmoSelection): void;
|
|
144
|
+
static dotDuration(selection: SmoSelection): void;
|
|
145
|
+
static undotDuration(selection: SmoSelection): void;
|
|
146
|
+
/**
|
|
147
|
+
* Transpose the whole score by a number of half steps. The destination key of each measure is
|
|
148
|
+
* computed from its current key, and each pitch is spelled so that its distance from the new key
|
|
149
|
+
* matches its distance from the old key (e.g. e natural in Eb becomes g# in G).
|
|
150
|
+
* @param score
|
|
151
|
+
* @param offset half steps, may be negative
|
|
152
|
+
*/
|
|
153
|
+
static transposeScore(score: SmoScore, offset: number): void;
|
|
154
|
+
static updateTabNote(selections: SmoSelection[], tabNote: SmoTabNote): void;
|
|
155
|
+
static removeTabNote(selections: SmoSelection[]): void;
|
|
156
|
+
static transpose(selection: SmoSelection, offset: number): boolean;
|
|
157
|
+
static setPitch(selection: SmoSelection, pitches: Pitch[]): void;
|
|
158
|
+
static toggleCourtesyAccidental(selection: SmoSelection): void;
|
|
159
|
+
static courtesyAccidental(pitchSelection: SmoSelection, toBe: boolean): void;
|
|
160
|
+
static toggleEnharmonic(pitchSelection: SmoSelection): void;
|
|
161
|
+
static addDynamic(selection: SmoSelection, dynamic: SmoDynamicText): void;
|
|
162
|
+
static removeDynamic(selection: SmoSelection, dynamic: SmoDynamicText): void;
|
|
163
|
+
static unbeamSelections(noteSelection: SmoSelection): void;
|
|
164
|
+
static beamSelections(score: SmoScore, selections: SmoSelection[]): void;
|
|
165
|
+
/**
|
|
166
|
+
* Set the beam grouping of the measures in the selections, or clear it with an empty list.
|
|
167
|
+
* Only the staves and measures in the selections change.
|
|
168
|
+
* @param score the score the selections belong to
|
|
169
|
+
* @param selections the notes or measures to change; every measure they touch is changed
|
|
170
|
+
* @param groups the longest beam group for each group in turn, whole numbers from 1 to 4
|
|
171
|
+
*/
|
|
172
|
+
static setBeamGroups(score: SmoScore, selections: SmoSelection[], groups: number[]): void;
|
|
173
|
+
/**
|
|
174
|
+
* Set the beam grouping of every measure in every staff of the score, or clear it with
|
|
175
|
+
* an empty list.
|
|
176
|
+
*/
|
|
177
|
+
static setAllBeamGroups(score: SmoScore, groups: number[]): void;
|
|
178
|
+
/**
|
|
179
|
+
* Fill the measures in the selections with rests, removing all the notes and voices in them. See
|
|
180
|
+
* {@link fillRestDurations} for which rests. Everything attached to the removed notes goes with them:
|
|
181
|
+
* staff modifiers that start or end in the measure (slurs, ties, hairpins) and text attached to its notes.
|
|
182
|
+
* Only the staves and measures in the selections change.
|
|
183
|
+
* @param score the score the selections belong to
|
|
184
|
+
* @param selections the notes or measures; every measure they touch is filled
|
|
185
|
+
* @param fill which rests
|
|
186
|
+
*/
|
|
187
|
+
static fillMeasures(score: SmoScore, selections: SmoSelection[], fill: MeasureFillType): void;
|
|
188
|
+
static clearAllBeamGroups(score: SmoScore): void;
|
|
189
|
+
static clearBeamGroups(score: SmoScore, selections: SmoSelection[]): void;
|
|
190
|
+
/**
|
|
191
|
+
* Put the selected notes back to automatic beaming: no hand-placed beam break or join, and the
|
|
192
|
+
* beam length for the meter from the score preferences. In a measure with its own beam grouping,
|
|
193
|
+
* that grouping applies.
|
|
194
|
+
*/
|
|
195
|
+
static autoBeamSelections(score: SmoScore, selections: SmoSelection[]): void;
|
|
196
|
+
/**
|
|
197
|
+
* Set the stem direction of the selected notes
|
|
198
|
+
* @param flagState one of {@link SmoNote.flagStates}: auto, up or down
|
|
199
|
+
*/
|
|
200
|
+
static setStemDirection(selections: SmoSelection[], flagState: number): void;
|
|
201
|
+
static toggleBeamDirection(selections: SmoSelection[]): void;
|
|
202
|
+
static addEnding(score: SmoScore, parameters: SmoVolta): void;
|
|
203
|
+
static removeEnding(score: SmoScore, ending: SmoVolta): void;
|
|
204
|
+
static addTextGroup(score: SmoScore, textGroup: SmoTextGroup): void;
|
|
205
|
+
static removeTextGroup(score: SmoScore, textGroup: SmoTextGroup): void;
|
|
206
|
+
static addMeasureText(score: SmoScore, selection: SmoSelection, measureText: SmoMeasureText): void;
|
|
207
|
+
static removeMeasureText(score: SmoScore, selection: SmoSelection, mt: SmoMeasureText): void;
|
|
208
|
+
static removeRehearsalMark(score: SmoScore, selection: SmoSelection): void;
|
|
209
|
+
static addRehearsalMark(score: SmoScore, selection: SmoSelection, rehearsalMark: SmoRehearsalMark): void;
|
|
210
|
+
static addTempo(score: SmoScore, selection: SmoSelection, tempo: SmoTempo): void;
|
|
211
|
+
static setMeasureBarline(score: SmoScore, selection: SmoSelection, barline: SmoBarline): void;
|
|
212
|
+
static setRepeatSymbol(score: SmoScore, selection: SmoSelection, sym: SmoRepeatSymbol): void;
|
|
213
|
+
static interval(selection: SmoSelection, interval: number): boolean;
|
|
214
|
+
static addOrReplaceBracket(modifier: SmoStaffTextBracket, fromSelection: SmoSelection, toSelection: SmoSelection): void;
|
|
215
|
+
static createTextBracket(fromSelection: SmoSelection, toSelection: SmoSelection, text: string): SmoStaffTextBracket;
|
|
216
|
+
static createTextBracketGeneric(fromSelection: SmoSelection, toSelection: SmoSelection): SmoStaffTextBracket;
|
|
217
|
+
static createRitardBracket(fromSelection: SmoSelection, toSelection: SmoSelection): SmoStaffTextBracket;
|
|
218
|
+
static createAccelerandoBracket(fromSelection: SmoSelection, toSelection: SmoSelection): SmoStaffTextBracket;
|
|
219
|
+
static createCrescendoBracket(fromSelection: SmoSelection, toSelection: SmoSelection): SmoStaffTextBracket;
|
|
220
|
+
static createDimenuendoBracket(fromSelection: SmoSelection, toSelection: SmoSelection): SmoStaffTextBracket;
|
|
221
|
+
static createCrescendo(fromSelection: SmoSelection, toSelection: SmoSelection): SmoStaffHairpin;
|
|
222
|
+
static createDecrescendo(fromSelection: SmoSelection, toSelection: SmoSelection): SmoStaffHairpin;
|
|
223
|
+
static createTie(fromSelection: SmoSelection, toSelection: SmoSelection): SmoTie;
|
|
224
|
+
static getSlurDefaultParameters(selections: SmoSelection[]): void;
|
|
225
|
+
/**
|
|
226
|
+
* Heuristically determine how a slur should be formatted based on the notes. Determine control points,
|
|
227
|
+
* offset, and alignment
|
|
228
|
+
*
|
|
229
|
+
* ## Note: Vexflow slurs consider `top` to mean the furthest point from the note head, which could be the top
|
|
230
|
+
* or the bottom of the note. It also considers yoffset to be negative if inverted is set. Head means close to the
|
|
231
|
+
* note head.
|
|
232
|
+
* @param score
|
|
233
|
+
* @param fromSelection
|
|
234
|
+
* @param toSelection
|
|
235
|
+
* @returns
|
|
236
|
+
*/
|
|
237
|
+
static getDefaultSlurDirection(score: SmoScore, fromSelector: SmoSelector, toSelector: SmoSelector): SmoSlurParams;
|
|
238
|
+
static createSlur(score: SmoScore, fromSelection: SmoSelection, toSelection: SmoSelection): SmoSlur;
|
|
239
|
+
static addStaff(score: SmoScore, parameters: SmoSystemStaffParams): SmoSystemStaff;
|
|
240
|
+
/**
|
|
241
|
+
* Create a part with one or two staves. The part goes at the requested location, but never
|
|
242
|
+
* inside an existing part with more than one staff. Staves below it move down, and anything
|
|
243
|
+
* that refers to them moves too. The new part keeps its text groups (preserveTextGroups), which
|
|
244
|
+
* is not the default for a part.
|
|
245
|
+
* @param score the full score
|
|
246
|
+
* @param params where to put the part and what it is called
|
|
247
|
+
* @returns the index of the first new staff
|
|
248
|
+
*/
|
|
249
|
+
static addPart(score: SmoScore, params: AddPartParams): number;
|
|
250
|
+
static removeStaff(score: SmoScore, index: number): void;
|
|
251
|
+
static transposeChords(smoNote: SmoNote, offset: number, key: string): void;
|
|
252
|
+
/**
|
|
253
|
+
* Compute new map based on current instrument selections, adjusting existing instruments as required
|
|
254
|
+
* @param instrument
|
|
255
|
+
* @param selections
|
|
256
|
+
*/
|
|
257
|
+
static changeInstrument(instrument: SmoInstrument, score: SmoScore, selections: SmoSelection[]): void;
|
|
258
|
+
/**
|
|
259
|
+
* Group runs of empty measures into multimeasure rests, for parts that show them. A landmark splits a run:
|
|
260
|
+
* a start landmark (rehearsal mark, key, time or tempo change, Segno, Coda, instrument change, repeat
|
|
261
|
+
* or double barline at the start of the measure) ends the rest before its measure and that measure
|
|
262
|
+
* starts the next rest; an end landmark (D.S., D.C., To Coda, Fine, repeat or double barline at the end of
|
|
263
|
+
* the measure) ends the rest after its measure. Measures under a volta ending are never grouped.
|
|
264
|
+
* The result is recorded in each measure's svg record: the first measure of a rest has its length, end
|
|
265
|
+
* barline and end symbol, the others are hidden; every other measure is reset.
|
|
266
|
+
* @param score the score being displayed
|
|
267
|
+
*/
|
|
268
|
+
static computeMultipartRest(score: SmoScore): void;
|
|
269
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { SmoScore } from '../data/score';
|
|
2
|
+
import { SmoTimeSignature } from '../data/measureModifiers';
|
|
3
|
+
/**
|
|
4
|
+
* What {@link rebarMeasures} did
|
|
5
|
+
* @category SmoTransform
|
|
6
|
+
*/
|
|
7
|
+
export interface RebarResult {
|
|
8
|
+
/** the first re-barred measure */
|
|
9
|
+
firstMeasure: number;
|
|
10
|
+
/** how many measures are now in the range: the ones it had, plus those that were added */
|
|
11
|
+
measureCount: number;
|
|
12
|
+
/** how many measures were added after the old last measure of the range */
|
|
13
|
+
added: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Which measures a time signature change applies to: only the selected ones, from the first selected one to the
|
|
17
|
+
* end of the score, or the whole score.
|
|
18
|
+
* @category SmoTransform
|
|
19
|
+
*/
|
|
20
|
+
export type TimeSignatureApplyTo = 'Selected' | 'Remaining' | 'Score';
|
|
21
|
+
/**
|
|
22
|
+
* The range of measures a time signature change applies to.
|
|
23
|
+
* @param applyTo which measures
|
|
24
|
+
* @param selectedMeasures the measure index of each selected note or measure, in any staff, in any order
|
|
25
|
+
* @param measureCount the number of measures in the score
|
|
26
|
+
* @returns the first and last measure, or null if there is no selection (and the choice is not the whole score) or no measures
|
|
27
|
+
*/
|
|
28
|
+
export declare const timeSignatureRange: (applyTo: TimeSignatureApplyTo, selectedMeasures: number[], measureCount: number) => {
|
|
29
|
+
firstMeasure: number;
|
|
30
|
+
lastMeasure: number;
|
|
31
|
+
} | null;
|
|
32
|
+
/**
|
|
33
|
+
* The length in ticks of the measure k places after the first of a range that gets a time signature. A time
|
|
34
|
+
* signature with several parts (3/4+2/4) alternates its parts from measure to measure.
|
|
35
|
+
* @param timeSignature the new time signature
|
|
36
|
+
* @param k how many measures after the first re-barred measure
|
|
37
|
+
* @param startIndex which part the first re-barred measure has
|
|
38
|
+
*/
|
|
39
|
+
export declare const rebarMeasureTicks: (timeSignature: SmoTimeSignature, k: number, startIndex: number) => number;
|
|
40
|
+
/**
|
|
41
|
+
* Re-bar the music of a range of measures into a new time signature, in every staff. The notes keep their order
|
|
42
|
+
* and their lengths. Where the new measures are not long enough, measures are added after the range (in every
|
|
43
|
+
* staff) so that all of the music fits; measures are never removed. A note that crosses a new bar line is split and
|
|
44
|
+
* tied. A tuplet is kept whole, starting the next measure if it does not fit. Things attached to a note stay with
|
|
45
|
+
* it; if the note is split they stay with the first part. Slurs, ties, hairpins and other things between notes
|
|
46
|
+
* follow their notes. Hand-placed beaming in the range is reset to automatic.
|
|
47
|
+
* @param score the score to change
|
|
48
|
+
* @param firstMeasure the first measure of the range
|
|
49
|
+
* @param lastMeasure the last measure of the range
|
|
50
|
+
* @param timeSignature the new time signature
|
|
51
|
+
* @returns what was done. Nothing is changed, and `added` is 0, if the range is not in the score.
|
|
52
|
+
*/
|
|
53
|
+
export declare const rebarMeasures: (score: SmoScore, firstMeasure: number, lastMeasure: number, timeSignature: SmoTimeSignature) => RebarResult;
|