@tspro/web-music-score 3.0.0 → 3.1.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.
@@ -221,6 +221,7 @@ declare enum Clef {
221
221
  type StaffConfig = {
222
222
  type: "staff";
223
223
  clef: Clef;
224
+ name?: string;
224
225
  isOctaveDown?: boolean;
225
226
  minNote?: string;
226
227
  maxNote?: string;
@@ -230,6 +231,7 @@ type StaffConfig = {
230
231
  /** @public */
231
232
  type TabConfig = {
232
233
  type: "tab";
234
+ name?: string;
233
235
  tuning?: string | string[];
234
236
  voiceIds?: number[];
235
237
  };
@@ -276,6 +278,13 @@ declare enum Connective {
276
278
  /** @public */
277
279
  type ConnectiveSpan = number | TieType;
278
280
  /** @public */
281
+ declare enum VerticalPosition {
282
+ Above = 0,
283
+ Below = 1,
284
+ Both = 2,
285
+ Auto = 3
286
+ }
287
+ /** @public */
279
288
  type NoteOptions = {
280
289
  dotted?: boolean;
281
290
  stem?: Stem;
@@ -434,9 +443,35 @@ type NotationLineObject = {
434
443
  offset?: (dx: number, dy: number) => void;
435
444
  offsetInPlace?: (dx: number, dy: number) => void;
436
445
  };
437
- declare class ObjStaff extends MusicObject {
446
+ declare abstract class ObjNotationLine extends MusicObject {
447
+ protected readonly objects: NotationLineObject[];
448
+ abstract readonly id: number;
449
+ abstract readonly name: string;
450
+ private layoutGroups;
451
+ constructor(parent: MusicObject);
452
+ addObject(o: NotationLineObject): void;
453
+ removeObjects(): void;
454
+ getLayoutGroup(lauoutGroupId: LayoutGroupId): LayoutGroup;
455
+ resetLayoutGroups(renderer: Renderer): void;
456
+ layoutLayoutGroups(renderer: Renderer): void;
457
+ private setObjectY;
458
+ private alignObjectsY;
459
+ layoutLayoutGroup(renderer: Renderer, layoutGroup: LayoutGroup, verticalPos: VerticalPos): void;
460
+ abstract calcTop(): number;
461
+ abstract calcBottom(): number;
462
+ abstract getTopLineY(): number;
463
+ abstract getBottomLineY(): number;
464
+ abstract containsVoiceId(voiceId: number): boolean;
465
+ abstract containsDiatonicId(diatonicId: number): boolean;
466
+ abstract layoutWidth(renderer: Renderer): void;
467
+ abstract layoutHeight(renderer: Renderer): void;
468
+ abstract offset(dx: number, dy: number): void;
469
+ abstract draw(renderer: Renderer): void;
470
+ }
471
+ declare class ObjStaff extends ObjNotationLine {
438
472
  readonly row: ObjScoreRow;
439
473
  readonly staffConfig: StaffConfig;
474
+ readonly id: number;
440
475
  readonly clefImageAsset: ImageAsset;
441
476
  readonly clefLineDiatonicId: number;
442
477
  readonly topLineDiatonicId: number;
@@ -447,11 +482,11 @@ declare class ObjStaff extends MusicObject {
447
482
  private joinedGrandStaff?;
448
483
  private topLineY;
449
484
  private bottomLineY;
450
- private readonly objects;
451
485
  readonly mi: MStaff;
452
- constructor(row: ObjScoreRow, staffConfig: StaffConfig);
486
+ constructor(row: ObjScoreRow, staffConfig: StaffConfig, id: number);
453
487
  getMusicInterface(): MStaff;
454
488
  get isOctaveDown(): boolean;
489
+ get name(): string;
455
490
  getTopLineY(): number;
456
491
  getMiddleLineY(): number;
457
492
  getBottomLineY(): number;
@@ -468,38 +503,38 @@ declare class ObjStaff extends MusicObject {
468
503
  isGrand(): boolean;
469
504
  calcTop(): number;
470
505
  calcBottom(): number;
471
- addObject(o: NotationLineObject): void;
472
- removeObjects(): void;
473
506
  pick(x: number, y: number): MusicObject[];
474
507
  layoutHeight(renderer: Renderer): void;
475
508
  layoutWidth(renderer: Renderer): void;
476
509
  offset(dx: number, dy: number): void;
477
510
  draw(renderer: Renderer): void;
478
511
  }
479
- declare class ObjTab extends MusicObject {
512
+ declare class ObjTab extends ObjNotationLine {
480
513
  readonly row: ObjScoreRow;
481
514
  readonly tabConfig: TabConfig;
515
+ readonly id: number;
482
516
  private top;
483
517
  private bottom;
484
- private readonly objects;
485
518
  private readonly tuningName?;
486
519
  private readonly tuningStrings;
487
520
  readonly mi: MTab;
488
- constructor(row: ObjScoreRow, tabConfig: TabConfig);
521
+ constructor(row: ObjScoreRow, tabConfig: TabConfig, id: number);
489
522
  getMusicInterface(): MTab;
523
+ get name(): string;
490
524
  getTuningName(): string | undefined;
491
525
  getTuningStrings(): ReadonlyArray<Note>;
492
526
  /** Return Y coordinate of string. */
493
527
  getStringY(stringId: number): number;
494
528
  getTopStringY(): number;
495
529
  getBottomStringY(): number;
530
+ getTopLineY(): number;
531
+ getBottomLineY(): number;
496
532
  getTop(): number;
497
533
  getBottom(): number;
498
534
  containsVoiceId(voiceId: number): boolean;
535
+ containsDiatonicId(diatonicId: number): boolean;
499
536
  calcTop(): number;
500
537
  calcBottom(): number;
501
- addObject(o: NotationLineObject): void;
502
- removeObjects(): void;
503
538
  pick(x: number, y: number): MusicObject[];
504
539
  layoutHeight(renderer: Renderer): void;
505
540
  layoutWidth(renderer: Renderer): void;
@@ -566,12 +601,13 @@ declare class ObjNoteGroup extends MusicObject {
566
601
  get row(): ObjScoreRow;
567
602
  get stemDir(): Stem.Up | Stem.Down;
568
603
  get triplet(): boolean;
569
- enableConnective(line: ObjStaff | ObjTab): boolean;
604
+ enableConnective(line: ObjNotationLine): boolean;
570
605
  startConnective(connectiveProps: ConnectiveProps): void;
606
+ getStaticObjects(line: ObjNotationLine): ReadonlyArray<MusicObject>;
571
607
  pick(x: number, y: number): MusicObject[];
572
608
  getTopNote(): Note;
573
609
  getBottomNote(): Note;
574
- getConnectiveAnchorPoint(connectiveProps: ConnectiveProps, line: ObjStaff | ObjTab, noteIndex: number, noteAnchor: NoteAnchor, side: "left" | "right"): {
610
+ getConnectiveAnchorPoint(connectiveProps: ConnectiveProps, line: ObjNotationLine, noteIndex: number, noteAnchor: NoteAnchor, side: "left" | "right"): {
575
611
  x: number;
576
612
  y: number;
577
613
  };
@@ -696,6 +732,7 @@ declare class ObjRest extends MusicObject {
696
732
  get dotted(): boolean;
697
733
  get stemDir(): Stem.Up | Stem.Down;
698
734
  get triplet(): boolean;
735
+ getStaticObjects(line: ObjNotationLine): ReadonlyArray<MusicObject>;
699
736
  pick(x: number, y: number): MusicObject[];
700
737
  getBeamGroup(): ObjBeamGroup | undefined;
701
738
  setBeamGroup(beam: ObjBeamGroup): void;
@@ -754,6 +791,7 @@ declare class ObjRhythmColumn extends MusicObject {
754
791
  getNextColumn(): ObjRhythmColumn | undefined;
755
792
  getTicksToNextColumn(): number;
756
793
  getShapeRects(): DivRect[];
794
+ getStaticObjects(line: ObjNotationLine): ReadonlyArray<MusicObject>;
757
795
  get doc(): ObjDocument;
758
796
  get row(): ObjScoreRow;
759
797
  pick(x: number, y: number): MusicObject[];
@@ -801,11 +839,11 @@ declare enum BarLineType {
801
839
  EndStartRepeat = 6
802
840
  }
803
841
  declare class ObjStaffTabBarLine extends MusicObject {
804
- readonly line: ObjStaff | ObjTab;
842
+ readonly line: ObjNotationLine;
805
843
  lineRects: DivRect[];
806
844
  dotRects: DivRect[];
807
845
  readonly mi: MStaffTabBarLine;
808
- constructor(line: ObjStaff | ObjTab);
846
+ constructor(line: ObjNotationLine);
809
847
  getMusicInterface(): MusicInterface;
810
848
  pick(x: number, y: number): MusicObject[];
811
849
  setRect(r: DivRect): void;
@@ -840,7 +878,7 @@ declare class ObjBarLineRight extends ObjBarLine {
840
878
 
841
879
  declare class ObjConnective extends MusicObject {
842
880
  readonly connectiveProps: ConnectiveProps;
843
- readonly line: ObjStaff | ObjTab;
881
+ readonly line: ObjNotationLine;
844
882
  readonly measure: ObjMeasure;
845
883
  private lx;
846
884
  private ly;
@@ -857,8 +895,8 @@ declare class ObjConnective extends MusicObject {
857
895
  private readonly rightNoteId?;
858
896
  private readonly tieType?;
859
897
  readonly mi: MConnective;
860
- constructor(connectiveProps: ConnectiveProps, line: ObjStaff | ObjTab, measure: ObjMeasure, leftNoteGroup: ObjNoteGroup, leftNoteId: number, rightNoteGroup: ObjNoteGroup, rightNoteId: number);
861
- constructor(connectiveProps: ConnectiveProps, line: ObjStaff | ObjTab, measure: ObjMeasure, leftNoteGroup: ObjNoteGroup, leftNoteId: number, tie: TieType);
898
+ constructor(connectiveProps: ConnectiveProps, line: ObjNotationLine, measure: ObjMeasure, leftNoteGroup: ObjNoteGroup, leftNoteId: number, rightNoteGroup: ObjNoteGroup, rightNoteId: number);
899
+ constructor(connectiveProps: ConnectiveProps, line: ObjNotationLine, measure: ObjMeasure, leftNoteGroup: ObjNoteGroup, leftNoteId: number, tie: TieType);
862
900
  getMusicInterface(): MConnective;
863
901
  isInsideMeasure(): boolean;
864
902
  pick(x: number, y: number): MusicObject[];
@@ -897,7 +935,7 @@ declare class ObjMeasure extends MusicObject {
897
935
  private voiceSymbols;
898
936
  private lastAddedRhythmColumn?;
899
937
  private lastAddedRhythmSymbol?;
900
- private addExtensionToMusicObject?;
938
+ private addExtensionToMusicObjects;
901
939
  private layoutObjects;
902
940
  private postMeasureBreakWidth;
903
941
  private passCount;
@@ -907,6 +945,7 @@ declare class ObjMeasure extends MusicObject {
907
945
  private isEndSection;
908
946
  private endRepeatPlayCount;
909
947
  private endRepeatPlayCountText?;
948
+ private staticObjectsCache;
910
949
  readonly mi: MMeasure;
911
950
  constructor(row: ObjScoreRow);
912
951
  getMusicInterface(): MMeasure;
@@ -940,17 +979,18 @@ declare class ObjMeasure extends MusicObject {
940
979
  hasPostMeasureBreak(): boolean;
941
980
  getPostMeasureBreakWidth(): number;
942
981
  private addLayoutObject;
943
- addFermata(fermata: Fermata): void;
982
+ addFermata(staffTabOrGroup: number | string | undefined, fermata: Fermata): void;
944
983
  hasFermata(anchor: ObjRhythmColumn | ObjBarLineRight): boolean;
945
- addNavigation(navigation: Navigation, ...args: unknown[]): void;
984
+ addNavigation(staffTabOrGroup: number | string | undefined, navigation: Navigation, ...args: unknown[]): void;
946
985
  hasNavigation(n: Navigation): boolean;
947
986
  getEnding(): ObjEnding | undefined;
948
987
  getEndRepeatPlayCount(): number;
949
988
  addConnective(connective: Connective.Tie, tieSpan?: number | TieType, notAnchor?: NoteAnchor): void;
950
989
  addConnective(connective: Connective.Slur, slurSpan?: number, notAnchor?: NoteAnchor): void;
951
990
  addConnective(connective: Connective.Slide, notAnchor?: NoteAnchor): void;
952
- addLabel(label: Label, text: string): void;
953
- addAnnotation(annotation: Annotation, text: string): void;
991
+ private forEachStaffGroup;
992
+ addLabel(staffTabOrGroup: number | string | undefined, label: Label, text: string): void;
993
+ addAnnotation(staffTabOrGroup: number | string | undefined, annotation: Annotation, text: string): void;
954
994
  endSong(): void;
955
995
  hasEndSong(): boolean;
956
996
  endSection(): void;
@@ -978,7 +1018,7 @@ declare class ObjMeasure extends MusicObject {
978
1018
  getMinWidth(): number;
979
1019
  getStaffLineLeft(): number;
980
1020
  getStaffLineRight(): number;
981
- getStaticObjects(): ReadonlyArray<ObjRhythmColumn | LayoutableMusicObject>;
1021
+ getStaticObjects(line: ObjNotationLine): ReadonlyArray<MusicObject>;
982
1022
  removeLayoutObjects(musicObj: MusicObject): void;
983
1023
  addConnectiveObject(connective: ObjConnective): void;
984
1024
  removeConnectiveObjects(): void;
@@ -1018,7 +1058,7 @@ declare class ObjScoreRow extends MusicObject {
1018
1058
  constructor(doc: ObjDocument, prevRow: ObjScoreRow | undefined, scoreConfig: (StaffConfig | TabConfig)[]);
1019
1059
  getMusicInterface(): MScoreRow;
1020
1060
  private createNotationLines;
1021
- getNotationLines(): ReadonlyArray<ObjStaff | ObjTab>;
1061
+ getNotationLines(): ReadonlyArray<ObjNotationLine>;
1022
1062
  getStaves(): ReadonlyArray<ObjStaff>;
1023
1063
  getTabs(): ReadonlyArray<ObjTab>;
1024
1064
  get hasStaff(): boolean;
@@ -1026,6 +1066,8 @@ declare class ObjScoreRow extends MusicObject {
1026
1066
  getTopStaff(): ObjStaff;
1027
1067
  getBottomStaff(): ObjStaff;
1028
1068
  getStaff(diatonicId: number): ObjStaff | undefined;
1069
+ resetLayoutGroups(renderer: Renderer): void;
1070
+ layoutLayoutGroups(renderer: Renderer): void;
1029
1071
  pick(x: number, y: number): MusicObject[];
1030
1072
  getConnectivesContentRect(): DivRect;
1031
1073
  getDiatonicIdAt(y: number): number | undefined;
@@ -1041,12 +1083,9 @@ declare class ObjScoreRow extends MusicObject {
1041
1083
  requestLayout(): void;
1042
1084
  layout(renderer: Renderer): void;
1043
1085
  layoutWidth(renderer: Renderer, width: number): void;
1086
+ updateRect(): void;
1044
1087
  alignStemsToBeams(): void;
1045
1088
  layoutPositionLines(renderer: Renderer): void;
1046
- updateRect(): void;
1047
- private setObjectY;
1048
- private alignObjectsY;
1049
- layoutLayoutGroup(renderer: Renderer, layoutGroup: LayoutGroup, verticalPos: VerticalPos): void;
1050
1089
  layoutPadding(renderer: Renderer): void;
1051
1090
  layoutDone(): void;
1052
1091
  offset(dx: number, dy: number): void;
@@ -1061,16 +1100,15 @@ declare class ObjDocument extends MusicObject {
1061
1100
  private measuresPerRow;
1062
1101
  private curScoreConfig;
1063
1102
  private header?;
1064
- private layoutGroups;
1065
1103
  private newRowRequested;
1066
1104
  private allConnectiveProps;
1105
+ private staffGroups;
1067
1106
  private readonly mi;
1068
1107
  constructor();
1069
1108
  getMusicInterface(): MDocument;
1070
1109
  setScoreConfiguration(config: StaffPreset | ScoreConfiguration): void;
1071
1110
  setMeasuresPerRow(measuresPerRow: number): void;
1072
1111
  addConnectiveProps(connectiveProps: ConnectiveProps): void;
1073
- getLayoutGroup(lauoutGroupId: LayoutGroupId): LayoutGroup;
1074
1112
  setRenderer(renderer?: Renderer): void;
1075
1113
  setHeader(title?: string, composer?: string, arranger?: string): void;
1076
1114
  getTitle(): string | undefined;
@@ -1084,6 +1122,8 @@ declare class ObjDocument extends MusicObject {
1084
1122
  getLastRow(): ObjScoreRow;
1085
1123
  requestNewRow(): void;
1086
1124
  addMeasure(): ObjMeasure;
1125
+ addStaffGroup(groupName: string, layoutElements: number | string | (number | string)[], verticalPosition: VerticalPosition): void;
1126
+ getStaffGroup(groupName: string): StaffGroup | undefined;
1087
1127
  getVoiceSymbols(voiceId: number): ReadonlyArray<RhythmSymbol>;
1088
1128
  removeLayoutObjects(musicObj: MusicObject): void;
1089
1129
  private forEachMeasure;
@@ -1267,12 +1307,19 @@ declare enum LayoutGroupId {
1267
1307
  ChordLabel = 6
1268
1308
  }
1269
1309
  declare enum VerticalPos {
1270
- AboveStaff = 0,
1271
- BelowStaff = 1
1310
+ Above = 0,
1311
+ Below = 1
1272
1312
  }
1273
1313
  type LayoutableMusicObject = ObjText | ObjSpecialText | ObjExtensionLine | ObjFermata | ObjEnding;
1314
+ declare class StaffGroup {
1315
+ readonly groupName: string;
1316
+ readonly staffsTabsAndGroups: number | string | (number | string)[];
1317
+ readonly verticalPosition: VerticalPosition;
1318
+ constructor(groupName: string, staffsTabsAndGroups: number | string | (number | string)[], verticalPosition: VerticalPosition);
1319
+ }
1274
1320
  declare class LayoutObjectWrapper {
1275
1321
  readonly musicObj: LayoutableMusicObject;
1322
+ readonly line: ObjNotationLine;
1276
1323
  readonly layoutGroupId: LayoutGroupId;
1277
1324
  readonly verticalPos: VerticalPos;
1278
1325
  readonly anchor: MusicObject;
@@ -1280,12 +1327,15 @@ declare class LayoutObjectWrapper {
1280
1327
  readonly row: ObjScoreRow;
1281
1328
  readonly layoutGroup: LayoutGroup;
1282
1329
  private positionResolved;
1283
- constructor(musicObj: LayoutableMusicObject, layoutGroupId: LayoutGroupId, verticalPos: VerticalPos);
1330
+ constructor(musicObj: LayoutableMusicObject, line: ObjNotationLine, layoutGroupId: LayoutGroupId, verticalPos: VerticalPos);
1284
1331
  clearPositionResolved(): void;
1285
1332
  setPositionResolved(): void;
1286
1333
  isPositionResolved(): boolean;
1287
1334
  resolveClosestToStaffY(renderer: Renderer): number;
1288
1335
  getTextContent(): string | undefined;
1336
+ layout(renderer: Renderer): void;
1337
+ offset(dx: number, dy: number): void;
1338
+ getRect(): DivRect;
1289
1339
  }
1290
1340
  declare class LayoutGroup {
1291
1341
  readonly layoutGroupId: number;
@@ -1345,14 +1395,15 @@ declare abstract class MusicObject {
1345
1395
 
1346
1396
  declare class ObjArpeggio extends MusicObject {
1347
1397
  readonly col: ObjRhythmColumn;
1398
+ readonly line: ObjNotationLine;
1348
1399
  readonly arpeggioDir: Arpeggio;
1349
1400
  private topArrowHeight;
1350
1401
  private bottomArrowHeight;
1351
- private static NumCycles;
1352
1402
  private cycleHeight;
1403
+ private numCycles;
1353
1404
  private color;
1354
1405
  readonly mi: MArpeggio;
1355
- constructor(col: ObjRhythmColumn, arpeggioDir: Arpeggio);
1406
+ constructor(col: ObjRhythmColumn, line: ObjNotationLine, arpeggioDir: Arpeggio);
1356
1407
  getMusicInterface(): MArpeggio;
1357
1408
  pick(x: number, y: number): MusicObject[];
1358
1409
  layout(renderer: Renderer): void;
@@ -1765,4 +1816,4 @@ declare class MPlaybackButtons {
1765
1816
  private static addOnClickListener;
1766
1817
  }
1767
1818
 
1768
- export { getVoiceIds as $, Annotation as A, MStaffRest as B, Connective as C, DivRect as D, MRhythmColumn as E, Fermata as F, MScoreRow as G, MStaff as H, MTab as I, MSignature as J, MSpecialText as K, Label as L, MDocument as M, type NoteOptions as N, ObjMeasure as O, MText as P, MExtensionLine as Q, type RestOptions as R, StaffPreset as S, TieType as T, MPlayer as U, MRenderer as V, MPlaybackButtons as W, Clef as X, type StaffConfig as Y, type TabConfig as Z, type VoiceId as _, type ScoreConfiguration as a, type StringNumber as a0, getStringNumbers as a1, Stem as a2, Arpeggio as a3, type ConnectiveSpan as a4, PlayState as a5, type PlayStateChangeListener as a6, Navigation as b, NoteAnchor as c, type ScoreEventType as d, ScoreEvent as e, ScoreStaffPosEvent as f, ScoreObjectEvent as g, type ScoreEventListener as h, MusicInterface as i, MAccidental as j, MConnective as k, MArpeggio as l, MBeamGroup as m, MStaffBeamGroup as n, MEnding as o, MFermata as p, MHeader as q, MImage as r, MMeasure as s, MBarLineRight as t, MBarLineLeft as u, MStaffTabBarLine as v, MNoteGroup as w, MStaffNoteGroup as x, MTabNoteGroup as y, MRest as z };
1819
+ export { getVoiceIds as $, Annotation as A, MStaffRest as B, Connective as C, DivRect as D, MRhythmColumn as E, Fermata as F, MScoreRow as G, MStaff as H, MTab as I, MSignature as J, MSpecialText as K, Label as L, MDocument as M, type NoteOptions as N, MText as O, MExtensionLine as P, MPlayer as Q, type RestOptions as R, StaffPreset as S, TieType as T, MRenderer as U, VerticalPosition as V, MPlaybackButtons as W, Clef as X, type StaffConfig as Y, type TabConfig as Z, type VoiceId as _, type ScoreConfiguration as a, type StringNumber as a0, getStringNumbers as a1, Stem as a2, Arpeggio as a3, type ConnectiveSpan as a4, PlayState as a5, type PlayStateChangeListener as a6, Navigation as b, NoteAnchor as c, type ScoreEventType as d, ScoreEvent as e, ScoreStaffPosEvent as f, ScoreObjectEvent as g, type ScoreEventListener as h, MusicInterface as i, MAccidental as j, MConnective as k, MArpeggio as l, MBeamGroup as m, MStaffBeamGroup as n, MEnding as o, MFermata as p, MHeader as q, MImage as r, MMeasure as s, MBarLineRight as t, MBarLineLeft as u, MStaffTabBarLine as v, MNoteGroup as w, MStaffNoteGroup as x, MTabNoteGroup as y, MRest as z };
@@ -1,4 +1,4 @@
1
- import { M as MDocument } from '../interface-CLb7xa7_.mjs';
1
+ import { M as MDocument } from '../interface-BedxdQDE.mjs';
2
2
  import '../note-B5ZtlHc8.mjs';
3
3
  import '../tempo-TjQKn46X.mjs';
4
4
  import '@tspro/ts-utils-lib';
@@ -1,4 +1,4 @@
1
- import { M as MDocument } from '../interface-DXyXwLBB.js';
1
+ import { M as MDocument } from '../interface-DprVf__B.js';
2
2
  import '../note-B5ZtlHc8.js';
3
3
  import '../tempo-DoJd-UYT.js';
4
4
  import '@tspro/ts-utils-lib';
@@ -1,4 +1,4 @@
1
- /* WebMusicScore v3.0.0 | (c) 2023 PahkaSoft | MIT License | Includes: Tone.js (MIT License) */
1
+ /* WebMusicScore v3.1.0 | (c) 2023 PahkaSoft | MIT License | Includes: Tone.js (MIT License) */
2
2
  "use strict";
3
3
  var __defProp = Object.defineProperty;
4
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -1,5 +1,5 @@
1
- /* WebMusicScore v3.0.0 | (c) 2023 PahkaSoft | MIT License | Includes: Tone.js (MIT License) */
2
- import "../chunk-ZWFAOHYM.mjs";
1
+ /* WebMusicScore v3.1.0 | (c) 2023 PahkaSoft | MIT License | Includes: Tone.js (MIT License) */
2
+ import "../chunk-B4J3KED2.mjs";
3
3
 
4
4
  // src/pieces/frere-jacques.ts
5
5
  import { NoteLength, ScaleType } from "@tspro/web-music-score/theory";
@@ -3,7 +3,7 @@ import * as React from 'react';
3
3
  import { c as Scale, S as ScaleType } from '../scale-C-YS5iVG.mjs';
4
4
  import { b as PitchNotation, G as GuitarNoteLabel, N as Note } from '../note-B5ZtlHc8.mjs';
5
5
  import { H as Handedness } from '../guitar-zASF7B1g.mjs';
6
- import { D as DivRect, M as MDocument, h as ScoreEventListener, V as MRenderer, W as MPlaybackButtons } from '../interface-CLb7xa7_.mjs';
6
+ import { D as DivRect, M as MDocument, h as ScoreEventListener, U as MRenderer, W as MPlaybackButtons } from '../interface-BedxdQDE.mjs';
7
7
  import '../tempo-TjQKn46X.mjs';
8
8
  import '@tspro/ts-utils-lib';
9
9
 
@@ -3,7 +3,7 @@ import * as React from 'react';
3
3
  import { c as Scale, S as ScaleType } from '../scale-B_2MZaT9.js';
4
4
  import { b as PitchNotation, G as GuitarNoteLabel, N as Note } from '../note-B5ZtlHc8.js';
5
5
  import { H as Handedness } from '../guitar-BIFwFT31.js';
6
- import { D as DivRect, M as MDocument, h as ScoreEventListener, V as MRenderer, W as MPlaybackButtons } from '../interface-DXyXwLBB.js';
6
+ import { D as DivRect, M as MDocument, h as ScoreEventListener, U as MRenderer, W as MPlaybackButtons } from '../interface-DprVf__B.js';
7
7
  import '../tempo-DoJd-UYT.js';
8
8
  import '@tspro/ts-utils-lib';
9
9
 
@@ -1,4 +1,4 @@
1
- /* WebMusicScore v3.0.0 | (c) 2023 PahkaSoft | MIT License | Includes: Tone.js (MIT License) */
1
+ /* WebMusicScore v3.1.0 | (c) 2023 PahkaSoft | MIT License | Includes: Tone.js (MIT License) */
2
2
  "use strict";
3
3
  var __create = Object.create;
4
4
  var __defProp = Object.defineProperty;
@@ -1,7 +1,7 @@
1
- /* WebMusicScore v3.0.0 | (c) 2023 PahkaSoft | MIT License | Includes: Tone.js (MIT License) */
1
+ /* WebMusicScore v3.1.0 | (c) 2023 PahkaSoft | MIT License | Includes: Tone.js (MIT License) */
2
2
  import {
3
3
  __publicField
4
- } from "../chunk-ZWFAOHYM.mjs";
4
+ } from "../chunk-B4J3KED2.mjs";
5
5
 
6
6
  // src/react-ui/circle-of-fifths.tsx
7
7
  import * as React from "react";
@@ -1,5 +1,5 @@
1
- import { S as StaffPreset, a as ScoreConfiguration, O as ObjMeasure, M as MDocument, N as NoteOptions, R as RestOptions, F as Fermata, b as Navigation, C as Connective, T as TieType, c as NoteAnchor, L as Label, A as Annotation } from '../interface-CLb7xa7_.mjs';
2
- export { a3 as Arpeggio, X as Clef, a4 as ConnectiveSpan, D as DivRect, j as MAccidental, l as MArpeggio, u as MBarLineLeft, t as MBarLineRight, m as MBeamGroup, k as MConnective, o as MEnding, Q as MExtensionLine, p as MFermata, q as MHeader, r as MImage, s as MMeasure, w as MNoteGroup, W as MPlaybackButtons, U as MPlayer, V as MRenderer, z as MRest, E as MRhythmColumn, G as MScoreRow, J as MSignature, K as MSpecialText, H as MStaff, n as MStaffBeamGroup, x as MStaffNoteGroup, B as MStaffRest, v as MStaffTabBarLine, I as MTab, y as MTabNoteGroup, P as MText, i as MusicInterface, a5 as PlayState, a6 as PlayStateChangeListener, e as ScoreEvent, h as ScoreEventListener, d as ScoreEventType, g as ScoreObjectEvent, f as ScoreStaffPosEvent, Y as StaffConfig, a2 as Stem, a0 as StringNumber, Z as TabConfig, _ as VoiceId, a1 as getStringNumbers, $ as getVoiceIds } from '../interface-CLb7xa7_.mjs';
1
+ import { S as StaffPreset, a as ScoreConfiguration, M as MDocument, N as NoteOptions, R as RestOptions, F as Fermata, b as Navigation, L as Label, A as Annotation, C as Connective, T as TieType, c as NoteAnchor, V as VerticalPosition } from '../interface-BedxdQDE.mjs';
2
+ export { a3 as Arpeggio, X as Clef, a4 as ConnectiveSpan, D as DivRect, j as MAccidental, l as MArpeggio, u as MBarLineLeft, t as MBarLineRight, m as MBeamGroup, k as MConnective, o as MEnding, P as MExtensionLine, p as MFermata, q as MHeader, r as MImage, s as MMeasure, w as MNoteGroup, W as MPlaybackButtons, Q as MPlayer, U as MRenderer, z as MRest, E as MRhythmColumn, G as MScoreRow, J as MSignature, K as MSpecialText, H as MStaff, n as MStaffBeamGroup, x as MStaffNoteGroup, B as MStaffRest, v as MStaffTabBarLine, I as MTab, y as MTabNoteGroup, O as MText, i as MusicInterface, a5 as PlayState, a6 as PlayStateChangeListener, e as ScoreEvent, h as ScoreEventListener, d as ScoreEventType, g as ScoreObjectEvent, f as ScoreStaffPosEvent, Y as StaffConfig, a2 as Stem, a0 as StringNumber, Z as TabConfig, _ as VoiceId, a1 as getStringNumbers, $ as getVoiceIds } from '../interface-BedxdQDE.mjs';
3
3
  import { N as Note } from '../note-B5ZtlHc8.mjs';
4
4
  import { S as ScaleType, c as Scale } from '../scale-C-YS5iVG.mjs';
5
5
  import { K as KeySignature, a as TimeSignature, T as TimeSignatureString, N as NoteLength } from '../tempo-TjQKn46X.mjs';
@@ -10,7 +10,7 @@ declare class DocumentBuilder {
10
10
  constructor();
11
11
  setScoreConfiguration(staffPreset: StaffPreset): DocumentBuilder;
12
12
  setScoreConfiguration(config: ScoreConfiguration): DocumentBuilder;
13
- getMeasure(): ObjMeasure;
13
+ private getMeasure;
14
14
  getDocument(): MDocument;
15
15
  setHeader(title?: string, composer?: string, arranger?: string): DocumentBuilder;
16
16
  setMeasuresPerRow(measuresPerRow: number): DocumentBuilder;
@@ -23,16 +23,40 @@ declare class DocumentBuilder {
23
23
  addNote(voiceId: number, note: Note | string, noteLength: NoteLength, options?: NoteOptions): DocumentBuilder;
24
24
  addChord(voiceId: number, notes: (Note | string)[], noteLength: NoteLength, options?: NoteOptions): DocumentBuilder;
25
25
  addRest(voiceId: number, restLength: NoteLength, options?: RestOptions): DocumentBuilder;
26
+ private addFermataInternal;
26
27
  addFermata(fermata?: Fermata): DocumentBuilder;
28
+ /** @param staffTabOrGroup - staff/tab index (0=top), staff/tab name, or staff group name. */
29
+ addFermataTo(staffTabOrGroup: number | string, fermata?: Fermata): DocumentBuilder;
30
+ private addNavigationInternal;
27
31
  addNavigation(navigation: Navigation): DocumentBuilder;
28
32
  addNavigation(navigation: Navigation.EndRepeat, playCount: number): DocumentBuilder;
29
33
  addNavigation(navigation: Navigation.Ending, ...passages: number[]): DocumentBuilder;
34
+ /** @param staffTabOrGroup - staff/tab index (0=top), staff/tab name, or staff group name. */
35
+ addNavigationTo(staffTabOrGroup: number | string, navigation: Navigation): DocumentBuilder;
36
+ /** @param staffTabOrGroup - staff/tab index (0=top), staff/tab name, or staff group name. */
37
+ addNavigationTo(staffTabOrGroup: number | string, navigation: Navigation.EndRepeat, playCount: number): DocumentBuilder;
38
+ /** @param staffTabOrGroup - staff/tab index (0=top), staff/tab name, or staff group name. */
39
+ addNavigationTo(staffTabOrGroup: number | string, navigation: Navigation.Ending, ...passages: number[]): DocumentBuilder;
40
+ private addLabelInternal;
41
+ addLabel(label: Label, text: string): DocumentBuilder;
42
+ /** @param staffTabOrGroup - staff/tab index (0=top), staff/tab name, or staff group name. */
43
+ addLabelTo(staffTabOrGroup: number | string, label: Label, text: string): DocumentBuilder;
44
+ private addAnnotationInternal;
45
+ addAnnotation(annotation: Annotation, text: string): DocumentBuilder;
46
+ /** @param staffTabOrGroup - staff/tab index (0=top), staff/tab name, or staff group name. */
47
+ addAnnotationTo(staffTabOrGroup: number | string, annotation: Annotation, text: string): DocumentBuilder;
30
48
  addConnective(connective: Connective.Tie, tieSpan?: number | TieType, notAnchor?: NoteAnchor): DocumentBuilder;
31
49
  addConnective(connective: Connective.Slur, slurSpan?: number, notAnchor?: NoteAnchor): DocumentBuilder;
32
50
  addConnective(connective: Connective.Slide, notAnchor?: NoteAnchor): DocumentBuilder;
33
- addLabel(label: Label, text: string): DocumentBuilder;
34
- addAnnotation(annotation: Annotation, text: string): DocumentBuilder;
35
51
  addExtension(extensionLength: NoteLength | number, extensionVisible?: boolean): DocumentBuilder;
52
+ /**
53
+ *
54
+ * @param groupName - Name of staff group.
55
+ * @param staffsTabsAndGroups - staff/tab index (0=top), staff/tab name, or staff group name. Single value or array.
56
+ * @param verticalPosition - Vertical position, are elements added above, below or both.
57
+ * @returns
58
+ */
59
+ addStaffGroup(groupName: string, staffsTabsAndGroups: number | string | (number | string)[], verticalPosition?: VerticalPosition): DocumentBuilder;
36
60
  endSong(): DocumentBuilder;
37
61
  endSection(): DocumentBuilder;
38
62
  endRow(): DocumentBuilder;
@@ -40,4 +64,4 @@ declare class DocumentBuilder {
40
64
  addScaleArpeggio(scale: Scale, bottomNote: string, numOctaves: number): DocumentBuilder;
41
65
  }
42
66
 
43
- export { Annotation, Connective, DocumentBuilder, Fermata, Label, MDocument, Navigation, NoteAnchor, NoteOptions, RestOptions, ScoreConfiguration, StaffPreset, TieType };
67
+ export { Annotation, Connective, DocumentBuilder, Fermata, Label, MDocument, Navigation, NoteAnchor, NoteOptions, RestOptions, ScoreConfiguration, StaffPreset, TieType, VerticalPosition };
@@ -1,5 +1,5 @@
1
- import { S as StaffPreset, a as ScoreConfiguration, O as ObjMeasure, M as MDocument, N as NoteOptions, R as RestOptions, F as Fermata, b as Navigation, C as Connective, T as TieType, c as NoteAnchor, L as Label, A as Annotation } from '../interface-DXyXwLBB.js';
2
- export { a3 as Arpeggio, X as Clef, a4 as ConnectiveSpan, D as DivRect, j as MAccidental, l as MArpeggio, u as MBarLineLeft, t as MBarLineRight, m as MBeamGroup, k as MConnective, o as MEnding, Q as MExtensionLine, p as MFermata, q as MHeader, r as MImage, s as MMeasure, w as MNoteGroup, W as MPlaybackButtons, U as MPlayer, V as MRenderer, z as MRest, E as MRhythmColumn, G as MScoreRow, J as MSignature, K as MSpecialText, H as MStaff, n as MStaffBeamGroup, x as MStaffNoteGroup, B as MStaffRest, v as MStaffTabBarLine, I as MTab, y as MTabNoteGroup, P as MText, i as MusicInterface, a5 as PlayState, a6 as PlayStateChangeListener, e as ScoreEvent, h as ScoreEventListener, d as ScoreEventType, g as ScoreObjectEvent, f as ScoreStaffPosEvent, Y as StaffConfig, a2 as Stem, a0 as StringNumber, Z as TabConfig, _ as VoiceId, a1 as getStringNumbers, $ as getVoiceIds } from '../interface-DXyXwLBB.js';
1
+ import { S as StaffPreset, a as ScoreConfiguration, M as MDocument, N as NoteOptions, R as RestOptions, F as Fermata, b as Navigation, L as Label, A as Annotation, C as Connective, T as TieType, c as NoteAnchor, V as VerticalPosition } from '../interface-DprVf__B.js';
2
+ export { a3 as Arpeggio, X as Clef, a4 as ConnectiveSpan, D as DivRect, j as MAccidental, l as MArpeggio, u as MBarLineLeft, t as MBarLineRight, m as MBeamGroup, k as MConnective, o as MEnding, P as MExtensionLine, p as MFermata, q as MHeader, r as MImage, s as MMeasure, w as MNoteGroup, W as MPlaybackButtons, Q as MPlayer, U as MRenderer, z as MRest, E as MRhythmColumn, G as MScoreRow, J as MSignature, K as MSpecialText, H as MStaff, n as MStaffBeamGroup, x as MStaffNoteGroup, B as MStaffRest, v as MStaffTabBarLine, I as MTab, y as MTabNoteGroup, O as MText, i as MusicInterface, a5 as PlayState, a6 as PlayStateChangeListener, e as ScoreEvent, h as ScoreEventListener, d as ScoreEventType, g as ScoreObjectEvent, f as ScoreStaffPosEvent, Y as StaffConfig, a2 as Stem, a0 as StringNumber, Z as TabConfig, _ as VoiceId, a1 as getStringNumbers, $ as getVoiceIds } from '../interface-DprVf__B.js';
3
3
  import { N as Note } from '../note-B5ZtlHc8.js';
4
4
  import { S as ScaleType, c as Scale } from '../scale-B_2MZaT9.js';
5
5
  import { K as KeySignature, a as TimeSignature, T as TimeSignatureString, N as NoteLength } from '../tempo-DoJd-UYT.js';
@@ -10,7 +10,7 @@ declare class DocumentBuilder {
10
10
  constructor();
11
11
  setScoreConfiguration(staffPreset: StaffPreset): DocumentBuilder;
12
12
  setScoreConfiguration(config: ScoreConfiguration): DocumentBuilder;
13
- getMeasure(): ObjMeasure;
13
+ private getMeasure;
14
14
  getDocument(): MDocument;
15
15
  setHeader(title?: string, composer?: string, arranger?: string): DocumentBuilder;
16
16
  setMeasuresPerRow(measuresPerRow: number): DocumentBuilder;
@@ -23,16 +23,40 @@ declare class DocumentBuilder {
23
23
  addNote(voiceId: number, note: Note | string, noteLength: NoteLength, options?: NoteOptions): DocumentBuilder;
24
24
  addChord(voiceId: number, notes: (Note | string)[], noteLength: NoteLength, options?: NoteOptions): DocumentBuilder;
25
25
  addRest(voiceId: number, restLength: NoteLength, options?: RestOptions): DocumentBuilder;
26
+ private addFermataInternal;
26
27
  addFermata(fermata?: Fermata): DocumentBuilder;
28
+ /** @param staffTabOrGroup - staff/tab index (0=top), staff/tab name, or staff group name. */
29
+ addFermataTo(staffTabOrGroup: number | string, fermata?: Fermata): DocumentBuilder;
30
+ private addNavigationInternal;
27
31
  addNavigation(navigation: Navigation): DocumentBuilder;
28
32
  addNavigation(navigation: Navigation.EndRepeat, playCount: number): DocumentBuilder;
29
33
  addNavigation(navigation: Navigation.Ending, ...passages: number[]): DocumentBuilder;
34
+ /** @param staffTabOrGroup - staff/tab index (0=top), staff/tab name, or staff group name. */
35
+ addNavigationTo(staffTabOrGroup: number | string, navigation: Navigation): DocumentBuilder;
36
+ /** @param staffTabOrGroup - staff/tab index (0=top), staff/tab name, or staff group name. */
37
+ addNavigationTo(staffTabOrGroup: number | string, navigation: Navigation.EndRepeat, playCount: number): DocumentBuilder;
38
+ /** @param staffTabOrGroup - staff/tab index (0=top), staff/tab name, or staff group name. */
39
+ addNavigationTo(staffTabOrGroup: number | string, navigation: Navigation.Ending, ...passages: number[]): DocumentBuilder;
40
+ private addLabelInternal;
41
+ addLabel(label: Label, text: string): DocumentBuilder;
42
+ /** @param staffTabOrGroup - staff/tab index (0=top), staff/tab name, or staff group name. */
43
+ addLabelTo(staffTabOrGroup: number | string, label: Label, text: string): DocumentBuilder;
44
+ private addAnnotationInternal;
45
+ addAnnotation(annotation: Annotation, text: string): DocumentBuilder;
46
+ /** @param staffTabOrGroup - staff/tab index (0=top), staff/tab name, or staff group name. */
47
+ addAnnotationTo(staffTabOrGroup: number | string, annotation: Annotation, text: string): DocumentBuilder;
30
48
  addConnective(connective: Connective.Tie, tieSpan?: number | TieType, notAnchor?: NoteAnchor): DocumentBuilder;
31
49
  addConnective(connective: Connective.Slur, slurSpan?: number, notAnchor?: NoteAnchor): DocumentBuilder;
32
50
  addConnective(connective: Connective.Slide, notAnchor?: NoteAnchor): DocumentBuilder;
33
- addLabel(label: Label, text: string): DocumentBuilder;
34
- addAnnotation(annotation: Annotation, text: string): DocumentBuilder;
35
51
  addExtension(extensionLength: NoteLength | number, extensionVisible?: boolean): DocumentBuilder;
52
+ /**
53
+ *
54
+ * @param groupName - Name of staff group.
55
+ * @param staffsTabsAndGroups - staff/tab index (0=top), staff/tab name, or staff group name. Single value or array.
56
+ * @param verticalPosition - Vertical position, are elements added above, below or both.
57
+ * @returns
58
+ */
59
+ addStaffGroup(groupName: string, staffsTabsAndGroups: number | string | (number | string)[], verticalPosition?: VerticalPosition): DocumentBuilder;
36
60
  endSong(): DocumentBuilder;
37
61
  endSection(): DocumentBuilder;
38
62
  endRow(): DocumentBuilder;
@@ -40,4 +64,4 @@ declare class DocumentBuilder {
40
64
  addScaleArpeggio(scale: Scale, bottomNote: string, numOctaves: number): DocumentBuilder;
41
65
  }
42
66
 
43
- export { Annotation, Connective, DocumentBuilder, Fermata, Label, MDocument, Navigation, NoteAnchor, NoteOptions, RestOptions, ScoreConfiguration, StaffPreset, TieType };
67
+ export { Annotation, Connective, DocumentBuilder, Fermata, Label, MDocument, Navigation, NoteAnchor, NoteOptions, RestOptions, ScoreConfiguration, StaffPreset, TieType, VerticalPosition };