smoosic 1.0.40 → 1.0.41
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 +3 -3
- package/package.json +1 -1
- package/release/smoosic.js +3 -3
- package/src/smo/data/scoreModifiers.ts +2 -2
- package/src/ui/components/dialogs/timeSignature.vue +25 -4
- package/types/src/application/application.d.ts +103 -102
- package/types/src/application/common.d.ts +6 -0
- package/types/src/application/configuration.d.ts +75 -75
- package/types/src/application/dynamicInit.d.ts +6 -6
- package/types/src/application/eventHandler.d.ts +87 -81
- package/types/src/application/exports.d.ts +482 -485
- package/types/src/render/audio/oscillator.d.ts +99 -99
- package/types/src/render/audio/player.d.ts +143 -143
- package/types/src/render/audio/samples.d.ts +56 -56
- package/types/src/render/sui/NoteEntryCaret.d.ts +107 -0
- package/types/src/render/sui/NoteEntryMediator.d.ts +24 -0
- package/types/src/render/sui/configuration.d.ts +53 -49
- package/types/src/render/sui/formatter.d.ts +163 -161
- package/types/src/render/sui/layoutDebug.d.ts +46 -46
- package/types/src/render/sui/mapper.d.ts +138 -135
- package/types/src/render/sui/renderState.d.ts +92 -90
- package/types/src/render/sui/scoreRender.d.ts +97 -96
- package/types/src/render/sui/scoreView.d.ts +280 -279
- package/types/src/render/sui/scoreViewOperations.d.ts +604 -594
- package/types/src/render/sui/scroller.d.ts +41 -41
- package/types/src/render/sui/svgPageMap.d.ts +344 -344
- package/types/src/render/sui/textEdit.d.ts +316 -316
- package/types/src/render/sui/tracker.d.ts +10 -4
- package/types/src/render/vex/vxMeasure.d.ts +97 -97
- package/types/src/smo/data/common.d.ts +220 -220
- package/types/src/smo/data/measure.d.ts +511 -511
- package/types/src/smo/data/measureModifiers.d.ts +509 -508
- package/types/src/smo/data/music.d.ts +2 -1
- package/types/src/smo/data/note.d.ts +2 -0
- package/types/src/smo/data/noteModifiers.d.ts +2 -0
- package/types/src/smo/data/score.d.ts +7 -5
- package/types/src/smo/data/scoreModifiers.d.ts +441 -440
- package/types/src/smo/data/systemStaff.d.ts +2 -2
- package/types/src/smo/data/tuplet.d.ts +7 -0
- package/types/src/smo/midi/midiToSmo.d.ts +12 -12
- package/types/src/smo/midi/smoToMidi.d.ts +3 -3
- package/types/src/smo/mxml/smoToXml.d.ts +4 -4
- package/types/src/smo/mxml/xmlState.d.ts +3 -3
- package/types/src/smo/mxml/xmlToSmo.d.ts +2 -2
- package/types/src/smo/xform/operations.d.ts +3 -3
- package/types/src/smo/xform/selections.d.ts +154 -154
- package/types/src/ui/buttons/display.d.ts +1 -0
- package/types/src/ui/common.d.ts +69 -67
- package/types/src/ui/composable/draggable.d.ts +1 -1
- package/types/src/ui/configuration.d.ts +30 -30
- package/types/src/ui/dialogs/chordChange.d.ts +35 -35
- 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/dropdown.d.ts +78 -78
- 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/textInPlace.d.ts +90 -90
- package/types/src/ui/dialogs/components/textInput.d.ts +58 -58
- package/types/src/ui/dialogs/components/toggle.d.ts +53 -53
- package/types/src/ui/dialogs/dialog.d.ts +203 -203
- package/types/src/ui/dialogs/endings.d.ts +2 -2
- package/types/src/ui/dialogs/lyric.d.ts +39 -39
- package/types/src/ui/dialogs/measureFormat.d.ts +2 -2
- package/types/src/ui/dialogs/tempo.d.ts +3 -3
- package/types/src/ui/dialogs/textBlock.d.ts +55 -61
- package/types/src/ui/dialogs/timeSignature.d.ts +2 -34
- package/types/src/ui/exceptions.d.ts +15 -15
- package/types/src/ui/help.d.ts +6 -1
- package/types/src/ui/menus/manager.d.ts +59 -59
- package/types/src/ui/navigation.d.ts +44 -37
- package/types/typedoc.d.ts +157 -157
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* **/
|
|
6
6
|
import { SmoObjectParams, SmoAttrs, Pitch, ElementLike } from './common';
|
|
7
7
|
import { SmoMeasure, SmoMeasureParamsSer } from './measure';
|
|
8
|
-
import { SmoRehearsalMarkParams,
|
|
8
|
+
import { SmoRehearsalMarkParams, SmoTempoParams, SmoVolta } from './measureModifiers';
|
|
9
9
|
import { SmoInstrumentParams, StaffModifierBase, SmoInstrument, SmoInstrumentMeasure, SmoTie, SmoStaffTextBracket, SmoStaffTextBracketParamsSer, StaffModifierBaseSer, SmoTabStave, SmoStaffHairpin } from './staffModifiers';
|
|
10
10
|
import { SmoPartInfo, SmoPartInfoParamsSer } from './partInfo';
|
|
11
11
|
import { SmoSelector } from '../xform/selections';
|
|
@@ -220,7 +220,7 @@ export declare class SmoSystemStaff implements SmoObjectParams {
|
|
|
220
220
|
applyBeams(): void;
|
|
221
221
|
addRehearsalMark(index: number, parameters: SmoRehearsalMarkParams): void;
|
|
222
222
|
removeTempo(index: number): void;
|
|
223
|
-
addTempo(tempo:
|
|
223
|
+
addTempo(tempo: SmoTempoParams, index: number): void;
|
|
224
224
|
removeRehearsalMark(index: number): void;
|
|
225
225
|
/**
|
|
226
226
|
* Sync the staff modifier indices between the full score and the score view, which may
|
|
@@ -31,6 +31,13 @@ export declare class SmoTupletTree {
|
|
|
31
31
|
constructor(params: SmoTupletTreeParams);
|
|
32
32
|
static syncTupletIds(tupletTrees: SmoTupletTree[], voices: SmoVoice[]): void;
|
|
33
33
|
static adjustTupletIndexes(tupletTrees: SmoTupletTree[], voice: number, startTick: number, diff: number): void;
|
|
34
|
+
/**
|
|
35
|
+
* When pasting a tuplet into am measure, adjust the tuplet indices for tuplets that come after.
|
|
36
|
+
* @param tupletTrees
|
|
37
|
+
* @param voice
|
|
38
|
+
* @param measure
|
|
39
|
+
*/
|
|
40
|
+
static adjustMeasureTupletIndices(tupletTrees: SmoTupletTree[], voice: number, measure: SmoMeasure): void;
|
|
34
41
|
static getTupletForNoteIndex(tupletTrees: SmoTupletTree[], voiceIx: number, noteIx: number): SmoTuplet | null;
|
|
35
42
|
static getTupletTreeForNoteIndex(tupletTrees: SmoTupletTree[], voiceIx: number, noteIx: number): SmoTupletTree | null;
|
|
36
43
|
static getTupletHierarchyForNoteIndex(tupletTrees: SmoTupletTree[], voiceIx: number, noteIx: number): SmoTuplet[];
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Clef, Pitch } from "../data/common";
|
|
2
2
|
import { SmoMeasure } from "../data/measure";
|
|
3
|
-
import {
|
|
3
|
+
import { SmoTempo, SmoTimeSignature } from "../data/measureModifiers";
|
|
4
4
|
import { SmoNote } from "../data/note";
|
|
5
5
|
import { SmoScore } from "../data/score";
|
|
6
6
|
import { SmoTuplet } from "../data/tuplet";
|
|
7
|
-
export type MidiEventType = 'text' | 'copyrightNotice' | 'trackName' | 'instrumentName' | 'lyrics' | 'marker' | 'cuePoint' | 'channelPrefix' | 'portPrefix' | 'endOfTrack' | 'setTempo' | 'smpteOffset' | '
|
|
7
|
+
export type MidiEventType = 'text' | 'copyrightNotice' | 'trackName' | 'instrumentName' | 'lyrics' | 'marker' | 'cuePoint' | 'channelPrefix' | 'portPrefix' | 'endOfTrack' | 'setTempo' | 'smpteOffset' | 'SmoTimeSignature' | 'keySignature' | 'sequencerSpecific' | 'unknownMeta' | 'noteOff' | 'noteOn' | 'noteAftertouch' | 'controller' | 'programChange' | 'channelAftertouch' | 'pitchBend';
|
|
8
8
|
/**
|
|
9
9
|
* These are the midi events as defined by the parser.
|
|
10
10
|
* @category serialization
|
|
@@ -29,8 +29,8 @@ export interface MidiTrackEvent {
|
|
|
29
29
|
*/
|
|
30
30
|
export interface RunningMetadata {
|
|
31
31
|
keySignature: string;
|
|
32
|
-
timeSignature:
|
|
33
|
-
tempo:
|
|
32
|
+
timeSignature: SmoTimeSignature;
|
|
33
|
+
tempo: SmoTempo;
|
|
34
34
|
}
|
|
35
35
|
/**
|
|
36
36
|
* @category serialization
|
|
@@ -58,8 +58,8 @@ export interface EventSmoData {
|
|
|
58
58
|
tupletInfo: MidiTupletInfo | null;
|
|
59
59
|
isRest: boolean;
|
|
60
60
|
isTied: boolean;
|
|
61
|
-
timeSignature:
|
|
62
|
-
tempo:
|
|
61
|
+
timeSignature: SmoTimeSignature;
|
|
62
|
+
tempo: SmoTempo;
|
|
63
63
|
keySignature: string;
|
|
64
64
|
measure: number;
|
|
65
65
|
tick: number;
|
|
@@ -70,8 +70,8 @@ export declare function getValueForTick<T>(arg: Record<number, T>, tick: number)
|
|
|
70
70
|
* @category serialization
|
|
71
71
|
*/
|
|
72
72
|
export declare class MidiToSmo {
|
|
73
|
-
|
|
74
|
-
tempoMap: Record<number,
|
|
73
|
+
SmoTimeSignatureMap: Record<number, SmoTimeSignature>;
|
|
74
|
+
tempoMap: Record<number, SmoTempo>;
|
|
75
75
|
keySignatureMap: Record<number, string>;
|
|
76
76
|
tieMap: Record<number, number[]>;
|
|
77
77
|
timeDivision: number;
|
|
@@ -102,13 +102,13 @@ export declare class MidiToSmo {
|
|
|
102
102
|
* @param ticks
|
|
103
103
|
* @returns
|
|
104
104
|
*/
|
|
105
|
-
getTempo(ticks: number):
|
|
105
|
+
getTempo(ticks: number): SmoTempo;
|
|
106
106
|
/**
|
|
107
107
|
* @internal
|
|
108
108
|
* @param ticks
|
|
109
109
|
* @returns
|
|
110
110
|
*/
|
|
111
|
-
|
|
111
|
+
getSmoTimeSignature(ticks: number): SmoTimeSignature;
|
|
112
112
|
/**
|
|
113
113
|
* @internal
|
|
114
114
|
* @param ticks
|
|
@@ -121,8 +121,8 @@ export declare class MidiToSmo {
|
|
|
121
121
|
* @returns
|
|
122
122
|
*/
|
|
123
123
|
getMetadata(ticks: number): {
|
|
124
|
-
tempo:
|
|
125
|
-
timeSignature:
|
|
124
|
+
tempo: SmoTempo;
|
|
125
|
+
timeSignature: SmoTimeSignature;
|
|
126
126
|
keySignature: string;
|
|
127
127
|
};
|
|
128
128
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SmoTimeSignature, SmoTempo } from '../data/measureModifiers';
|
|
2
2
|
import { SmoScore } from '../data/score';
|
|
3
3
|
/**
|
|
4
4
|
* @category serialization
|
|
@@ -6,8 +6,8 @@ import { SmoScore } from '../data/score';
|
|
|
6
6
|
export interface MidiTrackHash {
|
|
7
7
|
track: any;
|
|
8
8
|
lastMeasure: number;
|
|
9
|
-
timeSignature?:
|
|
10
|
-
tempo?:
|
|
9
|
+
timeSignature?: SmoTimeSignature;
|
|
10
|
+
tempo?: SmoTempo;
|
|
11
11
|
keySignature?: string;
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
@@ -3,9 +3,9 @@ import { SmoNote } from '../data/note';
|
|
|
3
3
|
import { SmoMeasure, SmoVoice } from '../data/measure';
|
|
4
4
|
import { SmoSystemStaff } from '../data/systemStaff';
|
|
5
5
|
import { SmoScore } from '../data/score';
|
|
6
|
-
import {
|
|
6
|
+
import { SmoTimeSignature } from '../data/measureModifiers';
|
|
7
7
|
import { SmoSelector } from '../xform/selections';
|
|
8
|
-
import {
|
|
8
|
+
import { SmoTempo } from '../data/measureModifiers';
|
|
9
9
|
/**
|
|
10
10
|
* @category serialization
|
|
11
11
|
*/
|
|
@@ -38,8 +38,8 @@ export interface SmoState {
|
|
|
38
38
|
note?: SmoNote;
|
|
39
39
|
beamState: number;
|
|
40
40
|
beamTicks: number;
|
|
41
|
-
timeSignature?:
|
|
42
|
-
tempo?:
|
|
41
|
+
timeSignature?: SmoTimeSignature;
|
|
42
|
+
tempo?: SmoTempo;
|
|
43
43
|
currentTupletLevel: number;
|
|
44
44
|
}
|
|
45
45
|
/**
|
|
@@ -3,7 +3,7 @@ import { SmoScore } from '../data/score';
|
|
|
3
3
|
import { SmoFormattingManager, SmoSystemGroup } from '../data/scoreModifiers';
|
|
4
4
|
import { SmoSystemStaff } from '../data/systemStaff';
|
|
5
5
|
import { SmoInstrument, SmoInstrumentParams, SmoSlurParams } from '../data/staffModifiers';
|
|
6
|
-
import {
|
|
6
|
+
import { SmoTempo } from '../data/measureModifiers';
|
|
7
7
|
import { SmoPartInfo } from '../data/partInfo';
|
|
8
8
|
import { SmoMeasure } from '../data/measure';
|
|
9
9
|
import { SmoNote } from '../data/note';
|
|
@@ -154,7 +154,7 @@ export interface XmlPartGroup {
|
|
|
154
154
|
export declare class XmlState {
|
|
155
155
|
static get defaults(): {
|
|
156
156
|
divisions: number;
|
|
157
|
-
tempo:
|
|
157
|
+
tempo: SmoTempo;
|
|
158
158
|
timeSignature: string;
|
|
159
159
|
keySignature: string;
|
|
160
160
|
clefInfo: never[];
|
|
@@ -186,7 +186,7 @@ export declare class XmlState {
|
|
|
186
186
|
completedTupletStates: XmlCompletedTupletState[];
|
|
187
187
|
tupletStatesInProgress: Record<number, XmlTupletState>;
|
|
188
188
|
tickCursor: number;
|
|
189
|
-
tempo:
|
|
189
|
+
tempo: SmoTempo;
|
|
190
190
|
staffArray: XmlStaffInfo[];
|
|
191
191
|
staffIndex: number;
|
|
192
192
|
graceNotes: SmoGraceNote[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { XmlState } from './xmlState';
|
|
2
2
|
import { SmoLayoutManager } from '../data/scoreModifiers';
|
|
3
|
-
import {
|
|
3
|
+
import { SmoTempo } from '../data/measureModifiers';
|
|
4
4
|
import { SmoScore } from '../data/score';
|
|
5
5
|
/**
|
|
6
6
|
* A class that takes a music XML file and outputs a {@link SmoScore}
|
|
@@ -68,7 +68,7 @@ export declare class XmlToSmo {
|
|
|
68
68
|
*/
|
|
69
69
|
static tempo(element: Element): {
|
|
70
70
|
staffId: number;
|
|
71
|
-
tempo:
|
|
71
|
+
tempo: SmoTempo;
|
|
72
72
|
}[];
|
|
73
73
|
/**
|
|
74
74
|
* /score-partwise/measure/direction/dynamics
|
|
@@ -3,7 +3,7 @@ import { SmoNote } from '../data/note';
|
|
|
3
3
|
import { SmoScore } from '../data/score';
|
|
4
4
|
import { SmoSystemStaff, SmoSystemStaffParams } from '../data/systemStaff';
|
|
5
5
|
import { SmoGraceNote, SmoDynamicText, SmoTabNote } from '../data/noteModifiers';
|
|
6
|
-
import { SmoRehearsalMark, SmoMeasureText, SmoVolta, SmoMeasureFormat,
|
|
6
|
+
import { SmoRehearsalMark, SmoMeasureText, SmoVolta, SmoMeasureFormat, SmoTempo, SmoBarline, SmoTimeSignature, SmoRepeatSymbol } from '../data/measureModifiers';
|
|
7
7
|
import { SmoStaffHairpin, SmoSlur, SmoTie, StaffModifierBase, SmoInstrument, SmoSlurParams, SmoStaffTextBracket, SmoTabStave } from '../data/staffModifiers';
|
|
8
8
|
import { SmoSystemGroup } from '../data/scoreModifiers';
|
|
9
9
|
import { SmoTextGroup } from '../data/scoreText';
|
|
@@ -42,7 +42,7 @@ export declare class SmoOperation {
|
|
|
42
42
|
static swapVoice(selections: SmoSelection[], voice1: number, voice2: number): void;
|
|
43
43
|
static setTabStave(score: SmoScore, tabStave: SmoTabStave): void;
|
|
44
44
|
static removeTabStave(score: SmoScore, tabStaves: SmoTabStave[]): void;
|
|
45
|
-
static setTimeSignature(score: SmoScore, selections: SmoSelection[], timeSignature:
|
|
45
|
+
static setTimeSignature(score: SmoScore, selections: SmoSelection[], timeSignature: SmoTimeSignature): void;
|
|
46
46
|
static batchSelectionOperation(score: SmoScore, selections: SmoSelection[], operation: BatchSelectionOperation): void;
|
|
47
47
|
static doubleDuration(selection: SmoSelection): boolean;
|
|
48
48
|
static halveDuration(selection: SmoSelection): boolean;
|
|
@@ -87,7 +87,7 @@ export declare class SmoOperation {
|
|
|
87
87
|
static removeMeasureText(score: SmoScore, selection: SmoSelection, mt: SmoMeasureText): void;
|
|
88
88
|
static removeRehearsalMark(score: SmoScore, selection: SmoSelection): void;
|
|
89
89
|
static addRehearsalMark(score: SmoScore, selection: SmoSelection, rehearsalMark: SmoRehearsalMark): void;
|
|
90
|
-
static addTempo(score: SmoScore, selection: SmoSelection, tempo:
|
|
90
|
+
static addTempo(score: SmoScore, selection: SmoSelection, tempo: SmoTempo): void;
|
|
91
91
|
static setMeasureBarline(score: SmoScore, selection: SmoSelection, barline: SmoBarline): void;
|
|
92
92
|
static setRepeatSymbol(score: SmoScore, selection: SmoSelection, sym: SmoRepeatSymbol): void;
|
|
93
93
|
static interval(selection: SmoSelection, interval: number): boolean;
|
|
@@ -1,154 +1,154 @@
|
|
|
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 nextNoteSelectionIncludeVoice(score: SmoScore, staffIndex: number, measureIndex: number, voiceIndex: number, tickIndex: number): SmoSelection | null;
|
|
132
|
-
static nextNoteSelection(score: SmoScore, staffIndex: number, measureIndex: number, voiceIndex: number, tickIndex: number): SmoSelection | null;
|
|
133
|
-
/**
|
|
134
|
-
*
|
|
135
|
-
* @param score
|
|
136
|
-
* @param selector
|
|
137
|
-
* @returns
|
|
138
|
-
*/
|
|
139
|
-
static innerSelections(score: SmoScore, startSelector: SmoSelector, endSelector: SmoSelector): SmoSelection[];
|
|
140
|
-
static nextNoteSelectionFromSelector(score: SmoScore, selector: SmoSelector): SmoSelection | null;
|
|
141
|
-
static lastNoteSelectionFromSelector(score: SmoScore, selector: SmoSelector): SmoSelection | null;
|
|
142
|
-
static lastNoteSelection(score: SmoScore, staffIndex: number, measureIndex: number, voiceIndex: number, tickIndex: number): SmoSelection | null;
|
|
143
|
-
static lastNoteSelectionNonRest(score: SmoScore, staffIndex: number, measureIndex: number, voiceIndex: number, tickIndex: number): SmoSelection | null;
|
|
144
|
-
static nextNoteSelectionNonRest(score: SmoScore, staffIndex: number, measureIndex: number, voiceIndex: number, tickIndex: number): SmoSelection | null;
|
|
145
|
-
static getMeasureList(selections: SmoSelection[]): SmoSelection[];
|
|
146
|
-
static getMeasuresBetween(score: SmoScore, fromSelector: SmoSelector, toSelector: SmoSelector): SmoSelection[];
|
|
147
|
-
static selectionsSameMeasure(selections: SmoSelection[]): boolean;
|
|
148
|
-
static selectionsSameStaff(selections: SmoSelection[]): boolean;
|
|
149
|
-
constructor(params: SmoSelectionParams);
|
|
150
|
-
get staff(): SmoSystemStaff;
|
|
151
|
-
get measure(): SmoMeasure;
|
|
152
|
-
get note(): SmoNote | null;
|
|
153
|
-
get pitches(): number[];
|
|
154
|
-
}
|
|
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 nextNoteSelectionIncludeVoice(score: SmoScore, staffIndex: number, measureIndex: number, voiceIndex: number, tickIndex: number): SmoSelection | null;
|
|
132
|
+
static nextNoteSelection(score: SmoScore, staffIndex: number, measureIndex: number, voiceIndex: number, tickIndex: number): SmoSelection | null;
|
|
133
|
+
/**
|
|
134
|
+
*
|
|
135
|
+
* @param score
|
|
136
|
+
* @param selector
|
|
137
|
+
* @returns
|
|
138
|
+
*/
|
|
139
|
+
static innerSelections(score: SmoScore, startSelector: SmoSelector, endSelector: SmoSelector): SmoSelection[];
|
|
140
|
+
static nextNoteSelectionFromSelector(score: SmoScore, selector: SmoSelector): SmoSelection | null;
|
|
141
|
+
static lastNoteSelectionFromSelector(score: SmoScore, selector: SmoSelector): SmoSelection | null;
|
|
142
|
+
static lastNoteSelection(score: SmoScore, staffIndex: number, measureIndex: number, voiceIndex: number, tickIndex: number): SmoSelection | null;
|
|
143
|
+
static lastNoteSelectionNonRest(score: SmoScore, staffIndex: number, measureIndex: number, voiceIndex: number, tickIndex: number): SmoSelection | null;
|
|
144
|
+
static nextNoteSelectionNonRest(score: SmoScore, staffIndex: number, measureIndex: number, voiceIndex: number, tickIndex: number): SmoSelection | null;
|
|
145
|
+
static getMeasureList(selections: SmoSelection[]): SmoSelection[];
|
|
146
|
+
static getMeasuresBetween(score: SmoScore, fromSelector: SmoSelector, toSelector: SmoSelector): SmoSelection[];
|
|
147
|
+
static selectionsSameMeasure(selections: SmoSelection[]): boolean;
|
|
148
|
+
static selectionsSameStaff(selections: SmoSelection[]): boolean;
|
|
149
|
+
constructor(params: SmoSelectionParams);
|
|
150
|
+
get staff(): SmoSystemStaff;
|
|
151
|
+
get measure(): SmoMeasure;
|
|
152
|
+
get note(): SmoNote | null;
|
|
153
|
+
get pitches(): number[];
|
|
154
|
+
}
|