web-music-score 0.0.1 → 6.0.0-pre.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 (42) hide show
  1. package/CHANGELOG.md +197 -0
  2. package/LICENSE +62 -1
  3. package/README.md +46 -2
  4. package/dist/audio/index.d.ts +50 -0
  5. package/dist/audio/index.js +1832 -0
  6. package/dist/audio/index.mjs +92 -0
  7. package/dist/audio-cg/index.d.ts +21 -0
  8. package/dist/audio-cg/index.js +17568 -0
  9. package/dist/audio-cg/index.mjs +90 -0
  10. package/dist/audio-synth/index.d.ts +15 -0
  11. package/dist/audio-synth/index.js +18497 -0
  12. package/dist/audio-synth/index.mjs +63 -0
  13. package/dist/chunk-2NTPGV6U.mjs +101 -0
  14. package/dist/chunk-FCR7WBDV.mjs +37 -0
  15. package/dist/chunk-OKY6DMTT.mjs +18381 -0
  16. package/dist/chunk-OZZ3NSJS.mjs +267 -0
  17. package/dist/chunk-SNZ77AGL.mjs +11 -0
  18. package/dist/chunk-URLQD334.mjs +3841 -0
  19. package/dist/core/index.d.ts +31 -0
  20. package/dist/core/index.js +74 -0
  21. package/dist/core/index.mjs +22 -0
  22. package/dist/iife/audio-cg.global.js +220 -0
  23. package/dist/iife/index.global.js +228 -0
  24. package/dist/instrument-DS-9C6_8.d.ts +44 -0
  25. package/dist/music-objects-DLmp5uL6.d.ts +2398 -0
  26. package/dist/note-RVXvpfyV.d.ts +306 -0
  27. package/dist/pieces/index.d.ts +46 -0
  28. package/dist/pieces/index.js +79 -0
  29. package/dist/pieces/index.mjs +50 -0
  30. package/dist/react-ui/index.d.ts +86 -0
  31. package/dist/react-ui/index.js +132 -0
  32. package/dist/react-ui/index.mjs +96 -0
  33. package/dist/scale-B1M10_fu.d.ts +230 -0
  34. package/dist/score/index.d.ts +466 -0
  35. package/dist/score/index.js +13927 -0
  36. package/dist/score/index.mjs +10081 -0
  37. package/dist/tempo-D-JF-8b_.d.ts +409 -0
  38. package/dist/theory/index.d.ts +78 -0
  39. package/dist/theory/index.js +4816 -0
  40. package/dist/theory/index.mjs +1986 -0
  41. package/package.json +131 -3
  42. package/workspace.code-workspace +0 -9
