smoosic 1.0.25 → 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/src/application/exports.ts +1 -0
- 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,127 +1,127 @@
|
|
|
1
|
-
import { Pitch } from '../data/common';
|
|
2
|
-
import { SmoNote } from '../data/note';
|
|
3
|
-
import { SmoScore } from '../data/score';
|
|
4
|
-
import { SmoSystemStaff, SmoSystemStaffParams } from '../data/systemStaff';
|
|
5
|
-
import { SmoGraceNote, SmoDynamicText, SmoTabNote } from '../data/noteModifiers';
|
|
6
|
-
import { SmoRehearsalMark, SmoMeasureText, SmoVolta, SmoMeasureFormat, SmoTempoText, SmoBarline, TimeSignature, SmoRepeatSymbol } from '../data/measureModifiers';
|
|
7
|
-
import { SmoStaffHairpin, SmoSlur, SmoTie, StaffModifierBase, SmoInstrument, SmoSlurParams, SmoStaffTextBracket, SmoTabStave } from '../data/staffModifiers';
|
|
8
|
-
import { SmoSystemGroup } from '../data/scoreModifiers';
|
|
9
|
-
import { SmoTextGroup } from '../data/scoreText';
|
|
10
|
-
import { SmoSelection, SmoSelector, ModifierTab } from './selections';
|
|
11
|
-
/**
|
|
12
|
-
* supported operations for {@link SmoOperation.batchSelectionOperation} to change a note's duration
|
|
13
|
-
*/
|
|
14
|
-
export type BatchSelectionOperation = 'dotDuration' | 'undotDuration' | 'doubleDuration' | 'halveDuration' | 'doubleGraceNoteDuration' | 'halveGraceNoteDuration';
|
|
15
|
-
export interface MakeTupletOperation {
|
|
16
|
-
numNotes: number;
|
|
17
|
-
notesOccupied: number;
|
|
18
|
-
ratioed: boolean;
|
|
19
|
-
bracketed: boolean;
|
|
20
|
-
}
|
|
21
|
-
export type createStaffModifierType<T> = (fromSelection: SmoSelection, toSelection: SmoSelection) => T;
|
|
22
|
-
/**
|
|
23
|
-
* SmoOperation is a collection of static methods that operate on/change/transform the music. Most methods
|
|
24
|
-
* take the score, a selection or selection array, and the parameters of the operation.
|
|
25
|
-
* @category SmoTransform
|
|
26
|
-
*/
|
|
27
|
-
export declare class SmoOperation {
|
|
28
|
-
static setMeasureFormat(score: SmoScore, selection: SmoSelection, value: SmoMeasureFormat): void;
|
|
29
|
-
static addKeySignature(score: SmoScore, selection: SmoSelection, keySignature: string): void;
|
|
30
|
-
static addConnectorDown(score: SmoScore, selections: SmoSelection[], parameters: SmoSystemGroup): void;
|
|
31
|
-
static setActiveVoice(score: SmoScore, voiceIx: number): void;
|
|
32
|
-
/**
|
|
33
|
-
* Move a single stave up or down one. If last down, move to first.
|
|
34
|
-
* If first up, move to last
|
|
35
|
-
* @param score
|
|
36
|
-
* @param selection
|
|
37
|
-
* @param index
|
|
38
|
-
*/
|
|
39
|
-
static moveStaffUpDown(score: SmoScore, selection: SmoSelection, index: number): void;
|
|
40
|
-
static depopulateVoice(selection: SmoSelection, voiceIx: number): void;
|
|
41
|
-
static populateVoice(selection: SmoSelection, voiceIx: number): void;
|
|
42
|
-
static swapVoice(selections: SmoSelection[], voice1: number, voice2: number): void;
|
|
43
|
-
static setTabStave(score: SmoScore, tabStave: SmoTabStave): void;
|
|
44
|
-
static removeTabStave(score: SmoScore, tabStaves: SmoTabStave[]): void;
|
|
45
|
-
static setTimeSignature(score: SmoScore, selections: SmoSelection[], timeSignature: TimeSignature): void;
|
|
46
|
-
static batchSelectionOperation(score: SmoScore, selections: SmoSelection[], operation: BatchSelectionOperation): void;
|
|
47
|
-
static doubleDuration(selection: SmoSelection): boolean;
|
|
48
|
-
static halveDuration(selection: SmoSelection): boolean;
|
|
49
|
-
static makeTuplet(selection: SmoSelection, params: MakeTupletOperation): void;
|
|
50
|
-
static addStaffModifier(selection: SmoSelection, modifier: StaffModifierBase): void;
|
|
51
|
-
static toggleRest(selection: SmoSelection): void;
|
|
52
|
-
static toggleSlash(selection: SmoSelection): void;
|
|
53
|
-
static makeRest(selection: SmoSelection): void;
|
|
54
|
-
static makeNote(selection: SmoSelection): void;
|
|
55
|
-
static setNoteHead(selections: SmoSelection[], noteHead: string): void;
|
|
56
|
-
static addGraceNote(selection: SmoSelection, g: SmoGraceNote, offset: number): void;
|
|
57
|
-
static removeGraceNote(selection: SmoSelection, offset: number): void;
|
|
58
|
-
static doubleGraceNoteDuration(selection: SmoSelection, modifiers: SmoGraceNote[]): void;
|
|
59
|
-
static halveGraceNoteDuration(selection: SmoSelection, modifiers: SmoGraceNote[]): void;
|
|
60
|
-
static toggleGraceNoteCourtesy(selection: any, modifiers: SmoGraceNote[]): void;
|
|
61
|
-
static toggleGraceNoteEnharmonic(selection: SmoSelection, modifiers: SmoGraceNote[]): void;
|
|
62
|
-
static transposeGraceNotes(selection: SmoSelection, modifiers: SmoGraceNote[], offset: number): void;
|
|
63
|
-
static slashGraceNotes(selections: ModifierTab[] | ModifierTab): void;
|
|
64
|
-
static unmakeTuplet(selection: SmoSelection): void;
|
|
65
|
-
static dotDuration(selection: SmoSelection): void;
|
|
66
|
-
static undotDuration(selection: SmoSelection): void;
|
|
67
|
-
static transposeScore(score: SmoScore, offset: number): void;
|
|
68
|
-
static updateTabNote(selections: SmoSelection[], tabNote: SmoTabNote): void;
|
|
69
|
-
static removeTabNote(selections: SmoSelection[]): void;
|
|
70
|
-
static transpose(selection: SmoSelection, offset: number): boolean;
|
|
71
|
-
static setPitch(selection: SmoSelection, pitches: Pitch[]): void;
|
|
72
|
-
static toggleCourtesyAccidental(selection: SmoSelection): void;
|
|
73
|
-
static courtesyAccidental(pitchSelection: SmoSelection, toBe: boolean): void;
|
|
74
|
-
static toggleEnharmonic(pitchSelection: SmoSelection): void;
|
|
75
|
-
static addDynamic(selection: SmoSelection, dynamic: SmoDynamicText): void;
|
|
76
|
-
static removeDynamic(selection: SmoSelection, dynamic: SmoDynamicText): void;
|
|
77
|
-
static unbeamSelections(noteSelection: SmoSelection): void;
|
|
78
|
-
static beamSelections(score: SmoScore, selections: SmoSelection[]): void;
|
|
79
|
-
static clearAllBeamGroups(score: SmoScore): void;
|
|
80
|
-
static clearBeamGroups(score: SmoScore, selections: SmoSelection[]): void;
|
|
81
|
-
static toggleBeamDirection(selections: SmoSelection[]): void;
|
|
82
|
-
static addEnding(score: SmoScore, parameters: SmoVolta): void;
|
|
83
|
-
static removeEnding(score: SmoScore, ending: SmoVolta): void;
|
|
84
|
-
static addTextGroup(score: SmoScore, textGroup: SmoTextGroup): void;
|
|
85
|
-
static removeTextGroup(score: SmoScore, textGroup: SmoTextGroup): void;
|
|
86
|
-
static addMeasureText(score: SmoScore, selection: SmoSelection, measureText: SmoMeasureText): void;
|
|
87
|
-
static removeMeasureText(score: SmoScore, selection: SmoSelection, mt: SmoMeasureText): void;
|
|
88
|
-
static removeRehearsalMark(score: SmoScore, selection: SmoSelection): void;
|
|
89
|
-
static addRehearsalMark(score: SmoScore, selection: SmoSelection, rehearsalMark: SmoRehearsalMark): void;
|
|
90
|
-
static addTempo(score: SmoScore, selection: SmoSelection, tempo: SmoTempoText): void;
|
|
91
|
-
static setMeasureBarline(score: SmoScore, selection: SmoSelection, barline: SmoBarline): void;
|
|
92
|
-
static setRepeatSymbol(score: SmoScore, selection: SmoSelection, sym: SmoRepeatSymbol): void;
|
|
93
|
-
static interval(selection: SmoSelection, interval: number): boolean;
|
|
94
|
-
static addOrReplaceBracket(modifier: SmoStaffTextBracket, fromSelection: SmoSelection, toSelection: SmoSelection): void;
|
|
95
|
-
static createRitardBracket(fromSelection: SmoSelection, toSelection: SmoSelection): SmoStaffTextBracket;
|
|
96
|
-
static createAccelerandoBracket(fromSelection: SmoSelection, toSelection: SmoSelection): SmoStaffTextBracket;
|
|
97
|
-
static createCrescendoBracket(fromSelection: SmoSelection, toSelection: SmoSelection): SmoStaffTextBracket;
|
|
98
|
-
static createDimenuendoBracket(fromSelection: SmoSelection, toSelection: SmoSelection): SmoStaffTextBracket;
|
|
99
|
-
static createCrescendo(fromSelection: SmoSelection, toSelection: SmoSelection): SmoStaffHairpin;
|
|
100
|
-
static createDecrescendo(fromSelection: SmoSelection, toSelection: SmoSelection): SmoStaffHairpin;
|
|
101
|
-
static createTie(fromSelection: SmoSelection, toSelection: SmoSelection): SmoTie;
|
|
102
|
-
static getSlurDefaultParameters(selections: SmoSelection[]): void;
|
|
103
|
-
/**
|
|
104
|
-
* Heuristically determine how a slur should be formatted based on the notes. Determine control points,
|
|
105
|
-
* offset, and alignment
|
|
106
|
-
*
|
|
107
|
-
* ## Note: Vexflow slurs consider `top` to mean the furthest point from the note head, which could be the top
|
|
108
|
-
* or the bottom of the note. It also considers yoffset to be negative if inverted is set. Head means close to the
|
|
109
|
-
* note head.
|
|
110
|
-
* @param score
|
|
111
|
-
* @param fromSelection
|
|
112
|
-
* @param toSelection
|
|
113
|
-
* @returns
|
|
114
|
-
*/
|
|
115
|
-
static getDefaultSlurDirection(score: SmoScore, fromSelector: SmoSelector, toSelector: SmoSelector): SmoSlurParams;
|
|
116
|
-
static createSlur(score: SmoScore, fromSelection: SmoSelection, toSelection: SmoSelection): SmoSlur;
|
|
117
|
-
static addStaff(score: SmoScore, parameters: SmoSystemStaffParams): SmoSystemStaff;
|
|
118
|
-
static removeStaff(score: SmoScore, index: number): void;
|
|
119
|
-
static transposeChords(smoNote: SmoNote, offset: number, key: string): void;
|
|
120
|
-
/**
|
|
121
|
-
* Compute new map based on current instrument selections, adjusting existing instruments as required
|
|
122
|
-
* @param instrument
|
|
123
|
-
* @param selections
|
|
124
|
-
*/
|
|
125
|
-
static changeInstrument(instrument: SmoInstrument, score: SmoScore, selections: SmoSelection[]): void;
|
|
126
|
-
static computeMultipartRest(score: SmoScore): void;
|
|
127
|
-
}
|
|
1
|
+
import { Pitch } from '../data/common';
|
|
2
|
+
import { SmoNote } from '../data/note';
|
|
3
|
+
import { SmoScore } from '../data/score';
|
|
4
|
+
import { SmoSystemStaff, SmoSystemStaffParams } from '../data/systemStaff';
|
|
5
|
+
import { SmoGraceNote, SmoDynamicText, SmoTabNote } from '../data/noteModifiers';
|
|
6
|
+
import { SmoRehearsalMark, SmoMeasureText, SmoVolta, SmoMeasureFormat, SmoTempoText, SmoBarline, TimeSignature, SmoRepeatSymbol } from '../data/measureModifiers';
|
|
7
|
+
import { SmoStaffHairpin, SmoSlur, SmoTie, StaffModifierBase, SmoInstrument, SmoSlurParams, SmoStaffTextBracket, SmoTabStave } from '../data/staffModifiers';
|
|
8
|
+
import { SmoSystemGroup } from '../data/scoreModifiers';
|
|
9
|
+
import { SmoTextGroup } from '../data/scoreText';
|
|
10
|
+
import { SmoSelection, SmoSelector, ModifierTab } from './selections';
|
|
11
|
+
/**
|
|
12
|
+
* supported operations for {@link SmoOperation.batchSelectionOperation} to change a note's duration
|
|
13
|
+
*/
|
|
14
|
+
export type BatchSelectionOperation = 'dotDuration' | 'undotDuration' | 'doubleDuration' | 'halveDuration' | 'doubleGraceNoteDuration' | 'halveGraceNoteDuration';
|
|
15
|
+
export interface MakeTupletOperation {
|
|
16
|
+
numNotes: number;
|
|
17
|
+
notesOccupied: number;
|
|
18
|
+
ratioed: boolean;
|
|
19
|
+
bracketed: boolean;
|
|
20
|
+
}
|
|
21
|
+
export type createStaffModifierType<T> = (fromSelection: SmoSelection, toSelection: SmoSelection) => T;
|
|
22
|
+
/**
|
|
23
|
+
* SmoOperation is a collection of static methods that operate on/change/transform the music. Most methods
|
|
24
|
+
* take the score, a selection or selection array, and the parameters of the operation.
|
|
25
|
+
* @category SmoTransform
|
|
26
|
+
*/
|
|
27
|
+
export declare class SmoOperation {
|
|
28
|
+
static setMeasureFormat(score: SmoScore, selection: SmoSelection, value: SmoMeasureFormat): void;
|
|
29
|
+
static addKeySignature(score: SmoScore, selection: SmoSelection, keySignature: string): void;
|
|
30
|
+
static addConnectorDown(score: SmoScore, selections: SmoSelection[], parameters: SmoSystemGroup): void;
|
|
31
|
+
static setActiveVoice(score: SmoScore, voiceIx: number): void;
|
|
32
|
+
/**
|
|
33
|
+
* Move a single stave up or down one. If last down, move to first.
|
|
34
|
+
* If first up, move to last
|
|
35
|
+
* @param score
|
|
36
|
+
* @param selection
|
|
37
|
+
* @param index
|
|
38
|
+
*/
|
|
39
|
+
static moveStaffUpDown(score: SmoScore, selection: SmoSelection, index: number): void;
|
|
40
|
+
static depopulateVoice(selection: SmoSelection, voiceIx: number): void;
|
|
41
|
+
static populateVoice(selection: SmoSelection, voiceIx: number): void;
|
|
42
|
+
static swapVoice(selections: SmoSelection[], voice1: number, voice2: number): void;
|
|
43
|
+
static setTabStave(score: SmoScore, tabStave: SmoTabStave): void;
|
|
44
|
+
static removeTabStave(score: SmoScore, tabStaves: SmoTabStave[]): void;
|
|
45
|
+
static setTimeSignature(score: SmoScore, selections: SmoSelection[], timeSignature: TimeSignature): void;
|
|
46
|
+
static batchSelectionOperation(score: SmoScore, selections: SmoSelection[], operation: BatchSelectionOperation): void;
|
|
47
|
+
static doubleDuration(selection: SmoSelection): boolean;
|
|
48
|
+
static halveDuration(selection: SmoSelection): boolean;
|
|
49
|
+
static makeTuplet(selection: SmoSelection, params: MakeTupletOperation): void;
|
|
50
|
+
static addStaffModifier(selection: SmoSelection, modifier: StaffModifierBase): void;
|
|
51
|
+
static toggleRest(selection: SmoSelection): void;
|
|
52
|
+
static toggleSlash(selection: SmoSelection): void;
|
|
53
|
+
static makeRest(selection: SmoSelection): void;
|
|
54
|
+
static makeNote(selection: SmoSelection): void;
|
|
55
|
+
static setNoteHead(selections: SmoSelection[], noteHead: string): void;
|
|
56
|
+
static addGraceNote(selection: SmoSelection, g: SmoGraceNote, offset: number): void;
|
|
57
|
+
static removeGraceNote(selection: SmoSelection, offset: number): void;
|
|
58
|
+
static doubleGraceNoteDuration(selection: SmoSelection, modifiers: SmoGraceNote[]): void;
|
|
59
|
+
static halveGraceNoteDuration(selection: SmoSelection, modifiers: SmoGraceNote[]): void;
|
|
60
|
+
static toggleGraceNoteCourtesy(selection: any, modifiers: SmoGraceNote[]): void;
|
|
61
|
+
static toggleGraceNoteEnharmonic(selection: SmoSelection, modifiers: SmoGraceNote[]): void;
|
|
62
|
+
static transposeGraceNotes(selection: SmoSelection, modifiers: SmoGraceNote[], offset: number): void;
|
|
63
|
+
static slashGraceNotes(selections: ModifierTab[] | ModifierTab): void;
|
|
64
|
+
static unmakeTuplet(selection: SmoSelection): void;
|
|
65
|
+
static dotDuration(selection: SmoSelection): void;
|
|
66
|
+
static undotDuration(selection: SmoSelection): void;
|
|
67
|
+
static transposeScore(score: SmoScore, offset: number): void;
|
|
68
|
+
static updateTabNote(selections: SmoSelection[], tabNote: SmoTabNote): void;
|
|
69
|
+
static removeTabNote(selections: SmoSelection[]): void;
|
|
70
|
+
static transpose(selection: SmoSelection, offset: number): boolean;
|
|
71
|
+
static setPitch(selection: SmoSelection, pitches: Pitch[]): void;
|
|
72
|
+
static toggleCourtesyAccidental(selection: SmoSelection): void;
|
|
73
|
+
static courtesyAccidental(pitchSelection: SmoSelection, toBe: boolean): void;
|
|
74
|
+
static toggleEnharmonic(pitchSelection: SmoSelection): void;
|
|
75
|
+
static addDynamic(selection: SmoSelection, dynamic: SmoDynamicText): void;
|
|
76
|
+
static removeDynamic(selection: SmoSelection, dynamic: SmoDynamicText): void;
|
|
77
|
+
static unbeamSelections(noteSelection: SmoSelection): void;
|
|
78
|
+
static beamSelections(score: SmoScore, selections: SmoSelection[]): void;
|
|
79
|
+
static clearAllBeamGroups(score: SmoScore): void;
|
|
80
|
+
static clearBeamGroups(score: SmoScore, selections: SmoSelection[]): void;
|
|
81
|
+
static toggleBeamDirection(selections: SmoSelection[]): void;
|
|
82
|
+
static addEnding(score: SmoScore, parameters: SmoVolta): void;
|
|
83
|
+
static removeEnding(score: SmoScore, ending: SmoVolta): void;
|
|
84
|
+
static addTextGroup(score: SmoScore, textGroup: SmoTextGroup): void;
|
|
85
|
+
static removeTextGroup(score: SmoScore, textGroup: SmoTextGroup): void;
|
|
86
|
+
static addMeasureText(score: SmoScore, selection: SmoSelection, measureText: SmoMeasureText): void;
|
|
87
|
+
static removeMeasureText(score: SmoScore, selection: SmoSelection, mt: SmoMeasureText): void;
|
|
88
|
+
static removeRehearsalMark(score: SmoScore, selection: SmoSelection): void;
|
|
89
|
+
static addRehearsalMark(score: SmoScore, selection: SmoSelection, rehearsalMark: SmoRehearsalMark): void;
|
|
90
|
+
static addTempo(score: SmoScore, selection: SmoSelection, tempo: SmoTempoText): void;
|
|
91
|
+
static setMeasureBarline(score: SmoScore, selection: SmoSelection, barline: SmoBarline): void;
|
|
92
|
+
static setRepeatSymbol(score: SmoScore, selection: SmoSelection, sym: SmoRepeatSymbol): void;
|
|
93
|
+
static interval(selection: SmoSelection, interval: number): boolean;
|
|
94
|
+
static addOrReplaceBracket(modifier: SmoStaffTextBracket, fromSelection: SmoSelection, toSelection: SmoSelection): void;
|
|
95
|
+
static createRitardBracket(fromSelection: SmoSelection, toSelection: SmoSelection): SmoStaffTextBracket;
|
|
96
|
+
static createAccelerandoBracket(fromSelection: SmoSelection, toSelection: SmoSelection): SmoStaffTextBracket;
|
|
97
|
+
static createCrescendoBracket(fromSelection: SmoSelection, toSelection: SmoSelection): SmoStaffTextBracket;
|
|
98
|
+
static createDimenuendoBracket(fromSelection: SmoSelection, toSelection: SmoSelection): SmoStaffTextBracket;
|
|
99
|
+
static createCrescendo(fromSelection: SmoSelection, toSelection: SmoSelection): SmoStaffHairpin;
|
|
100
|
+
static createDecrescendo(fromSelection: SmoSelection, toSelection: SmoSelection): SmoStaffHairpin;
|
|
101
|
+
static createTie(fromSelection: SmoSelection, toSelection: SmoSelection): SmoTie;
|
|
102
|
+
static getSlurDefaultParameters(selections: SmoSelection[]): void;
|
|
103
|
+
/**
|
|
104
|
+
* Heuristically determine how a slur should be formatted based on the notes. Determine control points,
|
|
105
|
+
* offset, and alignment
|
|
106
|
+
*
|
|
107
|
+
* ## Note: Vexflow slurs consider `top` to mean the furthest point from the note head, which could be the top
|
|
108
|
+
* or the bottom of the note. It also considers yoffset to be negative if inverted is set. Head means close to the
|
|
109
|
+
* note head.
|
|
110
|
+
* @param score
|
|
111
|
+
* @param fromSelection
|
|
112
|
+
* @param toSelection
|
|
113
|
+
* @returns
|
|
114
|
+
*/
|
|
115
|
+
static getDefaultSlurDirection(score: SmoScore, fromSelector: SmoSelector, toSelector: SmoSelector): SmoSlurParams;
|
|
116
|
+
static createSlur(score: SmoScore, fromSelection: SmoSelection, toSelection: SmoSelection): SmoSlur;
|
|
117
|
+
static addStaff(score: SmoScore, parameters: SmoSystemStaffParams): SmoSystemStaff;
|
|
118
|
+
static removeStaff(score: SmoScore, index: number): void;
|
|
119
|
+
static transposeChords(smoNote: SmoNote, offset: number, key: string): void;
|
|
120
|
+
/**
|
|
121
|
+
* Compute new map based on current instrument selections, adjusting existing instruments as required
|
|
122
|
+
* @param instrument
|
|
123
|
+
* @param selections
|
|
124
|
+
*/
|
|
125
|
+
static changeInstrument(instrument: SmoInstrument, score: SmoScore, selections: SmoSelection[]): void;
|
|
126
|
+
static computeMultipartRest(score: SmoScore): void;
|
|
127
|
+
}
|
|
@@ -1,70 +1,70 @@
|
|
|
1
|
-
import { SmoScore } from '../data/score';
|
|
2
|
-
export type playerStartReason = 'scoreStart' | 'startRepeat' | 'DC' | 'DS' | 'Volta';
|
|
3
|
-
export type playerEndReason = 'scoreStart' | 'scoreEnd' | 'endRepeat' | 'Coda' | 'Segno' | 'Volta';
|
|
4
|
-
export interface ScoreSegment {
|
|
5
|
-
startMeasure: number;
|
|
6
|
-
endMeasure: number;
|
|
7
|
-
startReason: playerStartReason;
|
|
8
|
-
endReason: playerEndReason;
|
|
9
|
-
ending: number;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Builds and maintans a road map from repeats and other landmarks in a score.
|
|
13
|
-
* Maintains an internal cursor into the current measure.
|
|
14
|
-
* This object should be repopulated (or recreated) each time it is played because the
|
|
15
|
-
* sections are consumed as the internal cursor advances.
|
|
16
|
-
*/
|
|
17
|
-
export declare class ScoreRoadMapBuilder {
|
|
18
|
-
jumpQueue: ScoreSegment[];
|
|
19
|
-
lastSkip: number;
|
|
20
|
-
score: SmoScore;
|
|
21
|
-
measureTracker: number;
|
|
22
|
-
dcMeasure: number;
|
|
23
|
-
codaMeasure: number;
|
|
24
|
-
signMeasure: number;
|
|
25
|
-
dsMeasure: number;
|
|
26
|
-
fineMeasure: number;
|
|
27
|
-
toCodaMeasure: number;
|
|
28
|
-
static get defaultMap(): ScoreSegment;
|
|
29
|
-
constructor(score: SmoScore);
|
|
30
|
-
/**
|
|
31
|
-
* Populate repeat landmarks e.g. coda
|
|
32
|
-
*/
|
|
33
|
-
private populateLandmarks;
|
|
34
|
-
/**
|
|
35
|
-
* When populating DC/DS logic, gets the score segments between start and the landmark (coda, fine etc).
|
|
36
|
-
* @param start
|
|
37
|
-
* @param end
|
|
38
|
-
* @param startReason
|
|
39
|
-
* @returns
|
|
40
|
-
*/
|
|
41
|
-
private duplicateJumpsFromTo;
|
|
42
|
-
/**
|
|
43
|
-
* Internal function to find the voltas before/after a repeat
|
|
44
|
-
* @param startMeasure
|
|
45
|
-
* @param endMeasure
|
|
46
|
-
* @returns
|
|
47
|
-
*/
|
|
48
|
-
private findVoltaBetween;
|
|
49
|
-
/**
|
|
50
|
-
* Gets the next measure in the score, including repeats etc. And advances the internal
|
|
51
|
-
* cursor
|
|
52
|
-
* @returns
|
|
53
|
-
*/
|
|
54
|
-
getAndAdvance(): number;
|
|
55
|
-
/**
|
|
56
|
-
* Returns true if all the score measures have been played
|
|
57
|
-
*
|
|
58
|
-
* @readonly
|
|
59
|
-
* @memberof ScoreRoadMapBuilder
|
|
60
|
-
*/
|
|
61
|
-
get isDone(): boolean;
|
|
62
|
-
private populateRange;
|
|
63
|
-
/**
|
|
64
|
-
* Populate the jump queue of sections of the score, starting
|
|
65
|
-
* at the given measure. This should be called before calling
|
|
66
|
-
* getAndAdvance the first time.
|
|
67
|
-
* @param startMeasure
|
|
68
|
-
*/
|
|
69
|
-
populate(startMeasure: number): void;
|
|
70
|
-
}
|
|
1
|
+
import { SmoScore } from '../data/score';
|
|
2
|
+
export type playerStartReason = 'scoreStart' | 'startRepeat' | 'DC' | 'DS' | 'Volta';
|
|
3
|
+
export type playerEndReason = 'scoreStart' | 'scoreEnd' | 'endRepeat' | 'Coda' | 'Segno' | 'Volta';
|
|
4
|
+
export interface ScoreSegment {
|
|
5
|
+
startMeasure: number;
|
|
6
|
+
endMeasure: number;
|
|
7
|
+
startReason: playerStartReason;
|
|
8
|
+
endReason: playerEndReason;
|
|
9
|
+
ending: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Builds and maintans a road map from repeats and other landmarks in a score.
|
|
13
|
+
* Maintains an internal cursor into the current measure.
|
|
14
|
+
* This object should be repopulated (or recreated) each time it is played because the
|
|
15
|
+
* sections are consumed as the internal cursor advances.
|
|
16
|
+
*/
|
|
17
|
+
export declare class ScoreRoadMapBuilder {
|
|
18
|
+
jumpQueue: ScoreSegment[];
|
|
19
|
+
lastSkip: number;
|
|
20
|
+
score: SmoScore;
|
|
21
|
+
measureTracker: number;
|
|
22
|
+
dcMeasure: number;
|
|
23
|
+
codaMeasure: number;
|
|
24
|
+
signMeasure: number;
|
|
25
|
+
dsMeasure: number;
|
|
26
|
+
fineMeasure: number;
|
|
27
|
+
toCodaMeasure: number;
|
|
28
|
+
static get defaultMap(): ScoreSegment;
|
|
29
|
+
constructor(score: SmoScore);
|
|
30
|
+
/**
|
|
31
|
+
* Populate repeat landmarks e.g. coda
|
|
32
|
+
*/
|
|
33
|
+
private populateLandmarks;
|
|
34
|
+
/**
|
|
35
|
+
* When populating DC/DS logic, gets the score segments between start and the landmark (coda, fine etc).
|
|
36
|
+
* @param start
|
|
37
|
+
* @param end
|
|
38
|
+
* @param startReason
|
|
39
|
+
* @returns
|
|
40
|
+
*/
|
|
41
|
+
private duplicateJumpsFromTo;
|
|
42
|
+
/**
|
|
43
|
+
* Internal function to find the voltas before/after a repeat
|
|
44
|
+
* @param startMeasure
|
|
45
|
+
* @param endMeasure
|
|
46
|
+
* @returns
|
|
47
|
+
*/
|
|
48
|
+
private findVoltaBetween;
|
|
49
|
+
/**
|
|
50
|
+
* Gets the next measure in the score, including repeats etc. And advances the internal
|
|
51
|
+
* cursor
|
|
52
|
+
* @returns
|
|
53
|
+
*/
|
|
54
|
+
getAndAdvance(): number;
|
|
55
|
+
/**
|
|
56
|
+
* Returns true if all the score measures have been played
|
|
57
|
+
*
|
|
58
|
+
* @readonly
|
|
59
|
+
* @memberof ScoreRoadMapBuilder
|
|
60
|
+
*/
|
|
61
|
+
get isDone(): boolean;
|
|
62
|
+
private populateRange;
|
|
63
|
+
/**
|
|
64
|
+
* Populate the jump queue of sections of the score, starting
|
|
65
|
+
* at the given measure. This should be called before calling
|
|
66
|
+
* getAndAdvance the first time.
|
|
67
|
+
* @param startMeasure
|
|
68
|
+
*/
|
|
69
|
+
populate(startMeasure: number): void;
|
|
70
|
+
}
|