@tspro/web-music-score 1.0.0 → 2.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 +19 -0
- package/README.md +271 -224
- package/dist/audio/index.d.mts +22 -0
- package/dist/audio/index.d.ts +22 -0
- package/dist/audio/index.js +147 -0
- package/dist/audio/index.mjs +109 -0
- package/dist/audio-cg/index.d.mts +4 -0
- package/dist/audio-cg/index.d.ts +4 -0
- package/dist/audio-cg/index.js +124 -0
- package/dist/audio-cg/index.mjs +91 -0
- package/dist/chunk-2EPWQZKJ.mjs +9 -0
- package/dist/core/index.d.mts +21 -0
- package/dist/core/index.d.ts +21 -0
- package/dist/core/index.js +72 -0
- package/dist/core/index.mjs +45 -0
- package/dist/guitar-BIFwFT31.d.ts +24 -0
- package/dist/guitar-kbJYu3Am.d.mts +24 -0
- package/dist/iife/index.global.js +222 -0
- package/dist/note-B5ZtlHc8.d.ts +99 -0
- package/dist/note-CraqEy8x.d.mts +99 -0
- package/dist/pieces/index.d.mts +15 -0
- package/dist/pieces/index.d.ts +15 -0
- package/dist/pieces/index.js +104 -0
- package/dist/pieces/index.mjs +77 -0
- package/dist/react-ui/index.d.mts +169 -0
- package/dist/react-ui/index.d.ts +169 -0
- package/dist/react-ui/index.js +624 -0
- package/dist/react-ui/index.mjs +582 -0
- package/dist/score/index.d.mts +1558 -0
- package/dist/score/index.d.ts +1558 -0
- package/dist/score/index.js +6937 -0
- package/dist/score/index.mjs +6863 -0
- package/dist/tempo--588tdcv.d.ts +203 -0
- package/dist/tempo-BEJBHZ5I.d.mts +203 -0
- package/dist/theory/index.d.mts +47 -0
- package/dist/theory/index.d.ts +47 -0
- package/dist/theory/index.js +1783 -0
- package/dist/theory/index.mjs +1716 -0
- package/package.json +99 -56
- package/dist/index.cjs.js +0 -40708
- package/dist/index.d.ts +0 -1258
- package/dist/index.esm.mjs +0 -40699
- package/dist/index.umd.min.js +0 -9
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/* WebMusicScore v2.0.0 | (c) 2023 PahkaSoft | MIT License | Includes: Tone.js (MIT License) */
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
|
+
|
|
6
|
+
export {
|
|
7
|
+
__publicField
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=chunk-2EPWQZKJ.mjs.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** @public */
|
|
2
|
+
declare enum MusicErrorType {
|
|
3
|
+
Unknown = 0,
|
|
4
|
+
InvalidArg = 1,
|
|
5
|
+
Note = 2,
|
|
6
|
+
Scale = 3,
|
|
7
|
+
KeySignature = 4,
|
|
8
|
+
Timesignature = 5,
|
|
9
|
+
Score = 6
|
|
10
|
+
}
|
|
11
|
+
/** @public */
|
|
12
|
+
declare class MusicError extends Error {
|
|
13
|
+
readonly type: MusicErrorType;
|
|
14
|
+
constructor(message: string);
|
|
15
|
+
constructor(type: MusicErrorType, message: string);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** @public */
|
|
19
|
+
declare function init(): void;
|
|
20
|
+
|
|
21
|
+
export { MusicError, MusicErrorType, init };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** @public */
|
|
2
|
+
declare enum MusicErrorType {
|
|
3
|
+
Unknown = 0,
|
|
4
|
+
InvalidArg = 1,
|
|
5
|
+
Note = 2,
|
|
6
|
+
Scale = 3,
|
|
7
|
+
KeySignature = 4,
|
|
8
|
+
Timesignature = 5,
|
|
9
|
+
Score = 6
|
|
10
|
+
}
|
|
11
|
+
/** @public */
|
|
12
|
+
declare class MusicError extends Error {
|
|
13
|
+
readonly type: MusicErrorType;
|
|
14
|
+
constructor(message: string);
|
|
15
|
+
constructor(type: MusicErrorType, message: string);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** @public */
|
|
19
|
+
declare function init(): void;
|
|
20
|
+
|
|
21
|
+
export { MusicError, MusicErrorType, init };
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/* WebMusicScore v2.0.0 | (c) 2023 PahkaSoft | MIT License | Includes: Tone.js (MIT License) */
|
|
2
|
+
"use strict";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
22
|
+
|
|
23
|
+
// src/core/index.ts
|
|
24
|
+
var core_exports = {};
|
|
25
|
+
__export(core_exports, {
|
|
26
|
+
MusicError: () => MusicError,
|
|
27
|
+
MusicErrorType: () => MusicErrorType,
|
|
28
|
+
init: () => init
|
|
29
|
+
});
|
|
30
|
+
module.exports = __toCommonJS(core_exports);
|
|
31
|
+
|
|
32
|
+
// src/core/error.ts
|
|
33
|
+
var MusicErrorType = /* @__PURE__ */ ((MusicErrorType2) => {
|
|
34
|
+
MusicErrorType2[MusicErrorType2["Unknown"] = 0] = "Unknown";
|
|
35
|
+
MusicErrorType2[MusicErrorType2["InvalidArg"] = 1] = "InvalidArg";
|
|
36
|
+
MusicErrorType2[MusicErrorType2["Note"] = 2] = "Note";
|
|
37
|
+
MusicErrorType2[MusicErrorType2["Scale"] = 3] = "Scale";
|
|
38
|
+
MusicErrorType2[MusicErrorType2["KeySignature"] = 4] = "KeySignature";
|
|
39
|
+
MusicErrorType2[MusicErrorType2["Timesignature"] = 5] = "Timesignature";
|
|
40
|
+
MusicErrorType2[MusicErrorType2["Score"] = 6] = "Score";
|
|
41
|
+
return MusicErrorType2;
|
|
42
|
+
})(MusicErrorType || {});
|
|
43
|
+
function formatType(type) {
|
|
44
|
+
return type === void 0 ? "" : `[${MusicErrorType[type]}] `;
|
|
45
|
+
}
|
|
46
|
+
var MusicError = class extends Error {
|
|
47
|
+
constructor(...args) {
|
|
48
|
+
const [type, msg] = args.length === 1 ? [0 /* Unknown */, args[0]] : args;
|
|
49
|
+
super(formatType(type) + msg);
|
|
50
|
+
__publicField(this, "type");
|
|
51
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
52
|
+
this.name = "MusicError";
|
|
53
|
+
this.type = type;
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
// src/core/index.ts
|
|
58
|
+
var initialized = false;
|
|
59
|
+
function init() {
|
|
60
|
+
if (initialized) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
initialized = true;
|
|
64
|
+
console.log("%cWebMusicScore v2.0.0 (cjs) initialized.", "background: black; color: white; padding: 2px;");
|
|
65
|
+
}
|
|
66
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
67
|
+
0 && (module.exports = {
|
|
68
|
+
MusicError,
|
|
69
|
+
MusicErrorType,
|
|
70
|
+
init
|
|
71
|
+
});
|
|
72
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/* WebMusicScore v2.0.0 | (c) 2023 PahkaSoft | MIT License | Includes: Tone.js (MIT License) */
|
|
2
|
+
import {
|
|
3
|
+
__publicField
|
|
4
|
+
} from "../chunk-2EPWQZKJ.mjs";
|
|
5
|
+
|
|
6
|
+
// src/core/error.ts
|
|
7
|
+
var MusicErrorType = /* @__PURE__ */ ((MusicErrorType2) => {
|
|
8
|
+
MusicErrorType2[MusicErrorType2["Unknown"] = 0] = "Unknown";
|
|
9
|
+
MusicErrorType2[MusicErrorType2["InvalidArg"] = 1] = "InvalidArg";
|
|
10
|
+
MusicErrorType2[MusicErrorType2["Note"] = 2] = "Note";
|
|
11
|
+
MusicErrorType2[MusicErrorType2["Scale"] = 3] = "Scale";
|
|
12
|
+
MusicErrorType2[MusicErrorType2["KeySignature"] = 4] = "KeySignature";
|
|
13
|
+
MusicErrorType2[MusicErrorType2["Timesignature"] = 5] = "Timesignature";
|
|
14
|
+
MusicErrorType2[MusicErrorType2["Score"] = 6] = "Score";
|
|
15
|
+
return MusicErrorType2;
|
|
16
|
+
})(MusicErrorType || {});
|
|
17
|
+
function formatType(type) {
|
|
18
|
+
return type === void 0 ? "" : `[${MusicErrorType[type]}] `;
|
|
19
|
+
}
|
|
20
|
+
var MusicError = class extends Error {
|
|
21
|
+
constructor(...args) {
|
|
22
|
+
const [type, msg] = args.length === 1 ? [0 /* Unknown */, args[0]] : args;
|
|
23
|
+
super(formatType(type) + msg);
|
|
24
|
+
__publicField(this, "type");
|
|
25
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
26
|
+
this.name = "MusicError";
|
|
27
|
+
this.type = type;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
// src/core/index.ts
|
|
32
|
+
var initialized = false;
|
|
33
|
+
function init() {
|
|
34
|
+
if (initialized) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
initialized = true;
|
|
38
|
+
console.log("%cWebMusicScore v2.0.0 (esm) initialized.", "background: black; color: white; padding: 2px;");
|
|
39
|
+
}
|
|
40
|
+
export {
|
|
41
|
+
MusicError,
|
|
42
|
+
MusicErrorType,
|
|
43
|
+
init
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { N as Note } from './note-B5ZtlHc8.js';
|
|
2
|
+
|
|
3
|
+
/** @public */
|
|
4
|
+
declare enum Handedness {
|
|
5
|
+
RightHanded = 0,
|
|
6
|
+
LeftHanded = 1
|
|
7
|
+
}
|
|
8
|
+
/** @public */
|
|
9
|
+
declare const DefaultHandedness = Handedness.RightHanded;
|
|
10
|
+
/** @public */
|
|
11
|
+
declare function validateHandedness(h: unknown): Handedness;
|
|
12
|
+
/** @public */
|
|
13
|
+
declare const TuningNameList: ReadonlyArray<string>;
|
|
14
|
+
/** @public */
|
|
15
|
+
declare const DefaultTuningName: string;
|
|
16
|
+
/** @public */
|
|
17
|
+
declare function validateTuningName(tuningName: string): string;
|
|
18
|
+
/**
|
|
19
|
+
* @public
|
|
20
|
+
* @returns Array of open string notes, note for each string.
|
|
21
|
+
*/
|
|
22
|
+
declare function getTuningStrings(tuningName: string): ReadonlyArray<Note>;
|
|
23
|
+
|
|
24
|
+
export { DefaultHandedness as D, Handedness as H, TuningNameList as T, DefaultTuningName as a, validateTuningName as b, getTuningStrings as g, validateHandedness as v };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { N as Note } from './note-CraqEy8x.mjs';
|
|
2
|
+
|
|
3
|
+
/** @public */
|
|
4
|
+
declare enum Handedness {
|
|
5
|
+
RightHanded = 0,
|
|
6
|
+
LeftHanded = 1
|
|
7
|
+
}
|
|
8
|
+
/** @public */
|
|
9
|
+
declare const DefaultHandedness = Handedness.RightHanded;
|
|
10
|
+
/** @public */
|
|
11
|
+
declare function validateHandedness(h: unknown): Handedness;
|
|
12
|
+
/** @public */
|
|
13
|
+
declare const TuningNameList: ReadonlyArray<string>;
|
|
14
|
+
/** @public */
|
|
15
|
+
declare const DefaultTuningName: string;
|
|
16
|
+
/** @public */
|
|
17
|
+
declare function validateTuningName(tuningName: string): string;
|
|
18
|
+
/**
|
|
19
|
+
* @public
|
|
20
|
+
* @returns Array of open string notes, note for each string.
|
|
21
|
+
*/
|
|
22
|
+
declare function getTuningStrings(tuningName: string): ReadonlyArray<Note>;
|
|
23
|
+
|
|
24
|
+
export { DefaultHandedness as D, Handedness as H, TuningNameList as T, DefaultTuningName as a, validateTuningName as b, getTuningStrings as g, validateHandedness as v };
|