@barmark/score 0.6.1 → 0.6.2

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 CHANGED
@@ -6,6 +6,18 @@ package uses [semantic versioning](https://semver.org/).
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.6.2] - 2026-11-18
10
+
11
+ ### Fixed
12
+
13
+ - **A lyric row's rhythm slashes sit on their line.** A chart with words
14
+ and no melody engraves the words on a one-line staff of slashes. Each
15
+ slash was drawn two steps above the line, with ledger lines through it,
16
+ which read as an unknown symbol. Verovio draws a one-line staff's line
17
+ where a treble staff has E4, and `@barmark/musicxml` writes the slash at
18
+ B4: the score now moves it for Verovio. The exported MusicXML is
19
+ unchanged.
20
+
9
21
  ## [0.6.1] - 2026-11-14
10
22
 
11
23
  ### Changed
@@ -302,7 +314,8 @@ First release.
302
314
  needs no config; Vite 7 needs `optimizeDeps.exclude` and
303
315
  `worker.format: "es"`.
304
316
 
305
- [Unreleased]: https://github.com/kevinpeckham/barmark/compare/score-v0.6.1...HEAD
317
+ [Unreleased]: https://github.com/kevinpeckham/barmark/compare/score-v0.6.2...HEAD
318
+ [0.6.2]: https://github.com/kevinpeckham/barmark/compare/score-v0.6.1...score-v0.6.2
306
319
  [0.6.1]: https://github.com/kevinpeckham/barmark/compare/score-v0.6.0...score-v0.6.1
307
320
  [0.6.0]: https://github.com/kevinpeckham/barmark/compare/score-v0.5.0...score-v0.6.0
308
321
  [0.5.0]: https://github.com/kevinpeckham/barmark/compare/score-v0.4.0...score-v0.5.0
package/dist/engrave.d.ts CHANGED
@@ -54,6 +54,8 @@ export declare const LAYOUT: {
54
54
  * The MusicXML as Verovio should read it. Verovio 6.4 appends every chord <degree> to the
55
55
  * kind text, `print-object="no"` or not, so a degree the text already spells is drawn twice
56
56
  * (`D7sus4(7)`); a degree that is not printed is dropped, which changes nothing it draws.
57
+ * And it draws a one-line staff's line where a treble staff has E4, so a lyric row's
58
+ * slashes, exported at B4, sat two steps above their line on ledger lines: they move to E4.
57
59
  */
58
60
  export declare function forVerovio(xml: string): string;
59
61
  /** MusicXML laid out for a width, every page as SVG in a `bms-score-page` div. Throws on unreadable XML. */
package/dist/engrave.js CHANGED
@@ -82,12 +82,21 @@ const DEFAULT_SCALE = 40;
82
82
  const MIN_WIDTH = 320;
83
83
  const HIDDEN_DEGREE = '<degree print-object="no">';
84
84
  const DEGREE_END = "</degree>";
85
+ /** Where `@barmark/musicxml` writes a rhythm staff's slash: the middle line of a five-line staff. */
86
+ const SLASH_AT_MIDDLE = "<unpitched><display-step>B</display-step><display-octave>4</display-octave></unpitched>";
87
+ /** Where Verovio draws a one-line staff's line: a treble staff's bottom line. */
88
+ const SLASH_ON_LINE = "<unpitched><display-step>E</display-step><display-octave>4</display-octave></unpitched>";
85
89
  /**
86
90
  * The MusicXML as Verovio should read it. Verovio 6.4 appends every chord <degree> to the
87
91
  * kind text, `print-object="no"` or not, so a degree the text already spells is drawn twice
88
92
  * (`D7sus4(7)`); a degree that is not printed is dropped, which changes nothing it draws.
93
+ * And it draws a one-line staff's line where a treble staff has E4, so a lyric row's
94
+ * slashes, exported at B4, sat two steps above their line on ledger lines: they move to E4.
89
95
  */
90
96
  export function forVerovio(xml) {
97
+ return withoutHiddenDegrees(xml).replaceAll(SLASH_AT_MIDDLE, SLASH_ON_LINE);
98
+ }
99
+ function withoutHiddenDegrees(xml) {
91
100
  // One pass with indexOf, never a backtracking regex: an opener with no closer ends the
92
101
  // search, so a hostile file of openers costs linear time, not a rescan per opener.
93
102
  const parts = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@barmark/score",
3
- "version": "0.6.1",
3
+ "version": "0.6.2",
4
4
  "description": "Show a barmark chord chart as a full engraved score: MusicXML from @barmark/musicxml, engraved by Verovio (LGPL-3.0, a dependency loaded unchanged).",
5
5
  "type": "module",
6
6
  "exports": {