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
package/CHANGELOG.md ADDED
@@ -0,0 +1,200 @@
1
+ # Changelog
2
+ ## [6.0.0-pre.1] - 2025-11-22
3
+ - SSR safety (for Docusaurus) by checking typeof `window` and `document` for `"undefined"`.
4
+
5
+ ## [6.0.0-pre.0] - 2025-11-22
6
+ ### **Breaking Changes**
7
+ - Switching to unscoped package name `web-music-score`.
8
+ - Removed all guitar and other stuff (GuitarApp, GuitarContext, circleOfFifths, etc.)
9
+ - Removed deprecated/obsolote stuff.
10
+
11
+ ## [5.5.0] - 2025-11-19
12
+ ### Added
13
+ - Coloring document.
14
+ - Instrument name starts with "!" (hide name) and "!{" (hide name and left brace).
15
+ - Pieces.createAll() to get array of all demo pieces.
16
+
17
+ ### Fixes
18
+ - Extension line update: connect to right side element.
19
+ - Vertical staff/bar line update on row groups.
20
+ - Moved bundled deps to devDeps.
21
+
22
+ ## [5.4.2] - 2025-11-05
23
+ ## Fixed
24
+ - Weird tab rendering bug where sad face appear on canvas.
25
+
26
+ ## [5.4.1] - 2025-11-04
27
+ ### FIxed
28
+ - Lyrics hyphen / extender line y-coord was wrong after previous update.
29
+ - Position of vertical curly arepggio line.
30
+ - Reserve space for specified layout objects.
31
+
32
+ ## [5.4.0] - 2025-11-03
33
+ ### Added
34
+ - isVoiceId(), isStringNumber() and isVerseNumber().
35
+ - Note.isNote().
36
+
37
+ ### Fixed
38
+ - Improved note displacement when notes are close to each other.
39
+ - If rest is the only symbol in voiceId then draw it in the middle of measure.
40
+
41
+ ### Deprecated
42
+ - `Score.DivRect` - Using `AnchoredRect` and `Rect` from `@tspro/ts-utils-lib`.
43
+
44
+ ## [5.3.0] - 2025-10-16
45
+ ## Added
46
+ - MeasureOptions with showNumber property.
47
+ - New piece Canon in D by Pachelbel.
48
+ - Single value voiceIds in staff/tab config.
49
+ - Renamed and deprecated staff/tab config `voiceIds`, use `voiceId` instead.
50
+ - Instrument group to staff/tab config, show instrument name and group with left brace.
51
+ - Renamed and deprecated `MRenderer`, use `MRenderContext` instead.
52
+
53
+ ## Fixed
54
+ - Improved auto stem direction.
55
+
56
+ ## [5.2.0] - 2025-10-10
57
+ ## Fixed
58
+ - Beam not created correctly near tuplet.
59
+ - Create beam only if all beam notes are visible.
60
+ - Not all beams in group were created.
61
+ - play() on empty music document crashed.
62
+
63
+ ## Changed
64
+ - Renamed audio-cg iife global name to Audio_CG but also support old name Audio_ClassicalGuitar.
65
+
66
+ ## [5.1.0] - 2025-10-08
67
+ ## Added
68
+ - Audio functions: mute(), unmute() and isMuted().
69
+ - Added audio-synth as an own module.
70
+ - Added PlaybackButtons properties singlePlayStop, playStop and playPauseStop (deprecated buttonLayout).
71
+ - Added grandId property to staff config, deprecated isGrand property.
72
+ - Added tab signature (show tempo, measure number and time siganture).
73
+ - Draw rhythms above tab.
74
+
75
+ ## Fixed
76
+ - Documentation errors.
77
+ - Correctly apply NoteOptions.string for each note when using addNote with arrya of notes.
78
+ - Incorrect detection upbeat beams.
79
+ - Increase beam separation by angle.
80
+ - Better tempo position above staff.
81
+ - Distance between staff and tab.
82
+
83
+ ## [5.0.0] - 2025-10-05
84
+ Major update required to enable independent browser iife instrument modules.
85
+
86
+ ### **Breiking Changes**
87
+ - Converted audio instrument modules (currently only audio-cg) independant of main lib.
88
+ - Instead of using registerClassicalGuitar() => use import { ClassicalGuitar } and Audio.addInstrument(ClassicalGuitar).
89
+ - Renamed Audio.registerInstrument() => Audio.addInstrument().
90
+ - Renamed Audio.setInstrument() => Audio.useInstrument().
91
+
92
+ ## [4.2.1] - 2025-10-04
93
+ ## Fixed
94
+ - Error was thrown with dotted rests.
95
+
96
+ ## [4.2.0] - 2025-10-03
97
+ ## Added
98
+ - Add support for lyrics/syllables with alignment and hyphen/extender.
99
+ - addNote accepts array of notes to add multiple notes at once.
100
+ - 3/8 time signature.
101
+
102
+ ## [4.1.0] - 2025-10-01
103
+ ## Added
104
+ - 4-4 (in adition to 2-2-2-2) beam grouping for 4/4 time signature.
105
+ - 12/8 time signature.
106
+ - 5/8 time signature and 2-3 and 3-2 beam groupings.
107
+ - 7/8 time signature and 2-2-3 and 3-2-2 beam groupings.
108
+
109
+ ## [4.0.1] - 2025-09-28
110
+ ## Fixed
111
+ - Invalid typedoc @params.
112
+ - AnotationType was not referenced for typedoc.
113
+ - Deprecated misspelled NoteLength.Whole12Dots.
114
+
115
+ ## Changed
116
+ - Improved Frere Jacques demo piece.
117
+
118
+ ## Added
119
+ - Typedoc comments for all public exports.
120
+
121
+ ## [4.0.0] - 2025-09-24
122
+ Another major update was required by new features.
123
+
124
+ ### **Breiking Changes**
125
+ - `RhythmProps` had major redesign.
126
+ - `DocumentBuilder.addExtension()` was changed.
127
+
128
+ ### Added
129
+ - Generic tuples with `DocumentBuilder.addTuplet()`.
130
+ - Support multiple dot count.
131
+ - Added `NoteLengthProps` to support note lengths.
132
+ - Support for "1n", "2n", "4n", etc. string note lengths alongside `NoteLength` enum.
133
+ - Support for all other string arguments alongside typescript enums.
134
+
135
+ **Lots of other undocumented small changes, updates and fixes!**
136
+
137
+ ## [3.2.0] - 2025-09-12
138
+ ### Added
139
+ - Added getter functions to score interface (MDocument, MMeasure, etc.)
140
+
141
+ ### Fixed
142
+ - Extension line tip direction.
143
+ - Cursor top was always 0 (top of document instead of top of row).
144
+ - Pick accidental.
145
+
146
+ ### Changed
147
+ - Do not pick note groups, rests and rhythm columns (only visible with multiple staff/tab anyway).
148
+
149
+ ## [3.1.1] - 2025-09-10
150
+ ### Fixed
151
+ - Accept array of staff/tab/group for addFermataTo(), addNavigationTo(), addAnnotationTo() and addLabelTo().
152
+ - Better infinite recursion detection for staff groups.
153
+
154
+ ## [3.1.0] - 2025-09-09
155
+ ### Added
156
+ - Staff/TabConfig.name.
157
+ - DocumentBuilder.addStaffGroup().
158
+ - DocumentBuilder.addFermataTo(), .addNavigationTo(), .addAnnotationTo() and .addLabelTo().
159
+
160
+ ## [3.0.1] - 2025-09-03
161
+ ### Fixed
162
+ - Draw arpeggio curly arrow also to guitar tab.
163
+
164
+ ## [3.0.0] - 2025-08-31
165
+ Major update and brought some important changes.
166
+ ### **Breaking Changes**
167
+ - Removed old way of creating scores using MDocument, MMeasure, etc. Use DocumentBuilder instead.
168
+ - Removed DocumentOptions. Replaced using functions addScoreConfiguration() and setMeasuresPerRow() in DocumentBuilder.
169
+ - Tie and slur removed from NoteOptions. Use addConnective() in DocumentBuilder.
170
+
171
+ ### Added
172
+ - Score configuration with multiple staves and tabs per row.
173
+ - Connective.Slide.
174
+ - Draw Connectives in tabs.
175
+
176
+ ### Changed
177
+ - Lots of undocumented fixes, changes and improvements.
178
+
179
+ ## [2.0.0] - 2025-07-28
180
+ Major update and brought many changes.
181
+ ### **Breaking Changes**
182
+ - Use subpath modules. There is no main export.
183
+ - Refactored musical terms that were wrong (e.g. pitch => diatonicId, noteId => chromaticId).
184
+ - Score module stayed mostly same. Some changes (e.g. enum StaffKind => StaffPreset) but nothing major.
185
+ - Classical guitar audio was put into separate module (audio-cg) because it bundles over 1MB of audio
186
+ samples. Also improved default synthesizer audio.
187
+ - Numerous other unlisted changes/improvements/fixes.
188
+
189
+ ## [1.1.0] - 2025-07-03
190
+ ### Added
191
+ - Preliminary support for rendering guitar tabs.
192
+
193
+ ### Fixed
194
+ - Ties/slurs were created multiple times.
195
+ - Beams in first measure (upbeat) were not created correctly.
196
+ - Quite much refactoring for better code.
197
+
198
+ ## [1.0.0] - 2025-07-03
199
+ ### Added
200
+ - First release.
package/LICENSE CHANGED
@@ -1,4 +1,8 @@
1
- Copyright (c) 2023-2025 Web Music Score
1
+
2
+ This project is licensed under the terms of the MIT license.
3
+ See below for full license text and third-party licenses.
4
+
5
+ Copyright (c) 2023-2025 Stefan Brockmann
2
6
 
