@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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Changelog
2
2
 
3
+ ## [3.1.0] - 2025-09-09
4
+ ## Added
5
+ - Staff/TabConfig.name.
6
+ - DocumentBuilder.addStaffGroup().
7
+ - DocumentBuilder.addFermataTo(), .addNavigationTo(), .addAnnotationTo() and .addLabelTo().
8
+
9
+ ## [3.0.1] - 2025-09-03
10
+ ## Fixed
11
+ - Draw arpeggio curly arrow also to guitar tab.
12
+
3
13
  ## [3.0.0] - 2025-08-31
4
14
  Major update and brought some important changes.
5
15
  ### ** Breaking Changes **
package/README.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # WebMusicScore
2
2
 
3
+ Typedoc API Reference, Examples and Demos can be found [here](https://pahkasoft.github.io). The API Reference is not commented but is mostly self explanatory and gives idea of full API.
4
+
5
+ ## About
6
+
3
7
  This library allows you to view and play music scores (notation) in the browser.
4
8
 
5
9
  I'm not a professional musician. I began learning classical guitar on my own,
@@ -88,9 +92,6 @@ and `Pieces` as corresponding subpath modules (excluding `react-ui` and `audio-c
88
92
 
89
93
  ## API
90
94
 
91
- Typedoc API reference is available [here](https://pahkasoft.github.io).
92
- It is not commented but is mostly self explanatory and gives idea of full API.
93
-
94
95
  Following is the main interface explained.
95
96
 
96
97
  ### Create DocumentBuilder
@@ -324,26 +325,6 @@ builder.addFermata(Score.Fermata.AtMeasureEnd);
324
325
  - `Score.Fermata.AtNote`: Adds fermata anchored to previously added note, chord or rest.
325
326
  - `Score.Fermata.AtMeasureEnd`: Adds fermata at the end of measure.
326
327
 
327
- ### Add Connective (tie, slur)
328
-
329
- ```js
330
- // Add tie
331
- builder.addConnective(connective: Score.Connetive.Tie, span?: Score.ConnectiveSpan, noteAnchor?: Score.NoteAnchor);
332
-
333
- // Add slur
334
- builder.addConnective(connective: Score.Connetive.Slur, span?: Score.ConnectiveSpan, noteAnchor?: Score.NoteAnchor);
335
-
336
- // Add slide
337
- builder.addConnective(connective: Score.Connetive.Slide, noteAnchor?: Score.NoteAnchor);
338
- ```
339
-
340
- - `span` describes how many notes the connective is across.
341
- It is integer >= 2 (for tie it can be also `Score.TieType.Stub|ToMeasureEnd`).
342
- Default value is 2.
343
- - `noteAnchor` describes the attach point of connective to note.
344
- It can be `Score.NoteAnchor.Auto|Above|Center|Below|StemTip`.
345
- Default value is `Score.NoteAnchor.Auto`.
346
-
347
328
  ### Add Navigation
348
329
 
349
330
  Add navigational element to measure.
@@ -404,6 +385,47 @@ builder.addAnnotation(Score.Annotation.Tempo, "accel.");
404
385
  * `Score.Annotation.Dynamics`: `text` could be for example `"fff"`, `"cresc."`, `"dim."`, etc.
405
386
  * `Score.Annotation.Tempo`: `text` could be for example `"accel."`, `"rit."`, `"a tempo"`, etc.
406
387
 
388
+ ### Add Elements To Certain Staff Or Tab
389
+
390
+ There are alternatives to these functions:
391
+ - `addFermata` => `addFermataTo`
392
+ - `addNavigation` => `addNavigationTo`
393
+ - `addAnnotation` => `addAnnotationTo`
394
+ - `addLabel` => `addLabelTo`.
395
+
396
+ First argument of these alterate functions is:
397
+
398
+ `staffTabOrGroup: number | string | (number | string)[]`.
399
+
400
+ It can be one of following things:
401
+ - `number`: staff/tab index, 0=top staff/tab, etc.
402
+ - `string`: staff/tab name.
403
+ - `string`: staff group name.
404
+ - Or an array of the above.
405
+
406
+ ```js
407
+ // Example: add label to top staff/tab.
408
+ builder.addLabelTo(0, Score.Label.Chord, "Am");
409
+ ```
410
+
411
+ #### Staff Group
412
+ ```js
413
+ builder.addStaffGroup(groupName: string, staffsTabsAndGroups: number | string | (number | string)[], verticalPosition: Score.VerticalPosition);
414
+ ```
415
+
416
+ Arguments are:
417
+ - `groupName`: Name of new staff group.
418
+ - `staffsTabsAndGroups`: single value or an array of staves, tabs and groups (index or name).
419
+ - `verticalPosition` (optional): Can be `Score.VerticalPosition.Above`/`Below`/`Both`/`Auto` (default).
420
+
421
+ ```js
422
+ // Example: create staff group to add elements below top staff/tab.
423
+ // Add staff group
424
+ builder.addStaffGroup("grp1", [0], Score.VertocalPosition.Below);
425
+ // Use group
426
+ builder.addLabelTo("grp1", Score.Label.Note, "C");
427
+ ```
428
+
407
429
  ### Add Extension
408
430
 
409
431
  Adds extension line to element, for example to previously added annotation.
@@ -419,6 +441,26 @@ builder.addAnnotation(Score.Annotation.Tempo, "accel.").addExtension(Theory.Note
419
441
 
420
442
  `visible` sets visibility of extension line, visible by default (if omitted).
421
443
 
444
+ ### Add Connective (tie, slur, slide)
445
+
446
+ ```js
447
+ // Add tie
448
+ builder.addConnective(connective: Score.Connetive.Tie, span?: Score.ConnectiveSpan, noteAnchor?: Score.NoteAnchor);
449
+
450
+ // Add slur
451
+ builder.addConnective(connective: Score.Connetive.Slur, span?: Score.ConnectiveSpan, noteAnchor?: Score.NoteAnchor);
452
+
453
+ // Add slide
454
+ builder.addConnective(connective: Score.Connetive.Slide, noteAnchor?: Score.NoteAnchor);
455
+ ```
456
+
457
+ - `span` describes how many notes the connective is across.
458
+ It is integer >= 2 (for tie it can be also `Score.TieType.Stub|ToMeasureEnd`).
459
+ Default value is 2.
460
+ - `noteAnchor` describes the attach point of connective to note.
461
+ It can be `Score.NoteAnchor.Auto|Above|Center|Below|StemTip`.
462
+ Default value is `Score.NoteAnchor.Auto`.
463
+
422
464
  ### Guitar Tab
423
465
 
424
466
  This library has preliminary guitar tabs rendering.
@@ -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/audio/index.ts
7
7
  import { Note, PitchNotation, SymbolSet } from "@tspro/web-music-score/theory";
@@ -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/audio-cg/index.ts
7
7
  import * as Tone from "tone";
@@ -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
  var __defProp = Object.defineProperty;
3
3
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4
4
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
@@ -6,4 +6,4 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
6
6
  export {
7
7
  __publicField
8
8
  };
9
- //# sourceMappingURL=chunk-ZWFAOHYM.mjs.map
9
+ //# sourceMappingURL=chunk-B4J3KED2.mjs.map
@@ -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;
@@ -61,7 +61,7 @@ function init() {
61
61
  return;
62
62
  }
63
63
  initialized = true;
64
- console.log("%cWebMusicScore v3.0.0 (cjs) initialized.", "background: black; color: white; padding: 2px;");
64
+ console.log("%cWebMusicScore v3.1.0 (cjs) initialized.", "background: black; color: white; padding: 2px;");
65
65
  }
66
66
  // Annotate the CommonJS export names for ESM import in node:
67
67
  0 && (module.exports = {
@@ -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/core/error.ts
7
7
  var MusicErrorType = /* @__PURE__ */ ((MusicErrorType2) => {
@@ -35,7 +35,7 @@ function init() {
35
35
  return;
36
36
  }
37
37
  initialized = true;
38
- console.log("%cWebMusicScore v3.0.0 (esm) initialized.", "background: black; color: white; padding: 2px;");
38
+ console.log("%cWebMusicScore v3.1.0 (esm) initialized.", "background: black; color: white; padding: 2px;");
39
39
  }
40
40
  export {
41
41
  MusicError,