@tspro/web-music-score 4.0.0 → 4.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +1 -1
  3. package/dist/audio/index.d.mts +40 -1
  4. package/dist/audio/index.d.ts +40 -1
  5. package/dist/audio/index.js +1 -1
  6. package/dist/audio/index.mjs +2 -2
  7. package/dist/audio-cg/index.d.mts +3 -0
  8. package/dist/audio-cg/index.d.ts +3 -0
  9. package/dist/audio-cg/index.js +1 -1
  10. package/dist/audio-cg/index.mjs +2 -2
  11. package/dist/{chunk-D643HZHM.mjs → chunk-YFPLOHP2.mjs} +2 -2
  12. package/dist/core/index.d.mts +12 -0
  13. package/dist/core/index.d.ts +12 -0
  14. package/dist/core/index.js +3 -2
  15. package/dist/core/index.mjs +4 -3
  16. package/dist/guitar-CaZJDA05.d.ts +35 -0
  17. package/dist/guitar-DdexKdN6.d.mts +35 -0
  18. package/dist/iife/index.global.js +11 -11
  19. package/dist/{interface-XoKiryoV.d.mts → music-objects-DJQ4d2OA.d.mts} +549 -53
  20. package/dist/{interface-7k8qGG44.d.ts → music-objects-Dc3kR-XF.d.ts} +549 -53
  21. package/dist/note-eA2xPPiG.d.mts +294 -0
  22. package/dist/note-eA2xPPiG.d.ts +294 -0
  23. package/dist/pieces/index.d.mts +22 -3
  24. package/dist/pieces/index.d.ts +22 -3
  25. package/dist/pieces/index.js +5 -2
  26. package/dist/pieces/index.mjs +6 -3
  27. package/dist/react-ui/index.d.mts +166 -17
  28. package/dist/react-ui/index.d.ts +166 -17
  29. package/dist/react-ui/index.js +78 -1
  30. package/dist/react-ui/index.mjs +79 -2
  31. package/dist/scale-B2Icbetz.d.ts +230 -0
  32. package/dist/scale-BbDJTbrG.d.mts +230 -0
  33. package/dist/score/index.d.mts +299 -46
  34. package/dist/score/index.d.ts +299 -46
  35. package/dist/score/index.js +553 -76
  36. package/dist/score/index.mjs +550 -75
  37. package/dist/{tempo-BAYoZ_Li.d.mts → tempo-CtUhvJbr.d.mts} +187 -5
  38. package/dist/{tempo-r2sb6Ku2.d.ts → tempo-Dt8aHpol.d.ts} +187 -5
  39. package/dist/theory/index.d.mts +29 -13
  40. package/dist/theory/index.d.ts +29 -13
  41. package/dist/theory/index.js +369 -25
  42. package/dist/theory/index.mjs +370 -26
  43. package/package.json +1 -1
  44. package/dist/guitar-DggbM2UL.d.mts +0 -17
  45. package/dist/guitar-cNmE-EvH.d.ts +0 -17
  46. package/dist/note-BFa43I86.d.mts +0 -85
  47. package/dist/note-CcVdUFqS.d.ts +0 -85
  48. package/dist/scale-C2pCNxdE.d.mts +0 -75
  49. package/dist/scale-CvPbJvfN.d.ts +0 -75
@@ -1,5 +1,5 @@
1
- import { N as Note, A as Accidental } from './note-CcVdUFqS.js';
2
- import { R as RhythmProps, N as NoteLength, h as NoteLengthStr, j as TupletRatio, c as Tempo, K as KeySignature, a as TimeSignature, T as TimeSignatureString } from './tempo-r2sb6Ku2.js';
1
+ import { N as Note, A as Accidental } from './note-eA2xPPiG.js';
2
+ import { R as RhythmProps, N as NoteLength, h as NoteLengthStr, j as TupletRatio, c as Tempo, K as KeySignature, a as TimeSignature, T as TimeSignatureString } from './tempo-Dt8aHpol.js';
3
3
  import { Vec2 } from '@tspro/ts-utils-lib';
4
4
 
