smoosic 1.0.24 → 1.0.26
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 +1 -1
- package/package.json +1 -1
- package/release/smoosic.js +1 -1
- package/release/styles/ribbon.css +5 -10
- package/src/application/exports.ts +1 -0
- package/src/styles/ribbon.css +5 -10
- package/types/src/application/application.d.ts +102 -102
- package/types/src/application/common.d.ts +74 -74
- package/types/src/application/configuration.d.ts +74 -74
- package/types/src/application/dom.d.ts +8 -8
- package/types/src/application/dynamicInit.d.ts +1 -1
- package/types/src/application/eventHandler.d.ts +78 -78
- package/types/src/application/exports.d.ts +494 -493
- package/types/src/application/generateVexTests.d.ts +10 -10
- package/types/src/application/keyCommands.d.ts +90 -90
- package/types/src/common/bootstrap.bundle.d.ts +1138 -1138
- package/types/src/common/htmlHelpers.d.ts +105 -105
- package/types/src/common/jszip.d.ts +2 -2
- package/types/src/common/midi-parser.d.ts +38 -38
- package/types/src/common/promiseHelpers.d.ts +30 -30
- package/types/src/common/serializationHelpers.d.ts +29 -29
- package/types/src/common/textformatter.d.ts +140 -140
- package/types/src/common/vex.d.ts +222 -222
- package/types/src/render/audio/musicCursor.d.ts +25 -25
- package/types/src/render/audio/oscillator.d.ts +98 -98
- package/types/src/render/audio/player.d.ts +141 -141
- package/types/src/render/audio/samples.d.ts +56 -56
- package/types/src/render/sui/configuration.d.ts +12 -12
- package/types/src/render/sui/formatter.d.ts +151 -151
- package/types/src/render/sui/layoutDebug.d.ts +43 -43
- package/types/src/render/sui/mapper.d.ts +116 -116
- package/types/src/render/sui/piano.d.ts +46 -46
- package/types/src/render/sui/renderState.d.ts +88 -88
- package/types/src/render/sui/scoreRender.d.ts +93 -93
- package/types/src/render/sui/scoreView.d.ts +267 -267
- package/types/src/render/sui/scoreViewOperations.d.ts +594 -594
- package/types/src/render/sui/scroller.d.ts +34 -34
- package/types/src/render/sui/svgHelpers.d.ts +85 -85
- package/types/src/render/sui/svgPageMap.d.ts +318 -318
- package/types/src/render/sui/textEdit.d.ts +310 -310
- package/types/src/render/sui/textRender.d.ts +189 -189
- package/types/src/render/sui/tracker.d.ts +90 -90
- package/types/src/render/vex/glyphDimensions.d.ts +23 -23
- package/types/src/render/vex/smoAdapter.d.ts +46 -46
- package/types/src/render/vex/toVex.d.ts +13 -13
- package/types/src/render/vex/vxMeasure.d.ts +95 -95
- package/types/src/render/vex/vxNote.d.ts +55 -55
- package/types/src/render/vex/vxSystem.d.ts +64 -64
- package/types/src/smo/data/common.d.ts +220 -220
- package/types/src/smo/data/measure.d.ts +510 -510
- package/types/src/smo/data/measureModifiers.d.ts +506 -506
- package/types/src/smo/data/music.d.ts +438 -438
- package/types/src/smo/data/note.d.ts +485 -485
- package/types/src/smo/data/noteModifiers.d.ts +590 -590
- package/types/src/smo/data/partInfo.d.ts +162 -162
- package/types/src/smo/data/score.d.ts +395 -395
- package/types/src/smo/data/scoreModifiers.d.ts +433 -433
- package/types/src/smo/data/scoreText.d.ts +277 -277
- package/types/src/smo/data/staffModifiers.d.ts +767 -767
- package/types/src/smo/data/systemStaff.d.ts +238 -238
- package/types/src/smo/data/tuplet.d.ts +146 -146
- package/types/src/smo/midi/midiToSmo.d.ts +198 -198
- package/types/src/smo/midi/smoToMidi.d.ts +23 -23
- package/types/src/smo/mxml/smoToXml.d.ts +165 -165
- package/types/src/smo/mxml/xmlHelpers.d.ts +140 -140
- package/types/src/smo/mxml/xmlState.d.ts +257 -257
- package/types/src/smo/mxml/xmlToSmo.d.ts +92 -92
- package/types/src/smo/xform/beamers.d.ts +46 -46
- package/types/src/smo/xform/copypaste.d.ts +99 -99
- package/types/src/smo/xform/operations.d.ts +127 -127
- package/types/src/smo/xform/roadmap.d.ts +70 -70
- package/types/src/smo/xform/selections.d.ts +153 -153
- package/types/src/smo/xform/tickDuration.d.ts +155 -155
- package/types/src/smo/xform/tickMap.d.ts +34 -34
- package/types/src/smo/xform/undo.d.ts +142 -142
- package/types/src/smo/xform/updateAudio.d.ts +9 -9
- package/types/src/styles/font_metrics/Commissioner-Medium-Metrics.d.ts +871 -871
- package/types/src/styles/font_metrics/ConcertOne-Regular.d.ts +871 -871
- package/types/src/styles/font_metrics/Merriweather-Regular.d.ts +871 -871
- package/types/src/styles/font_metrics/arial_metrics.d.ts +870 -870
- package/types/src/styles/font_metrics/ssp-sans-metrics.d.ts +871 -871
- package/types/src/styles/font_metrics/ssp-serif-metrics.d.ts +871 -871
- package/types/src/styles/font_metrics/times_metrics.d.ts +870 -870
- package/types/src/ui/buttons/button.d.ts +95 -95
- package/types/src/ui/buttons/collapsable.d.ts +42 -42
- package/types/src/ui/buttons/display.d.ts +23 -23
- package/types/src/ui/buttons/ribbon.d.ts +76 -76
- package/types/src/ui/common.d.ts +45 -45
- package/types/src/ui/composable/draggable.d.ts +12 -12
- package/types/src/ui/configuration.d.ts +31 -31
- package/types/src/ui/dialogs/adapter.d.ts +107 -107
- package/types/src/ui/dialogs/addMeasure.d.ts +20 -20
- package/types/src/ui/dialogs/arpeggio.d.ts +2 -2
- package/types/src/ui/dialogs/articulation.d.ts +2 -2
- package/types/src/ui/dialogs/audioSettings.d.ts +32 -32
- package/types/src/ui/dialogs/chordChange.d.ts +35 -35
- package/types/src/ui/dialogs/clefChange.d.ts +2 -2
- package/types/src/ui/dialogs/components/baseComponent.d.ts +158 -158
- package/types/src/ui/dialogs/components/button.d.ts +54 -54
- package/types/src/ui/dialogs/components/buttonArray.d.ts +101 -101
- package/types/src/ui/dialogs/components/checkdrop.d.ts +27 -27
- package/types/src/ui/dialogs/components/dragText.d.ts +27 -27
- package/types/src/ui/dialogs/components/dropdown.d.ts +78 -78
- package/types/src/ui/dialogs/components/fileDownload.d.ts +28 -28
- package/types/src/ui/dialogs/components/fontComponent.d.ts +32 -32
- package/types/src/ui/dialogs/components/noteText.d.ts +98 -98
- package/types/src/ui/dialogs/components/pitch.d.ts +95 -95
- package/types/src/ui/dialogs/components/rocker.d.ts +66 -66
- package/types/src/ui/dialogs/components/staffComponents.d.ts +77 -77
- package/types/src/ui/dialogs/components/textCheck.d.ts +38 -38
- package/types/src/ui/dialogs/components/textInPlace.d.ts +90 -90
- package/types/src/ui/dialogs/components/textInput.d.ts +58 -58
- package/types/src/ui/dialogs/components/tie.d.ts +41 -41
- package/types/src/ui/dialogs/components/toggle.d.ts +53 -53
- package/types/src/ui/dialogs/components/tree.d.ts +46 -46
- package/types/src/ui/dialogs/customTuplets.d.ts +25 -25
- package/types/src/ui/dialogs/dialog.d.ts +201 -201
- package/types/src/ui/dialogs/durations.d.ts +2 -2
- package/types/src/ui/dialogs/dynamics.d.ts +37 -37
- package/types/src/ui/dialogs/endings.d.ts +61 -61
- 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/fonts.d.ts +2 -2
- package/types/src/ui/dialogs/globalLayout.d.ts +2 -2
- package/types/src/ui/dialogs/gracenote.d.ts +2 -2
- package/types/src/ui/dialogs/hairpin.d.ts +35 -35
- package/types/src/ui/dialogs/instrument.d.ts +3 -3
- package/types/src/ui/dialogs/keySignature.d.ts +33 -33
- package/types/src/ui/dialogs/library.d.ts +70 -70
- package/types/src/ui/dialogs/lyric.d.ts +39 -39
- package/types/src/ui/dialogs/measureFormat.d.ts +52 -52
- package/types/src/ui/dialogs/microtones.d.ts +2 -2
- package/types/src/ui/dialogs/noteHead.d.ts +2 -2
- package/types/src/ui/dialogs/ornament.d.ts +2 -2
- package/types/src/ui/dialogs/pageLayout.d.ts +2 -2
- package/types/src/ui/dialogs/partInfo.d.ts +2 -2
- package/types/src/ui/dialogs/pedalMarking.d.ts +35 -35
- package/types/src/ui/dialogs/pitch.d.ts +2 -2
- package/types/src/ui/dialogs/preferences.d.ts +2 -2
- package/types/src/ui/dialogs/scoreId.d.ts +2 -2
- package/types/src/ui/dialogs/scoreView.d.ts +2 -2
- package/types/src/ui/dialogs/slur.d.ts +57 -57
- package/types/src/ui/dialogs/staffGroup.d.ts +2 -2
- package/types/src/ui/dialogs/tabNote.d.ts +32 -32
- package/types/src/ui/dialogs/tabStave.d.ts +43 -43
- package/types/src/ui/dialogs/tempo.d.ts +50 -50
- package/types/src/ui/dialogs/textBlock.d.ts +61 -61
- package/types/src/ui/dialogs/textBracket.d.ts +35 -35
- package/types/src/ui/dialogs/tie.d.ts +41 -41
- package/types/src/ui/dialogs/timeSignature.d.ts +34 -34
- package/types/src/ui/dialogs/transposeScore.d.ts +2 -2
- package/types/src/ui/dialogs/volta.d.ts +40 -40
- package/types/src/ui/eventSource.d.ts +63 -63
- package/types/src/ui/exceptions.d.ts +12 -12
- package/types/src/ui/fileio/fileInput.d.ts +12 -12
- package/types/src/ui/fileio/library.d.ts +40 -40
- package/types/src/ui/fileio/xhrLoader.d.ts +18 -18
- package/types/src/ui/help.d.ts +22 -22
- package/types/src/ui/i18n/language.d.ts +37 -37
- package/types/src/ui/i18n/language_ar.d.ts +5 -5
- package/types/src/ui/i18n/language_de.d.ts +1 -1
- package/types/src/ui/i18n/language_en.d.ts +18 -18
- package/types/src/ui/i18n/translationEditor.d.ts +14 -14
- package/types/src/ui/keyBindings/default/editorKeys.d.ts +7 -7
- package/types/src/ui/keyBindings/default/trackerKeys.d.ts +7 -7
- package/types/src/ui/menus/beams.d.ts +13 -13
- package/types/src/ui/menus/edit.d.ts +8 -8
- package/types/src/ui/menus/file.d.ts +26 -26
- package/types/src/ui/menus/help.d.ts +8 -8
- package/types/src/ui/menus/keySignature.d.ts +13 -13
- package/types/src/ui/menus/language.d.ts +12 -12
- package/types/src/ui/menus/manager.d.ts +57 -57
- package/types/src/ui/menus/measure.d.ts +8 -8
- package/types/src/ui/menus/menu.d.ts +136 -136
- package/types/src/ui/menus/note.d.ts +8 -8
- package/types/src/ui/menus/partSelection.d.ts +19 -19
- package/types/src/ui/menus/parts.d.ts +50 -50
- package/types/src/ui/menus/score.d.ts +20 -20
- package/types/src/ui/menus/staffModifier.d.ts +21 -21
- package/types/src/ui/menus/text.d.ts +8 -8
- package/types/src/ui/menus/timeSignature.d.ts +12 -12
- package/types/src/ui/menus/tuplets.d.ts +13 -13
- package/types/src/ui/menus/voices.d.ts +8 -8
- package/types/src/ui/modalDialogs.d.ts +1 -1
- package/types/src/ui/navigation.d.ts +15 -15
- package/types/src/ui/qwerty.d.ts +41 -41
- package/types/src/ui/ribbonLayout/default/defaultRibbon.d.ts +15 -15
- package/types/src/ui/ribbonLayout/default/tabletRibbon.d.ts +22 -22
- package/types/typedoc.d.ts +158 -158
|
@@ -1,395 +1,395 @@
|
|
|
1
|
-
import { SvgDimensions } from './common';
|
|
2
|
-
import { SmoMeasure, SmoMeasureParams, ColumnMappedParams } from './measure';
|
|
3
|
-
import { SmoNoteModifierBase } from './noteModifiers';
|
|
4
|
-
import { SmoTempoText, SmoMeasureModifierBase, TimeSignature, SmoMeasureFormatParamsSer } from './measureModifiers';
|
|
5
|
-
import { StaffModifierBase, SmoInstrument } from './staffModifiers';
|
|
6
|
-
import { SmoSystemGroup, SmoSystemGroupParamsSer, SmoScoreModifierBase, SmoFormattingManager, SmoAudioPlayerSettings, SmoAudioPlayerParameters, SmoLayoutManagerParamsSer, SmoLayoutManager, FontPurpose, SmoScoreInfo, ScoreMetadataSer, SmoScorePreferences } from './scoreModifiers';
|
|
7
|
-
import { SmoTextGroup, SmoTextGroupParamsSer } from './scoreText';
|
|
8
|
-
import { SmoSystemStaff, SmoSystemStaffParams, SmoSystemStaffParamsSer } from './systemStaff';
|
|
9
|
-
import { SmoSelector, SmoSelection } from '../xform/selections';
|
|
10
|
-
import { FontInfo } from '../../common/vex';
|
|
11
|
-
/**
|
|
12
|
-
* List of engraving fonts available in Smoosic
|
|
13
|
-
*/
|
|
14
|
-
export type engravingFontType = 'Bravura' | 'Gonville' | 'Petaluma' | 'Leland';
|
|
15
|
-
/**
|
|
16
|
-
* Arrary of engraving fonts available in Smoosic
|
|
17
|
-
*/
|
|
18
|
-
export declare const engravingFontTypes: engravingFontType[];
|
|
19
|
-
export declare function isEngravingFont(et: engravingFontType | string): et is engravingFontType;
|
|
20
|
-
/**
|
|
21
|
-
* Constructor parameters. Usually you will call
|
|
22
|
-
* {@link SmoScore.defaults}, and modify the parameters you need to change.
|
|
23
|
-
* A new score with the defaults will create a single, empty measure.
|
|
24
|
-
* @category SmoObject
|
|
25
|
-
*/
|
|
26
|
-
export interface SmoScoreParams {
|
|
27
|
-
/**
|
|
28
|
-
* global font defaults for this score
|
|
29
|
-
*/
|
|
30
|
-
fonts: FontPurpose[];
|
|
31
|
-
/**
|
|
32
|
-
* identifying information about the score
|
|
33
|
-
*/
|
|
34
|
-
scoreInfo: SmoScoreInfo;
|
|
35
|
-
/**
|
|
36
|
-
* customized editor behavior
|
|
37
|
-
*/
|
|
38
|
-
preferences: SmoScorePreferences;
|
|
39
|
-
/**
|
|
40
|
-
* contained {@link SmoSystemStaffParams} objects
|
|
41
|
-
*/
|
|
42
|
-
staves: SmoSystemStaffParams[];
|
|
43
|
-
activeStaff?: number;
|
|
44
|
-
/**
|
|
45
|
-
* score text, not part of specific music
|
|
46
|
-
*/
|
|
47
|
-
textGroups: SmoTextGroup[];
|
|
48
|
-
/**
|
|
49
|
-
* System groups for formatting/justification
|
|
50
|
-
*/
|
|
51
|
-
systemGroups: SmoSystemGroup[];
|
|
52
|
-
/**
|
|
53
|
-
* future: global audio settings
|
|
54
|
-
*/
|
|
55
|
-
audioSettings: SmoAudioPlayerParameters;
|
|
56
|
-
/**
|
|
57
|
-
* layout manager, for svg and div geometry, page sizes, header sizes etc.
|
|
58
|
-
*/
|
|
59
|
-
layoutManager?: SmoLayoutManager;
|
|
60
|
-
/**
|
|
61
|
-
* measure-specific formatting
|
|
62
|
-
*/
|
|
63
|
-
formattingManager?: SmoFormattingManager;
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Serialization structure for the entire score. Score is deserialized from this
|
|
67
|
-
* @category serialization
|
|
68
|
-
*/
|
|
69
|
-
export interface SmoScoreParamsSer {
|
|
70
|
-
/**
|
|
71
|
-
* some information about the score, mostly non-musical
|
|
72
|
-
*/
|
|
73
|
-
metadata: ScoreMetadataSer;
|
|
74
|
-
/**
|
|
75
|
-
* contained {@link SmoSystemStaffParams} objects
|
|
76
|
-
*/
|
|
77
|
-
staves: SmoSystemStaffParamsSer[];
|
|
78
|
-
/**
|
|
79
|
-
* score text, not part of specific music
|
|
80
|
-
*/
|
|
81
|
-
textGroups: SmoTextGroupParamsSer[];
|
|
82
|
-
/**
|
|
83
|
-
* System groups for formatting/justification
|
|
84
|
-
*/
|
|
85
|
-
systemGroups: SmoSystemGroupParamsSer[];
|
|
86
|
-
/**
|
|
87
|
-
* future: global audio settings
|
|
88
|
-
*/
|
|
89
|
-
audioSettings: SmoAudioPlayerParameters;
|
|
90
|
-
/**
|
|
91
|
-
* layout manager, for svg and div geometry, page sizes, header sizes etc.
|
|
92
|
-
*/
|
|
93
|
-
layoutManager?: SmoLayoutManagerParamsSer;
|
|
94
|
-
/**
|
|
95
|
-
* map of measure formats to measure
|
|
96
|
-
*/
|
|
97
|
-
measureFormats: SmoMeasureFormatParamsSer[];
|
|
98
|
-
/**
|
|
99
|
-
* tempo, key and other column-mapped parameters
|
|
100
|
-
*/
|
|
101
|
-
columnAttributeMap: ColumnParamsMapType;
|
|
102
|
-
/**
|
|
103
|
-
* dictionary compression for serialization
|
|
104
|
-
*/
|
|
105
|
-
dictionary: Record<string, string>;
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* @category SmoObject
|
|
109
|
-
*/
|
|
110
|
-
export interface SmoScoreSerializeOptions {
|
|
111
|
-
skipStaves: boolean;
|
|
112
|
-
useDictionary: boolean;
|
|
113
|
-
preserveStaffIds: boolean;
|
|
114
|
-
}
|
|
115
|
-
export declare function isEmptyTextBlock(params: Partial<SmoTextGroupParamsSer>): params is SmoTextGroupParamsSer;
|
|
116
|
-
/**
|
|
117
|
-
* @category SmoObject
|
|
118
|
-
*/
|
|
119
|
-
export interface ColumnParamsMapType {
|
|
120
|
-
keySignature: Record<number, string>;
|
|
121
|
-
tempo: Record<number, SmoTempoText>;
|
|
122
|
-
timeSignature: Record<number, TimeSignature>;
|
|
123
|
-
renumberingMap: Record<number, number>;
|
|
124
|
-
}
|
|
125
|
-
export declare function isSmoScoreParemsSer(params: Partial<SmoScoreParamsSer>): params is SmoScoreParamsSer;
|
|
126
|
-
/**
|
|
127
|
-
* Union of modifier types Smo modifier types
|
|
128
|
-
*/
|
|
129
|
-
export type SmoModifier = SmoNoteModifierBase | SmoMeasureModifierBase | StaffModifierBase | SmoScoreModifierBase;
|
|
130
|
-
/**
|
|
131
|
-
* Score is a container of staves, and metadata about the score. Serializing the score serializes the
|
|
132
|
-
* child object. It is the highest-level object in Smoosic.
|
|
133
|
-
* @category SmoObject
|
|
134
|
-
*/
|
|
135
|
-
export declare class SmoScore {
|
|
136
|
-
/**
|
|
137
|
-
* Default fonts in this score, for each type of text (lyrics, etc)
|
|
138
|
-
*
|
|
139
|
-
* @type {FontPurpose[]}
|
|
140
|
-
* @memberof SmoScore
|
|
141
|
-
*/
|
|
142
|
-
fonts: FontPurpose[];
|
|
143
|
-
/**
|
|
144
|
-
* General info about the score, used for export and library
|
|
145
|
-
*
|
|
146
|
-
* @type {SmoScoreInfo}
|
|
147
|
-
* @memberof SmoScore
|
|
148
|
-
*/
|
|
149
|
-
scoreInfo: SmoScoreInfo;
|
|
150
|
-
/**
|
|
151
|
-
* Default behavior for this score. Indicates some global behavior like whether to advance the cursor.
|
|
152
|
-
*
|
|
153
|
-
* @type {SmoScorePreferences}
|
|
154
|
-
* @memberof SmoScore
|
|
155
|
-
*/
|
|
156
|
-
preferences: SmoScorePreferences;
|
|
157
|
-
/**
|
|
158
|
-
* The staves that make up the music of the score
|
|
159
|
-
*
|
|
160
|
-
* @type {SmoSystemStaff[]}
|
|
161
|
-
* @memberof SmoScore
|
|
162
|
-
*/
|
|
163
|
-
staves: SmoSystemStaff[];
|
|
164
|
-
/**
|
|
165
|
-
* The active staff, used for some types of selections. Not serialized.
|
|
166
|
-
*
|
|
167
|
-
* @type {number}
|
|
168
|
-
* @memberof SmoScore
|
|
169
|
-
*/
|
|
170
|
-
activeStaff: number;
|
|
171
|
-
/**
|
|
172
|
-
* Text associated with the score, but not a specific musical element (e.g. lyrics are contains by notes)
|
|
173
|
-
*
|
|
174
|
-
* @type {SmoTextGroup[]}
|
|
175
|
-
* @memberof SmoScore
|
|
176
|
-
*/
|
|
177
|
-
textGroups: SmoTextGroup[];
|
|
178
|
-
/**
|
|
179
|
-
* A logical grouping of staves for justification
|
|
180
|
-
*
|
|
181
|
-
* @type {SmoSystemGroup[]}
|
|
182
|
-
* @memberof SmoScore
|
|
183
|
-
*/
|
|
184
|
-
systemGroups: SmoSystemGroup[];
|
|
185
|
-
/**
|
|
186
|
-
* some audio player defaults
|
|
187
|
-
*
|
|
188
|
-
* @type {SmoAudioPlayerSettings}
|
|
189
|
-
* @memberof SmoScore
|
|
190
|
-
*/
|
|
191
|
-
audioSettings: SmoAudioPlayerSettings;
|
|
192
|
-
/**
|
|
193
|
-
* Preserve a map of measures to their actual measure numbers
|
|
194
|
-
*
|
|
195
|
-
* @type {Record<number, number>}
|
|
196
|
-
* @memberof SmoScore
|
|
197
|
-
*/
|
|
198
|
-
renumberingMap: Record<number, number>;
|
|
199
|
-
/**
|
|
200
|
-
* page and rendering layout of the score, including the ppi and scaling of the pages.
|
|
201
|
-
*
|
|
202
|
-
* @type {SmoLayoutManager}
|
|
203
|
-
* @memberof SmoScore
|
|
204
|
-
*/
|
|
205
|
-
layoutManager?: SmoLayoutManager;
|
|
206
|
-
/**
|
|
207
|
-
* per-measure formatting customizations.
|
|
208
|
-
*
|
|
209
|
-
* @type {SmoFormattingManager}
|
|
210
|
-
* @memberof SmoScore
|
|
211
|
-
*/
|
|
212
|
-
formattingManager?: SmoFormattingManager;
|
|
213
|
-
constructor(params: SmoScoreParams);
|
|
214
|
-
static get engravingFonts(): Record<string, string>;
|
|
215
|
-
static get fontPurposes(): Record<string, number>;
|
|
216
|
-
static get scoreInfoDefaults(): SmoScoreInfo;
|
|
217
|
-
static get scoreMetadataDefaults(): ScoreMetadataSer;
|
|
218
|
-
static get defaults(): SmoScoreParams;
|
|
219
|
-
static get pageSizes(): string[];
|
|
220
|
-
static get pageDimensions(): Record<string, SvgDimensions>;
|
|
221
|
-
static pageSizeFromDimensions(width: number, height: number): string | null;
|
|
222
|
-
static get preferences(): string[];
|
|
223
|
-
/**
|
|
224
|
-
* serialize the keySignature, tempo and time signature, which are mapped
|
|
225
|
-
* to a column at a measure index
|
|
226
|
-
* @returns
|
|
227
|
-
*/
|
|
228
|
-
serializeColumnMapped(func: (measure: SmoMeasure) => ColumnMappedParams): {
|
|
229
|
-
keySignature: Record<number, string>;
|
|
230
|
-
tempo: Record<number, SmoTempoText>;
|
|
231
|
-
timeSignature: Record<number, TimeSignature>;
|
|
232
|
-
renumberingMap: Record<number, number>;
|
|
233
|
-
};
|
|
234
|
-
/**
|
|
235
|
-
* Column-mapped attributes stay the same in each measure until
|
|
236
|
-
* changed, like key-signatures. We don't store each measure value to
|
|
237
|
-
* make the files smaller
|
|
238
|
-
* @param scoreObj - the json blob that contains the score data
|
|
239
|
-
* @returns
|
|
240
|
-
*/
|
|
241
|
-
static deserializeColumnMapped(scoreObj: any): void;
|
|
242
|
-
/**
|
|
243
|
-
* Serialize the entire score.
|
|
244
|
-
* @returns JSON object
|
|
245
|
-
*/
|
|
246
|
-
serialize(options?: SmoScoreSerializeOptions): SmoScoreParamsSer;
|
|
247
|
-
updateScorePreferences(pref: SmoScorePreferences): void;
|
|
248
|
-
get engravingFont(): engravingFontType;
|
|
249
|
-
set engravingFont(value: engravingFontType);
|
|
250
|
-
static upConvertGlobalLayout(jsonObj: any): void;
|
|
251
|
-
/**
|
|
252
|
-
* Convert legacy score layout to layoutManager object parameters
|
|
253
|
-
* @param jsonObj
|
|
254
|
-
*/
|
|
255
|
-
static upConvertLayout(jsonObj: any): void;
|
|
256
|
-
/**
|
|
257
|
-
* Hack: for the case of a score containing only a single part, use the text from the
|
|
258
|
-
* part.
|
|
259
|
-
* @param jsonObj
|
|
260
|
-
* @returns
|
|
261
|
-
*/
|
|
262
|
-
static fixTextGroupSinglePart(jsonObj: any): void;
|
|
263
|
-
/**
|
|
264
|
-
* Deserialize an entire score
|
|
265
|
-
* @param jsonString
|
|
266
|
-
* @returns SmoScore
|
|
267
|
-
*/
|
|
268
|
-
static deserialize(jsonString: string): SmoScore;
|
|
269
|
-
/**
|
|
270
|
-
* Convert measure formatting from legacy scores, that had the formatting
|
|
271
|
-
* per measure, to the new way that has a separate formatting object.
|
|
272
|
-
* **/
|
|
273
|
-
static measureFormatFromLegacyScore(score: SmoScore, jsonObj: any): SmoFormattingManager | null;
|
|
274
|
-
/**
|
|
275
|
-
* Return a default score with all default setting and one measure of notes
|
|
276
|
-
* @param scoreDefaults
|
|
277
|
-
* @param measureDefaults
|
|
278
|
-
* @returns
|
|
279
|
-
*/
|
|
280
|
-
static getDefaultScore(scoreDefaults: SmoScoreParams, measureDefaults: SmoMeasureParams | null): SmoScore;
|
|
281
|
-
/**
|
|
282
|
-
* Return an 'empty' score, with one measure of rests
|
|
283
|
-
* @param scoreDefaults
|
|
284
|
-
* @returns
|
|
285
|
-
*/
|
|
286
|
-
static getEmptyScore(scoreDefaults: SmoScoreParams): SmoScore;
|
|
287
|
-
/**
|
|
288
|
-
* We have deleted a measure, update the renumber index to
|
|
289
|
-
* shuffle back.
|
|
290
|
-
* @param indexToDelete
|
|
291
|
-
*/
|
|
292
|
-
updateRenumberForAddDelete(indexToDelete: number, toAdd: boolean): void;
|
|
293
|
-
updateRenumberingMap(measureIndex: number, localIndex: number): void;
|
|
294
|
-
/**
|
|
295
|
-
* Iteratively number the staves, like when adding a measure
|
|
296
|
-
*/
|
|
297
|
-
numberStaves(): void;
|
|
298
|
-
get measureCount(): number;
|
|
299
|
-
/**
|
|
300
|
-
* determine if the measure at this index could be a multi-measure rest
|
|
301
|
-
* @param measureIndex - the measure index we are considering to add
|
|
302
|
-
* @param start - the measure index would be the start of the rest
|
|
303
|
-
* @returns
|
|
304
|
-
*/
|
|
305
|
-
isMultimeasureRest(measureIndex: number, start: boolean, forceRest: boolean): boolean;
|
|
306
|
-
/**
|
|
307
|
-
* Restore measure formats stored when a score is serialized
|
|
308
|
-
*/
|
|
309
|
-
updateMeasureFormats(): void;
|
|
310
|
-
/**
|
|
311
|
-
* Add a measure to the score with the supplied parameters at the supplied index.
|
|
312
|
-
* The defaults per staff may be different depending on the clef, key of the staff.
|
|
313
|
-
*/
|
|
314
|
-
addDefaultMeasureWithNotes(measureIndex: number, parameters: SmoMeasureParams): void;
|
|
315
|
-
getLocalMeasureIndex(measureIndex: number): number;
|
|
316
|
-
/**
|
|
317
|
-
* delete the measure at the supplied index in all the staves
|
|
318
|
-
*/
|
|
319
|
-
deleteMeasure(measureIndex: number): void;
|
|
320
|
-
/**
|
|
321
|
-
* coordinate the ids of the display score with the stored score
|
|
322
|
-
* @param other
|
|
323
|
-
*/
|
|
324
|
-
synchronizeTextGroups(other: SmoTextGroup[]): void;
|
|
325
|
-
/**
|
|
326
|
-
* get a measure 'compatible' with the measure at the given index, in terms
|
|
327
|
-
* of key, time signature etc.
|
|
328
|
-
* @param measureIndex
|
|
329
|
-
* @param staffIndex
|
|
330
|
-
* @returns
|
|
331
|
-
*/
|
|
332
|
-
getPrototypeMeasure(measureIndex: number, staffIndex: number): SmoMeasure;
|
|
333
|
-
/**
|
|
334
|
-
* Give a measure prototype, create a new measure and add it to each staff, with the
|
|
335
|
-
* correct settings for current time signature/clef.
|
|
336
|
-
* @param measureIndex
|
|
337
|
-
*/
|
|
338
|
-
addMeasure(measureIndex: number): void;
|
|
339
|
-
/**
|
|
340
|
-
* Replace the measure at the given location. Probably due to an undo operation or paste.
|
|
341
|
-
* @param selector
|
|
342
|
-
* @param measure
|
|
343
|
-
*/
|
|
344
|
-
replaceMeasure(selector: SmoSelector, measure: SmoMeasure): void;
|
|
345
|
-
getSystemGroupForStaff(selection: SmoSelection): SmoSystemGroup | undefined;
|
|
346
|
-
getSystemGroupForStaffId(staffId: number): SmoSystemGroup | undefined;
|
|
347
|
-
getStavesForGroup(group: SmoSystemGroup): SmoSystemStaff[];
|
|
348
|
-
addOrReplaceSystemGroup(newGroup: SmoSystemGroup): void;
|
|
349
|
-
removeSystemGroup(group: SmoSystemGroup): void;
|
|
350
|
-
clearSystemGroups(): void;
|
|
351
|
-
isPartExposed(): boolean;
|
|
352
|
-
/**
|
|
353
|
-
* Probably due to an undo operation, replace the staff at the given index.
|
|
354
|
-
* @param index
|
|
355
|
-
* @param staff
|
|
356
|
-
*/
|
|
357
|
-
replaceStaff(index: number, staff: SmoSystemStaff): void;
|
|
358
|
-
/**
|
|
359
|
-
*
|
|
360
|
-
* @param measureIndex
|
|
361
|
-
* @param key
|
|
362
|
-
*/
|
|
363
|
-
addKeySignature(measureIndex: number, key: string): void;
|
|
364
|
-
/**
|
|
365
|
-
* If the part is a transposing part, remove the transposition from the notes/staff. This logic
|
|
366
|
-
* assumes the measures previously had transposeIndex set up by the instrument map.
|
|
367
|
-
*/
|
|
368
|
-
setTransposing(): void;
|
|
369
|
-
/**
|
|
370
|
-
* If the score is switching from transposing to non-transposing, update the index
|
|
371
|
-
* and pitches. This logic assumes we are changing from transposing to non-transposing.
|
|
372
|
-
*/
|
|
373
|
-
setNonTransposing(): void;
|
|
374
|
-
setNoteInstrumentProperties(): void;
|
|
375
|
-
addStaff(parameters: SmoSystemStaffParams): SmoSystemStaff;
|
|
376
|
-
/**
|
|
377
|
-
* delete any system groups that apply to deleted staves
|
|
378
|
-
*/
|
|
379
|
-
updateSystemGroups(): void;
|
|
380
|
-
removeStaff(index: number): void;
|
|
381
|
-
getStaffInstrument(selector: SmoSelector): SmoInstrument;
|
|
382
|
-
swapStaves(index1: number, index2: number): void;
|
|
383
|
-
updateTextGroup(textGroup: SmoTextGroup, toAdd: boolean): void;
|
|
384
|
-
addTextGroup(textGroup: SmoTextGroup): void;
|
|
385
|
-
getTextGroups(): SmoTextGroup[];
|
|
386
|
-
scaleTextGroups(scale: number): void;
|
|
387
|
-
removeTextGroup(textGroup: SmoTextGroup): void;
|
|
388
|
-
setLyricAdjustWidth(adjustNoteWidth: boolean): void;
|
|
389
|
-
setChordAdjustWidth(adjustNoteWidth: boolean): void;
|
|
390
|
-
setLyricFont(fontInfo: FontInfo): void;
|
|
391
|
-
setChordFont(fontInfo: FontInfo): void;
|
|
392
|
-
get measures(): SmoMeasure[];
|
|
393
|
-
incrementActiveStaff(offset: number): number;
|
|
394
|
-
setActiveStaff(index: number): void;
|
|
395
|
-
}
|
|
1
|
+
import { SvgDimensions } from './common';
|
|
2
|
+
import { SmoMeasure, SmoMeasureParams, ColumnMappedParams } from './measure';
|
|
3
|
+
import { SmoNoteModifierBase } from './noteModifiers';
|
|
4
|
+
import { SmoTempoText, SmoMeasureModifierBase, TimeSignature, SmoMeasureFormatParamsSer } from './measureModifiers';
|
|
5
|
+
import { StaffModifierBase, SmoInstrument } from './staffModifiers';
|
|
6
|
+
import { SmoSystemGroup, SmoSystemGroupParamsSer, SmoScoreModifierBase, SmoFormattingManager, SmoAudioPlayerSettings, SmoAudioPlayerParameters, SmoLayoutManagerParamsSer, SmoLayoutManager, FontPurpose, SmoScoreInfo, ScoreMetadataSer, SmoScorePreferences } from './scoreModifiers';
|
|
7
|
+
import { SmoTextGroup, SmoTextGroupParamsSer } from './scoreText';
|
|
8
|
+
import { SmoSystemStaff, SmoSystemStaffParams, SmoSystemStaffParamsSer } from './systemStaff';
|
|
9
|
+
import { SmoSelector, SmoSelection } from '../xform/selections';
|
|
10
|
+
import { FontInfo } from '../../common/vex';
|
|
11
|
+
/**
|
|
12
|
+
* List of engraving fonts available in Smoosic
|
|
13
|
+
*/
|
|
14
|
+
export type engravingFontType = 'Bravura' | 'Gonville' | 'Petaluma' | 'Leland';
|
|
15
|
+
/**
|
|
16
|
+
* Arrary of engraving fonts available in Smoosic
|
|
17
|
+
*/
|
|
18
|
+
export declare const engravingFontTypes: engravingFontType[];
|
|
19
|
+
export declare function isEngravingFont(et: engravingFontType | string): et is engravingFontType;
|
|
20
|
+
/**
|
|
21
|
+
* Constructor parameters. Usually you will call
|
|
22
|
+
* {@link SmoScore.defaults}, and modify the parameters you need to change.
|
|
23
|
+
* A new score with the defaults will create a single, empty measure.
|
|
24
|
+
* @category SmoObject
|
|
25
|
+
*/
|
|
26
|
+
export interface SmoScoreParams {
|
|
27
|
+
/**
|
|
28
|
+
* global font defaults for this score
|
|
29
|
+
*/
|
|
30
|
+
fonts: FontPurpose[];
|
|
31
|
+
/**
|
|
32
|
+
* identifying information about the score
|
|
33
|
+
*/
|
|
34
|
+
scoreInfo: SmoScoreInfo;
|
|
35
|
+
/**
|
|
36
|
+
* customized editor behavior
|
|
37
|
+
*/
|
|
38
|
+
preferences: SmoScorePreferences;
|
|
39
|
+
/**
|
|
40
|
+
* contained {@link SmoSystemStaffParams} objects
|
|
41
|
+
*/
|
|
42
|
+
staves: SmoSystemStaffParams[];
|
|
43
|
+
activeStaff?: number;
|
|
44
|
+
/**
|
|
45
|
+
* score text, not part of specific music
|
|
46
|
+
*/
|
|
47
|
+
textGroups: SmoTextGroup[];
|
|
48
|
+
/**
|
|
49
|
+
* System groups for formatting/justification
|
|
50
|
+
*/
|
|
51
|
+
systemGroups: SmoSystemGroup[];
|
|
52
|
+
/**
|
|
53
|
+
* future: global audio settings
|
|
54
|
+
*/
|
|
55
|
+
audioSettings: SmoAudioPlayerParameters;
|
|
56
|
+
/**
|
|
57
|
+
* layout manager, for svg and div geometry, page sizes, header sizes etc.
|
|
58
|
+
*/
|
|
59
|
+
layoutManager?: SmoLayoutManager;
|
|
60
|
+
/**
|
|
61
|
+
* measure-specific formatting
|
|
62
|
+
*/
|
|
63
|
+
formattingManager?: SmoFormattingManager;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Serialization structure for the entire score. Score is deserialized from this
|
|
67
|
+
* @category serialization
|
|
68
|
+
*/
|
|
69
|
+
export interface SmoScoreParamsSer {
|
|
70
|
+
/**
|
|
71
|
+
* some information about the score, mostly non-musical
|
|
72
|
+
*/
|
|
73
|
+
metadata: ScoreMetadataSer;
|
|
74
|
+
/**
|
|
75
|
+
* contained {@link SmoSystemStaffParams} objects
|
|
76
|
+
*/
|
|
77
|
+
staves: SmoSystemStaffParamsSer[];
|
|
78
|
+
/**
|
|
79
|
+
* score text, not part of specific music
|
|
80
|
+
*/
|
|
81
|
+
textGroups: SmoTextGroupParamsSer[];
|
|
82
|
+
/**
|
|
83
|
+
* System groups for formatting/justification
|
|
84
|
+
*/
|
|
85
|
+
systemGroups: SmoSystemGroupParamsSer[];
|
|
86
|
+
/**
|
|
87
|
+
* future: global audio settings
|
|
88
|
+
*/
|
|
89
|
+
audioSettings: SmoAudioPlayerParameters;
|
|
90
|
+
/**
|
|
91
|
+
* layout manager, for svg and div geometry, page sizes, header sizes etc.
|
|
92
|
+
*/
|
|
93
|
+
layoutManager?: SmoLayoutManagerParamsSer;
|
|
94
|
+
/**
|
|
95
|
+
* map of measure formats to measure
|
|
96
|
+
*/
|
|
97
|
+
measureFormats: SmoMeasureFormatParamsSer[];
|
|
98
|
+
/**
|
|
99
|
+
* tempo, key and other column-mapped parameters
|
|
100
|
+
*/
|
|
101
|
+
columnAttributeMap: ColumnParamsMapType;
|
|
102
|
+
/**
|
|
103
|
+
* dictionary compression for serialization
|
|
104
|
+
*/
|
|
105
|
+
dictionary: Record<string, string>;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* @category SmoObject
|
|
109
|
+
*/
|
|
110
|
+
export interface SmoScoreSerializeOptions {
|
|
111
|
+
skipStaves: boolean;
|
|
112
|
+
useDictionary: boolean;
|
|
113
|
+
preserveStaffIds: boolean;
|
|
114
|
+
}
|
|
115
|
+
export declare function isEmptyTextBlock(params: Partial<SmoTextGroupParamsSer>): params is SmoTextGroupParamsSer;
|
|
116
|
+
/**
|
|
117
|
+
* @category SmoObject
|
|
118
|
+
*/
|
|
119
|
+
export interface ColumnParamsMapType {
|
|
120
|
+
keySignature: Record<number, string>;
|
|
121
|
+
tempo: Record<number, SmoTempoText>;
|
|
122
|
+
timeSignature: Record<number, TimeSignature>;
|
|
123
|
+
renumberingMap: Record<number, number>;
|
|
124
|
+
}
|
|
125
|
+
export declare function isSmoScoreParemsSer(params: Partial<SmoScoreParamsSer>): params is SmoScoreParamsSer;
|
|
126
|
+
/**
|
|
127
|
+
* Union of modifier types Smo modifier types
|
|
128
|
+
*/
|
|
129
|
+
export type SmoModifier = SmoNoteModifierBase | SmoMeasureModifierBase | StaffModifierBase | SmoScoreModifierBase;
|
|
130
|
+
/**
|
|
131
|
+
* Score is a container of staves, and metadata about the score. Serializing the score serializes the
|
|
132
|
+
* child object. It is the highest-level object in Smoosic.
|
|
133
|
+
* @category SmoObject
|
|
134
|
+
*/
|
|
135
|
+
export declare class SmoScore {
|
|
136
|
+
/**
|
|
137
|
+
* Default fonts in this score, for each type of text (lyrics, etc)
|
|
138
|
+
*
|
|
139
|
+
* @type {FontPurpose[]}
|
|
140
|
+
* @memberof SmoScore
|
|
141
|
+
*/
|
|
142
|
+
fonts: FontPurpose[];
|
|
143
|
+
/**
|
|
144
|
+
* General info about the score, used for export and library
|
|
145
|
+
*
|
|
146
|
+
* @type {SmoScoreInfo}
|
|
147
|
+
* @memberof SmoScore
|
|
148
|
+
*/
|
|
149
|
+
scoreInfo: SmoScoreInfo;
|
|
150
|
+
/**
|
|
151
|
+
* Default behavior for this score. Indicates some global behavior like whether to advance the cursor.
|
|
152
|
+
*
|
|
153
|
+
* @type {SmoScorePreferences}
|
|
154
|
+
* @memberof SmoScore
|
|
155
|
+
*/
|
|
156
|
+
preferences: SmoScorePreferences;
|
|
157
|
+
/**
|
|
158
|
+
* The staves that make up the music of the score
|
|
159
|
+
*
|
|
160
|
+
* @type {SmoSystemStaff[]}
|
|
161
|
+
* @memberof SmoScore
|
|
162
|
+
*/
|
|
163
|
+
staves: SmoSystemStaff[];
|
|
164
|
+
/**
|
|
165
|
+
* The active staff, used for some types of selections. Not serialized.
|
|
166
|
+
*
|
|
167
|
+
* @type {number}
|
|
168
|
+
* @memberof SmoScore
|
|
169
|
+
*/
|
|
170
|
+
activeStaff: number;
|
|
171
|
+
/**
|
|
172
|
+
* Text associated with the score, but not a specific musical element (e.g. lyrics are contains by notes)
|
|
173
|
+
*
|
|
174
|
+
* @type {SmoTextGroup[]}
|
|
175
|
+
* @memberof SmoScore
|
|
176
|
+
*/
|
|
177
|
+
textGroups: SmoTextGroup[];
|
|
178
|
+
/**
|
|
179
|
+
* A logical grouping of staves for justification
|
|
180
|
+
*
|
|
181
|
+
* @type {SmoSystemGroup[]}
|
|
182
|
+
* @memberof SmoScore
|
|
183
|
+
*/
|
|
184
|
+
systemGroups: SmoSystemGroup[];
|
|
185
|
+
/**
|
|
186
|
+
* some audio player defaults
|
|
187
|
+
*
|
|
188
|
+
* @type {SmoAudioPlayerSettings}
|
|
189
|
+
* @memberof SmoScore
|
|
190
|
+
*/
|
|
191
|
+
audioSettings: SmoAudioPlayerSettings;
|
|
192
|
+
/**
|
|
193
|
+
* Preserve a map of measures to their actual measure numbers
|
|
194
|
+
*
|
|
195
|
+
* @type {Record<number, number>}
|
|
196
|
+
* @memberof SmoScore
|
|
197
|
+
*/
|
|
198
|
+
renumberingMap: Record<number, number>;
|
|
199
|
+
/**
|
|
200
|
+
* page and rendering layout of the score, including the ppi and scaling of the pages.
|
|
201
|
+
*
|
|
202
|
+
* @type {SmoLayoutManager}
|
|
203
|
+
* @memberof SmoScore
|
|
204
|
+
*/
|
|
205
|
+
layoutManager?: SmoLayoutManager;
|
|
206
|
+
/**
|
|
207
|
+
* per-measure formatting customizations.
|
|
208
|
+
*
|
|
209
|
+
* @type {SmoFormattingManager}
|
|
210
|
+
* @memberof SmoScore
|
|
211
|
+
*/
|
|
212
|
+
formattingManager?: SmoFormattingManager;
|
|
213
|
+
constructor(params: SmoScoreParams);
|
|
214
|
+
static get engravingFonts(): Record<string, string>;
|
|
215
|
+
static get fontPurposes(): Record<string, number>;
|
|
216
|
+
static get scoreInfoDefaults(): SmoScoreInfo;
|
|
217
|
+
static get scoreMetadataDefaults(): ScoreMetadataSer;
|
|
218
|
+
static get defaults(): SmoScoreParams;
|
|
219
|
+
static get pageSizes(): string[];
|
|
220
|
+
static get pageDimensions(): Record<string, SvgDimensions>;
|
|
221
|
+
static pageSizeFromDimensions(width: number, height: number): string | null;
|
|
222
|
+
static get preferences(): string[];
|
|
223
|
+
/**
|
|
224
|
+
* serialize the keySignature, tempo and time signature, which are mapped
|
|
225
|
+
* to a column at a measure index
|
|
226
|
+
* @returns
|
|
227
|
+
*/
|
|
228
|
+
serializeColumnMapped(func: (measure: SmoMeasure) => ColumnMappedParams): {
|
|
229
|
+
keySignature: Record<number, string>;
|
|
230
|
+
tempo: Record<number, SmoTempoText>;
|
|
231
|
+
timeSignature: Record<number, TimeSignature>;
|
|
232
|
+
renumberingMap: Record<number, number>;
|
|
233
|
+
};
|
|
234
|
+
/**
|
|
235
|
+
* Column-mapped attributes stay the same in each measure until
|
|
236
|
+
* changed, like key-signatures. We don't store each measure value to
|
|
237
|
+
* make the files smaller
|
|
238
|
+
* @param scoreObj - the json blob that contains the score data
|
|
239
|
+
* @returns
|
|
240
|
+
*/
|
|
241
|
+
static deserializeColumnMapped(scoreObj: any): void;
|
|
242
|
+
/**
|
|
243
|
+
* Serialize the entire score.
|
|
244
|
+
* @returns JSON object
|
|
245
|
+
*/
|
|
246
|
+
serialize(options?: SmoScoreSerializeOptions): SmoScoreParamsSer;
|
|
247
|
+
updateScorePreferences(pref: SmoScorePreferences): void;
|
|
248
|
+
get engravingFont(): engravingFontType;
|
|
249
|
+
set engravingFont(value: engravingFontType);
|
|
250
|
+
static upConvertGlobalLayout(jsonObj: any): void;
|
|
251
|
+
/**
|
|
252
|
+
* Convert legacy score layout to layoutManager object parameters
|
|
253
|
+
* @param jsonObj
|
|
254
|
+
*/
|
|
255
|
+
static upConvertLayout(jsonObj: any): void;
|
|
256
|
+
/**
|
|
257
|
+
* Hack: for the case of a score containing only a single part, use the text from the
|
|
258
|
+
* part.
|
|
259
|
+
* @param jsonObj
|
|
260
|
+
* @returns
|
|
261
|
+
*/
|
|
262
|
+
static fixTextGroupSinglePart(jsonObj: any): void;
|
|
263
|
+
/**
|
|
264
|
+
* Deserialize an entire score
|
|
265
|
+
* @param jsonString
|
|
266
|
+
* @returns SmoScore
|
|
267
|
+
*/
|
|
268
|
+
static deserialize(jsonString: string): SmoScore;
|
|
269
|
+
/**
|
|
270
|
+
* Convert measure formatting from legacy scores, that had the formatting
|
|
271
|
+
* per measure, to the new way that has a separate formatting object.
|
|
272
|
+
* **/
|
|
273
|
+
static measureFormatFromLegacyScore(score: SmoScore, jsonObj: any): SmoFormattingManager | null;
|
|
274
|
+
/**
|
|
275
|
+
* Return a default score with all default setting and one measure of notes
|
|
276
|
+
* @param scoreDefaults
|
|
277
|
+
* @param measureDefaults
|
|
278
|
+
* @returns
|
|
279
|
+
*/
|
|
280
|
+
static getDefaultScore(scoreDefaults: SmoScoreParams, measureDefaults: SmoMeasureParams | null): SmoScore;
|
|
281
|
+
/**
|
|
282
|
+
* Return an 'empty' score, with one measure of rests
|
|
283
|
+
* @param scoreDefaults
|
|
284
|
+
* @returns
|
|
285
|
+
*/
|
|
286
|
+
static getEmptyScore(scoreDefaults: SmoScoreParams): SmoScore;
|
|
287
|
+
/**
|
|
288
|
+
* We have deleted a measure, update the renumber index to
|
|
289
|
+
* shuffle back.
|
|
290
|
+
* @param indexToDelete
|
|
291
|
+
*/
|
|
292
|
+
updateRenumberForAddDelete(indexToDelete: number, toAdd: boolean): void;
|
|
293
|
+
updateRenumberingMap(measureIndex: number, localIndex: number): void;
|
|
294
|
+
/**
|
|
295
|
+
* Iteratively number the staves, like when adding a measure
|
|
296
|
+
*/
|
|
297
|
+
numberStaves(): void;
|
|
298
|
+
get measureCount(): number;
|
|
299
|
+
/**
|
|
300
|
+
* determine if the measure at this index could be a multi-measure rest
|
|
301
|
+
* @param measureIndex - the measure index we are considering to add
|
|
302
|
+
* @param start - the measure index would be the start of the rest
|
|
303
|
+
* @returns
|
|
304
|
+
*/
|
|
305
|
+
isMultimeasureRest(measureIndex: number, start: boolean, forceRest: boolean): boolean;
|
|
306
|
+
/**
|
|
307
|
+
* Restore measure formats stored when a score is serialized
|
|
308
|
+
*/
|
|
309
|
+
updateMeasureFormats(): void;
|
|
310
|
+
/**
|
|
311
|
+
* Add a measure to the score with the supplied parameters at the supplied index.
|
|
312
|
+
* The defaults per staff may be different depending on the clef, key of the staff.
|
|
313
|
+
*/
|
|
314
|
+
addDefaultMeasureWithNotes(measureIndex: number, parameters: SmoMeasureParams): void;
|
|
315
|
+
getLocalMeasureIndex(measureIndex: number): number;
|
|
316
|
+
/**
|
|
317
|
+
* delete the measure at the supplied index in all the staves
|
|
318
|
+
*/
|
|
319
|
+
deleteMeasure(measureIndex: number): void;
|
|
320
|
+
/**
|
|
321
|
+
* coordinate the ids of the display score with the stored score
|
|
322
|
+
* @param other
|
|
323
|
+
*/
|
|
324
|
+
synchronizeTextGroups(other: SmoTextGroup[]): void;
|
|
325
|
+
/**
|
|
326
|
+
* get a measure 'compatible' with the measure at the given index, in terms
|
|
327
|
+
* of key, time signature etc.
|
|
328
|
+
* @param measureIndex
|
|
329
|
+
* @param staffIndex
|
|
330
|
+
* @returns
|
|
331
|
+
*/
|
|
332
|
+
getPrototypeMeasure(measureIndex: number, staffIndex: number): SmoMeasure;
|
|
333
|
+
/**
|
|
334
|
+
* Give a measure prototype, create a new measure and add it to each staff, with the
|
|
335
|
+
* correct settings for current time signature/clef.
|
|
336
|
+
* @param measureIndex
|
|
337
|
+
*/
|
|
338
|
+
addMeasure(measureIndex: number): void;
|
|
339
|
+
/**
|
|
340
|
+
* Replace the measure at the given location. Probably due to an undo operation or paste.
|
|
341
|
+
* @param selector
|
|
342
|
+
* @param measure
|
|
343
|
+
*/
|
|
344
|
+
replaceMeasure(selector: SmoSelector, measure: SmoMeasure): void;
|
|
345
|
+
getSystemGroupForStaff(selection: SmoSelection): SmoSystemGroup | undefined;
|
|
346
|
+
getSystemGroupForStaffId(staffId: number): SmoSystemGroup | undefined;
|
|
347
|
+
getStavesForGroup(group: SmoSystemGroup): SmoSystemStaff[];
|
|
348
|
+
addOrReplaceSystemGroup(newGroup: SmoSystemGroup): void;
|
|
349
|
+
removeSystemGroup(group: SmoSystemGroup): void;
|
|
350
|
+
clearSystemGroups(): void;
|
|
351
|
+
isPartExposed(): boolean;
|
|
352
|
+
/**
|
|
353
|
+
* Probably due to an undo operation, replace the staff at the given index.
|
|
354
|
+
* @param index
|
|
355
|
+
* @param staff
|
|
356
|
+
*/
|
|
357
|
+
replaceStaff(index: number, staff: SmoSystemStaff): void;
|
|
358
|
+
/**
|
|
359
|
+
*
|
|
360
|
+
* @param measureIndex
|
|
361
|
+
* @param key
|
|
362
|
+
*/
|
|
363
|
+
addKeySignature(measureIndex: number, key: string): void;
|
|
364
|
+
/**
|
|
365
|
+
* If the part is a transposing part, remove the transposition from the notes/staff. This logic
|
|
366
|
+
* assumes the measures previously had transposeIndex set up by the instrument map.
|
|
367
|
+
*/
|
|
368
|
+
setTransposing(): void;
|
|
369
|
+
/**
|
|
370
|
+
* If the score is switching from transposing to non-transposing, update the index
|
|
371
|
+
* and pitches. This logic assumes we are changing from transposing to non-transposing.
|
|
372
|
+
*/
|
|
373
|
+
setNonTransposing(): void;
|
|
374
|
+
setNoteInstrumentProperties(): void;
|
|
375
|
+
addStaff(parameters: SmoSystemStaffParams): SmoSystemStaff;
|
|
376
|
+
/**
|
|
377
|
+
* delete any system groups that apply to deleted staves
|
|
378
|
+
*/
|
|
379
|
+
updateSystemGroups(): void;
|
|
380
|
+
removeStaff(index: number): void;
|
|
381
|
+
getStaffInstrument(selector: SmoSelector): SmoInstrument;
|
|
382
|
+
swapStaves(index1: number, index2: number): void;
|
|
383
|
+
updateTextGroup(textGroup: SmoTextGroup, toAdd: boolean): void;
|
|
384
|
+
addTextGroup(textGroup: SmoTextGroup): void;
|
|
385
|
+
getTextGroups(): SmoTextGroup[];
|
|
386
|
+
scaleTextGroups(scale: number): void;
|
|
387
|
+
removeTextGroup(textGroup: SmoTextGroup): void;
|
|
388
|
+
setLyricAdjustWidth(adjustNoteWidth: boolean): void;
|
|
389
|
+
setChordAdjustWidth(adjustNoteWidth: boolean): void;
|
|
390
|
+
setLyricFont(fontInfo: FontInfo): void;
|
|
391
|
+
setChordFont(fontInfo: FontInfo): void;
|
|
392
|
+
get measures(): SmoMeasure[];
|
|
393
|
+
incrementActiveStaff(offset: number): number;
|
|
394
|
+
setActiveStaff(index: number): void;
|
|
395
|
+
}
|