@tspro/web-music-score 3.1.0 → 3.2.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.
Files changed (43) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +5 -3
  3. package/dist/audio/index.d.mts +1 -8
  4. package/dist/audio/index.d.ts +1 -8
  5. package/dist/audio/index.js +1 -1
  6. package/dist/audio/index.mjs +2 -2
  7. package/dist/audio-cg/index.d.mts +0 -1
  8. package/dist/audio-cg/index.d.ts +0 -1
  9. package/dist/audio-cg/index.js +1 -1
  10. package/dist/audio-cg/index.mjs +2 -2
  11. package/dist/{chunk-B4J3KED2.mjs → chunk-LCTM7BID.mjs} +2 -2
  12. package/dist/core/index.d.mts +0 -3
  13. package/dist/core/index.d.ts +0 -3
  14. package/dist/core/index.js +2 -2
  15. package/dist/core/index.mjs +3 -3
  16. package/dist/{guitar-BIFwFT31.d.ts → guitar-C2Cp71NZ.d.ts} +1 -8
  17. package/dist/{guitar-zASF7B1g.d.mts → guitar-DggbM2UL.d.mts} +1 -8
  18. package/dist/iife/index.global.js +11 -11
  19. package/dist/{interface-DprVf__B.d.ts → interface-BlNl69uT.d.ts} +57 -77
  20. package/dist/{interface-BedxdQDE.d.mts → interface-Bn5HFt_U.d.mts} +57 -77
  21. package/dist/{note-B5ZtlHc8.d.mts → note-BFa43I86.d.mts} +0 -14
  22. package/dist/{note-B5ZtlHc8.d.ts → note-BFa43I86.d.ts} +0 -14
  23. package/dist/pieces/index.d.mts +3 -6
  24. package/dist/pieces/index.d.ts +3 -6
  25. package/dist/pieces/index.js +1 -1
  26. package/dist/pieces/index.mjs +2 -2
  27. package/dist/react-ui/index.d.mts +5 -23
  28. package/dist/react-ui/index.d.ts +5 -23
  29. package/dist/react-ui/index.js +1 -1
  30. package/dist/react-ui/index.mjs +2 -2
  31. package/dist/{scale-B_2MZaT9.d.ts → scale-DRR-t4Kr.d.mts} +2 -15
  32. package/dist/{scale-C-YS5iVG.d.mts → scale-ebJm37q1.d.ts} +2 -15
  33. package/dist/score/index.d.mts +18 -18
  34. package/dist/score/index.d.ts +18 -18
  35. package/dist/score/index.js +376 -229
  36. package/dist/score/index.mjs +377 -230
  37. package/dist/{tempo-TjQKn46X.d.mts → tempo-B4h5Ktob.d.mts} +1 -17
  38. package/dist/{tempo-DoJd-UYT.d.ts → tempo-DgqDEsn0.d.ts} +1 -17
  39. package/dist/theory/index.d.mts +6 -8
  40. package/dist/theory/index.d.ts +6 -8
  41. package/dist/theory/index.js +1 -1
  42. package/dist/theory/index.mjs +2 -2
  43. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # Changelog
2
2
 
3
+ ## [3.2.0] - 2025-09-12
4
+ ## Added
5
+ - Added getter functions to score interface (MDocument, MMeasure, etc.)
6
+
7
+ ## Fixed
8
+ - Extension line tip direction.
9
+ - Cursor top was always 0 (top of document instead of top of row).
10
+ - Pick accidental.
11
+
12
+ ## Changed
13
+ - Do not pick note groups, rests and rhythm columns (only visible with multiple staff/tab anyway).
14
+
15
+ ## [3.1.1] - 2025-09-10
16
+ ## Fixed
17
+ - Accept array of staff/tab/group for addFermataTo(), addNavigationTo(), addAnnotationTo() and addLabelTo().
18
+ - Better infinite recursion detection for staff groups.
19
+
3
20
  ## [3.1.0] - 2025-09-09
4
21
  ## Added
5
22
  - Staff/TabConfig.name.
package/README.md CHANGED
@@ -144,6 +144,7 @@ builder.setScoreConfiguration(config: (Score.StaffConfig | Score.TabConfig)[]);
144
144
  * `type`: "staff"
145
145
  * `clef`: Clef can be `Score.Clef.G` or `Score.Clef.F`.
146
146
  * `isOctaveDown`: boolean (optional)
147
+ * `name`: staff name.
147
148
  * `minNote`: string (optional), minimum note allowed in staff.
148
149
  * `maxNote`: string (optional), maximum note allowed in staff.
149
150
  * `voiceIds`: number[] (optional), array of voice ids are visible on this staff.
@@ -151,6 +152,7 @@ builder.setScoreConfiguration(config: (Score.StaffConfig | Score.TabConfig)[]);
151
152
 
152
153
  `TabConfig` contains following properties:
153
154
  * `type`: "tab"
