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.
Files changed (189) hide show
  1. package/build/smoosic.js +1 -1
  2. package/package.json +1 -1
  3. package/release/smoosic.js +1 -1
  4. package/release/styles/ribbon.css +5 -10
  5. package/src/application/exports.ts +1 -0
  6. package/src/styles/ribbon.css +5 -10
  7. package/types/src/application/application.d.ts +102 -102
  8. package/types/src/application/common.d.ts +74 -74
  9. package/types/src/application/configuration.d.ts +74 -74
  10. package/types/src/application/dom.d.ts +8 -8
  11. package/types/src/application/dynamicInit.d.ts +1 -1
  12. package/types/src/application/eventHandler.d.ts +78 -78
  13. package/types/src/application/exports.d.ts +494 -493
  14. package/types/src/application/generateVexTests.d.ts +10 -10
  15. package/types/src/application/keyCommands.d.ts +90 -90
  16. package/types/src/common/bootstrap.bundle.d.ts +1138 -1138
  17. package/types/src/common/htmlHelpers.d.ts +105 -105
  18. package/types/src/common/jszip.d.ts +2 -2
  19. package/types/src/common/midi-parser.d.ts +38 -38
  20. package/types/src/common/promiseHelpers.d.ts +30 -30
  21. package/types/src/common/serializationHelpers.d.ts +29 -29
  22. package/types/src/common/textformatter.d.ts +140 -140
  23. package/types/src/common/vex.d.ts +222 -222
  24. package/types/src/render/audio/musicCursor.d.ts +25 -25
  25. package/types/src/render/audio/oscillator.d.ts +98 -98
  26. package/types/src/render/audio/player.d.ts +141 -141
  27. package/types/src/render/audio/samples.d.ts +56 -56
  28. package/types/src/render/sui/configuration.d.ts +12 -12
  29. package/types/src/render/sui/formatter.d.ts +151 -151
  30. package/types/src/render/sui/layoutDebug.d.ts +43 -43
  31. package/types/src/render/sui/mapper.d.ts +116 -116
  32. package/types/src/render/sui/piano.d.ts +46 -46
  33. package/types/src/render/sui/renderState.d.ts +88 -88
  34. package/types/src/render/sui/scoreRender.d.ts +93 -93
  35. package/types/src/render/sui/scoreView.d.ts +267 -267
  36. package/types/src/render/sui/scoreViewOperations.d.ts +594 -594
  37. package/types/src/render/sui/scroller.d.ts +34 -34
  38. package/types/src/render/sui/svgHelpers.d.ts +85 -85
  39. package/types/src/render/sui/svgPageMap.d.ts +318 -318
  40. package/types/src/render/sui/textEdit.d.ts +310 -310
  41. package/types/src/render/sui/textRender.d.ts +189 -189
  42. package/types/src/render/sui/tracker.d.ts +90 -90
  43. package/types/src/render/vex/glyphDimensions.d.ts +23 -23
  44. package/types/src/render/vex/smoAdapter.d.ts +46 -46
  45. package/types/src/render/vex/toVex.d.ts +13 -13
  46. package/types/src/render/vex/vxMeasure.d.ts +95 -95
  47. package/types/src/render/vex/vxNote.d.ts +55 -55
  48. package/types/src/render/vex/vxSystem.d.ts +64 -64
  49. package/types/src/smo/data/common.d.ts +220 -220
  50. package/types/src/smo/data/measure.d.ts +510 -510
  51. package/types/src/smo/data/measureModifiers.d.ts +506 -506
  52. package/types/src/smo/data/music.d.ts +438 -438
  53. package/types/src/smo/data/note.d.ts +485 -485
  54. package/types/src/smo/data/noteModifiers.d.ts +590 -590
  55. package/types/src/smo/data/partInfo.d.ts +162 -162
  56. package/types/src/smo/data/score.d.ts +395 -395
  57. package/types/src/smo/data/scoreModifiers.d.ts +433 -433
  58. package/types/src/smo/data/scoreText.d.ts +277 -277
  59. package/types/src/smo/data/staffModifiers.d.ts +767 -767
  60. package/types/src/smo/data/systemStaff.d.ts +238 -238
  61. package/types/src/smo/data/tuplet.d.ts +146 -146
  62. package/types/src/smo/midi/midiToSmo.d.ts +198 -198
  63. package/types/src/smo/midi/smoToMidi.d.ts +23 -23
  64. package/types/src/smo/mxml/smoToXml.d.ts +165 -165
  65. package/types/src/smo/mxml/xmlHelpers.d.ts +140 -140
  66. package/types/src/smo/mxml/xmlState.d.ts +257 -257
  67. package/types/src/smo/mxml/xmlToSmo.d.ts +92 -92
  68. package/types/src/smo/xform/beamers.d.ts +46 -46
  69. package/types/src/smo/xform/copypaste.d.ts +99 -99
  70. package/types/src/smo/xform/operations.d.ts +127 -127
  71. package/types/src/smo/xform/roadmap.d.ts +70 -70
  72. package/types/src/smo/xform/selections.d.ts +153 -153
  73. package/types/src/smo/xform/tickDuration.d.ts +155 -155
  74. package/types/src/smo/xform/tickMap.d.ts +34 -34
  75. package/types/src/smo/xform/undo.d.ts +142 -142
  76. package/types/src/smo/xform/updateAudio.d.ts +9 -9
  77. package/types/src/styles/font_metrics/Commissioner-Medium-Metrics.d.ts +871 -871
  78. package/types/src/styles/font_metrics/ConcertOne-Regular.d.ts +871 -871
  79. package/types/src/styles/font_metrics/Merriweather-Regular.d.ts +871 -871
  80. package/types/src/styles/font_metrics/arial_metrics.d.ts +870 -870
  81. package/types/src/styles/font_metrics/ssp-sans-metrics.d.ts +871 -871
  82. package/types/src/styles/font_metrics/ssp-serif-metrics.d.ts +871 -871
  83. package/types/src/styles/font_metrics/times_metrics.d.ts +870 -870
  84. package/types/src/ui/buttons/button.d.ts +95 -95
  85. package/types/src/ui/buttons/collapsable.d.ts +42 -42
  86. package/types/src/ui/buttons/display.d.ts +23 -23
  87. package/types/src/ui/buttons/ribbon.d.ts +76 -76
  88. package/types/src/ui/common.d.ts +45 -45
  89. package/types/src/ui/composable/draggable.d.ts +12 -12
  90. package/types/src/ui/configuration.d.ts +31 -31
  91. package/types/src/ui/dialogs/adapter.d.ts +107 -107
  92. package/types/src/ui/dialogs/addMeasure.d.ts +20 -20
  93. package/types/src/ui/dialogs/arpeggio.d.ts +2 -2
  94. package/types/src/ui/dialogs/articulation.d.ts +2 -2
  95. package/types/src/ui/dialogs/audioSettings.d.ts +32 -32
  96. package/types/src/ui/dialogs/chordChange.d.ts +35 -35
  97. package/types/src/ui/dialogs/clefChange.d.ts +2 -2
  98. package/types/src/ui/dialogs/components/baseComponent.d.ts +158 -158
  99. package/types/src/ui/dialogs/components/button.d.ts +54 -54
  100. package/types/src/ui/dialogs/components/buttonArray.d.ts +101 -101
  101. package/types/src/ui/dialogs/components/checkdrop.d.ts +27 -27
  102. package/types/src/ui/dialogs/components/dragText.d.ts +27 -27
  103. package/types/src/ui/dialogs/components/dropdown.d.ts +78 -78
  104. package/types/src/ui/dialogs/components/fileDownload.d.ts +28 -28
  105. package/types/src/ui/dialogs/components/fontComponent.d.ts +32 -32
  106. package/types/src/ui/dialogs/components/noteText.d.ts +98 -98
  107. package/types/src/ui/dialogs/components/pitch.d.ts +95 -95
  108. package/types/src/ui/dialogs/components/rocker.d.ts +66 -66
  109. package/types/src/ui/dialogs/components/staffComponents.d.ts +77 -77
  110. package/types/src/ui/dialogs/components/textCheck.d.ts +38 -38
  111. package/types/src/ui/dialogs/components/textInPlace.d.ts +90 -90
  112. package/types/src/ui/dialogs/components/textInput.d.ts +58 -58
  113. package/types/src/ui/dialogs/components/tie.d.ts +41 -41
  114. package/types/src/ui/dialogs/components/toggle.d.ts +53 -53
  115. package/types/src/ui/dialogs/components/tree.d.ts +46 -46
  116. package/types/src/ui/dialogs/customTuplets.d.ts +25 -25
  117. package/types/src/ui/dialogs/dialog.d.ts +201 -201
  118. package/types/src/ui/dialogs/durations.d.ts +2 -2
  119. package/types/src/ui/dialogs/dynamics.d.ts +37 -37
  120. package/types/src/ui/dialogs/endings.d.ts +61 -61
  121. package/types/src/ui/dialogs/factory.d.ts +15 -15
  122. package/types/src/ui/dialogs/fileDialogs.d.ts +4 -4
  123. package/types/src/ui/dialogs/fonts.d.ts +2 -2
  124. package/types/src/ui/dialogs/globalLayout.d.ts +2 -2
  125. package/types/src/ui/dialogs/gracenote.d.ts +2 -2
  126. package/types/src/ui/dialogs/hairpin.d.ts +35 -35
  127. package/types/src/ui/dialogs/instrument.d.ts +3 -3
  128. package/types/src/ui/dialogs/keySignature.d.ts +33 -33
  129. package/types/src/ui/dialogs/library.d.ts +70 -70
  130. package/types/src/ui/dialogs/lyric.d.ts +39 -39
  131. package/types/src/ui/dialogs/measureFormat.d.ts +52 -52
  132. package/types/src/ui/dialogs/microtones.d.ts +2 -2
  133. package/types/src/ui/dialogs/noteHead.d.ts +2 -2
  134. package/types/src/ui/dialogs/ornament.d.ts +2 -2
  135. package/types/src/ui/dialogs/pageLayout.d.ts +2 -2
  136. package/types/src/ui/dialogs/partInfo.d.ts +2 -2
  137. package/types/src/ui/dialogs/pedalMarking.d.ts +35 -35
  138. package/types/src/ui/dialogs/pitch.d.ts +2 -2
  139. package/types/src/ui/dialogs/preferences.d.ts +2 -2
  140. package/types/src/ui/dialogs/scoreId.d.ts +2 -2
  141. package/types/src/ui/dialogs/scoreView.d.ts +2 -2
  142. package/types/src/ui/dialogs/slur.d.ts +57 -57
  143. package/types/src/ui/dialogs/staffGroup.d.ts +2 -2
  144. package/types/src/ui/dialogs/tabNote.d.ts +32 -32
  145. package/types/src/ui/dialogs/tabStave.d.ts +43 -43
  146. package/types/src/ui/dialogs/tempo.d.ts +50 -50
  147. package/types/src/ui/dialogs/textBlock.d.ts +61 -61
  148. package/types/src/ui/dialogs/textBracket.d.ts +35 -35
  149. package/types/src/ui/dialogs/tie.d.ts +41 -41
  150. package/types/src/ui/dialogs/timeSignature.d.ts +34 -34
  151. package/types/src/ui/dialogs/transposeScore.d.ts +2 -2
  152. package/types/src/ui/dialogs/volta.d.ts +40 -40
  153. package/types/src/ui/eventSource.d.ts +63 -63
  154. package/types/src/ui/exceptions.d.ts +12 -12
  155. package/types/src/ui/fileio/fileInput.d.ts +12 -12
  156. package/types/src/ui/fileio/library.d.ts +40 -40
  157. package/types/src/ui/fileio/xhrLoader.d.ts +18 -18
  158. package/types/src/ui/help.d.ts +22 -22
  159. package/types/src/ui/i18n/language.d.ts +37 -37
  160. package/types/src/ui/i18n/language_ar.d.ts +5 -5
  161. package/types/src/ui/i18n/language_de.d.ts +1 -1
  162. package/types/src/ui/i18n/language_en.d.ts +18 -18
  163. package/types/src/ui/i18n/translationEditor.d.ts +14 -14
  164. package/types/src/ui/keyBindings/default/editorKeys.d.ts +7 -7
  165. package/types/src/ui/keyBindings/default/trackerKeys.d.ts +7 -7
  166. package/types/src/ui/menus/beams.d.ts +13 -13
  167. package/types/src/ui/menus/edit.d.ts +8 -8
  168. package/types/src/ui/menus/file.d.ts +26 -26
  169. package/types/src/ui/menus/help.d.ts +8 -8
  170. package/types/src/ui/menus/keySignature.d.ts +13 -13
  171. package/types/src/ui/menus/language.d.ts +12 -12
  172. package/types/src/ui/menus/manager.d.ts +57 -57
  173. package/types/src/ui/menus/measure.d.ts +8 -8
  174. package/types/src/ui/menus/menu.d.ts +136 -136
  175. package/types/src/ui/menus/note.d.ts +8 -8
  176. package/types/src/ui/menus/partSelection.d.ts +19 -19
  177. package/types/src/ui/menus/parts.d.ts +50 -50
  178. package/types/src/ui/menus/score.d.ts +20 -20
  179. package/types/src/ui/menus/staffModifier.d.ts +21 -21
  180. package/types/src/ui/menus/text.d.ts +8 -8
  181. package/types/src/ui/menus/timeSignature.d.ts +12 -12
  182. package/types/src/ui/menus/tuplets.d.ts +13 -13
  183. package/types/src/ui/menus/voices.d.ts +8 -8
  184. package/types/src/ui/modalDialogs.d.ts +1 -1
  185. package/types/src/ui/navigation.d.ts +15 -15
  186. package/types/src/ui/qwerty.d.ts +41 -41
  187. package/types/src/ui/ribbonLayout/default/defaultRibbon.d.ts +15 -15
  188. package/types/src/ui/ribbonLayout/default/tabletRibbon.d.ts +22 -22
  189. package/types/typedoc.d.ts +158 -158