3
7
  Permission is hereby granted, free of charge, to any person obtaining
4
8
  a copy of this software and associated documentation files (the
@@ -18,3 +22,60 @@ Copyright (c) 2023-2025 Web Music Score
18
22
  CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19
23
  TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20
24
  SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25
+
26
+ ---
27
+
28
+ This project includes third-party code.
29
+
30
+ The following licenses apply to the bundled libraries, not to WebMusicScore itself.
31
+
32
+ ---
33
+
34
+ * Tone.js (https://github.com/Tonejs/Tone.js)
35
+
36
+ MIT License
37
+
38
+ Copyright (c) 2014-2020 Yotam Mann
39
+
40
+ Permission is hereby granted, free of charge, to any person obtaining a copy
41
+ of this software and associated documentation files (the "Software"), to deal
42
+ in the Software without restriction, including without limitation the rights
43
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
44
+ copies of the Software, and to permit persons to whom the Software is
45
+ furnished to do so, subject to the following conditions:
46
+
47
+ The above copyright notice and this permission notice shall be included in all
48
+ copies or substantial portions of the Software.
49
+
50
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
51
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
52
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
53
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
54
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
55
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
56
+ SOFTWARE.
57
+
58
+ ---
59
+
60
+ * Color Name to Code (https://github.com/simbo/color-name-to-code)
61
+
62
+ The MIT License (MIT)
63
+
64
+ Copyright © 2023 Simon Lepel <simbo@simbo.de>
65
+
66
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
67
+ this software and associated documentation files (the "Software"), to deal in
68
+ the Software without restriction, including without limitation the rights to
69
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
70
+ the Software, and to permit persons to whom the Software is furnished to do so,
71
+ subject to the following conditions:
72
+
73
+ The above copyright notice and this permission notice shall be included in all
74
+ copies or substantial portions of the Software.
75
+
76
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
77
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
78
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
79
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
80
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
81
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md CHANGED
@@ -1,4 +1,48 @@
1
1
  # Web Music Score
2
+ Web Music Score is a TypeScript/JavaScript music notation web component and player.
2
3
 
3
- This package name is reserved for the Web Music Score project,
4
- which is currently published under @tspro/web-music-score.
4
+ 📚 Full documentation: [web-music-score.org](https://web-music-score.org)
5
+
6
+ ## Install
7
+ ```bash
8
+ npm i web-music-score
9
+ ```
10
+
11
+ ## Quick Example
12
+ ```ts
13
+ import * as Score from "web-music-score/score";
14
+
15
+ const doc = new Score.DocumentBuilder()
16
+ .setScoreConfiguration("guitarTreble")
17
+ .addMeasure()
18
+ .setKeySignature("C Major")
19
+ .setTimeSignature("3/4")
20
+ .addNote(0, "C4", "4n")
21
+ .addNote(0, "E4", "4n")
22
+ .addNote(0, "G4", "4n")
23
+ .endSong()
24
+ .getDocument();
25
+
26
+ new Score.MRenderContext().
27
+ setCanvas("scoreCanvasId").
28
+ setDocument(doc).
29
+ draw();
30
+
31
+ new Score.MPlaybackButtons().
32
+ setPlayStopButton("playButtonId").
33
+ setDocument(doc);
34
+ ```
35
+
36
+ ## Report a Bug
37
+ Found a bug or have a feature suggestion?
38
+
39
+ [Please open an issue!](https://github.com/web-music-score/wms/issues/new/choose)
40
+
41
+ Thanks for helping improve the project!
42
+
43
+ ## License
44
+ This project is licensed under the [MIT License](https://mit-license.org/).
45
+
46
+ It also bundles the following libraries:
47
+ - [Tone.js](https://github.com/Tonejs/Tone.js) — [MIT License](https://opensource.org/license/mit)
48
+ - [Color Name to Code](https://github.com/simbo/color-name-to-code) — [MIT License](http://simbo.mit-license.org/)
@@ -0,0 +1,50 @@
1
+ import { N as Note } from '../note-RVXvpfyV.js';
2
+ import { I as Instrument } from '../instrument-DS-9C6_8.js';
3
+ export { l as linearToDecibels } from '../instrument-DS-9C6_8.js';
4
+
5
+ /**
6
+ * Get instrument name list.
7
+ * @returns - Array of available instrument names.
8
+ */
9
+ declare function getInstrumentList(): ReadonlyArray<string>;
10
+ /**
11
+ * Get current instrument name.
12
+ * @returns - Name of current instrument.
13
+ */
14
+ declare function getCurrentInstrument(): string;
15
+ /**
16
+ * Add and use instrument.
17
+ * @param instrument - Object that implements Instrument interface. Can be single instrument or array of instruments.
18
+ */
19
+ declare function addInstrument(instrument: Instrument | Instrument[]): void;
20
+ /**
21
+ * Set instrument to use in playback.
22
+ * @param instrumentName - Instrument name.
23
+ */
24
+ declare function useInstrument(instrumentName: string): void;
25
+ /**
26
+ * Play a note using current instrument.
27
+ * @param note - Note instance of Note object, note name (e.g. "C4"), or midiNumber.
28
+ * @param duration - Play duration in seconds.
29
+ * @param linearVolume - Linear volume in range [0, 1].
30
+ */
31
+ declare function playNote(note: Note | string | number, duration?: number, linearVolume?: number): void;
32
+ /**
33
+ * Stop playback on current instrument.
34
+ */
35
+ declare function stop(): void;
36
+ /**
37
+ * Mute playback on current instrument.
38
+ */
39
+ declare function mute(): void;
40
+ /**
41
+ * Unmute playback on current instrument.
42
+ */
43
+ declare function unmute(): void;
44
+ /**
45
+ * Is playback muted?
46
+ * @returns True/false.
47
+ */
48
+ declare function isMuted(): boolean;
49
+
50
+ export { Instrument, addInstrument, getCurrentInstrument, getInstrumentList, isMuted, mute, playNote, stop, unmute, useInstrument };