vexflow 4.0.1-beta.0 → 4.0.1-rc.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/README.md +58 -56
- package/build/cjs/vexflow-bravura.js +2 -2
- package/build/cjs/vexflow-bravura.js.map +1 -1
- package/build/cjs/vexflow-core.js +2 -2
- package/build/cjs/vexflow-core.js.map +1 -1
- package/build/cjs/vexflow-debug-with-tests.js +846 -719
- package/build/cjs/vexflow-debug-with-tests.js.map +1 -1
- package/build/cjs/vexflow-debug.js +640 -632
- package/build/cjs/vexflow-debug.js.map +1 -1
- package/build/cjs/vexflow-font-gonville.js +1 -1
- package/build/cjs/vexflow-font-gonville.js.map +1 -1
- package/build/cjs/vexflow-gonville.js +2 -2
- package/build/cjs/vexflow-gonville.js.map +1 -1
- package/build/cjs/vexflow-petaluma.js +2 -2
- package/build/cjs/vexflow-petaluma.js.map +1 -1
- package/build/cjs/vexflow.js +2 -2
- package/build/cjs/vexflow.js.map +1 -1
- package/build/esm/entry/vexflow-bravura.js +1 -2
- package/build/esm/entry/vexflow-core.js +1 -2
- package/build/esm/entry/vexflow-debug-with-tests.js +9 -2
- package/build/esm/entry/vexflow-debug.js +7 -2
- package/build/esm/entry/vexflow-gonville.js +1 -2
- package/build/esm/entry/vexflow-petaluma.js +1 -2
- package/build/esm/entry/vexflow.js +1 -2
- package/build/esm/src/annotation.js +30 -5
- package/build/esm/src/articulation.js +5 -2
- package/build/esm/src/beam.js +18 -6
- package/build/esm/src/factory.js +6 -1
- package/build/esm/src/flow.js +27 -14
- package/build/esm/src/font.js +0 -2
- package/build/esm/src/fonts/gonville_glyphs.js +4 -4
- package/build/esm/src/formatter.js +21 -4
- package/build/esm/src/glyph.js +6 -0
- package/build/esm/src/index.js +1 -3
- package/build/esm/src/note.js +2 -2
- package/build/esm/src/staveline.js +2 -5
- package/build/esm/src/stavenote.js +83 -22
- package/build/esm/src/stavetext.js +3 -3
- package/build/esm/src/system.js +1 -8
- package/build/esm/src/textnote.js +12 -14
- package/build/esm/src/version.js +3 -3
- package/build/esm/tests/annotation_tests.js +14 -1
- package/build/esm/tests/beam_tests.js +19 -0
- package/build/esm/tests/easyscore_tests.js +5 -2
- package/build/esm/tests/formatter_tests.js +9 -8
- package/build/esm/tests/gracenote_tests.js +43 -0
- package/build/esm/tests/stave_tests.js +3 -3
- package/build/esm/tests/stavenote_tests.js +32 -0
- package/build/types/entry/vexflow-bravura.d.ts +1 -2
- package/build/types/entry/vexflow-core.d.ts +1 -2
- package/build/types/entry/vexflow-debug.d.ts +1 -2
- package/build/types/entry/vexflow-gonville.d.ts +1 -2
- package/build/types/entry/vexflow-petaluma.d.ts +1 -2
- package/build/types/entry/vexflow.d.ts +1 -2
- package/build/types/src/annotation.d.ts +1 -0
- package/build/types/src/beam.d.ts +30 -1
- package/build/types/src/easyscore.d.ts +4 -0
- package/build/types/src/factory.d.ts +4 -1
- package/build/types/src/flow.d.ts +27 -12
- package/build/types/src/font.d.ts +0 -1
- package/build/types/src/glyph.d.ts +2 -0
- package/build/types/src/index.d.ts +1 -3
- package/build/types/src/note.d.ts +2 -0
- package/build/types/src/staveline.d.ts +2 -5
- package/build/types/src/textnote.d.ts +4 -4
- package/entry/vexflow-bravura.ts +3 -3
- package/entry/vexflow-core.ts +3 -3
- package/entry/vexflow-debug-with-tests.ts +16 -2
- package/entry/vexflow-debug.ts +11 -3
- package/entry/vexflow-gonville.ts +3 -3
- package/entry/vexflow-petaluma.ts +3 -3
- package/entry/vexflow.ts +3 -3
- package/package.json +1 -1
- package/src/annotation.ts +38 -6
- package/src/articulation.ts +8 -2
- package/src/beam.ts +53 -6
- package/src/easyscore.ts +11 -1
- package/src/factory.ts +16 -2
- package/src/flow.ts +35 -20
- package/src/font.ts +0 -4
- package/src/fonts/gonville_glyphs.ts +4 -4
- package/src/formatter.ts +24 -8
- package/src/glyph.ts +8 -0
- package/src/index.ts +2 -7
- package/src/note.ts +4 -3
- package/src/staveline.ts +2 -5
- package/src/stavenote.ts +93 -25
- package/src/stavetext.ts +3 -3
- package/src/system.ts +1 -7
- package/src/textnote.ts +9 -11
package/README.md
CHANGED
|
@@ -1,67 +1,63 @@
|
|
|
1
|
-
# VexFlow
|
|
1
|
+
# VexFlow
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Copyright (c) 2010 Mohit Muthanna Cheppudira
|
|
3
|
+
VexFlow is an open-source library for rendering music notation. It is written in TypeScript (compiled to ES6), and outputs scores to HTML
|
|
4
|
+
Canvas and SVG, right in the browser. It also works in Node.js projects (e.g., a command line script to save a score as a PDF).
|
|
6
5
|
|
|
7
6
|
## Sponsor this Project
|
|
8
7
|
|
|
9
|
-
If you
|
|
10
|
-
|
|
11
|
-
## Need Help?
|
|
12
|
-
|
|
13
|
-
Ask on the [Vexflow Google Group](https://groups.google.com/forum/?fromgroups#!forum/vexflow).
|
|
14
|
-
|
|
15
|
-
## What is VexFlow?
|
|
8
|
+
If you find VexFlow useful, please consider sponsoring its development: https://github.com/sponsors/0xfe.
|
|
16
9
|
|
|
17
|
-
|
|
18
|
-
Canvas and SVG, and runs on all modern browsers.
|
|
10
|
+
## Version 3 → 4
|
|
19
11
|
|
|
20
|
-
|
|
12
|
+
As of this writing (March 2022), we are nearing the release of a new major version of VexFlow. The guide below refers to VexFlow 4 (the new version). If you need to work with the previous version, follow the [version 3.0.9 tutorial.](https://github.com/0xfe/vexflow/wiki/VexFlow-3.0.9-Tutorial)
|
|
21
13
|
|
|
22
14
|
## Quick Start
|
|
23
15
|
|
|
24
|
-
|
|
16
|
+
The quickest way to add VexFlow to an HTML page is via a `<script>` tag.
|
|
25
17
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
18
|
+
```html
|
|
19
|
+
<script src="https://cdn.jsdelivr.net/npm/vexflow/build/cjs/vexflow.js"></script>
|
|
20
|
+
<script>
|
|
21
|
+
// YOUR CODE GOES HERE
|
|
22
|
+
</script>
|
|
30
23
|
```
|
|
31
24
|
|
|
32
|
-
|
|
25
|
+
The URL above will work once VexFlow 4 is released. For now, insert `@beta` into the URL:
|
|
33
26
|
|
|
34
|
-
```
|
|
35
|
-
|
|
27
|
+
```html
|
|
28
|
+
<!-- BETA URL BELOW -->
|
|
29
|
+
<script src="https://cdn.jsdelivr.net/npm/vexflow@beta/build/cjs/vexflow.js"></script>
|
|
30
|
+
<script>
|
|
31
|
+
// YOUR CODE GOES HERE
|
|
32
|
+
</script>
|
|
36
33
|
```
|
|
37
34
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
Releases are served via CDN:
|
|
35
|
+
If your project uses a bundler, you can install VexFlow from npm:
|
|
41
36
|
|
|
42
|
-
|
|
37
|
+
```sh
|
|
38
|
+
npm install vexflow
|
|
39
|
+
```
|
|
43
40
|
|
|
44
|
-
|
|
45
|
-
- Debug: https://unpkg.com/vexflow@4.0.0/build/vexflow-debug.js
|
|
41
|
+
The command above currently installs the previous version (3.0.9). At the moment, add `@beta` to get VexFlow 4:
|
|
46
42
|
|
|
47
|
-
|
|
43
|
+
```sh
|
|
44
|
+
npm install vexflow@beta
|
|
45
|
+
```
|
|
48
46
|
|
|
49
|
-
|
|
50
|
-
- Debug: https://cdn.jsdelivr.net/npm/vexflow@4.0.0/build/vexflow-debug.js
|
|
47
|
+
[More details on integrating with VexFlow 4.](https://github.com/0xfe/vexflow/wiki/VexFlow-4-Tutorial)
|
|
51
48
|
|
|
52
|
-
|
|
49
|
+
## EasyScore
|
|
53
50
|
|
|
54
|
-
|
|
51
|
+
EasyScore is VexFlow's high-level API for creating music notation.
|
|
52
|
+
[See a running example here.](https://jsfiddle.net/2pbh9xq0/)
|
|
55
53
|
|
|
56
54
|
```javascript
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
const vf = new Vex.Flow.Factory({
|
|
55
|
+
const f = new Vex.Flow.Factory({
|
|
60
56
|
renderer: { elementId: 'boo', width: 500, height: 200 },
|
|
61
57
|
});
|
|
62
58
|
|
|
63
|
-
const score =
|
|
64
|
-
const system =
|
|
59
|
+
const score = f.EasyScore();
|
|
60
|
+
const system = f.System();
|
|
65
61
|
|
|
66
62
|
system
|
|
67
63
|
.addStave({
|
|
@@ -73,22 +69,21 @@ system
|
|
|
73
69
|
.addClef('treble')
|
|
74
70
|
.addTimeSignature('4/4');
|
|
75
71
|
|
|
76
|
-
|
|
72
|
+
f.draw();
|
|
77
73
|
```
|
|
78
74
|
|
|
79
|
-
Learn
|
|
75
|
+
[Learn more about EasyScore here.](https://github.com/0xfe/vexflow/wiki/Using-EasyScore)
|
|
80
76
|
|
|
81
|
-
|
|
77
|
+
## Native API
|
|
82
78
|
|
|
83
|
-
|
|
79
|
+
If you need more control, you can use the low-level VexFlow API.
|
|
80
|
+
Below, we render a stave using SVG. [See a running example here.](https://jsfiddle.net/j6dpazx2/)
|
|
84
81
|
|
|
85
82
|
```javascript
|
|
86
|
-
import Vex from 'vexflow';
|
|
87
|
-
|
|
88
83
|
const VF = Vex.Flow;
|
|
89
84
|
|
|
90
|
-
// Create an SVG renderer and attach it to the DIV element named "
|
|
91
|
-
const div = document.getElementById('
|
|
85
|
+
// Create an SVG renderer and attach it to the DIV element named "output".
|
|
86
|
+
const div = document.getElementById('output');
|
|
92
87
|
const renderer = new VF.Renderer(div, VF.Renderer.Backends.SVG);
|
|
93
88
|
|
|
94
89
|
// Configure the rendering context.
|
|
@@ -106,15 +101,27 @@ stave.addClef('treble').addTimeSignature('4/4');
|
|
|
106
101
|
stave.setContext(context).draw();
|
|
107
102
|
```
|
|
108
103
|
|
|
109
|
-
##
|
|
104
|
+
## Examples
|
|
110
105
|
|
|
111
|
-
|
|
106
|
+
- Take a look at [the VexFlow tutorial](https://github.com/0xfe/vexflow/wiki/Tutorial).
|
|
112
107
|
|
|
113
|
-
|
|
108
|
+
- Dig into [the unit tests](https://github.com/0xfe/vexflow/tree/master/tests).
|
|
114
109
|
|
|
115
|
-
|
|
110
|
+
## Need Help?
|
|
111
|
+
|
|
112
|
+
Ask on the [Vexflow Google Group](https://groups.google.com/forum/?fromgroups#!forum/vexflow).
|
|
113
|
+
|
|
114
|
+
## More Resources
|
|
115
|
+
|
|
116
|
+
- Learn and contribute. Check out the [VexFlow Wiki](https://github.com/0xfe/vexflow/wiki).
|
|
117
|
+
|
|
118
|
+
- Build VexFlow from scratch. Read the [Build Instructions](https://github.com/0xfe/vexflow/wiki/Build%2C-Test%2C-Release).
|
|
116
119
|
|
|
117
|
-
|
|
120
|
+
- [VexFlow Home](https://vexflow.com)
|
|
121
|
+
|
|
122
|
+
- VexFlow Founder: [Mohit Muthanna Cheppudira](https://muthanna.com)
|
|
123
|
+
|
|
124
|
+
# MIT License
|
|
118
125
|
|
|
119
126
|
Copyright (c) Mohit Muthanna Cheppudira 2010 <br/>
|
|
120
127
|
0xFE <mohit@muthanna.com> https://www.vexflow.com
|
|
@@ -136,8 +143,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
136
143
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
137
144
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
138
145
|
THE SOFTWARE.
|
|
139
|
-
|
|
140
|
-
## Links
|
|
141
|
-
|
|
142
|
-
- [VexFlow Home](https://vexflow.com)
|
|
143
|
-
- [Me](https://muthanna.com)
|