@@ -0,0 +1,63 @@
1
+ /* WebMusicScore v6.0.0-pre.0 | (c) 2023-2025 Stefan Brockmann | MIT License | Includes: Tone.js (MIT License), Color Name to Code (MIT License) */
2
+ import {
3
+ Filter,
4
+ PolySynth,
5
+ Reverb,
6
+ Synth
7
+ } from "../chunk-OKY6DMTT.mjs";
8
+ import {
9
+ linearToDecibels
10
+ } from "../chunk-SNZ77AGL.mjs";
11
+ import {
12
+ __publicField
13
+ } from "../chunk-2NTPGV6U.mjs";
14
+
15
+ // src/audio-instruments/audio-synth/index.ts
16
+ var SynthesizerInstr = class {
17
+ constructor() {
18
+ __publicField(this, "audioSource");
19
+ try {
20
+ const reverb = new Reverb({ decay: 3, wet: 0.4 }).toDestination();
21
+ const filter = new Filter(800, "lowpass").connect(reverb);
22
+ this.audioSource = new PolySynth(Synth, {
23
+ oscillator: {
24
+ type: "triangle"
25
+ },
26
+ envelope: {
27
+ attack: 1e-3,
28
+ decay: 2,
29
+ sustain: 0.1,
30
+ release: 1.2
31
+ }
32
+ }).connect(filter);
33
+ } catch (err) {
34
+ this.audioSource = void 0;
35
+ console.error(err);
36
+ }
37
+ }
38
+ getName() {
39
+ return "Synthesizer";
40
+ }
41
+ playNote(note, duration, linearVolume) {
42
+ try {
43
+ if (this.audioSource) {
44
+ this.audioSource.volume.value = linearToDecibels(linearVolume);
45
+ this.audioSource.triggerAttackRelease(note, duration);
46
+ }
47
+ } catch (err) {
48
+ }
49
+ }
50
+ stop() {
51
+ try {
52
+ if (this.audioSource) {
53
+ this.audioSource.releaseAll();
54
+ }
55
+ } catch (err) {
56
+ }
57
+ }
58
+ };
59
+ var Synthesizer = new SynthesizerInstr();
60
+ export {
61
+ Synthesizer
62
+ };
63
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,101 @@
1
+ /* WebMusicScore v6.0.0-pre.0 | (c) 2023-2025 Stefan Brockmann | MIT License | Includes: Tone.js (MIT License), Color Name to Code (MIT License) */
2
+ var __defProp = Object.defineProperty;
3
+ var __defProps = Object.defineProperties;
4
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
5
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
8
+ var __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
9
+ var __typeError = (msg) => {
10
+ throw TypeError(msg);
11
+ };
12
+ var __pow = Math.pow;
13
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
14
+ var __spreadValues = (a, b) => {
15
+ for (var prop in b || (b = {}))
16
+ if (__hasOwnProp.call(b, prop))
17
+ __defNormalProp(a, prop, b[prop]);
18
+ if (__getOwnPropSymbols)
19
+ for (var prop of __getOwnPropSymbols(b)) {
20
+ if (__propIsEnum.call(b, prop))
21
+ __defNormalProp(a, prop, b[prop]);
22
+ }
23
+ return a;
24
+ };
25
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
26
+ var __objRest = (source, exclude) => {
27
+ var target = {};
28
+ for (var prop in source)
29
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
30
+ target[prop] = source[prop];
31
+ if (source != null && __getOwnPropSymbols)
32
+ for (var prop of __getOwnPropSymbols(source)) {
33
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
34
+ target[prop] = source[prop];
35
+ }
36
+ return target;
37
+ };
38
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
39
+ var __async = (__this, __arguments, generator) => {
40
+ return new Promise((resolve, reject) => {
41
+ var fulfilled = (value) => {
42
+ try {
43
+ step(generator.next(value));
44
+ } catch (e) {
45
+ reject(e);
46
+ }
47
+ };
48
+ var rejected = (value) => {
49
+ try {
50
+ step(generator.throw(value));
51
+ } catch (e) {
52
+ reject(e);
53
+ }
54
+ };
55
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
56
+ step((generator = generator.apply(__this, __arguments)).next());
57
+ });
58
+ };
59
+ var __await = function(promise, isYieldStar) {
60
+ this[0] = promise;
61
+ this[1] = isYieldStar;
62
+ };
63
+ var __yieldStar = (value) => {
64
+ var obj = value[__knownSymbol("asyncIterator")], isAwait = false, method, it = {};
65
+ if (obj == null) {
66
+ obj = value[__knownSymbol("iterator")]();
67
+ method = (k) => it[k] = (x) => obj[k](x);
68
+ } else {
69
+ obj = obj.call(value);
70
+ method = (k) => it[k] = (v) => {
71
+ if (isAwait) {
72
+ isAwait = false;
73
+ if (k === "throw") throw v;
74
+ return v;
75
+ }
76
+ isAwait = true;
77
+ return {
78
+ done: false,
79
+ value: new __await(new Promise((resolve) => {
80
+ var x = obj[k](v);
81
+ if (!(x instanceof Object)) __typeError("Object expected");
82
+ resolve(x);
83
+ }), 1)
84
+ };
85
+ };
86
+ }
87
+ return it[__knownSymbol("iterator")] = () => it, method("next"), "throw" in obj ? method("throw") : it.throw = (x) => {
88
+ throw x;
89
+ }, "return" in obj && method("return"), it;
90
+ };
91
+
92
+ export {
93
+ __pow,
94
+ __spreadValues,
95
+ __spreadProps,
96
+ __objRest,
97
+ __publicField,
98
+ __async,
99
+ __yieldStar
100
+ };
101
+ //# sourceMappingURL=chunk-2NTPGV6U.mjs.map
@@ -0,0 +1,37 @@
1
+ /* WebMusicScore v6.0.0-pre.0 | (c) 2023-2025 Stefan Brockmann | MIT License | Includes: Tone.js (MIT License), Color Name to Code (MIT License) */
2
+ import {
3
+ __publicField
4
+ } from "./chunk-2NTPGV6U.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
+ MusicErrorType2[MusicErrorType2["Audio"] = 7] = "Audio";
16
+ return MusicErrorType2;
17
+ })(MusicErrorType || {});
18
+ function formatType(type) {
19
+ return type === void 0 ? "" : `[${MusicErrorType[type]}] `;
20
+ }
21
+ var MusicError = class extends Error {
22
+ constructor(...args) {
23
+ const [type, msg] = args.length === 1 ? [0 /* Unknown */, args[0]] : args;
24
+ super(formatType(type) + msg);
25
+ /** Music error type. */
26
+ __publicField(this, "type");
27
+ Object.setPrototypeOf(this, new.target.prototype);
28
+ this.name = "MusicError";
29
+ this.type = type;
30
+ }
31
+ };
32
+
33
+ export {
34
+ MusicErrorType,
35
+ MusicError
36
+ };
37
+ //# sourceMappingURL=chunk-FCR7WBDV.mjs.map