@tspro/web-music-score 5.4.2 → 5.5.0
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/CHANGELOG.md +11 -0
- package/LICENSE +24 -0
- package/README.md +13 -6
- package/dist/audio/index.d.ts +1 -1
- package/dist/audio/index.js +1637 -5
- package/dist/audio/index.mjs +9 -6
- package/dist/audio-cg/index.js +17487 -46
- package/dist/audio-cg/index.mjs +7 -5
- package/dist/audio-synth/index.js +18434 -32
- package/dist/audio-synth/index.mjs +12 -7
- package/dist/{chunk-MMWSQGVR.mjs → chunk-2DCCUAGC.mjs} +3 -3
- package/dist/{chunk-CVYTUTL6.mjs → chunk-2PEB4HWS.mjs} +2 -2
- package/dist/{chunk-42IBAVOC.mjs → chunk-33HIE3HR.mjs} +18 -13
- package/dist/chunk-BMKUAUSJ.mjs +101 -0
- package/dist/chunk-PCQGQM63.mjs +18381 -0
- package/dist/chunk-T6TYLAJE.mjs +3766 -0
- package/dist/core/index.js +2 -2
- package/dist/core/index.mjs +4 -4
- package/dist/{guitar-CNOxM4ZK.d.ts → guitar-CarHGDAt.d.ts} +1 -1
- package/dist/iife/audio-cg.global.js +1 -1
- package/dist/iife/index.global.js +11 -11
- package/dist/{music-objects-DqoO-Sfv.d.mts → music-objects-CcJvZxS6.d.mts} +123 -96
- package/dist/{music-objects-T8u8bnNP.d.ts → music-objects-l5Ai97QA.d.ts} +125 -98
- package/dist/{note-RVXvpfyV.d.ts → note-CJuq5aBy.d.ts} +1 -1
- package/dist/pieces/index.d.mts +12 -6
- package/dist/pieces/index.d.ts +14 -8
- package/dist/pieces/index.js +25 -13
- package/dist/pieces/index.mjs +25 -14
- package/dist/react-ui/index.d.mts +1 -1
- package/dist/react-ui/index.d.ts +5 -5
- package/dist/react-ui/index.js +2163 -22
- package/dist/react-ui/index.mjs +18 -15
- package/dist/{scale-CUYFBo-8.d.ts → scale-DulPFco_.d.ts} +2 -2
- package/dist/score/index.d.mts +51 -3
- package/dist/score/index.d.ts +54 -6
- package/dist/score/index.js +4828 -872
- package/dist/score/index.mjs +1280 -729
- package/dist/{tempo-DwuZsv2T.d.ts → tempo-BnUjm25M.d.ts} +1 -1
- package/dist/theory/index.d.ts +6 -6
- package/dist/theory/index.js +2576 -136
- package/dist/theory/index.mjs +41 -49
- package/package.json +4 -5
- package/dist/chunk-ROBXPR34.mjs +0 -9
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { N as Note, A as Accidental } from './note-
|
|
2
|
-
import { R as RhythmProps, N as NoteLength, i as NoteLengthStr, l as TupletRatio, d as Tempo, K as KeySignature, b as TimeSignature } from './tempo-
|
|
1
|
+
import { N as Note, A as Accidental } from './note-CJuq5aBy.js';
|
|
2
|
+
import { R as RhythmProps, N as NoteLength, i as NoteLengthStr, l as TupletRatio, d as Tempo, K as KeySignature, b as TimeSignature } from './tempo-BnUjm25M.js';
|
|
3
3
|
import { AnchoredRect, UniMap, Rect, Vec } from '@tspro/ts-utils-lib';
|
|
4
4
|
|
|
5
5
|
/** Staff preset values for score configuration. */
|
|
@@ -32,7 +32,13 @@ type BaseConfig = {
|
|
|
32
32
|
voiceId?: VoiceId | VoiceId[];
|
|
33
33
|
/** @deprecated - Use `voiceId` instead. */
|
|
34
34
|
voiceIds?: VoiceId | VoiceId[];
|
|
35
|
-
/**
|
|
35
|
+
/**
|
|
36
|
+
* Instrument name for this staf/tab.<br />
|
|
37
|
+
* Consecutive staves/tabs with the same name are grouped together.<br />
|
|
38
|
+
* Hint!<br />
|
|
39
|
+
* `"!Piano"` hides name.<br />
|
|
40
|
+
* `"!{Piano"` hides both name and left brace of the group.
|
|
41
|
+
* */
|
|
36
42
|
instrument?: string;
|
|
37
43
|
};
|
|
38
44
|
/** Staff config to add staff notation line in score configuration. */
|
|
@@ -362,14 +368,33 @@ declare class ObjText extends MusicObject {
|
|
|
362
368
|
constructor(parent: MusicObject, text: TextProps, anchorX: number, anchorY: number);
|
|
363
369
|
getMusicInterface(): MText;
|
|
364
370
|
getText(): string;
|
|
365
|
-
updateAnchorX(anchorX: number): void;
|
|
366
|
-
updateAnchorY(anchorY: number): void;
|
|
367
371
|
pick(x: number, y: number): MusicObject[];
|
|
368
372
|
layout(ctx: RenderContext): void;
|
|
369
373
|
offset(dx: number, dy: number): void;
|
|
370
374
|
draw(ctx: RenderContext): void;
|
|
371
375
|
}
|
|
372
376
|
|
|
377
|
+
declare class ObjScoreRowGroup extends MusicObject {
|
|
378
|
+
readonly lines: readonly ObjNotationLine[];
|
|
379
|
+
private space;
|
|
380
|
+
readonly instrument: string;
|
|
381
|
+
readonly hasBrace: boolean;
|
|
382
|
+
private readonly instrText;
|
|
383
|
+
private braceRect;
|
|
384
|
+
readonly mi: MScoreRowGroup;
|
|
385
|
+
constructor(lines: readonly ObjNotationLine[]);
|
|
386
|
+
getMusicInterface(): MScoreRowGroup;
|
|
387
|
+
get row(): ObjScoreRow;
|
|
388
|
+
get hasInstrument(): boolean;
|
|
389
|
+
hasNotationLine(line: ObjNotationLine): boolean;
|
|
390
|
+
pick(x: number, y: number): MusicObject[];
|
|
391
|
+
updateRect(): void;
|
|
392
|
+
layout(ctx: RenderContext): void;
|
|
393
|
+
layoutToNotationLines(): void;
|
|
394
|
+
offset(dx: number, dy: number): void;
|
|
395
|
+
draw(ctx: RenderContext): void;
|
|
396
|
+
}
|
|
397
|
+
|
|
373
398
|
type NotationLineObject = {
|
|
374
399
|
getRect: () => AnchoredRect;
|
|
375
400
|
offset?: (dx: number, dy: number) => void;
|
|
@@ -382,6 +407,7 @@ declare abstract class ObjNotationLine extends MusicObject {
|
|
|
382
407
|
abstract readonly name: string;
|
|
383
408
|
private layoutGroups;
|
|
384
409
|
constructor(row: ObjScoreRow);
|
|
410
|
+
getRowGroup(): ObjScoreRowGroup;
|
|
385
411
|
addObject(o: NotationLineObject): void;
|
|
386
412
|
removeObjects(): void;
|
|
387
413
|
getLayoutGroup(lauoutGroupId: LayoutGroupId): LayoutGroup;
|
|
@@ -390,6 +416,7 @@ declare abstract class ObjNotationLine extends MusicObject {
|
|
|
390
416
|
private setObjectY;
|
|
391
417
|
private alignObjectsY;
|
|
392
418
|
layoutLayoutGroup(ctx: RenderContext, layoutGroup: LayoutGroup, verticalPos: VerticalPos): void;
|
|
419
|
+
drawVerticalLine(ctx: RenderContext, left: number, width: number, isSystemBarLine?: boolean): void;
|
|
393
420
|
abstract getConfig(): StaffConfig | TabConfig;
|
|
394
421
|
abstract calcTop(): number;
|
|
395
422
|
abstract calcBottom(): number;
|
|
@@ -403,7 +430,6 @@ declare abstract class ObjNotationLine extends MusicObject {
|
|
|
403
430
|
abstract draw(ctx: RenderContext): void;
|
|
404
431
|
}
|
|
405
432
|
declare class ObjStaff extends ObjNotationLine {
|
|
406
|
-
readonly row: ObjScoreRow;
|
|
407
433
|
readonly staffConfig: StaffConfig;
|
|
408
434
|
readonly id: number;
|
|
409
435
|
readonly clefImageAsset: ImageAsset;
|
|
@@ -426,6 +452,8 @@ declare class ObjStaff extends ObjNotationLine {
|
|
|
426
452
|
getMiddleLineY(): number;
|
|
427
453
|
getBottomLineY(): number;
|
|
428
454
|
joinGrandStaff(staff: ObjStaff): void;
|
|
455
|
+
isGrandTreble(): boolean;
|
|
456
|
+
isGrandBass(): boolean;
|
|
429
457
|
getLineSpacing(): number;
|
|
430
458
|
getDiatonicSpacing(): number;
|
|
431
459
|
containsDiatonicId(diatonicId: number): boolean;
|
|
@@ -444,7 +472,6 @@ declare class ObjStaff extends ObjNotationLine {
|
|
|
444
472
|
draw(ctx: RenderContext): void;
|
|
445
473
|
}
|
|
446
474
|
declare class ObjTab extends ObjNotationLine {
|
|
447
|
-
readonly row: ObjScoreRow;
|
|
448
475
|
readonly tabConfig: TabConfig;
|
|
449
476
|
readonly id: number;
|
|
450
477
|
private top;
|
|
@@ -583,7 +610,7 @@ declare class ObjNoteGroup extends MusicObject {
|
|
|
583
610
|
setStemTipY(staff: ObjStaff, stemTipY: number): void;
|
|
584
611
|
offset(dx: number, dy: number): void;
|
|
585
612
|
draw(ctx: RenderContext): void;
|
|
586
|
-
getDotVerticalDisplacement(staff: ObjStaff, diatonicId: number, stemDir: Stem):
|
|
613
|
+
getDotVerticalDisplacement(staff: ObjStaff, diatonicId: number, stemDir: Stem): 1 | 0 | -1;
|
|
587
614
|
static hasSameNotes(ng1: ObjNoteGroup, ng2: ObjNoteGroup): boolean;
|
|
588
615
|
}
|
|
589
616
|
|
|
@@ -639,7 +666,7 @@ declare class ObjBeamGroup extends MusicObject {
|
|
|
639
666
|
getSymbols(): ReadonlyArray<RhythmSymbol>;
|
|
640
667
|
getFirstSymbol(): RhythmSymbol | undefined;
|
|
641
668
|
getLastSymbol(): RhythmSymbol | undefined;
|
|
642
|
-
get color()
|
|
669
|
+
private get color();
|
|
643
670
|
layout(ctx: RenderContext): void;
|
|
644
671
|
updateRect(): void;
|
|
645
672
|
updateStemTips(): void;
|
|
@@ -805,26 +832,6 @@ declare class PlayerColumnProps {
|
|
|
805
832
|
getFermataHoldTicks(): number;
|
|
806
833
|
}
|
|
807
834
|
|
|
808
|
-
declare class ObjScoreRowGroup extends MusicObject {
|
|
809
|
-
readonly lines: readonly ObjNotationLine[];
|
|
810
|
-
private space;
|
|
811
|
-
readonly instrument: string;
|
|
812
|
-
private readonly instrText;
|
|
813
|
-
private braceRect;
|
|
814
|
-
readonly mi: MScoreRowGroup;
|
|
815
|
-
constructor(lines: readonly ObjNotationLine[]);
|
|
816
|
-
getMusicInterface(): MScoreRowGroup;
|
|
817
|
-
get row(): ObjScoreRow;
|
|
818
|
-
get hasBrace(): boolean;
|
|
819
|
-
get hasInstrument(): boolean;
|
|
820
|
-
pick(x: number, y: number): MusicObject[];
|
|
821
|
-
updateRect(): void;
|
|
822
|
-
layout(ctx: RenderContext): void;
|
|
823
|
-
layoutToNotationLines(): void;
|
|
824
|
-
offset(dx: number, dy: number): void;
|
|
825
|
-
draw(ctx: RenderContext): void;
|
|
826
|
-
}
|
|
827
|
-
|
|
828
835
|
declare enum BarLineType {
|
|
829
836
|
None = 0,
|
|
830
837
|
Single = 1,
|
|
@@ -837,6 +844,7 @@ declare enum BarLineType {
|
|
|
837
844
|
declare class ObjStaffBarLine extends MusicObject {
|
|
838
845
|
readonly barLine: ObjBarLine;
|
|
839
846
|
readonly line: ObjNotationLine;
|
|
847
|
+
readonly rowGroup: ObjScoreRowGroup;
|
|
840
848
|
vlines: {
|
|
841
849
|
left: number;
|
|
842
850
|
width: number;
|
|
@@ -847,7 +855,7 @@ declare class ObjStaffBarLine extends MusicObject {
|
|
|
847
855
|
r: number;
|
|
848
856
|
}[];
|
|
849
857
|
readonly mi: MStaffBarLine;
|
|
850
|
-
constructor(barLine: ObjBarLine, line: ObjNotationLine);
|
|
858
|
+
constructor(barLine: ObjBarLine, line: ObjNotationLine, rowGroup: ObjScoreRowGroup);
|
|
851
859
|
getMusicInterface(): MusicInterface;
|
|
852
860
|
pick(x: number, y: number): MusicObject[];
|
|
853
861
|
updateRect(): void;
|
|
@@ -860,6 +868,8 @@ declare abstract class ObjBarLine extends MusicObject {
|
|
|
860
868
|
protected barLineType: BarLineType;
|
|
861
869
|
constructor(measure: ObjMeasure);
|
|
862
870
|
abstract solveBarLineType(): BarLineType;
|
|
871
|
+
get doc(): ObjDocument;
|
|
872
|
+
get row(): ObjScoreRow;
|
|
863
873
|
pick(x: number, y: number): MusicObject[];
|
|
864
874
|
layout(ctx: RenderContext): void;
|
|
865
875
|
updateRect(): void;
|
|
@@ -903,6 +913,7 @@ declare class ObjConnective extends MusicObject {
|
|
|
903
913
|
constructor(connectiveProps: ConnectiveProps, line: ObjNotationLine, measure: ObjMeasure, leftNoteGroup: ObjNoteGroup, leftNoteId: number, rightNoteGroup: ObjNoteGroup, rightNoteId: number);
|
|
904
914
|
constructor(connectiveProps: ConnectiveProps, line: ObjNotationLine, measure: ObjMeasure, leftNoteGroup: ObjNoteGroup, leftNoteId: number, tie: TieType);
|
|
905
915
|
getMusicInterface(): MConnective;
|
|
916
|
+
get doc(): ObjDocument;
|
|
906
917
|
isInsideMeasure(): boolean;
|
|
907
918
|
pick(x: number, y: number): MusicObject[];
|
|
908
919
|
layout(ctx: RenderContext): void;
|
|
@@ -910,6 +921,73 @@ declare class ObjConnective extends MusicObject {
|
|
|
910
921
|
draw(ctx: RenderContext): void;
|
|
911
922
|
}
|
|
912
923
|
|
|
924
|
+
declare class ObjSpecialText extends MusicObject {
|
|
925
|
+
readonly text: string;
|
|
926
|
+
readonly color: string;
|
|
927
|
+
static toCoda: string;
|
|
928
|
+
static Coda: string;
|
|
929
|
+
static Segno: string;
|
|
930
|
+
private components;
|
|
931
|
+
readonly mi: MSpecialText;
|
|
932
|
+
constructor(parent: MusicObject, text: string, color?: string);
|
|
933
|
+
getMusicInterface(): MSpecialText;
|
|
934
|
+
getText(): string;
|
|
935
|
+
pick(x: number, y: number): MusicObject[];
|
|
936
|
+
layout(ctx: RenderContext): void;
|
|
937
|
+
offset(dx: number, dy: number): void;
|
|
938
|
+
draw(ctx: RenderContext): void;
|
|
939
|
+
}
|
|
940
|
+
|
|
941
|
+
type ExtensionStartObject = ObjText | ObjSpecialText;
|
|
942
|
+
type ExtensionLineLeftObject = ObjBarLineLeft | MusicObject;
|
|
943
|
+
type ExtensionLineRightObject = ObjRhythmColumn | ObjBarLineRight;
|
|
944
|
+
type ExtensionStopObject = ObjBarLineRight | ObjText | ObjSpecialText;
|
|
945
|
+
type ExtensionObjectAll = ExtensionStartObject | ExtensionLineLeftObject | ExtensionLineRightObject | ExtensionStopObject;
|
|
946
|
+
declare class ObjExtensionLine extends MusicObject {
|
|
947
|
+
readonly measure: ObjMeasure;
|
|
948
|
+
readonly line: ObjNotationLine;
|
|
949
|
+
readonly extension: Extension;
|
|
950
|
+
readonly cols: ExtensionObjectAll[];
|
|
951
|
+
readonly mi: MExtensionLine;
|
|
952
|
+
constructor(measure: ObjMeasure, line: ObjNotationLine, extension: Extension, cols: ExtensionObjectAll[]);
|
|
953
|
+
get row(): ObjScoreRow;
|
|
954
|
+
getMusicInterface(): MExtensionLine;
|
|
955
|
+
private getLineLeft;
|
|
956
|
+
private getLineRight;
|
|
957
|
+
layoutFitToMeasure(ctx: RenderContext): void;
|
|
958
|
+
pick(x: number, y: number): MusicObject[];
|
|
959
|
+
layout(ctx: RenderContext): void;
|
|
960
|
+
offset(dx: number, dy: number): void;
|
|
961
|
+
draw(ctx: RenderContext): void;
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
type ExtensionLineStyle = "solid" | "dashed";
|
|
965
|
+
type ExtensionLinePos = "bottom" | "middle";
|
|
966
|
+
declare class ExtensionRange {
|
|
967
|
+
readonly startColumn: ObjRhythmColumn;
|
|
968
|
+
readonly columnRange: ObjRhythmColumn[];
|
|
969
|
+
stopObject?: ExtensionStopObject;
|
|
970
|
+
constructor(startColumn: ObjRhythmColumn);
|
|
971
|
+
get endColumn(): ObjRhythmColumn;
|
|
972
|
+
addColumn(col: ObjRhythmColumn): void;
|
|
973
|
+
setStopObject(obj: ExtensionStopObject): void;
|
|
974
|
+
}
|
|
975
|
+
declare class Extension extends MusicObjectLink {
|
|
976
|
+
readonly headObj: LayoutObjectWrapper;
|
|
977
|
+
private readonly length;
|
|
978
|
+
private readonly visible;
|
|
979
|
+
private readonly lineStyle;
|
|
980
|
+
private readonly linePos;
|
|
981
|
+
private readonly startColumn;
|
|
982
|
+
constructor(headObj: LayoutObjectWrapper, startColumn: ObjRhythmColumn, length: number, visible: boolean, lineStyle: ExtensionLineStyle, linePos: ExtensionLinePos);
|
|
983
|
+
isVisible(): boolean;
|
|
984
|
+
getLineStyle(): ExtensionLineStyle;
|
|
985
|
+
getLinePos(): ExtensionLinePos;
|
|
986
|
+
private static StopNavigations;
|
|
987
|
+
private whatStopped;
|
|
988
|
+
getRange(): ExtensionRange;
|
|
989
|
+
}
|
|
990
|
+
|
|
913
991
|
declare class ObjMeasure extends MusicObject {
|
|
914
992
|
readonly row: ObjScoreRow;
|
|
915
993
|
private readonly options;
|
|
@@ -934,7 +1012,7 @@ declare class ObjMeasure extends MusicObject {
|
|
|
934
1012
|
private voiceSymbols;
|
|
935
1013
|
private lastAddedRhythmColumn?;
|
|
936
1014
|
private lastAddedRhythmSymbol?;
|
|
937
|
-
private
|
|
1015
|
+
private addExtensionTo;
|
|
938
1016
|
private layoutObjects;
|
|
939
1017
|
private postMeasureBreakWidth;
|
|
940
1018
|
private passCount;
|
|
@@ -967,6 +1045,8 @@ declare class ObjMeasure extends MusicObject {
|
|
|
967
1045
|
getColumn(columnId: number): ObjRhythmColumn | undefined;
|
|
968
1046
|
isFirstMeasure(): boolean;
|
|
969
1047
|
isLastMeasure(): boolean;
|
|
1048
|
+
isFirstMeasureInRow(): boolean;
|
|
1049
|
+
isLastMeasureInRow(): boolean;
|
|
970
1050
|
getNextMeasure(): ObjMeasure | undefined;
|
|
971
1051
|
getPrevMeasure(): ObjMeasure | undefined;
|
|
972
1052
|
getKeySignature(): KeySignature;
|
|
@@ -1073,6 +1153,7 @@ declare class ObjScoreRow extends MusicObject {
|
|
|
1073
1153
|
private readonly staves;
|
|
1074
1154
|
private readonly tabs;
|
|
1075
1155
|
private readonly measures;
|
|
1156
|
+
private rowGroupByLine;
|
|
1076
1157
|
private needLayout;
|
|
1077
1158
|
readonly mi: MScoreRow;
|
|
1078
1159
|
constructor(doc: ObjDocument, prevRow: ObjScoreRow | undefined, scoreConfig: (StaffConfig | TabConfig)[]);
|
|
@@ -1080,6 +1161,7 @@ declare class ObjScoreRow extends MusicObject {
|
|
|
1080
1161
|
private createNotationLines;
|
|
1081
1162
|
getNotationLines(): ReadonlyArray<ObjNotationLine>;
|
|
1082
1163
|
getRowGroups(): ReadonlyArray<ObjScoreRowGroup>;
|
|
1164
|
+
getRowGroupByLineId(id: number): ObjScoreRowGroup;
|
|
1083
1165
|
findMatchingLine(line: ObjNotationLine): ObjNotationLine | undefined;
|
|
1084
1166
|
get regions(): ScoreRowRegions;
|
|
1085
1167
|
getStaves(): ReadonlyArray<ObjStaff>;
|
|
@@ -1111,6 +1193,7 @@ declare class ObjScoreRow extends MusicObject {
|
|
|
1111
1193
|
layoutSetNotationLines(ctx: RenderContext): void;
|
|
1112
1194
|
layoutDone(): void;
|
|
1113
1195
|
offset(dx: number, dy: number): void;
|
|
1196
|
+
getStaffLineLeft(): number | undefined;
|
|
1114
1197
|
draw(ctx: RenderContext): void;
|
|
1115
1198
|
}
|
|
1116
1199
|
|
|
@@ -1194,8 +1277,9 @@ declare class RenderContext {
|
|
|
1194
1277
|
constructor(mi: MRenderContext);
|
|
1195
1278
|
getMusicInterface(): MRenderContext;
|
|
1196
1279
|
get doc(): ObjDocument | undefined;
|
|
1197
|
-
|
|
1198
|
-
|
|
1280
|
+
getImageAsset(asset: ImageAsset, color?: string): HTMLImageElement | undefined;
|
|
1281
|
+
private forceDraw;
|
|
1282
|
+
private onImageLoaded;
|
|
1199
1283
|
setDocument(mdoc?: MDocument): void;
|
|
1200
1284
|
setCanvas(canvas: HTMLCanvasElement): void;
|
|
1201
1285
|
setScoreEventListener(fn: ScoreEventListener): void;
|
|
@@ -1207,7 +1291,6 @@ declare class RenderContext {
|
|
|
1207
1291
|
onMouseMove(e: MouseEvent): void;
|
|
1208
1292
|
onMouseLeave(e: MouseEvent): void;
|
|
1209
1293
|
onTouchEnd(e: TouchEvent): void;
|
|
1210
|
-
onLoad(): void;
|
|
1211
1294
|
hilightObject(obj?: MusicObject): void;
|
|
1212
1295
|
hilightStaffPos(staffPos?: {
|
|
1213
1296
|
scoreRow: ObjScoreRow;
|
|
@@ -1262,11 +1345,12 @@ declare class RenderContext {
|
|
|
1262
1345
|
|
|
1263
1346
|
declare class ObjEnding extends MusicObject {
|
|
1264
1347
|
readonly measure: ObjMeasure;
|
|
1348
|
+
readonly color: string;
|
|
1265
1349
|
readonly passages: number[];
|
|
1266
1350
|
private endingText;
|
|
1267
1351
|
private shapeRects;
|
|
1268
1352
|
readonly mi: MEnding;
|
|
1269
|
-
constructor(measure: ObjMeasure, passages: number[]);
|
|
1353
|
+
constructor(measure: ObjMeasure, color: string, passages: number[]);
|
|
1270
1354
|
getMusicInterface(): MEnding;
|
|
1271
1355
|
getShapeRects(): AnchoredRect[];
|
|
1272
1356
|
isSingleMeasureEnding(): boolean;
|
|
@@ -1281,9 +1365,9 @@ declare class ObjEnding extends MusicObject {
|
|
|
1281
1365
|
|
|
1282
1366
|
declare class ObjFermata extends MusicObject {
|
|
1283
1367
|
readonly pos: VerticalPos;
|
|
1284
|
-
|
|
1368
|
+
readonly color: string;
|
|
1285
1369
|
readonly mi: MFermata;
|
|
1286
|
-
constructor(parent: ObjRhythmColumn | ObjBarLineRight, pos: VerticalPos);
|
|
1370
|
+
constructor(parent: ObjRhythmColumn | ObjBarLineRight, pos: VerticalPos, color: string);
|
|
1287
1371
|
getMusicInterface(): MFermata;
|
|
1288
1372
|
static getFermataPositions(anchor: ObjRhythmColumn | ObjBarLineRight): VerticalPos[];
|
|
1289
1373
|
pick(x: number, y: number): MusicObject[];
|
|
@@ -1292,66 +1376,6 @@ declare class ObjFermata extends MusicObject {
|
|
|
1292
1376
|
draw(ctx: RenderContext): void;
|
|
1293
1377
|
}
|
|
1294
1378
|
|
|
1295
|
-
declare class ObjSpecialText extends MusicObject {
|
|
1296
|
-
readonly text: string;
|
|
1297
|
-
static toCoda: string;
|
|
1298
|
-
static Coda: string;
|
|
1299
|
-
static Segno: string;
|
|
1300
|
-
private components;
|
|
1301
|
-
readonly mi: MSpecialText;
|
|
1302
|
-
constructor(parent: MusicObject, text: string);
|
|
1303
|
-
getMusicInterface(): MSpecialText;
|
|
1304
|
-
getText(): string;
|
|
1305
|
-
pick(x: number, y: number): MusicObject[];
|
|
1306
|
-
layout(ctx: RenderContext): void;
|
|
1307
|
-
offset(dx: number, dy: number): void;
|
|
1308
|
-
draw(ctx: RenderContext): void;
|
|
1309
|
-
}
|
|
1310
|
-
|
|
1311
|
-
type ExtensionLineStyle = "solid" | "dashed";
|
|
1312
|
-
type ExtensionLinePos = "bottom" | "middle";
|
|
1313
|
-
type ExtensionRangeInfo = {
|
|
1314
|
-
startColumn: ObjRhythmColumn;
|
|
1315
|
-
endColumn: ObjRhythmColumn;
|
|
1316
|
-
columnRange: ObjRhythmColumn[];
|
|
1317
|
-
extensionBreakText?: string;
|
|
1318
|
-
};
|
|
1319
|
-
declare class Extension extends MusicObjectLink {
|
|
1320
|
-
private readonly length;
|
|
1321
|
-
private readonly visible;
|
|
1322
|
-
private readonly lineStyle;
|
|
1323
|
-
private readonly linePos;
|
|
1324
|
-
private readonly startColumn;
|
|
1325
|
-
private readonly context;
|
|
1326
|
-
constructor(head: MusicObject, startColumn: ObjRhythmColumn, length: number, visible: boolean, lineStyle: ExtensionLineStyle, linePos: ExtensionLinePos);
|
|
1327
|
-
isVisible(): boolean;
|
|
1328
|
-
getLineStyle(): ExtensionLineStyle;
|
|
1329
|
-
getLinePos(): ExtensionLinePos;
|
|
1330
|
-
private getSpanBreakText;
|
|
1331
|
-
getExtensionRangeInfo(): ExtensionRangeInfo;
|
|
1332
|
-
}
|
|
1333
|
-
|
|
1334
|
-
type ExtensionLineLeftObj = ObjBarLineLeft | MusicObject;
|
|
1335
|
-
type ExtensionLineRightObj = ObjRhythmColumn | ObjBarLineRight;
|
|
1336
|
-
declare class ObjExtensionLine extends MusicObject {
|
|
1337
|
-
readonly measure: ObjMeasure;
|
|
1338
|
-
readonly line: ObjNotationLine;
|
|
1339
|
-
readonly extension: Extension;
|
|
1340
|
-
readonly leftObj: ExtensionLineLeftObj;
|
|
1341
|
-
readonly rightObj: ExtensionLineRightObj;
|
|
1342
|
-
readonly mi: MExtensionLine;
|
|
1343
|
-
constructor(measure: ObjMeasure, line: ObjNotationLine, extension: Extension, leftObj: ExtensionLineLeftObj, rightObj: ExtensionLineRightObj);
|
|
1344
|
-
get row(): ObjScoreRow;
|
|
1345
|
-
getMusicInterface(): MExtensionLine;
|
|
1346
|
-
private getLineLeft;
|
|
1347
|
-
private getLineRight;
|
|
1348
|
-
layoutFitToMeasure(ctx: RenderContext): void;
|
|
1349
|
-
pick(x: number, y: number): MusicObject[];
|
|
1350
|
-
layout(ctx: RenderContext): void;
|
|
1351
|
-
offset(dx: number, dy: number): void;
|
|
1352
|
-
draw(ctx: RenderContext): void;
|
|
1353
|
-
}
|
|
1354
|
-
|
|
1355
1379
|
declare class ObjTabRhythm extends MusicObject {
|
|
1356
1380
|
readonly measure: ObjMeasure;
|
|
1357
1381
|
readonly tab: ObjTab;
|
|
@@ -1359,6 +1383,7 @@ declare class ObjTabRhythm extends MusicObject {
|
|
|
1359
1383
|
readonly mi: MTabRhythm;
|
|
1360
1384
|
constructor(measure: ObjMeasure, tab: ObjTab);
|
|
1361
1385
|
getMusicInterface(): MTabRhythm;
|
|
1386
|
+
get doc(): ObjDocument;
|
|
1362
1387
|
pick(x: number, y: number): MusicObject[];
|
|
1363
1388
|
layout(ctx: RenderContext): void;
|
|
1364
1389
|
private hasTuplets;
|
|
@@ -1407,7 +1432,6 @@ declare class LayoutObjectWrapper {
|
|
|
1407
1432
|
setPositionResolved(): void;
|
|
1408
1433
|
isPositionResolved(): boolean;
|
|
1409
1434
|
resolveClosestToStaffY(ctx: RenderContext): number;
|
|
1410
|
-
getTextContent(): string | undefined;
|
|
1411
1435
|
layout(ctx: RenderContext): void;
|
|
1412
1436
|
offset(dx: number, dy: number): void;
|
|
1413
1437
|
setAnchorY(y: number): void;
|
|
@@ -1440,6 +1464,7 @@ declare abstract class MusicObject {
|
|
|
1440
1464
|
protected readonly parent: MusicObject | undefined;
|
|
1441
1465
|
private anchoredLayoutObjects;
|
|
1442
1466
|
private link?;
|
|
1467
|
+
readonly userData: Record<string, unknown>;
|
|
1443
1468
|
constructor(parent: MusicObject | undefined);
|
|
1444
1469
|
abstract getMusicInterface(): MusicInterface;
|
|
1445
1470
|
getParent(): MusicObject | undefined;
|
|
@@ -1547,6 +1572,7 @@ declare class ObjStaffSignature extends MusicObject {
|
|
|
1547
1572
|
private tempoText?;
|
|
1548
1573
|
readonly mi: MStaffSignature;
|
|
1549
1574
|
constructor(measure: ObjMeasure, staff: ObjStaff);
|
|
1575
|
+
get doc(): ObjDocument;
|
|
1550
1576
|
getMusicInterface(): MStaffSignature;
|
|
1551
1577
|
updateClefImage(ctx: RenderContext, showClef: boolean): void;
|
|
1552
1578
|
updateMeasureNumber(showMeasureNumber: boolean): void;
|
|
@@ -1569,6 +1595,7 @@ declare class ObjTabSignature extends MusicObject {
|
|
|
1569
1595
|
readonly mi: MTabSignature;
|
|
1570
1596
|
constructor(measure: ObjMeasure, tab: ObjTab);
|
|
1571
1597
|
getMusicInterface(): MTabSignature;
|
|
1598
|
+
get doc(): ObjDocument;
|
|
1572
1599
|
updateMeasureNumber(showMeasureNumber: boolean): void;
|
|
1573
1600
|
updateTimeSignature(showTimeSignature: boolean): void;
|
|
1574
1601
|
updateTempo(showTempo: boolean): void;
|
|
@@ -300,7 +300,7 @@ declare class Note {
|
|
|
300
300
|
* @param b - Note b.
|
|
301
301
|
* @returns - -1, 0 or 1.
|
|
302
302
|
*/
|
|
303
|
-
static compareFunc(a: Note, b: Note): 1 |
|
|
303
|
+
static compareFunc(a: Note, b: Note): 1 | -1 | 0;
|
|
304
304
|
}
|
|
305
305
|
|
|
306
306
|
export { type Accidental as A, DefaultPitchNotation as D, GuitarNoteLabel as G, Note as N, type ParsedNote as P, SymbolSet as S, type NoteLetter as a, PitchNotation as b, PitchNotationList as c, DefaultGuitarNoteLabel as d, GuitarNoteLabelList as e, validateGuitarNoteLabel as f, getPitchNotationName as g, validatePitchNotation as v };
|
package/dist/pieces/index.d.mts
CHANGED
|
@@ -1,8 +1,15 @@
|
|
|
1
|
-
import { M as MDocument } from '../music-objects-
|
|
1
|
+
import { M as MDocument } from '../music-objects-CcJvZxS6.mjs';
|
|
2
2
|
import '../note-CJuq5aBy.mjs';
|
|
3
3
|
import '../tempo-Cxu8vusu.mjs';
|
|
4
4
|
import '@tspro/ts-utils-lib';
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Create Andante by A. Diabelli music piece.
|
|
8
|
+
*
|
|
9
|
+
* @returns - Music document.
|
|
10
|
+
*/
|
|
11
|
+
declare function createAndanteByDiabelli(): MDocument;
|
|
12
|
+
|
|
6
13
|
/**
|
|
7
14
|
* Create Canon in D by Pachelbel music piece.<br />
|
|
8
15
|
* <br />
|
|
@@ -31,10 +38,9 @@ declare function createFrereJacques(): MDocument;
|
|
|
31
38
|
declare function createGreensleeves(): MDocument;
|
|
32
39
|
|
|
33
40
|
/**
|
|
34
|
-
* Create
|
|
35
|
-
*
|
|
36
|
-
* @returns - Music document.
|
|
41
|
+
* Create all music pieces.
|
|
42
|
+
* @returns - Array of music documents containing all available pieces.
|
|
37
43
|
*/
|
|
38
|
-
declare function
|
|
44
|
+
declare function createAll(): readonly MDocument[];
|
|
39
45
|
|
|
40
|
-
export { createAndanteByDiabelli, createCanonInD, createFrereJacques, createGreensleeves };
|
|
46
|
+
export { createAll, createAndanteByDiabelli, createCanonInD, createFrereJacques, createGreensleeves };
|
package/dist/pieces/index.d.ts
CHANGED
|
@@ -1,8 +1,15 @@
|
|
|
1
|
-
import { M as MDocument } from '../music-objects-
|
|
2
|
-
import '../note-
|
|
3
|
-
import '../tempo-
|
|
1
|
+
import { M as MDocument } from '../music-objects-l5Ai97QA.js';
|
|
2
|
+
import '../note-CJuq5aBy.js';
|
|
3
|
+
import '../tempo-BnUjm25M.js';
|
|
4
4
|
import '@tspro/ts-utils-lib';
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Create Andante by A. Diabelli music piece.
|
|
8
|
+
*
|
|
9
|
+
* @returns - Music document.
|
|
10
|
+
*/
|
|
11
|
+
declare function createAndanteByDiabelli(): MDocument;
|
|
12
|
+
|
|
6
13
|
/**
|
|
7
14
|
* Create Canon in D by Pachelbel music piece.<br />
|
|
8
15
|
* <br />
|
|
@@ -31,10 +38,9 @@ declare function createFrereJacques(): MDocument;
|
|
|
31
38
|
declare function createGreensleeves(): MDocument;
|
|
32
39
|
|
|
33
40
|
/**
|
|
34
|
-
* Create
|
|
35
|
-
*
|
|
36
|
-
* @returns - Music document.
|
|
41
|
+
* Create all music pieces.
|
|
42
|
+
* @returns - Array of music documents containing all available pieces.
|
|
37
43
|
*/
|
|
38
|
-
declare function
|
|
44
|
+
declare function createAll(): readonly MDocument[];
|
|
39
45
|
|
|
40
|
-
export { createAndanteByDiabelli, createCanonInD, createFrereJacques, createGreensleeves };
|
|
46
|
+
export { createAll, createAndanteByDiabelli, createCanonInD, createFrereJacques, createGreensleeves };
|