@tspro/web-music-score 4.2.0 → 5.0.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 +13 -0
- package/README.md +51 -17
- package/dist/audio/index.d.mts +9 -26
- package/dist/audio/index.d.ts +9 -26
- package/dist/audio/index.js +44 -25
- package/dist/audio/index.mjs +38 -24
- package/dist/audio-cg/index.d.mts +13 -3
- package/dist/audio-cg/index.d.ts +13 -3
- package/dist/audio-cg/index.js +54 -51
- package/dist/audio-cg/index.mjs +49 -52
- package/dist/chunk-AAL3CMRO.mjs +11 -0
- package/dist/{chunk-7MNV5JN6.mjs → chunk-EYFT3RWB.mjs} +3 -3
- package/dist/{chunk-5NWLGWHS.mjs → chunk-J3KU3U4W.mjs} +2 -2
- package/dist/core/index.d.mts +2 -1
- package/dist/core/index.d.ts +2 -1
- package/dist/core/index.js +3 -2
- package/dist/core/index.mjs +4 -3
- package/dist/iife/audio-cg.global.js +220 -0
- package/dist/iife/index.global.js +11 -11
- package/dist/instrument-DYboobMW.d.mts +44 -0
- package/dist/instrument-DYboobMW.d.ts +44 -0
- package/dist/pieces/index.js +1 -1
- package/dist/pieces/index.mjs +2 -2
- package/dist/react-ui/index.d.mts +22 -22
- package/dist/react-ui/index.d.ts +22 -22
- package/dist/react-ui/index.js +1 -1
- package/dist/react-ui/index.mjs +2 -2
- package/dist/score/index.d.mts +6 -6
- package/dist/score/index.d.ts +6 -6
- package/dist/score/index.js +24 -24
- package/dist/score/index.mjs +26 -26
- package/dist/theory/index.js +1 -1
- package/dist/theory/index.mjs +3 -3
- package/package.json +3 -3
package/dist/score/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/* WebMusicScore
|
|
1
|
+
/* WebMusicScore v5.0.0 | (c) 2023 PahkaSoft | MIT License | Includes: Tone.js (MIT License) */
|
|
2
2
|
import {
|
|
3
3
|
RhythmProps
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-EYFT3RWB.mjs";
|
|
5
5
|
import {
|
|
6
6
|
__publicField
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-J3KU3U4W.mjs";
|
|
8
8
|
|
|
9
9
|
// src/score/pub/div-rect.ts
|
|
10
10
|
import { Utils } from "@tspro/ts-utils-lib";
|
|
@@ -1729,24 +1729,24 @@ var ObjRest = class extends MusicObject {
|
|
|
1729
1729
|
visibleInStaff(staff) {
|
|
1730
1730
|
return staff.containsVoiceId(this.voiceId) && this.staffObjects.some((obj) => obj instanceof ObjStaffRest && obj.staff === staff);
|
|
1731
1731
|
}
|
|
1732
|
-
getRestDotVerticalDisplacement(
|
|
1733
|
-
switch (
|
|
1734
|
-
case
|
|
1732
|
+
getRestDotVerticalDisplacement(noteSize) {
|
|
1733
|
+
switch (noteSize) {
|
|
1734
|
+
case 1:
|
|
1735
1735
|
return 1;
|
|
1736
|
-
case
|
|
1736
|
+
case 2:
|
|
1737
1737
|
return -1;
|
|
1738
|
-
case
|
|
1738
|
+
case 4:
|
|
1739
1739
|
return -1;
|
|
1740
|
-
case
|
|
1740
|
+
case 8:
|
|
1741
1741
|
return -1;
|
|
1742
|
-
case
|
|
1742
|
+
case 16:
|
|
1743
1743
|
return -1;
|
|
1744
|
-
case
|
|
1744
|
+
case 32:
|
|
1745
1745
|
return -3;
|
|
1746
|
-
case
|
|
1746
|
+
case 64:
|
|
1747
1747
|
return -3;
|
|
1748
1748
|
default:
|
|
1749
|
-
throw new MusicError5(MusicErrorType5.Score,
|
|
1749
|
+
throw new MusicError5(MusicErrorType5.Score, `Get rest dot vertical displacement: Invalid note size: ${noteSize}`);
|
|
1750
1750
|
}
|
|
1751
1751
|
}
|
|
1752
1752
|
updateAccidentalState(accState) {
|
|
@@ -1759,22 +1759,22 @@ var ObjRest = class extends MusicObject {
|
|
|
1759
1759
|
}
|
|
1760
1760
|
let { unitSize } = renderer;
|
|
1761
1761
|
let { ownDiatonicId } = this;
|
|
1762
|
-
let {
|
|
1762
|
+
let { noteSize, dotCount, flagCount } = this.rhythmProps;
|
|
1763
1763
|
let leftw = 0;
|
|
1764
1764
|
let rightw = 0;
|
|
1765
1765
|
let toph = 0;
|
|
1766
1766
|
let bottomh = 0;
|
|
1767
|
-
if (
|
|
1767
|
+
if (NoteLengthProps.equals(noteSize, NoteLength.Whole)) {
|
|
1768
1768
|
leftw = unitSize;
|
|
1769
1769
|
rightw = unitSize;
|
|
1770
1770
|
toph = 0;
|
|
1771
1771
|
bottomh = unitSize;
|
|
1772
|
-
} else if (
|
|
1772
|
+
} else if (NoteLengthProps.equals(noteSize, NoteLength.Half)) {
|
|
1773
1773
|
leftw = unitSize;
|
|
1774
1774
|
rightw = unitSize;
|
|
1775
1775
|
toph = unitSize;
|
|
1776
1776
|
bottomh = 0;
|
|
1777
|
-
} else if (
|
|
1777
|
+
} else if (NoteLengthProps.equals(noteSize, NoteLength.Quarter)) {
|
|
1778
1778
|
leftw = unitSize * 1;
|
|
1779
1779
|
rightw = unitSize * 1;
|
|
1780
1780
|
toph = unitSize * 3.2;
|
|
@@ -1795,7 +1795,7 @@ var ObjRest = class extends MusicObject {
|
|
|
1795
1795
|
for (let i = 0; i < dotCount; i++) {
|
|
1796
1796
|
let dotWidth = DocumentSettings.DotSize * unitSize;
|
|
1797
1797
|
let dotX = rightw + (DocumentSettings.RestDotSpace + DocumentSettings.DotSize * unitSize) + i * DocumentSettings.DotSize * unitSize * 1.5;
|
|
1798
|
-
let dotY = this.getRestDotVerticalDisplacement(
|
|
1798
|
+
let dotY = this.getRestDotVerticalDisplacement(noteSize) * unitSize;
|
|
1799
1799
|
obj.dotRects.push(DivRect.createCentered(dotX, dotY, dotWidth, dotWidth));
|
|
1800
1800
|
}
|
|
1801
1801
|
obj.offset(0, staff.getDiatonicIdY(ownDiatonicId));
|
|
@@ -1826,18 +1826,18 @@ var ObjRest = class extends MusicObject {
|
|
|
1826
1826
|
renderer.drawDebugRect(this.getRect());
|
|
1827
1827
|
let { unitSize, lineWidth } = renderer;
|
|
1828
1828
|
let { color } = this;
|
|
1829
|
-
let {
|
|
1829
|
+
let { noteSize, flagCount } = this.rhythmProps;
|
|
1830
1830
|
ctx.strokeStyle = ctx.fillStyle = color;
|
|
1831
1831
|
ctx.lineWidth = lineWidth;
|
|
1832
1832
|
this.staffObjects.forEach((obj) => {
|
|
1833
1833
|
let { dotRects, restRect } = obj;
|
|
1834
1834
|
let x = restRect.centerX;
|
|
1835
1835
|
let y = restRect.centerY;
|
|
1836
|
-
if (
|
|
1836
|
+
if (NoteLengthProps.equals(noteSize, NoteLength.Whole)) {
|
|
1837
1837
|
ctx.fillRect(x - unitSize, y, unitSize * 2, unitSize);
|
|
1838
|
-
} else if (
|
|
1838
|
+
} else if (NoteLengthProps.equals(noteSize, NoteLength.Half)) {
|
|
1839
1839
|
ctx.fillRect(x - unitSize, y - unitSize, unitSize * 2, unitSize);
|
|
1840
|
-
} else if (
|
|
1840
|
+
} else if (NoteLengthProps.equals(noteSize, NoteLength.Quarter)) {
|
|
1841
1841
|
ctx.beginPath();
|
|
1842
1842
|
ctx.moveTo(x - unitSize * 0.6, y - unitSize * 3.2);
|
|
1843
1843
|
ctx.lineTo(x + unitSize * 0.7, y - unitSize * 1.5);
|
|
@@ -7425,13 +7425,13 @@ var DocumentBuilder = class {
|
|
|
7425
7425
|
}
|
|
7426
7426
|
/**
|
|
7427
7427
|
* Usage:
|
|
7428
|
-
*
|
|
7428
|
+
* ```ts
|
|
7429
7429
|
* addTuplet(0, Theory.Tuplet.Triplet, notes => {
|
|
7430
7430
|
* notes.addNote("G3", Theory.NoteLength.Eighth);
|
|
7431
7431
|
* notes.addNote("B3", Theory.NoteLength.Eighth);
|
|
7432
7432
|
* notes.addNote("D4", Theory.NoteLength.Eighth);
|
|
7433
7433
|
* });
|
|
7434
|
-
*
|
|
7434
|
+
* ```
|
|
7435
7435
|
*
|
|
7436
7436
|
* @param voiceId - Voice id to add tuplet to.
|
|
7437
7437
|
* @param tupletRatio - You can also use Theory.Tuplet presets (e.g. Theory.Tuplet.Triplet).
|
|
@@ -7646,13 +7646,13 @@ var DocumentBuilder = class {
|
|
|
7646
7646
|
}
|
|
7647
7647
|
/**
|
|
7648
7648
|
* Add extension line to previously added annotation or label element.
|
|
7649
|
-
*
|
|
7649
|
+
* ```ts
|
|
7650
7650
|
* // Example
|
|
7651
7651
|
* addExtension(ext => ext.notes("1n", 2)) // length is 2 whole notes
|
|
7652
7652
|
* addExtension(ext => ext.measures(3).hide()) // length is 3 measures, hidden
|
|
7653
7653
|
* addExtension(ext => ext.measures(1).notes("8n")) // length is 1 measure + 1 eigth note
|
|
7654
7654
|
* addExtension(ext => ext.infinity()) // length is as long as possible
|
|
7655
|
-
*
|
|
7655
|
+
* ```
|
|
7656
7656
|
* @param extensionBuilder - Extension builder function used to build exstension.
|
|
7657
7657
|
* @returns - This document builder instance.
|
|
7658
7658
|
*/
|
package/dist/theory/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* WebMusicScore
|
|
1
|
+
/* WebMusicScore v5.0.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;
|
package/dist/theory/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* WebMusicScore
|
|
1
|
+
/* WebMusicScore v5.0.0 | (c) 2023 PahkaSoft | MIT License | Includes: Tone.js (MIT License) */
|
|
2
2
|
import {
|
|
3
3
|
NoteLength,
|
|
4
4
|
NoteLengthProps,
|
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
Tuplet,
|
|
7
7
|
validateNoteLength,
|
|
8
8
|
validateTupletRatio
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-EYFT3RWB.mjs";
|
|
10
10
|
import {
|
|
11
11
|
__publicField
|
|
12
|
-
} from "../chunk-
|
|
12
|
+
} from "../chunk-J3KU3U4W.mjs";
|
|
13
13
|
|
|
14
14
|
// src/theory/chord.ts
|
|
15
15
|
import { Utils as Utils6 } from "@tspro/ts-utils-lib";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tspro/web-music-score",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"author": "PahkaSoft",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"private": false,
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
"package.json"
|
|
97
97
|
],
|
|
98
98
|
"dependencies": {
|
|
99
|
-
"@tspro/ts-utils-lib": "^1.
|
|
99
|
+
"@tspro/ts-utils-lib": "^1.7.0",
|
|
100
100
|
"tone": "^15.1.22"
|
|
101
101
|
},
|
|
102
102
|
"peerDependencies": {
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
"@types/react-dom": "^18.0.0",
|
|
109
109
|
"rimraf": "^6.0.1",
|
|
110
110
|
"tsup": "^8.5.0",
|
|
111
|
-
"typedoc": "^0.28.
|
|
111
|
+
"typedoc": "^0.28.13",
|
|
112
112
|
"typescript": "latest"
|
|
113
113
|
},
|
|
114
114
|
"workspaces": [
|