5
5
  /**
@@ -197,6 +197,7 @@ declare class DivRect {
197
197
  getRect(): DivRect;
198
198
  }
199
199
 
200
+ /** Staff preset values for score configuration. */
200
201
  declare enum StaffPreset {
201
202
  /** Treble staff has treble (G-) clef. */
202
203
  Treble = "treble",
@@ -211,92 +212,157 @@ declare enum StaffPreset {
211
212
  /** GuitarCombined has treble clef and tab for guitar. */
212
213
  GuitarCombined = "guitarCombined"
213
214
  }
215
+ /** Clef for staff notation lines. */
214
216
  declare enum Clef {
217
+ /** G-clef (treble cleff) */
215
218
  G = "G",
219
+ /** F-clef (bass cleff) */
216
220
  F = "F"
217
221
  }
222
+ /** Staff config to add staff notation line in score configuration. */
218
223
  type StaffConfig = {
224
+ /** Config type, must be "staff" for staff config. */
219
225
  type: "staff";
226
+ /** G-clef or F-clef for this staff config? */
220
227
  clef: Clef | `${Clef}`;
228
+ /** Set name for this staff config. */
221
229
  name?: string;
230
+ /** Set octave down with G-clef for guitar treble staff notation line. */
222
231
  isOctaveDown?: boolean;
232
+ /** Lowest note (e.g. "C2")that can be presented in this staff notation line. */
223
233
  minNote?: string;
234
+ /** Highest note (e.g. "C6") that can be presented in this staff notation line. */
224
235
  maxNote?: string;
236
+ /** Voice ids that are presented in this staff notation line. */
225
237
  voiceIds?: number[];
238
+ /** Set true for two staff configs with G-clef and F-clef to create grand staff. */
226
239
  isGrand?: boolean;
227
240
  };
241
+ /** Tab config to add guitar tab in score configuration. */
228
242
  type TabConfig = {
243
+ /** Config type, must be "tab" for tab config. */
229
244
  type: "tab";
245
+ /** Set name for this tab config. */
230
246
  name?: string;
231
247
  tuning?: string | string[];
248
+ /** Voice ids that are presented in this guitar tab notation line. */
232
249
  voiceIds?: number[];
233
250
  };
251
+ /** Score configuration. */
234
252
  type ScoreConfiguration = StaffConfig | TabConfig | (StaffConfig | TabConfig)[];
253
+ /** VoiceId type. */
235
254
  type VoiceId = 0 | 1 | 2 | 3;
255
+ /** Get supported VoiceIds. Returns [0, 1, 2, 3]. */
236
256
  declare function getVoiceIds(): ReadonlyArray<VoiceId>;
257
+ /** Strng number type. */
237
258
  type StringNumber = 1 | 2 | 3 | 4 | 5 | 6;
259
+ /** Get strin numbers. Returns [0, 1, 2, 3, 4, 5]. */
238
260
  declare function getStringNumbers(): ReadonlyArray<StringNumber>;
261
+ /** Stem direction enum. */
239
262
  declare enum Stem {
263
+ /** Auto stem direction. */
240
264
  Auto = "auto",
265
+ /** Stem is upwards. */
241
266
  Up = "up",
267
+ /** Stm is downwards. */
242
268
  Down = "down"
243
269
  }
270
+ /** Arpeggio direction enum. */
244
271
  declare enum Arpeggio {
272
+ /** Upwards, chord played from lowes to highest. */
245
273
  Up = "up",
274
+ /** Downwards, chord played from highest to loest. */
246
275
  Down = "down"
247
276
  }
277
+ /** Special tie length enum. */
248
278
  declare enum TieType {
279
+ /** Stub tie is short tie that left anchors to note and has not right anchor point. */
249
280
  Stub = "stub",
281
+ /** To measure end tie is tie that left anchors to note and right anchors to measure end. */
250
282
  ToMeasureEnd = "toMeasureEnd"
251
283
  }
284
+ /** Anchor point enum for connectives (ties, slurs, slides). */
252
285
  declare enum NoteAnchor {
286
+ /** Automatically choose anchor point using simple logic. */
253
287
  Auto = "auto",
288
+ /** Anchor connective above note head. */
254
289
  Above = "above",
290
+ /** Anchor connective center/next to note head.*/
255
291
  Center = "center",
292
+ /** Anchor connective below note head. */
256
293
  Below = "below",
294
+ /** Anchor connective to stem tip. */
257
295
  StemTip = "stemTip"
258
296
  }
297
+ /** Connective enum. */
259
298
  declare enum Connective {
299
+ /** Tie, connects two or more adjacent notes of same pitch with arc. */
260
300
  Tie = "tie",
301
+ /** Slur, connects two or more adjacent notes of different pitch with arc. */
261
302
  Slur = "slur",
303
+ /** Slide, connects two adjacent notes of different pitch with straight line. */
262
304
  Slide = "slide"
263
305
  }
306
+ /** Vertical position enum used to layout notation elements. */
264
307
  declare enum VerticalPosition {
308
+ /** Automatic/default layout position depending on element. */
265
309
  Auto = "auto",
310
+ /** Add element above staff/tab. */
266
311
  Above = "above",
312
+ /** Add element below staff/tab. */
267
313
  Below = "below",
314
+ /** Add element both above and below staff/tab. */
268
315
  Both = "both"
269
316
  }
317
+ /** Staff/tab/group type can be staff/tab index or staff/tab/group name. */
270
318
  type StaffTabOrGroup = number | string;
319
+ /** Staff/tab/group snglevalue or array of values. */
271
320
  type StaffTabOrGroups = StaffTabOrGroup | StaffTabOrGroup[];
321
+ /** Options for notes/chords. */
272
322
  type NoteOptions = {
323
+ /** Stem direction. */
273
324
  stem?: Stem | `${Stem}`;
325
+ /** Set color. */
274
326
  color?: string;
327
+ /** Arepggio direction for chords. true = "up". */
275
328
  arpeggio?: boolean | Arpeggio | `${Arpeggio}`;
329
+ /** Add staccato dot. */
276
330
  staccato?: boolean;
331
+ /** Use diamond shaped note head. */
277
332
  diamond?: boolean;
333
+ /** Set string number (array of numbers for chord) to use in guitar tab. */
278
334
  string?: StringNumber | StringNumber[];
279
335
  /** @deprecated - Use triplet NoteLength values instead, e.g. NoteLength.QuarterTriplet or "4t", etc. */
280
336
  triplet?: boolean;
281
337
  /** @deprecated - Use dotted NoteLength values instead, e.g. NoteLength.Quarter2Dots or "4..", etc. */
282
338
  dotted?: boolean | number;
283
339
  };
340
+ /** Options for rests. */
284
341
  type RestOptions = {
342
+ /** Set staff position for this rest. Can be instance of Note, string (e.g. "C3"), or midiNumber. */
285
343
  staffPos?: Note | string | number;
344
+ /** Set color. */
286
345
  color?: string;
346
+ /** Hide this rest, still affects playing. */
287
347
  hide?: boolean;
288
348
  /** @deprecated - Use triplet NoteLength values instead, e.g. NoteLength.QuarterTriplet or "4t", etc. */
289
349
  triplet?: boolean;
290
350
  /** @deprecated - Use dotted NoteLength values instead, e.g. NoteLength.Quarter2Dots or "4..", etc. */
291
351
  dotted?: boolean | number;
292
352
  };
353
+ /** Tuplet options. */
293
354
  type TupletOptions = {
355
+ /** Show tuplet ratio (e.g. "3:2") instead of number of parts (e.g. "3"). */
294
356
  showRatio?: boolean;
295
357
  };
358
+ /** Fermata enum. */
296
359
  declare enum Fermata {
360
+ /** Anchor fermata to note/rest. */
297
361
  AtNote = "atNote",
362
+ /** Anchor fermata to measure end. */
298
363
  AtMeasureEnd = "atMeasureEnd"
299
364
  }
365
+ /** Navigation element enum. */
300
366
  declare enum Navigation {
301
367
  /** Repeat back to beginning and play to the "Fine" marking. */
302
368
  DC_al_Fine = "D.C. al Fine",
@@ -321,23 +387,53 @@ declare enum Navigation {
321
387
  /** Jump to ending with correct passage number. */
322
388
  Ending = "ending"
323
389
  }
390
+ /** Annotation element enum. */
324
391
  declare enum Annotation {
325
392
  /** "ppp", "pp", "p", "mp", "m", "mf", "f", "ff", "fff", "cresc.", "decresc.", "dim." */
326
393
  Dynamics = "dynamics",
327
394
  /** "accel.", "rit.", "a tempo" */
328
395
  Tempo = "tempo"
329
396
  }
397
+ /** Some known dynamics annotations. */
398
+ declare enum DynamicsAnnotation {
399
+ cresc = "cresc.",
400
+ decresc = "decresc.",
401
+ dim = "dim.",
402
+ ppp = "ppp",
403
+ pp = "pp",
404
+ p = "p",
405
+ mp = "mp",
406
+ m = "m",
407
+ mf = "mf",
408
+ f = "f",
409
+ ff = "ff",
410
+ fff = "fff"
411
+ }
412
+ /** Some known tempo annotations. */
413
+ declare enum TempoAnnotation {
414
+ accel = "accel.",
415
+ rit = "rit.",
416
+ a_tempo = "a tempo"
417
+ }
418
+ /** Known annotation test type. */
419
+ type AnnotationText = `${DynamicsAnnotation}` | `${TempoAnnotation}`;
420
+ /** Label element enum. */
330
421
  declare enum Label {
331
422
  /** "C", "C#", "Db", "D", etc. */
332
423
  Note = "note",
333
424
  /** "C", "Am", "G7", etc. */
334
425
  Chord = "chord"
335
426
  }
427
+ /** Play state enum. */
336
428
  declare enum PlayState {
429
+ /** Playing. */
337
430
  Playing = 0,
431
+ /** Paused. */
338
432
  Paused = 1,
433
+ /** Stopped. */
339
434
  Stopped = 2
340
435
  }
436
+ /** Play state change listener type. */
341
437
  type PlayStateChangeListener = (playState: PlayState) => void;
342
438
 
343
439
  declare class AccidentalState {
@@ -1458,350 +1554,750 @@ declare class ObjSignature extends MusicObject {
1458
1554
  draw(renderer: Renderer): void;
1459
1555
  }
1460
1556
 
1557
+ /** Score event type. */
1461
1558
  type ScoreEventType = "enter" | "leave" | "click";
1559
+ /** Abstract score event class. */
1462
1560
  declare abstract class ScoreEvent {
1463
1561
  readonly type: ScoreEventType;
1562
+ /**
1563
+ * Create new score event instance.
1564
+ * @param type - Score event type.
1565
+ */
1464
1566
  constructor(type: ScoreEventType);
1465
1567
  }
1568
+ /** Score staff position event for clicking/entering/leaving staff position (diatonic id) in staff notation line. */
1466
1569
  declare class ScoreStaffPosEvent extends ScoreEvent {
1467
1570
  readonly renderer: MRenderer;
1468
1571
  readonly scoreRow: MScoreRow;
1469
1572
  readonly diatonicId: number;
1573
+ /**
1574
+ * Create new score staff position event.
1575
+ * @param type - Score event type.
1576
+ * @param renderer - Renderer.
1577
+ * @param scoreRow - Score row.
1578
+ * @param diatonicId - Diatonic id that was clicked/entered/left.
1579
+ */
1470
1580
  constructor(type: ScoreEventType, renderer: MRenderer, scoreRow: MScoreRow, diatonicId: number);
1471
1581
  }
1582
+ /** Score object event for clicking/entering/leaving score object. */
1472
1583
  declare class ScoreObjectEvent extends ScoreEvent {
1473
1584
  readonly renderer: MRenderer;
1474
1585
  readonly objects: MusicInterface[];
1586
+ /**
1587
+ * Create new score object event.
1588
+ * @param type - Score event type.
1589
+ * @param renderer - Renderer.
1590
+ * @param objects - Array of objects, last object in this array is the top object that was clicked/entered/left, previous objects are it's parent objects.
1591
+ */
1475
1592
  constructor(type: ScoreEventType, renderer: MRenderer, objects: MusicInterface[]);
1593
+ /** Top object getter. */
1476
1594
  get topObject(): MusicInterface;
1595
+ /**
1596
+ * Find object.
1597
+ * @param fn - Compare function.
1598
+ * @returns - First object that matched compare function, or undefined if no match.
1599
+ */
1477
1600
  findObject(fn: (obj: MusicInterface) => boolean): MusicInterface | undefined;
1478
1601
  }
1602
+ /** Score event listener type. */
1479
1603
  type ScoreEventListener = (event: ScoreEvent) => void;
1480
1604
 
1605
+ /** Music player class. */
1606
+ declare class MPlayer {
1607
+ private static currentlyPlaying;
1608
+ private readonly player;
1609
+ /**
1610
+ * Create new music player.
1611
+ * @param doc - Music document to play.
1612
+ * @param playStateChangeListener - Play state change listener.
1613
+ */
1614
+ constructor(doc: MDocument, playStateChangeListener?: PlayStateChangeListener);
1615
+ /**
1616
+ * Stop all playing.
1617
+ */
1618
+ static stopAll(): void;
1619
+ /**
1620
+ * Playe attached document.
1621
+ * @returns - This player instance.
1622
+ */
1623
+ play(): this;
1624
+ /**
1625
+ * Pause playback of attached document.
1626
+ * @returns - This player instance.
1627
+ */
1628
+ pause(): this;
1629
+ /**
1630
+ * Stop playback of attached document.
1631
+ * @returns - This player instance.
1632
+ */
1633
+ stop(): this;
1634
+ }
1635
+ /** Renderer class. */
1636
+ declare class MRenderer {
1637
+ private readonly renderer;
1638
+ /**
1639
+ * Create new renderer instance.
1640
+ */
1641
+ constructor();
1642
+ /**
1643
+ * Attach music document to this renderer.
1644
+ * @param doc - Music document.
1645
+ * @returns - This renderer instance.
1646
+ */
1647
+ setDocument(doc?: MDocument): MRenderer;
1648
+ /**
1649
+ * Set target canvas html element for this renderer.
1650
+ * @param canvas - HTML canvas element or element id.
1651
+ * @returns - This renderer instance.
1652
+ */
1653
+ setCanvas(canvas: HTMLCanvasElement | string): MRenderer;
1654
+ /**
1655
+ * Set score event listener.
1656
+ * @param scoreEventListener - Score event listener.
1657
+ */
1658
+ setScoreEventListener(scoreEventListener: ScoreEventListener): void;
1659
+ /**
1660
+ * Draw given music object hilighted.
1661
+ * @param obj - Music object or undefined to remove hilighting.
1662
+ */
1663
+ hilightObject(obj?: MusicInterface): void;
1664
+ /**
1665
+ * Draw given staff position hilighted.
1666
+ * @param staffPos - Staff position (score row and diatonic id) or undefined to remove hilighting.
1667
+ */
1668
+ hilightStaffPos(staffPos?: {
1669
+ scoreRow: MScoreRow;
1670
+ diatonicId: number;
1671
+ }): void;
1672
+ /**
1673
+ * Draw contents of attached music document to attached canvas.
1674
+ */
1675
+ draw(): void;
1676
+ }
1677
+ /** Playback buttons helper class. */
1678
+ declare class MPlaybackButtons {
1679
+ private playButton?;
1680
+ private stopButton?;
1681
+ private playStopButton?;
1682
+ private pauseButton?;
1683
+ private onPlay;
1684
+ private onStop;
1685
+ private onPlayStop;
1686
+ private onPause;
1687
+ private playLabel;
1688
+ private stopLabel;
1689
+ private pauseLabel;
1690
+ private playState;
1691
+ private player?;
1692
+ /**
1693
+ * Create new playback buttons helper class instance.
1694
+ */
1695
+ constructor();
1696
+ /**
1697
+ * Attach music document whose playcak will be controlled by this playback buttons helper class instance.
1698
+ * @param doc - Music document.
1699
+ * @returns
1700
+ */
1701
+ setDocument(doc?: MDocument): MPlaybackButtons;
1702
+ /**
1703
+ * Detach attached music document.
1704
+ */
1705
+ detachDocument(): void;
1706
+ private updateButtons;
1707
+ /**
1708
+ * Set play button.
1709
+ * @param btn - HTML button element or element id.
1710
+ * @param btnLabel - Custom button label (e.g. "Play").
1711
+ * @returns - This playback buttons class instance.
1712
+ */
1713
+ setPlayButton(btn: HTMLButtonElement | string, btnLabel?: string): MPlaybackButtons;
1714
+ /**
1715
+ * Set stop button.
1716
+ * @param btn - HTML button element or element id.
1717
+ * @param btnLabel - Custom button label (e.g. "Stop").
1718
+ * @returns - This playback buttons class instance.
1719
+ */
1720
+ setStopButton(btn: HTMLButtonElement | string, btnLabel?: string): MPlaybackButtons;
1721
+ /**
1722
+ * Set play/stop button.
1723
+ * @param btn - HTML button element or element id.
1724
+ * @param playLabel - Custom button label for play action (e.g. "Play").
1725
+ * @param stopLabel - Custom button label for stop action (e.g. "Stop").
1726
+ * @returns - This playback buttons class instance.
1727
+ */
1728
+ setPlayStopButton(btn: HTMLButtonElement | string, playLabel?: string, stopLabel?: string): MPlaybackButtons;
1729
+ /**
1730
+ * Set pause button.
1731
+ * @param btn - HTML button element or element id.
1732
+ * @param btnLabel - Custom button label (e.g. "Pause").
1733
+ * @returns - This playback buttons class instance.
1734
+ */
1735
+ setPauseButton(btn: HTMLButtonElement | string, btnLabel?: string): MPlaybackButtons;
1736
+ private static savedOnClickListeners;
1737
+ private static removeOnClickListeners;
1738
+ private static addOnClickListener;
1739
+ }
1740
+
1741
+ /** Abstract music interface object class. */
1481
1742
  declare abstract class MusicInterface {
1482
1743
  readonly name: string;
1744
+ /**
1745
+ * Create new music interface object.
1746
+ * @param name - OBject name.
1747
+ */
1483
1748
  constructor(name: string);
1484
1749
  /** @internal */
1485
1750
  abstract getMusicObject(): MusicObject;
1751
+ /**
1752
+ * Get parent object.
1753
+ * @returns - Parent object or undefined.
1754
+ */
1486
1755
  getParent(): MusicInterface | undefined;
1487
1756
  }
1757
+ /** Accidental object. */
1488
1758
  declare class MAccidental extends MusicInterface {
1489
1759
  private readonly obj;
1760
+ /** Object name. */
1490
1761
  static readonly Name = "Accidental";
1491
1762
  /** @internal */
1492
1763
  constructor(obj: ObjAccidental);
1493
1764
  /** @internal */
1494
1765
  getMusicObject(): ObjAccidental;
1766
+ /**
1767
+ * Get accidental.
1768
+ * @returns - Accidental (e.g. 1 = #).
1769
+ */
1495
1770
  getAccidental(): Accidental;
1496
1771
  }
1772
+ /** Connective object. */
1497
1773
  declare class MConnective extends MusicInterface {
1498
1774
  private readonly obj;
1775
+ /** Object name. */
1499
1776
  static readonly Name = "Connective";
1500
1777
  /** @internal */
1501
1778
  constructor(obj: ObjConnective);
1502
1779
  /** @internal */
1503
1780
  getMusicObject(): ObjConnective;
1504
1781
  }
1782
+ /** Arpeggio object. */
1505
1783
  declare class MArpeggio extends MusicInterface {
1506
1784
  private readonly obj;
1785
+ /** Object name. */
1507
1786
  static readonly Name = "Arpeggio";
1508
1787
  /** @internal */
1509
1788
  constructor(obj: ObjArpeggio);
1510
1789
  /** @internal */
1511
1790
  getMusicObject(): ObjArpeggio;
1791
+ /**
1792
+ * Get rhythm column this arpeggio is in.
1793
+ * @returns - Rhythm column.
1794
+ */
1512
1795
  getRhythmColumn(): MRhythmColumn;
1796
+ /**
1797
+ * Get notation line this arpeggio is in.
1798
+ * @returns - Staff or tab object.
1799
+ */
1513
1800
  getNotationLine(): MStaff | MTab;
1514
1801
  }
1802
+ /** Beam group object. */
1515
1803
  declare class MBeamGroup extends MusicInterface {
1516
1804
  private readonly obj;
1805
+ /** OBject name. */
1517
1806
  static readonly Name = "BeamGroup";
1518
1807
  /** @internal */
1519
1808
  constructor(obj: ObjBeamGroup);
1520
1809
  /** @internal */
1521
1810
  getMusicObject(): ObjBeamGroup;
1522
1811
  }
1812
+ /** Beam group object of certain staff. */
1523
1813
  declare class MStaffBeamGroup extends MusicInterface {
1524
1814
  private readonly obj;
1815
+ /** Object name. */
1525
1816
  static readonly Name = "StaffBeamGroup";
1526
1817
  /** @internal */
1527
1818
  constructor(obj: ObjStaffBeamGroup);
1528
1819
  /** @internal */
1529
1820
  getMusicObject(): ObjStaffBeamGroup;
1821
+ /**
1822
+ * Get staff this beam group is in.
1823
+ * @returns - Staff object.
1824
+ */
1530
1825
  getStaff(): MStaff;
1531
1826
  }
1827
+ /** Document object. */
1532
1828
  declare class MDocument extends MusicInterface {
1533
1829
  private readonly obj;
1830
+ /** Object name. */
1534
1831
  static readonly Name = "Document";
1535
1832
  /** @internal */
1536
1833
  constructor(obj: ObjDocument);
1537
1834
  /** @internal */
1538
1835
  getMusicObject(): ObjDocument;
1836
+ /**
1837
+ * Get title.
1838
+ * @returns - Title string or undefined.
1839
+ */
1539
1840
  getTitle(): string | undefined;
1841
+ /**
1842
+ * Get composer.
1843
+ * @returns - Composer string or undefined.
1844
+ */
1540
1845
  getComposer(): string | undefined;
1846
+ /**
1847
+ * Get arranger.
1848
+ * @returns - Arranger string or undefined.
1849
+ */
1541
1850
  getArranger(): string | undefined;
1851
+ /**
1852
+ * Get score rows.
1853
+ * @returns - Array or score rows.
1854
+ */
1542
1855
  getRows(): ReadonlyArray<MScoreRow>;
1856
+ /**
1857
+ * Get measures.
1858
+ * @returns - Array of measures.
1859
+ */
1543
1860
  getMeasures(): ReadonlyArray<MMeasure>;
1544
- play(fn?: PlayStateChangeListener): MPlayer;
1861
+ /**
1862
+ * Play this document.
1863
+ * @param playStateChangeListener - Play state change listener function or undefined.
1864
+ * @returns - Player instance.
1865
+ */
1866
+ play(playStateChangeListener?: PlayStateChangeListener): MPlayer;
1545
1867
  }
1868
+ /** Ending object. */
1546
1869
  declare class MEnding extends MusicInterface {
1547
1870
  private readonly obj;
1871
+ /** Object name. */
1548
1872
  static readonly Name = "Ending";
1549
1873
  /** @internal */
1550
1874
  constructor(obj: ObjEnding);
1551
1875
  /** @internal */
1552
1876
  getMusicObject(): ObjEnding;
1877
+ /**
1878
+ * Get passages.
1879
+ * @returns - Array of passage numbers, e.g. passage number 1 means that this ending is played on first pass.
1880
+ */
1553
1881
  getPassages(): ReadonlyArray<number>;
1882
+ /**
1883
+ * Has passage number?
1884
+ * @param passage - Passage number to find out.
1885
+ * @returns - Boolean whether this ending has asked passage number.
1886
+ */
1554
1887
  hasPassage(passage: number): boolean;
1555
1888
  }
1889
+ /** Fermata object. */
1556
1890
  declare class MFermata extends MusicInterface {
1557
1891
  private readonly obj;
1892
+ /** OBject name. */
1558
1893
  static readonly Name = "Fermata";
1559
1894
  /** @internal */
1560
1895
  constructor(obj: ObjFermata);
1561
1896
  /** @internal */
1562
1897
  getMusicObject(): ObjFermata;
1563
1898
  }
1899
+ /** Header object. */
1564
1900
  declare class MHeader extends MusicInterface {
1565
1901
  private readonly obj;
1902
+ /** OBject name. */
1566
1903
  static readonly Name = "Header";
1567
1904
  /** @internal */
1568
1905
  constructor(obj: ObjHeader);
1569
1906
  /** @internal */
1570
1907
  getMusicObject(): ObjHeader;
1908
+ /**
1909
+ * Get title.
1910
+ * @returns - Title string or undefined.
1911
+ */
1571
1912
  getTitle(): string | undefined;
1913
+ /**
1914
+ * Get composer.
1915
+ * @returns - Composer string or undefined.
1916
+ */
1572
1917
  getComposer(): string | undefined;
1918
+ /**
1919
+ * Get arranger.
1920
+ * @returns - Arranger string or undefined.
1921
+ */
1573
1922
  getArranger(): string | undefined;
1574
1923
  }
1924
+ /** Image object. */
1575
1925
  declare class MImage extends MusicInterface {
1576
1926
  private readonly obj;
1927
+ /** Object name. */
1577
1928
  static readonly Name = "Image";
1578
1929
  /** @internal */
1579
1930
  constructor(obj: ObjImage);
1580
1931
  /** @internal */
1581
1932
  getMusicObject(): ObjImage;
1582
1933
  }
1934
+ /** Measure object. */
1583
1935
  declare class MMeasure extends MusicInterface {
1584
1936
  private readonly obj;
1937
+ /** OBject name. */
1585
1938
  static readonly Name = "Measure";
1586
1939
  /** @internal */
1587
1940
  constructor(obj: ObjMeasure);
1588
1941
  /** @internal */
1589
1942
  getMusicObject(): ObjMeasure;
1943
+ /**
1944
+ * Get measure number.
1945
+ * @returns - Measure number starting from 1, or 0 if upbeat.
1946
+ */
1590
1947
  getMeasureNumber(): number;
1948
+ /**
1949
+ * Get rhythm columns.
1950
+ * @returns - Array of rhythm columns.
1951
+ */
1591
1952
  getRhythmColumns(): ReadonlyArray<MRhythmColumn>;
1953
+ /**
1954
+ * Get score row that this measure is in.
1955
+ * @returns - Score row.
1956
+ */
1592
1957
  getRow(): MScoreRow;
1593
1958
  }
1959
+ /** Right bar line object. */
1594
1960
  declare class MBarLineRight extends MusicInterface {
1595
1961
  private readonly obj;
1962
+ /** OBject name. */
1596
1963
  static readonly Name = "BarLineRight";
1597
1964
  /** @internal */
1598
1965
  constructor(obj: ObjBarLineRight);
1599
1966
  /** @internal */
1600
1967
  getMusicObject(): ObjBarLineRight;
1601
1968
  }
1969
+ /** Left bar line object. */
1602
1970
  declare class MBarLineLeft extends MusicInterface {
1603
1971
  private readonly obj;
1972
+ /** Object name. */
1604
1973
  static readonly Name = "BarLineLeft";
1605
1974
  /** @internal */
1606
1975
  constructor(obj: ObjBarLineLeft);
1607
1976
  /** @internal */
1608
1977
  getMusicObject(): ObjBarLineLeft;
1609
1978
  }
1979
+ /** Bar line object for certain staff or tab. */
1610
1980
  declare class MStaffTabBarLine extends MusicInterface {
1611
1981
  private readonly obj;
1982
+ /** Object name. */
1612
1983
  static readonly Name = "StaffTabBarLine";
1613
1984
  /** @internal */
1614
1985
  constructor(obj: ObjStaffTabBarLine);
1615
1986
  /** @internal */
1616
1987
  getMusicObject(): ObjStaffTabBarLine;
1988
+ /**
1989
+ * Get parent bar line object.
1990
+ * @returns - Parent bar line object.
1991
+ */
1617
1992
  getBarLine(): MBarLineLeft | MBarLineRight;
1993
+ /**
1994
+ * Get staff or tab this bar lien object is in.
1995
+ * @returns - Staff or tab.
1996
+ */
1618
1997
  getNotationLine(): MStaff | MTab;
1619
1998
  }
1999
+ /** Note group object. */
1620
2000
  declare class MNoteGroup extends MusicInterface {
1621
2001
  private readonly obj;
2002
+ /** Object name. */
1622
2003
  static readonly Name = "NoteGroup";
1623
2004
  /** @internal */
1624
2005
  constructor(obj: ObjNoteGroup);
1625
2006
  /** @internal */
1626
2007
  getMusicObject(): ObjNoteGroup;
2008
+ /**
2009
+ * Get notes of this note group.
2010
+ * @returns - Array of Note instances.
2011
+ */
1627
2012
  getNotes(): ReadonlyArray<Note>;
2013
+ /**
2014
+ * Get rhythm props of this note group.
2015
+ * @returns - Rhythm props.
2016
+ */
1628
2017
  getRhythmProps(): RhythmProps;
2018
+ /**
2019
+ * Get rhythm column this note group is in.
2020
+ * @returns - Rhythm column.
2021
+ */
1629
2022
  getRhythmColumn(): MRhythmColumn;
2023
+ /**
2024
+ * Get the measure this note group is in.
2025
+ * @returns - Measure.
2026
+ */
1630
2027
  getMeasure(): MMeasure;
1631
2028
  }
2029
+ /** Note group object of certain staff. */
1632
2030
  declare class MStaffNoteGroup extends MusicInterface {
1633
2031
  private readonly obj;
2032
+ /** Object name. */
1634
2033
  static readonly Name = "StaffNoteGroup";
1635
2034
  /** @internal */
1636
2035
  constructor(obj: ObjStaffNoteGroup);
1637
2036
  /** @internal */
1638
2037
  getMusicObject(): ObjStaffNoteGroup;
2038
+ /**
2039
+ * Get parent note group.
2040
+ * @returns - Parent note group.
2041
+ */
1639
2042
  getNoteGroup(): MNoteGroup;
2043
+ /**
2044
+ * Get rhythm column this note group is in.
2045
+ * @returns - Rhythm column.
2046
+ */
1640
2047
  getRhythmColumn(): MRhythmColumn;
2048
+ /**
2049
+ * Get the measure this note group is in.
2050
+ * @returns - Measure.
2051
+ */
1641
2052
  getMeasure(): MMeasure;
2053
+ /**
2054
+ * Get staff notation line this note group is in.
2055
+ * @returns - Staff object.
2056
+ */
1642
2057
  getStaff(): MStaff;
1643
2058
  }
2059
+ /** Note group object of certain tab. Contains fret numbers for tab. */
1644
2060
  declare class MTabNoteGroup extends MusicInterface {
1645
2061
  private readonly obj;
2062
+ /** OBject name. */
1646
2063
  static readonly Name = "TabNoteGroup";
1647
2064
  /** @internal */
1648
2065
  constructor(obj: ObjTabNoteGroup);
1649
2066
  /** @internal */
1650
2067
  getMusicObject(): ObjTabNoteGroup;
2068
+ /**
2069
+ * Get parent note group.
2070
+ * @returns - Parent note group.
2071
+ */
1651
2072
  getNoteGroup(): MNoteGroup;
2073
+ /**
2074
+ * Get rhythm column this note group is in.
2075
+ * @returns - Rhythm column.
2076
+ */
1652
2077
  getRhythmColumn(): MRhythmColumn;
2078
+ /**
2079
+ * Get the measure this note group is in.
2080
+ * @returns - Measure.
2081
+ */
1653
2082
  getMeasure(): MMeasure;
2083
+ /**
2084
+ * Get guitar tab this note group is in.
2085
+ * @returns - Tab object.
2086
+ */
1654
2087
  getTab(): MTab;
1655
2088
  }
2089
+ /** Rest object. */
1656
2090
  declare class MRest extends MusicInterface {
1657
2091
  private readonly obj;
2092
+ /** OBject name. */
1658
2093
  static readonly Name = "Rest";
1659
2094
  /** @internal */
1660
2095
  constructor(obj: ObjRest);
1661
2096
  /** @internal */
1662
2097
  getMusicObject(): ObjRest;
2098
+ /**
2099
+ * Get rhythm props of this rest.
2100
+ * @returns - Rhythm props.
2101
+ */
1663
2102
  getRhythmProps(): RhythmProps;
2103
+ /**
2104
+ * Get rhythm column this rest is in.
2105
+ * @returns - Rhythm column.
2106
+ */
1664
2107
  getRhythmColumn(): MRhythmColumn;
2108
+ /**
2109
+ * Get the measure this rest is in.
2110
+ * @returns - Measure.
2111
+ */
1665
2112
  getMeasure(): MMeasure;
1666
2113
  }
2114
+ /** Rest object for certain tab. */
1667
2115
  declare class MStaffRest extends MusicInterface {
1668
2116
  private readonly obj;
2117
+ /** Object name. */
1669
2118
  static readonly Name = "StaffRest";
1670
2119
  /** @internal */
1671
2120
  constructor(obj: ObjStaffRest);
1672
2121
  /** @internal */
1673
2122
  getMusicObject(): ObjStaffRest;
2123
+ /**
2124
+ * Get parent rest object.
2125
+ * @returns - Parent rest object.
2126
+ */
1674
2127
  getRest(): MRest;
2128
+ /**
2129
+ * Get rhythm column this rest is in.
2130
+ * @returns - Rhythm column.
2131
+ */
1675
2132
  getRhythmColumn(): MRhythmColumn;
2133
+ /**
2134
+ * Get the measure this rest is in.
2135
+ * @returns - Measure.
2136
+ */
1676
2137
  getMeasure(): MMeasure;
2138
+ /**
2139
+ * Get staff notation line this rest is in.
2140
+ * @returns - Staff object.
2141
+ */
1677
2142
  getStaff(): MStaff;
1678
2143
  }
2144
+ /** Rhythm column object. */
1679
2145
  declare class MRhythmColumn extends MusicInterface {
1680
2146
  private readonly obj;
2147
+ /** OBject name. */
1681
2148
  static readonly Name = "RhythmColumn";
1682
2149
  /** @internal */
1683
2150
  constructor(obj: ObjRhythmColumn);
1684
2151
  /** @internal */
1685
2152
  getMusicObject(): ObjRhythmColumn;
2153
+ /**
2154
+ * Get symbol (note group or rest) of this column for given voice id.
2155
+ * @param voiceId - Voice id.
2156
+ * @returns - Note group, rest or undefined.
2157
+ */
1686
2158
  getRhythmSymbol(voiceId: number): MNoteGroup | MRest | undefined;
1687
- getMeasure(): MMeasure;
2159
+ /**
2160
+ * Get symbol (note group or rest) of this column for given voice id.
2161
+ * @deprecated - Use getRhythmSymbol(voiceId) instead.
2162
+ * @param voiceId - Voice id.
2163
+ * @returns - Note group, rest or undefined.
2164
+ */
1688
2165
  getVoiceSymbol(voiceId: VoiceId): MNoteGroup | MRest | undefined;
2166
+ /**
2167
+ * Get the measure this rhythm column is in.
2168
+ * @returns - Measure.
2169
+ */
2170
+ getMeasure(): MMeasure;
1689
2171
  }
2172
+ /** Score row object. */
1690
2173
  declare class MScoreRow extends MusicInterface {
1691
2174
  private readonly obj;
2175
+ /** Object name. */
1692
2176
  static readonly Name = "ScoreRow";
1693
2177
  /** @internal */
1694
2178
  constructor(obj: ObjScoreRow);
1695
2179
  /** @internal */
1696
2180
  getMusicObject(): ObjScoreRow;
2181
+ /**
2182
+ * Parent music document.
2183
+ * @returns - Parent music document.
2184
+ */
1697
2185
  getDocument(): MDocument;
2186
+ /**
2187
+ * Get measures of this score row.
2188
+ * @returns - Array of measures.
2189
+ */
1698
2190
  getMeasures(): ReadonlyArray<MMeasure>;
2191
+ /**
2192
+ * Get notation lines (staves and tabs) of this score row.
2193
+ * @returns - Array of staves and tabs.
2194
+ */
1699
2195
  getNotationLines(): ReadonlyArray<MStaff | MTab>;
1700
2196
  }
2197
+ /** Staff notatio line object. */
1701
2198
  declare class MStaff extends MusicInterface {
1702
2199
  private readonly obj;
2200
+ /** Object name. */
1703
2201
  static readonly Name = "Staff";
1704
2202
  /** @internal */
1705
2203
  constructor(obj: ObjStaff);
1706
2204
  /** @internal */
1707
2205
  getMusicObject(): ObjStaff;
2206
+ /**
2207
+ * Get index of this staff in score row.
2208
+ * @returns - Index (0=top notation line).
2209
+ */
1708
2210
  getId(): number;
2211
+ /**
2212
+ * Get name of this staff.
2213
+ * @returns - Staff name.
2214
+ */
1709
2215
  getName(): string | undefined;
2216
+ /**
2217
+ * Get the score row this staff is in.
2218
+ * @returns - Score row.
2219
+ */
1710
2220
  getRow(): MScoreRow;
1711
2221
  }
2222
+ /** Guitar tab notation line object. */
1712
2223
  declare class MTab extends MusicInterface {
1713
2224
  private readonly obj;
2225
+ /** Object name. */
1714
2226
  static readonly Name = "Tab";
1715
2227
  /** @internal */
1716
2228
  constructor(obj: ObjTab);
1717
2229
  /** @internal */
1718
2230
  getMusicObject(): ObjTab;
2231
+ /**
2232
+ * Get index of this guitar tab in score row.
2233
+ * @returns - Index (0=top notation line).
2234
+ */
1719
2235
  getId(): number;
2236
+ /**
2237
+ * Get name of this guitar tab.
2238
+ * @returns - Staff name.
2239
+ */
1720
2240
  getName(): string | undefined;
2241
+ /**
2242
+ * Get the score row this guitar tab is in.
2243
+ * @returns - Score row.
2244
+ */
1721
2245
  getRow(): MScoreRow;
1722
2246
  }
2247
+ /** Signature object contains clef, key signature, time signature and tempo, all optional depending on measure. */
1723
2248
  declare class MSignature extends MusicInterface {
1724
2249
  private readonly obj;
2250
+ /** Object name. */
1725
2251
  static readonly Name = "Signature";
1726
2252
  /** @internal */
1727
2253
  constructor(obj: ObjSignature);
1728
2254
  /** @internal */
1729
2255
  getMusicObject(): ObjSignature;
2256
+ /**
2257
+ * Get staff notation line this signature is in.
2258
+ * @returns - Staff object.
2259
+ */
1730
2260
  getStaff(): MStaff;
1731
2261
  }
2262
+ /** Spacial text object contains text and possibly special symbols (e.g. Segno or Coda). */
1732
2263
  declare class MSpecialText extends MusicInterface {
1733
2264
  private readonly obj;
2265
+ /** Object name. */
1734
2266
  static readonly Name = "SpecialText";
1735
2267
  /** @internal */
1736
2268
  constructor(obj: ObjSpecialText);
1737
2269
  /** @internal */
1738
2270
  getMusicObject(): ObjSpecialText;
2271
+ /**
2272
+ * Get text content.
2273
+ * @returns - Text content.
2274
+ */
1739
2275
  getText(): string;
1740
2276
  }
2277
+ /** Text object. */
1741
2278
  declare class MText extends MusicInterface {
1742
2279
  private readonly obj;
2280
+ /** Object name. */
1743
2281
  static readonly Name = "Text";
1744
2282
  /** @internal */
1745
2283
  constructor(obj: ObjText);
1746
2284
  /** @internal */
1747
2285
  getMusicObject(): ObjText;
2286
+ /**
2287
+ * Get text content.
2288
+ * @returns - Text content.
2289
+ */
1748
2290
  getText(): string;
1749
2291
  }
2292
+ /** Extension line object. */
1750
2293
  declare class MExtensionLine extends MusicInterface {
1751
2294
  private readonly obj;
2295
+ /** OBject name. */
1752
2296
  static readonly Name = "ExtensionLine";
1753
2297
  /** @internal */
1754
2298
  constructor(obj: ObjExtensionLine);
1755
2299
  /** @internal */
1756
2300
  getMusicObject(): ObjExtensionLine;
1757
2301
  }
1758
- declare class MPlayer {
1759
- private static currentlyPlaying;
1760
- private readonly player;
1761
- constructor(doc: MDocument, fn?: PlayStateChangeListener);
1762
- static stopAll(): void;
1763
- play(): this;
1764
- pause(): this;
1765
- stop(): this;
1766
- }
1767
- declare class MRenderer {
1768
- private readonly renderer;
1769
- constructor();
1770
- setDocument(doc?: MDocument): this;
1771
- setCanvas(canvas: HTMLCanvasElement | string): this;
1772
- setScoreEventListener(fn: ScoreEventListener): void;
1773
- hilightObject(obj?: MusicInterface): void;
1774
- hilightStaffPos(staffPos?: {
1775
- scoreRow: MScoreRow;
1776
- diatonicId: number;
1777
- }): void;
1778
- draw(): void;
1779
- }
1780
- declare class MPlaybackButtons {
1781
- private playButton?;
1782
- private stopButton?;
1783
- private playStopButton?;
1784
- private pauseButton?;
1785
- private onPlay;
1786
- private onStop;
1787
- private onPlayStop;
1788
- private onPause;
1789
- private playLabel;
1790
- private stopLabel;
1791
- private pauseLabel;
1792
- private playState;
1793
- private player?;
1794
- constructor();
1795
- setDocument(doc?: MDocument): this;
1796
- detachDocument(): void;
1797
- private updateButtons;
1798
- setPlayButton(btn: HTMLButtonElement | string, btnLabel?: string): this;
1799
- setStopButton(btn: HTMLButtonElement | string, btnLabel?: string): this;
1800
- setPlayStopButton(btn: HTMLButtonElement | string, playLabel?: string, stopLabel?: string): this;
1801
- setPauseButton(btn: HTMLButtonElement | string, btnLabel?: string): this;
1802
- private static savedOnClickListeners;
1803
- private static removeOnClickListeners;
1804
- private static addOnClickListener;
1805
- }
1806
2302
 
1807
- export { type StaffConfig as $, Annotation as A, MStaffNoteGroup as B, Connective as C, DivRect as D, MTabNoteGroup as E, Fermata as F, MRest as G, MStaffRest as H, MRhythmColumn as I, MScoreRow as J, MStaff as K, Label as L, MDocument as M, type NoteOptions as N, MTab as O, MSignature as P, MSpecialText as Q, type RestOptions as R, StaffPreset as S, type TupletOptions as T, MText as U, type VoiceId as V, MExtensionLine as W, MPlayer as X, MRenderer as Y, MPlaybackButtons as Z, Clef as _, type ScoreConfiguration as a, type TabConfig as a0, getVoiceIds as a1, type StringNumber as a2, getStringNumbers as a3, Stem as a4, Arpeggio as a5, type StaffTabOrGroup as a6, PlayState as a7, type PlayStateChangeListener as a8, type StaffTabOrGroups as b, Navigation as c, TieType as d, NoteAnchor as e, VerticalPosition as f, type ScoreEventType as g, ScoreEvent as h, ScoreStaffPosEvent as i, ScoreObjectEvent as j, type ScoreEventListener as k, MusicInterface as l, MAccidental as m, MConnective as n, MArpeggio as o, MBeamGroup as p, MStaffBeamGroup as q, MEnding as r, MFermata as s, MHeader as t, MImage as u, MMeasure as v, MBarLineRight as w, MBarLineLeft as x, MStaffTabBarLine as y, MNoteGroup as z };
2303
+ export { Clef as $, type AnnotationText as A, MBarLineRight as B, Connective as C, DivRect as D, MBarLineLeft as E, Fermata as F, MStaffTabBarLine as G, MNoteGroup as H, MStaffNoteGroup as I, MTabNoteGroup as J, MRest as K, Label as L, MDocument as M, type NoteOptions as N, MStaffRest as O, MRhythmColumn as P, MScoreRow as Q, type RestOptions as R, StaffPreset as S, type TupletOptions as T, MStaff as U, type VoiceId as V, MTab as W, MSignature as X, MSpecialText as Y, MText as Z, MExtensionLine as _, type ScoreConfiguration as a, type StaffConfig as a0, type TabConfig as a1, getVoiceIds as a2, type StringNumber as a3, getStringNumbers as a4, Stem as a5, Arpeggio as a6, type StaffTabOrGroup as a7, DynamicsAnnotation as a8, TempoAnnotation as a9, PlayState as aa, type PlayStateChangeListener as ab, type StaffTabOrGroups as b, Navigation as c, Annotation as d, TieType as e, NoteAnchor as f, VerticalPosition as g, type ScoreEventType as h, ScoreEvent as i, ScoreStaffPosEvent as j, ScoreObjectEvent as k, type ScoreEventListener as l, MPlayer as m, MRenderer as n, MPlaybackButtons as o, MusicInterface as p, MAccidental as q, MConnective as r, MArpeggio as s, MBeamGroup as t, MStaffBeamGroup as u, MEnding as v, MFermata as w, MHeader as x, MImage as y, MMeasure as z };