web-music-score 0.0.1 → 6.0.0-pre.1

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 +200 -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 +1858 -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-A7C2G7OG.mjs +101 -0
  14. package/dist/chunk-GNT3ECDB.mjs +267 -0
  15. package/dist/chunk-LO4NI4AU.mjs +18381 -0
  16. package/dist/chunk-PW2SO6EZ.mjs +37 -0
  17. package/dist/chunk-VHB57TXT.mjs +11 -0
  18. package/dist/chunk-X7BMJX7E.mjs +3867 -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 +13964 -0
  36. package/dist/score/index.mjs +10092 -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 +4842 -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,44 @@
1
+ /**
2
+ * Instrument interface.
3
+ * <p>To create your own instrument just create a class that implement this simple interface.</p>
4
+ *
5
+ * ```ts
6
+ * import * as Audio from "web-music-score/audio";
7
+ *
8
+ * class MyCoolInstrument implements Audio.Instrument {
9
+ * constructor() { }
10
+ * getName() { return "My Cool Instrument"; }
11
+ * playNote(note: string, duration: number, linearVolume: number) { }
12
+ * stop() { }
13
+ * }
14
+ *
15
+ * // Add and use my cool instrument.
16
+ * Audio.addInstrument(new MyCoolInstrument());
17
+ * ```
18
+ */
19
+ interface Instrument {
20
+ /**
21
+ * Get instrument name.
22
+ * @return - Instrument name.
23
+ */
24
+ getName(): string;
25
+ /**
26
+ * Play a note.
27
+ * @param note - Note to play (e.g. "C4").
28
+ * @param duration - Play duration in seconds.
29
+ * @param linearVolume - Linear volume in range [0, 1].
30
+ */
31
+ playNote(note: string, duration: number, linearVolume: number): void;
32
+ /**
33
+ * Stop playback.
34
+ */
35
+ stop(): void;
36
+ }
37
+ /**
38
+ * Linear volume to decibels converter.
39
+ * @param linearVolume - Linear volume in range [0, 1].
40
+ * @returns - Volume in decibels.
41
+ */
42
+ declare function linearToDecibels(linearVolume: number): number;
43
+
44
+ export { type Instrument as I, linearToDecibels as l };