@tspro/web-music-score 3.0.1 → 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,7 +1,12 @@
1
1
  # Changelog
2
2
 
3
- ## [3.0.1] - 2025-09-03
3
+ ## [3.1.0] - 2025-09-09
4
+ ## Added
5
+ - Staff/TabConfig.name.
6
+ - DocumentBuilder.addStaffGroup().
7
+ - DocumentBuilder.addFermataTo(), .addNavigationTo(), .addAnnotationTo() and .addLabelTo().
4
8
 
9
+ ## [3.0.1] - 2025-09-03
5
10
  ## Fixed
6
11
  - Draw arpeggio curly arrow also to guitar tab.
7
12
 
package/README.md CHANGED
@@ -325,26 +325,6 @@ builder.addFermata(Score.Fermata.AtMeasureEnd);
325
325
  - `Score.Fermata.AtNote`: Adds fermata anchored to previously added note, chord or rest.
326
326
  - `Score.Fermata.AtMeasureEnd`: Adds fermata at the end of measure.
327
327
 
328
- ### Add Connective (tie, slur)
329
-
330
- ```js
331
- // Add tie
332
- builder.addConnective(connective: Score.Connetive.Tie, span?: Score.ConnectiveSpan, noteAnchor?: Score.NoteAnchor);
333
-
334
- // Add slur
335
- builder.addConnective(connective: Score.Connetive.Slur, span?: Score.ConnectiveSpan, noteAnchor?: Score.NoteAnchor);
336
-
337
- // Add slide
338
- builder.addConnective(connective: Score.Connetive.Slide, noteAnchor?: Score.NoteAnchor);
339
- ```
340
-
341
- - `span` describes how many notes the connective is across.
342
- It is integer >= 2 (for tie it can be also `Score.TieType.Stub|ToMeasureEnd`).
343
- Default value is 2.
344
- - `noteAnchor` describes the attach point of connective to note.
345
- It can be `Score.NoteAnchor.Auto|Above|Center|Below|StemTip`.
346
- Default value is `Score.NoteAnchor.Auto`.
347
-
348
328
  ### Add Navigation
349
329
 
350
330
  Add navigational element to measure.
@@ -405,6 +385,47 @@ builder.addAnnotation(Score.Annotation.Tempo, "accel.");
405
385
  * `Score.Annotation.Dynamics`: `text` could be for example `"fff"`, `"cresc."`, `"dim."`, etc.
406
386
  * `Score.Annotation.Tempo`: `text` could be for example `"accel."`, `"rit."`, `"a tempo"`, etc.
407
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
+
408
429
  ### Add Extension
409
430
 
410
431
  Adds extension line to element, for example to previously added annotation.
@@ -420,6 +441,26 @@ builder.addAnnotation(Score.Annotation.Tempo, "accel.").addExtension(Theory.Note
420
441
 
421
442
  `visible` sets visibility of extension line, visible by default (if omitted).
422
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
+
423
464
  ### Guitar Tab
424
465
 
425
466
  This library has preliminary guitar tabs rendering.
@@ -1,4 +1,4 @@
1
- /* WebMusicScore v3.0.1 | (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.1 | (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-4AS76G4O.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.1 | (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.1 | (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-4AS76G4O.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.1 | (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-4AS76G4O.mjs.map
9
+ //# sourceMappingURL=chunk-B4J3KED2.mjs.map
@@ -1,4 +1,4 @@
1
- /* WebMusicScore v3.0.1 | (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.1 (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.1 | (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-4AS76G4O.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.1 (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,