@@ -1,153 +1,153 @@
1
- /**
2
- * Editing operations are performed on selections. A selection can be different things, from a single pitch
3
- * to many notes. These classes standardize some standard selection operations.
4
- * SmoSelector
5
- * @module /smo/xform/selections
6
- */
7
- import { SmoScore, SmoModifier } from '../data/score';
8
- import { SmoMeasure } from '../data/measure';
9
- import { SmoNote } from '../data/note';
10
- import { SmoSystemStaff } from '../data/systemStaff';
11
- import { SvgBox, SvgPoint } from '../data/common';
12
- /**
13
- * Modifier tab is a modifier and its bounding box, that can be tabbed to with the keyboard
14
- * @category SmoTransform
15
- */
16
- export interface ModifierTab {
17
- modifier: SmoModifier;
18
- selection: SmoSelection | null;
19
- box: SvgBox;
20
- index: number;
21
- }
22
- /**
23
- * There are 2 parts to a selection: the actual musical bits that are selected, and the
24
- * indices that define what was selected. This is the latter. The actual object does not
25
- * have any methods so there is no constructor.
26
- * @category SmoTransform
27
- * */
28
- export declare class SmoSelector {
29
- static get default(): SmoSelector;
30
- staff: number;
31
- measure: number;
32
- voice: number;
33
- tick: number;
34
- pitches: number[];
35
- static measureSelector(staff: number, measure: number): SmoSelector;
36
- static fromMeasure(measure: SmoMeasure): SmoSelector;
37
- static sameNote(sel1: SmoSelector, sel2: SmoSelector): boolean;
38
- static sameMeasure(sel1: SmoSelector, sel2: SmoSelector): boolean;
39
- static sameStaff(sel1: SmoSelector, sel2: SmoSelector): boolean;
40
- /**
41
- * Return gt, not considering the voice (e.g. gt in time)
42
- * @param sel1
43
- * @param sel2
44
- */
45
- static gtInTime(sel1: SmoSelector, sel2: SmoSelector): boolean;
46
- /**
47
- * return true if sel1 > sel2
48
- */
49
- static gt(sel1: SmoSelector, sel2: SmoSelector): boolean;
50
- static eq(sel1: SmoSelector, sel2: SmoSelector): boolean;
51
- static neq(sel1: SmoSelector, sel2: SmoSelector): boolean;
52
- /**
53
- * return true if sel1 < sel2
54
- */
55
- static lt(sel1: SmoSelector, sel2: SmoSelector): boolean;
56
- /**
57
- * return true if sel1 >= sel2
58
- */
59
- static gteq(sel1: SmoSelector, sel2: SmoSelector): boolean;
60
- /**
61
- * return true if sel1 <= sel2
62
- */
63
- static lteq(sel1: SmoSelector, sel2: SmoSelector): boolean;
64
- static order(a: SmoSelector, b: SmoSelector): SmoSelector[];
65
- static getNoteKey(selector: SmoSelector): string;
66
- static getMeasureKey(selector: SmoSelector): string;
67
- static contains(testSel: SmoSelector, selStart: SmoSelector, selEnd: SmoSelector): boolean;
68
- static overlaps(start1: SmoSelector, end1: SmoSelector, start2: SmoSelector, end2: SmoSelector): boolean;
69
- static selectorNoteKey(selector: SmoSelector): string;
70
- }
71
- /**
72
- * The fields in a selection. We have the 5 musical cardinal directions of staff, measure, note, pitches,
73
- * and a selector. The pitches are indices
74
- * @category SmoTransform
75
- * */
76
- export interface SmoSelectionParams {
77
- selector: SmoSelector;
78
- _staff: SmoSystemStaff;
79
- _measure: SmoMeasure;
80
- _note?: SmoNote;
81
- _pitches?: number[];
82
- type?: string;
83
- box?: SvgBox;
84
- }
85
- /**
86
- * A selection is a {@link SmoSelector} and a set of references to musical elements, like measure etc.
87
- * The staff and measure are always a part of the selection, and possible a voice and note,
88
- * and one or more pitches. Selections can also be made from the UI by clicking on an element
89
- * or navigating to an element with the keyboard.
90
- * @category SmoTransform
91
- * */
92
- export declare class SmoSelection {
93
- selector: SmoSelector;
94
- _staff: SmoSystemStaff;
95
- _measure: SmoMeasure;
96
- _note: SmoNote | null;
97
- _pitches: number[];
98
- box: SvgBox | null;
99
- scrollBox: SvgPoint | null;
100
- static measureSelection(score: SmoScore, staffIndex: number, measureIndex: number): SmoSelection | null;
101
- static measuresInColumn(score: SmoScore, staffIndex: number): SmoSelection[];
102
- static noteSelection(score: SmoScore, staffIndex: number, measureIndex: number, voiceIndex: number, tickIndex: number): SmoSelection | null;
103
- static noteFromSelector(score: SmoScore, selector: SmoSelector): SmoSelection | null;
104
- static selectionsToEnd(score: SmoScore, staff: number, startMeasure: number): SmoSelection[];
105
- static selectionFromSelector(score: SmoScore, selector: SmoSelector): SmoSelection | null;
106
- static pitchSelection(score: SmoScore, staffIndex: number, measureIndex: number, voiceIndex: number, tickIndex: number, pitches: number[]): SmoSelection;
107
- /**
108
- * Return the selection that is tickCount ticks after the current selection.
109
- * @param score
110
- * @param selection
111
- * @param tickCount
112
- * @returns
113
- */
114
- static advanceTicks(score: SmoScore, selection: SmoSelection, tickCount: number): SmoSelection | null;
115
- /**
116
- * Count the number of tick indices between selector 1 and selector 2;
117
- * @param score
118
- * @param sel1
119
- * @param sel2
120
- * @returns
121
- */
122
- static countTickIndices(score: SmoScore, sel1: SmoSelector, sel2: SmoSelector): number;
123
- /**
124
- * Count the number of tick indices between selector 1 and selector 2;
125
- * @param score
126
- * @param sel1
127
- * @param sel2
128
- * @returns
129
- */
130
- static countTicks(score: SmoScore, sel1: SmoSelector, sel2: SmoSelector): number;
131
- static nextNoteSelection(score: SmoScore, staffIndex: number, measureIndex: number, voiceIndex: number, tickIndex: number): SmoSelection | null;
132
- /**
133
- *
134
- * @param score
135
- * @param selector
136
- * @returns
137
- */
138
- static innerSelections(score: SmoScore, startSelector: SmoSelector, endSelector: SmoSelector): SmoSelection[];
139
- static nextNoteSelectionFromSelector(score: SmoScore, selector: SmoSelector): SmoSelection | null;
140
- static lastNoteSelectionFromSelector(score: SmoScore, selector: SmoSelector): SmoSelection | null;
141
- static lastNoteSelection(score: SmoScore, staffIndex: number, measureIndex: number, voiceIndex: number, tickIndex: number): SmoSelection | null;
142
- static lastNoteSelectionNonRest(score: SmoScore, staffIndex: number, measureIndex: number, voiceIndex: number, tickIndex: number): SmoSelection | null;
143
- static nextNoteSelectionNonRest(score: SmoScore, staffIndex: number, measureIndex: number, voiceIndex: number, tickIndex: number): SmoSelection | null;
144
- static getMeasureList(selections: SmoSelection[]): SmoSelection[];
145
- static getMeasuresBetween(score: SmoScore, fromSelector: SmoSelector, toSelector: SmoSelector): SmoSelection[];
146
- static selectionsSameMeasure(selections: SmoSelection[]): boolean;
147
- static selectionsSameStaff(selections: SmoSelection[]): boolean;
148
- constructor(params: SmoSelectionParams);
149
- get staff(): SmoSystemStaff;
150
- get measure(): SmoMeasure;
151
- get note(): SmoNote | null;
152
- get pitches(): number[];
153
- }
1
+ /**
2
+ * Editing operations are performed on selections. A selection can be different things, from a single pitch
3
+ * to many notes. These classes standardize some standard selection operations.
4
+ * SmoSelector
5
+ * @module /smo/xform/selections
6
+ */
7
+ import { SmoScore, SmoModifier } from '../data/score';
8
+ import { SmoMeasure } from '../data/measure';
9
+ import { SmoNote } from '../data/note';
10
+ import { SmoSystemStaff } from '../data/systemStaff';
11
+ import { SvgBox, SvgPoint } from '../data/common';
12
+ /**
13
+ * Modifier tab is a modifier and its bounding box, that can be tabbed to with the keyboard
14
+ * @category SmoTransform
15
+ */
16
+ export interface ModifierTab {
17
+ modifier: SmoModifier;
18
+ selection: SmoSelection | null;
19
+ box: SvgBox;
20
+ index: number;
21
+ }
22
+ /**
23
+ * There are 2 parts to a selection: the actual musical bits that are selected, and the
24
+ * indices that define what was selected. This is the latter. The actual object does not
25
+ * have any methods so there is no constructor.
26
+ * @category SmoTransform
27
+ * */
28
+ export declare class SmoSelector {
29
+ static get default(): SmoSelector;
30
+ staff: number;
31
+ measure: number;
32
+ voice: number;
33
+ tick: number;
34
+ pitches: number[];
35
+ static measureSelector(staff: number, measure: number): SmoSelector;
36
+ static fromMeasure(measure: SmoMeasure): SmoSelector;
37
+ static sameNote(sel1: SmoSelector, sel2: SmoSelector): boolean;
38
+ static sameMeasure(sel1: SmoSelector, sel2: SmoSelector): boolean;
39
+ static sameStaff(sel1: SmoSelector, sel2: SmoSelector): boolean;
40
+ /**
41
+ * Return gt, not considering the voice (e.g. gt in time)
42
+ * @param sel1
43
+ * @param sel2
44
+ */
45
+ static gtInTime(sel1: SmoSelector, sel2: SmoSelector): boolean;
46
+ /**
47
+ * return true if sel1 > sel2
48
+ */
49
+ static gt(sel1: SmoSelector, sel2: SmoSelector): boolean;
50
+ static eq(sel1: SmoSelector, sel2: SmoSelector): boolean;
51
+ static neq(sel1: SmoSelector, sel2: SmoSelector): boolean;
52
+ /**
53
+ * return true if sel1 < sel2
54
+ */
55
+ static lt(sel1: SmoSelector, sel2: SmoSelector): boolean;
56
+ /**
57
+ * return true if sel1 >= sel2
58
+ */
59
+ static gteq(sel1: SmoSelector, sel2: SmoSelector): boolean;
60
+ /**
61
+ * return true if sel1 <= sel2
62
+ */
63
+ static lteq(sel1: SmoSelector, sel2: SmoSelector): boolean;
64
+ static order(a: SmoSelector, b: SmoSelector): SmoSelector[];
65
+ static getNoteKey(selector: SmoSelector): string;
66
+ static getMeasureKey(selector: SmoSelector): string;
67
+ static contains(testSel: SmoSelector, selStart: SmoSelector, selEnd: SmoSelector): boolean;
68
+ static overlaps(start1: SmoSelector, end1: SmoSelector, start2: SmoSelector, end2: SmoSelector): boolean;
69
+ static selectorNoteKey(selector: SmoSelector): string;
70
+ }
71
+ /**
72
+ * The fields in a selection. We have the 5 musical cardinal directions of staff, measure, note, pitches,
73
+ * and a selector. The pitches are indices
74
+ * @category SmoTransform
75
+ * */
76
+ export interface SmoSelectionParams {
77
+ selector: SmoSelector;
78
+ _staff: SmoSystemStaff;
79
+ _measure: SmoMeasure;
80
+ _note?: SmoNote;
81
+ _pitches?: number[];
82
+ type?: string;
83
+ box?: SvgBox;
84
+ }
85
+ /**
86
+ * A selection is a {@link SmoSelector} and a set of references to musical elements, like measure etc.
87
+ * The staff and measure are always a part of the selection, and possible a voice and note,
88
+ * and one or more pitches. Selections can also be made from the UI by clicking on an element
89
+ * or navigating to an element with the keyboard.
90
+ * @category SmoTransform
91
+ * */
92
+ export declare class SmoSelection {
93
+ selector: SmoSelector;
94
+ _staff: SmoSystemStaff;
95
+ _measure: SmoMeasure;
96
+ _note: SmoNote | null;
97
+ _pitches: number[];
98
+ box: SvgBox | null;
99
+ scrollBox: SvgPoint | null;
100
+ static measureSelection(score: SmoScore, staffIndex: number, measureIndex: number): SmoSelection | null;
101
+ static measuresInColumn(score: SmoScore, staffIndex: number): SmoSelection[];
102
+ static noteSelection(score: SmoScore, staffIndex: number, measureIndex: number, voiceIndex: number, tickIndex: number): SmoSelection | null;
103
+ static noteFromSelector(score: SmoScore, selector: SmoSelector): SmoSelection | null;
104
+ static selectionsToEnd(score: SmoScore, staff: number, startMeasure: number): SmoSelection[];
105
+ static selectionFromSelector(score: SmoScore, selector: SmoSelector): SmoSelection | null;
106
+ static pitchSelection(score: SmoScore, staffIndex: number, measureIndex: number, voiceIndex: number, tickIndex: number, pitches: number[]): SmoSelection;
107
+ /**
108
+ * Return the selection that is tickCount ticks after the current selection.
109
+ * @param score
110
+ * @param selection
111
+ * @param tickCount
112
+ * @returns
113
+ */
114
+ static advanceTicks(score: SmoScore, selection: SmoSelection, tickCount: number): SmoSelection | null;
115
+ /**
116
+ * Count the number of tick indices between selector 1 and selector 2;
117
+ * @param score
118
+ * @param sel1
119
+ * @param sel2
120
+ * @returns
121
+ */
122
+ static countTickIndices(score: SmoScore, sel1: SmoSelector, sel2: SmoSelector): number;
123
+ /**
124
+ * Count the number of tick indices between selector 1 and selector 2;
125
+ * @param score
126
+ * @param sel1
127
+ * @param sel2
128
+ * @returns
129
+ */
130
+ static countTicks(score: SmoScore, sel1: SmoSelector, sel2: SmoSelector): number;
131
+ static nextNoteSelection(score: SmoScore, staffIndex: number, measureIndex: number, voiceIndex: number, tickIndex: number): SmoSelection | null;
132
+ /**
133
+ *
134
+ * @param score
135
+ * @param selector
136
+ * @returns
137
+ */
138
+ static innerSelections(score: SmoScore, startSelector: SmoSelector, endSelector: SmoSelector): SmoSelection[];
139
+ static nextNoteSelectionFromSelector(score: SmoScore, selector: SmoSelector): SmoSelection | null;
140
+ static lastNoteSelectionFromSelector(score: SmoScore, selector: SmoSelector): SmoSelection | null;
141
+ static lastNoteSelection(score: SmoScore, staffIndex: number, measureIndex: number, voiceIndex: number, tickIndex: number): SmoSelection | null;
142
+ static lastNoteSelectionNonRest(score: SmoScore, staffIndex: number, measureIndex: number, voiceIndex: number, tickIndex: number): SmoSelection | null;
143
+ static nextNoteSelectionNonRest(score: SmoScore, staffIndex: number, measureIndex: number, voiceIndex: number, tickIndex: number): SmoSelection | null;
144
+ static getMeasureList(selections: SmoSelection[]): SmoSelection[];
145
+ static getMeasuresBetween(score: SmoScore, fromSelector: SmoSelector, toSelector: SmoSelector): SmoSelection[];
146
+ static selectionsSameMeasure(selections: SmoSelection[]): boolean;
147
+ static selectionsSameStaff(selections: SmoSelection[]): boolean;
148
+ constructor(params: SmoSelectionParams);
149
+ get staff(): SmoSystemStaff;
150
+ get measure(): SmoMeasure;
151
+ get note(): SmoNote | null;
152
+ get pitches(): number[];
153
+ }
@@ -1,155 +1,155 @@
1
- import { SmoNote } from '../data/note';
2
- import { SmoMeasure } from '../data/measure';
3
- import { TickMap } from './tickMap';
4
- /**
5
- * Abstract class for classes that modifiy duration.
6
- * @category SmoTransform
7
- * @param note the note we're iterating over
8
- * @param tickmap the tickmap for the measure
9
- * @param index the index into the tickmap
10
- * @returns the note or notes that replace this one. Null if this note is no longer in the measure
11
- */
12
- export declare abstract class TickIteratorBase {
13
- iterateOverTick(note: SmoNote, tickmap: TickMap, index: number): SmoNote | SmoNote[] | null;
14
- }
15
- /**
16
- * SmoTickIterator
17
- * this is a local helper class that follows a pattern of iterating of the notes. Most of the
18
- * duration changers iterate over a selection, and return:
19
- * - A note, if the duration changes
20
- * - An array of notes, if the notes split
21
- * - null if the note stays the same
22
- * - empty array, remove the note from the group
23
- * @category SmoTransform
24
- */
25
- export declare class SmoTickIterator {
26
- notes: SmoNote[];
27
- newNotes: SmoNote[];
28
- actor: TickIteratorBase;
29
- measure: SmoMeasure;
30
- voice: number;
31
- keySignature: string;
32
- constructor(measure: SmoMeasure, actor: TickIteratorBase, voiceIndex: number);
33
- static nullActor(note: SmoNote): SmoNote;
34
- /**
35
- *
36
- * @param measure {SmoMeasure}
37
- * @param actor {}
38
- * @param voiceIndex
39
- */
40
- static iterateOverTicks(measure: SmoMeasure, actor: TickIteratorBase, voiceIndex: number): void;
41
- iterateOverTick(tickmap: TickMap, index: number, note: SmoNote): SmoNote | null;
42
- run(): SmoNote[];
43
- }
44
- /**
45
- * used to create a contract/dilate operation on a note via {@link SmoContractNoteActor}
46
- * @category SmoTransform
47
- */
48
- export interface SmoContractNoteParams {
49
- startIndex: number;
50
- measure: SmoMeasure;
51
- voice: number;
52
- newStemTicks: number;
53
- }
54
- /**
55
- * Contract the duration of a note, filling in the space with another note
56
- * or rest.
57
- * @category SmoTransform
58
- * */
59
- export declare class SmoContractNoteActor extends TickIteratorBase {
60
- startIndex: number;
61
- newStemTicks: number;
62
- measure: SmoMeasure;
63
- voice: number;
64
- constructor(params: SmoContractNoteParams);
65
- static apply(params: SmoContractNoteParams): void;
66
- iterateOverTick(note: SmoNote, tickmap: TickMap, index: number): SmoNote | SmoNote[] | null;
67
- }
68
- /**
69
- * Constructor when we want to double or dot the duration of a note (stretch)
70
- * for {@link SmoStretchNoteActor}
71
- * @param startIndex tick index into the measure
72
- * @param measure the container measure
73
- * @param voice the voice index
74
- * @param newTicks the ticks the new note will take up
75
- * @category SmoTransform
76
- */
77
- export interface SmoStretchNoteParams {
78
- startIndex: number;
79
- measure: SmoMeasure;
80
- voice: number;
81
- newStemTicks: number;
82
- }
83
- /**
84
- * increase the length of a note, removing future notes in the measure as required
85
- * @category SmoTransform
86
- */
87
- export declare class SmoStretchNoteActor extends TickIteratorBase {
88
- startIndex: number;
89
- newStemTicks: number;
90
- measure: SmoMeasure;
91
- voice: number;
92
- notes: SmoNote[];
93
- notesToInsert: SmoNote[];
94
- numberOfNotesToDelete: number;
95
- constructor(params: SmoStretchNoteParams);
96
- private calculateNewTicks;
97
- private determineNotesToDelete;
98
- private prepareNotesToInsert;
99
- static apply(params: SmoStretchNoteParams): void;
100
- iterateOverTick(note: SmoNote, tickmap: TickMap, index: number): SmoNote[] | null;
101
- }
102
- /**
103
- * constructor parameters for {@link SmoMakeTupletActor}
104
- * @category SmoTransform
105
- */
106
- export interface SmoMakeTupletParams {
107
- measure: SmoMeasure;
108
- numNotes: number;
109
- notesOccupied: number;
110
- ratioed: boolean;
111
- bracketed: boolean;
112
- voice: number;
113
- index: number;
114
- }
115
- /**
116
- * Turn a tuplet into a non-tuplet of the same length
117
- * @category SmoTransform
118
- *
119
- * */
120
- export declare class SmoMakeTupletActor extends TickIteratorBase {
121
- measure: SmoMeasure;
122
- numNotes: number;
123
- voice: number;
124
- index: number;
125
- notesOccupied: number;
126
- ratioed: boolean;
127
- bracketed: boolean;
128
- constructor(params: SmoMakeTupletParams);
129
- static apply(params: SmoMakeTupletParams): void;
130
- iterateOverTick(note: SmoNote, tickmap: TickMap, index: number): SmoNote[] | null;
131
- private _generateNotesForTuplet;
132
- }
133
- /**
134
- * Constructor params for {@link SmoUnmakeTupletActor}
135
- * @category SmoTransform
136
- */
137
- export interface SmoUnmakeTupletParams {
138
- startIndex: number;
139
- endIndex: number;
140
- measure: SmoMeasure;
141
- voice: number;
142
- }
143
- /**
144
- * Convert a tuplet into a single note that takes up the whole duration
145
- * @category SmoTransform
146
- */
147
- export declare class SmoUnmakeTupletActor extends TickIteratorBase {
148
- startIndex: number;
149
- endIndex: number;
150
- measure: SmoMeasure;
151
- voice: number;
152
- constructor(parameters: SmoUnmakeTupletParams);
153
- static apply(params: SmoUnmakeTupletParams): void;
154
- iterateOverTick(note: SmoNote, tickmap: TickMap, index: number): SmoNote[] | null;
155
- }
1
+ import { SmoNote } from '../data/note';
2
+ import { SmoMeasure } from '../data/measure';
3
+ import { TickMap } from './tickMap';
4
+ /**
5
+ * Abstract class for classes that modifiy duration.
6
+ * @category SmoTransform
7
+ * @param note the note we're iterating over
8
+ * @param tickmap the tickmap for the measure
9
+ * @param index the index into the tickmap
10
+ * @returns the note or notes that replace this one. Null if this note is no longer in the measure
11
+ */
12
+ export declare abstract class TickIteratorBase {
13
+ iterateOverTick(note: SmoNote, tickmap: TickMap, index: number): SmoNote | SmoNote[] | null;
14
+ }
15
+ /**
16
+ * SmoTickIterator
17
+ * this is a local helper class that follows a pattern of iterating of the notes. Most of the
18
+ * duration changers iterate over a selection, and return:
19
+ * - A note, if the duration changes
20
+ * - An array of notes, if the notes split
21
+ * - null if the note stays the same
22
+ * - empty array, remove the note from the group
23
+ * @category SmoTransform
24
+ */
25
+ export declare class SmoTickIterator {
26
+ notes: SmoNote[];
27
+ newNotes: SmoNote[];
28
+ actor: TickIteratorBase;
29
+ measure: SmoMeasure;
30
+ voice: number;
31
+ keySignature: string;
32
+ constructor(measure: SmoMeasure, actor: TickIteratorBase, voiceIndex: number);
33
+ static nullActor(note: SmoNote): SmoNote;
34
+ /**
35
+ *
36
+ * @param measure {SmoMeasure}
37
+ * @param actor {}
38
+ * @param voiceIndex
39
+ */
40
+ static iterateOverTicks(measure: SmoMeasure, actor: TickIteratorBase, voiceIndex: number): void;
41
+ iterateOverTick(tickmap: TickMap, index: number, note: SmoNote): SmoNote | null;
42
+ run(): SmoNote[];
43
+ }
44
+ /**
45
+ * used to create a contract/dilate operation on a note via {@link SmoContractNoteActor}
46
+ * @category SmoTransform
47
+ */
48
+ export interface SmoContractNoteParams {
49
+ startIndex: number;
50
+ measure: SmoMeasure;
51
+ voice: number;
52
+ newStemTicks: number;
53
+ }
54
+ /**
55
+ * Contract the duration of a note, filling in the space with another note
56
+ * or rest.
57
+ * @category SmoTransform
58
+ * */
59
+ export declare class SmoContractNoteActor extends TickIteratorBase {
60
+ startIndex: number;
61
+ newStemTicks: number;
62
+ measure: SmoMeasure;
63
+ voice: number;
64
+ constructor(params: SmoContractNoteParams);
65
+ static apply(params: SmoContractNoteParams): void;
66
+ iterateOverTick(note: SmoNote, tickmap: TickMap, index: number): SmoNote | SmoNote[] | null;
67
+ }
68
+ /**
69
+ * Constructor when we want to double or dot the duration of a note (stretch)
70
+ * for {@link SmoStretchNoteActor}
71
+ * @param startIndex tick index into the measure
72
+ * @param measure the container measure
73
+ * @param voice the voice index
74
+ * @param newTicks the ticks the new note will take up
75
+ * @category SmoTransform
76
+ */
77
+ export interface SmoStretchNoteParams {
78
+ startIndex: number;
79
+ measure: SmoMeasure;
80
+ voice: number;
81
+ newStemTicks: number;
82
+ }
83
+ /**
84
+ * increase the length of a note, removing future notes in the measure as required
85
+ * @category SmoTransform
86
+ */
87
+ export declare class SmoStretchNoteActor extends TickIteratorBase {
88
+ startIndex: number;
89
+ newStemTicks: number;
90
+ measure: SmoMeasure;
91
+ voice: number;
92
+ notes: SmoNote[];
93
+ notesToInsert: SmoNote[];
94
+ numberOfNotesToDelete: number;
95
+ constructor(params: SmoStretchNoteParams);
96
+ private calculateNewTicks;
97
+ private determineNotesToDelete;
98
+ private prepareNotesToInsert;
99
+ static apply(params: SmoStretchNoteParams): void;
100
+ iterateOverTick(note: SmoNote, tickmap: TickMap, index: number): SmoNote[] | null;
101
+ }
102
+ /**
103
+ * constructor parameters for {@link SmoMakeTupletActor}
104
+ * @category SmoTransform
105
+ */
106
+ export interface SmoMakeTupletParams {
107
+ measure: SmoMeasure;
108
+ numNotes: number;
109
+ notesOccupied: number;
110
+ ratioed: boolean;
111
+ bracketed: boolean;
112
+ voice: number;
113
+ index: number;
114
+ }
115
+ /**
116
+ * Turn a tuplet into a non-tuplet of the same length
117
+ * @category SmoTransform
118
+ *
119
+ * */
120
+ export declare class SmoMakeTupletActor extends TickIteratorBase {
121
+ measure: SmoMeasure;
122
+ numNotes: number;
123
+ voice: number;
124
+ index: number;
125
+ notesOccupied: number;
126
+ ratioed: boolean;
127
+ bracketed: boolean;
128
+ constructor(params: SmoMakeTupletParams);
129
+ static apply(params: SmoMakeTupletParams): void;
130
+ iterateOverTick(note: SmoNote, tickmap: TickMap, index: number): SmoNote[] | null;
131
+ private _generateNotesForTuplet;
132
+ }
133
+ /**
134
+ * Constructor params for {@link SmoUnmakeTupletActor}
135
+ * @category SmoTransform
136
+ */
137
+ export interface SmoUnmakeTupletParams {
138
+ startIndex: number;
139
+ endIndex: number;
140
+ measure: SmoMeasure;
141
+ voice: number;
142
+ }
143
+ /**
144
+ * Convert a tuplet into a single note that takes up the whole duration
145
+ * @category SmoTransform
146
+ */
147
+ export declare class SmoUnmakeTupletActor extends TickIteratorBase {
148
+ startIndex: number;
149
+ endIndex: number;
150
+ measure: SmoMeasure;
151
+ voice: number;
152
+ constructor(parameters: SmoUnmakeTupletParams);
153
+ static apply(params: SmoUnmakeTupletParams): void;
154
+ iterateOverTick(note: SmoNote, tickmap: TickMap, index: number): SmoNote[] | null;
155
+ }