155
+ * `name`: tab name.
154
156
  * `tuning`: string | string[] (optional), tuning name or array of 6 note names for tuning.
155
157
  * `voiceIds`: number[] (optional), array of voice ids are visible on this tab.
156
158
 
@@ -395,13 +397,13 @@ There are alternatives to these functions:
395
397
 
396
398
  First argument of these alterate functions is:
397
399
 
398
- `staffTabOrGroup: number | string | (number | string)[]`.
400
+ `staffTabOrGroups: Score.StaffTabOrGroups`.
399
401
 
400
- It can be one of following things:
402
+ `StaffTabOrGroups` can be:
401
403
  - `number`: staff/tab index, 0=top staff/tab, etc.
402
404
  - `string`: staff/tab name.
403
405
  - `string`: staff group name.
404
- - Or an array of the above.
406
+ - `(number | string)[]`: an array of staff/tab indices, names or group names.
405
407
 
406
408
  ```js
407
409
  // Example: add label to top staff/tab.
@@ -1,22 +1,15 @@
1
- import { N as Note } from '../note-B5ZtlHc8.mjs';
1
+ import { N as Note } from '../note-BFa43I86.mjs';
2
2
 
3
- /** @public */
4
3
  interface Instrument {
5
4
  getName(): string;
6
5
  playNote(note: string, duration?: number, volume?: number): void;
7
6
  stop(): void;
8
7
  }
9
- /** @public */
10
8
  declare function getInstrumentList(): ReadonlyArray<string>;
11
- /** @public */
12
9
  declare function getCurrentInstrument(): string;
13
- /** @public */
14
10
  declare function registerInstrument(instr: Instrument): void;
15
- /** @public */
16
11
  declare function setInstrument(instrName: string): void;
17
- /** @public */
18
12
  declare function playNote(note: Note | string | number, duration?: number, linearVolume?: number): void;
19
- /** @public */
20
13
  declare function stop(): void;
21
14
 
22
15
  export { type Instrument, getCurrentInstrument, getInstrumentList, playNote, registerInstrument, setInstrument, stop };
@@ -1,22 +1,15 @@
1
- import { N as Note } from '../note-B5ZtlHc8.js';
1
+ import { N as Note } from '../note-BFa43I86.js';
2
2
 
3
- /** @public */
4
3
  interface Instrument {
5
4
  getName(): string;
6
5
  playNote(note: string, duration?: number, volume?: number): void;
7
6
  stop(): void;
8
7
  }
9
- /** @public */
10
8
  declare function getInstrumentList(): ReadonlyArray<string>;
11
- /** @public */
12
9
  declare function getCurrentInstrument(): string;
13
- /** @public */
14
10
  declare function registerInstrument(instr: Instrument): void;
15
- /** @public */
16
11
  declare function setInstrument(instrName: string): void;
17
- /** @public */
18
12
  declare function playNote(note: Note | string | number, duration?: number, linearVolume?: number): void;
19
- /** @public */
20
13
  declare function stop(): void;
21
14
 
22
15
  export { type Instrument, getCurrentInstrument, getInstrumentList, playNote, registerInstrument, setInstrument, stop };
@@ -1,4 +1,4 @@
1
- /* WebMusicScore v3.1.0 | (c) 2023 PahkaSoft | MIT License | Includes: Tone.js (MIT License) */
1
+ /* WebMusicScore v3.2.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.1.0 | (c) 2023 PahkaSoft | MIT License | Includes: Tone.js (MIT License) */
1
+ /* WebMusicScore v3.2.0 | (c) 2023 PahkaSoft | MIT License | Includes: Tone.js (MIT License) */
2
2
  import {
3
3
  __publicField
4
- } from "../chunk-B4J3KED2.mjs";
4
+ } from "../chunk-LCTM7BID.mjs";
5
5
 
6
6
  // src/audio/index.ts
7
7
  import { Note, PitchNotation, SymbolSet } from "@tspro/web-music-score/theory";
@@ -1,4 +1,3 @@
1
- /** @public */
2
1
  declare function registerClassicalGuitar(): void;
3
2
 
4
3
  export { registerClassicalGuitar };
@@ -1,4 +1,3 @@
1
- /** @public */
2
1
  declare function registerClassicalGuitar(): void;
3
2
 
4
3
  export { registerClassicalGuitar };
@@ -1,4 +1,4 @@
1
- /* WebMusicScore v3.1.0 | (c) 2023 PahkaSoft | MIT License | Includes: Tone.js (MIT License) */
1
+ /* WebMusicScore v3.2.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.1.0 | (c) 2023 PahkaSoft | MIT License | Includes: Tone.js (MIT License) */
1
+ /* WebMusicScore v3.2.0 | (c) 2023 PahkaSoft | MIT License | Includes: Tone.js (MIT License) */
2
2
  import {
3
3
  __publicField
4
- } from "../chunk-B4J3KED2.mjs";
4
+ } from "../chunk-LCTM7BID.mjs";
5
5
 
6
6
  // src/audio-cg/index.ts
7
7
  import * as Tone from "tone";
@@ -1,4 +1,4 @@
1
- /* WebMusicScore v3.1.0 | (c) 2023 PahkaSoft | MIT License | Includes: Tone.js (MIT License) */
1
+ /* WebMusicScore v3.2.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-B4J3KED2.mjs.map
9
+ //# sourceMappingURL=chunk-LCTM7BID.mjs.map
@@ -1,4 +1,3 @@
1
- /** @public */
2
1
  declare enum MusicErrorType {
3
2
  Unknown = 0,
4
3
  InvalidArg = 1,
@@ -8,14 +7,12 @@ declare enum MusicErrorType {
8
7
  Timesignature = 5,
9
8
  Score = 6
10
9
  }
11
- /** @public */
12
10
  declare class MusicError extends Error {
13
11
  readonly type: MusicErrorType;
14
12
  constructor(message: string);
15
13
  constructor(type: MusicErrorType, message: string);
16
14
  }
17
15
 
18
- /** @public */
19
16
  declare function init(): void;
20
17
 
21
18
  export { MusicError, MusicErrorType, init };
@@ -1,4 +1,3 @@
1
- /** @public */
2
1
  declare enum MusicErrorType {
3
2
  Unknown = 0,
4
3
  InvalidArg = 1,
@@ -8,14 +7,12 @@ declare enum MusicErrorType {
8
7
  Timesignature = 5,
9
8
  Score = 6
10
9
  }
11
- /** @public */
12
10
  declare class MusicError extends Error {
13
11
  readonly type: MusicErrorType;
14
12
  constructor(message: string);
15
13
  constructor(type: MusicErrorType, message: string);
16
14
  }
17
15
 
18
- /** @public */
19
16
  declare function init(): void;
20
17
 
21
18
  export { MusicError, MusicErrorType, init };
@@ -1,4 +1,4 @@
1
- /* WebMusicScore v3.1.0 | (c) 2023 PahkaSoft | MIT License | Includes: Tone.js (MIT License) */
1
+ /* WebMusicScore v3.2.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.1.0 (cjs) initialized.", "background: black; color: white; padding: 2px;");
64
+ console.log("%cWebMusicScore v3.2.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.1.0 | (c) 2023 PahkaSoft | MIT License | Includes: Tone.js (MIT License) */
1
+ /* WebMusicScore v3.2.0 | (c) 2023 PahkaSoft | MIT License | Includes: Tone.js (MIT License) */
2
2
  import {
3
3
  __publicField
4
- } from "../chunk-B4J3KED2.mjs";
4
+ } from "../chunk-LCTM7BID.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.1.0 (esm) initialized.", "background: black; color: white; padding: 2px;");
38
+ console.log("%cWebMusicScore v3.2.0 (esm) initialized.", "background: black; color: white; padding: 2px;");
39
39
  }
40
40
  export {
41
41
  MusicError,
@@ -1,22 +1,15 @@
1
- import { N as Note } from './note-B5ZtlHc8.js';
1
+ import { N as Note } from './note-BFa43I86.js';
2
2
 
3
- /** @public */
4
3
  declare enum Handedness {
5
4
  RightHanded = 0,
6
5
  LeftHanded = 1
7
6
  }
8
- /** @public */
9
7
  declare const DefaultHandedness = Handedness.RightHanded;
10
- /** @public */
11
8
  declare function validateHandedness(h: unknown): Handedness;
12
- /** @public */
13
9
  declare const TuningNameList: ReadonlyArray<string>;
14
- /** @public */
15
10
  declare const DefaultTuningName: string;
16
- /** @public */
17
11
  declare function validateTuningName(tuningName: string): string;
18
12
  /**
19
- * @public
20
13
  * @returns Array of open string notes, note for each string.
21
14
  */
22
15
  declare function getTuningStrings(tuningName: string): ReadonlyArray<Note>;
@@ -1,22 +1,15 @@
1
- import { N as Note } from './note-B5ZtlHc8.mjs';
1
+ import { N as Note } from './note-BFa43I86.mjs';
2
2
 
3
- /** @public */
4
3
  declare enum Handedness {
5
4
  RightHanded = 0,
6
5
  LeftHanded = 1
7
6
  }
8
- /** @public */
9
7
  declare const DefaultHandedness = Handedness.RightHanded;
10
- /** @public */
11
8
  declare function validateHandedness(h: unknown): Handedness;
12
- /** @public */
13
9
  declare const TuningNameList: ReadonlyArray<string>;
14
- /** @public */
15
10
  declare const DefaultTuningName: string;
16
- /** @public */
17
11
  declare function validateTuningName(tuningName: string): string;
18
12
  /**
19
- * @public
20
13
  * @returns Array of open string notes, note for each string.
21
14
  */
22
15
  declare function getTuningStrings(tuningName: string): ReadonlyArray<Note>;