@barmark/render 0.6.0 → 0.7.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.
package/CHANGELOG.md CHANGED
@@ -6,6 +6,30 @@ package uses [semantic versioning](https://semver.org/).
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.7.1] - 2026-11-02
10
+
11
+ Requires `barmark` 0.8.0. No change to the renderer's code: it now reads
12
+ charts with `barmark` 0.8.0's rules (`(add9)` and friends inside
13
+ parentheses, the clearer empty-section message), so a page that installs
14
+ `barmark` 0.8.0 alongside it gets one copy instead of two.
15
+
16
+ ### Changed
17
+
18
+ - **Depends on `barmark` `^0.8.0`** (was `^0.7.0`, which in 0.x stops
19
+ short of 0.8.0 and made npm install a second, older copy for the
20
+ renderer).
21
+
22
+ ## [0.7.0] - 2026-11-02
23
+
24
+ Power chords in the numerals views. Requires `barmark` 0.7.0.
25
+
26
+ ### Changed
27
+
28
+ - **A power chord's 5 is raised in the numerals views:** D5 in D shows as
29
+ 1⁵ (Nashville) and I⁵ (Roman), G5(7) as 4⁵⁽⁷⁾. On the baseline the
30
+ Nashville 5 joined the number and read as 15. Chord names are
31
+ unchanged (D5).
32
+
9
33
  ## [0.6.0] - 2026-11-02
10
34
 
11
35
  Charts that scroll instead of wrapping. barmark.dev's home page uses it.
@@ -179,7 +203,9 @@ that needs no script or as the `<barmark-chart>` web component. Requires
179
203
  zoom without sideways scrolling, the element renders and re-renders, and
180
204
  a screen reader hears "bar 9: D". Run them with `bun run test:browser`.
181
205
 
182
- [Unreleased]: https://github.com/kevinpeckham/barmark/compare/render-v0.6.0...HEAD
206
+ [Unreleased]: https://github.com/kevinpeckham/barmark/compare/render-v0.7.1...HEAD
207
+ [0.7.1]: https://github.com/kevinpeckham/barmark/compare/render-v0.7.0...render-v0.7.1
208
+ [0.7.0]: https://github.com/kevinpeckham/barmark/compare/render-v0.6.0...render-v0.7.0
183
209
  [0.6.0]: https://github.com/kevinpeckham/barmark/compare/render-v0.5.0...render-v0.6.0
184
210
  [0.5.0]: https://github.com/kevinpeckham/barmark/compare/render-v0.4.0...render-v0.5.0
185
211
  [0.4.0]: https://github.com/kevinpeckham/barmark/compare/render-v0.3.0...render-v0.4.0
package/README.md CHANGED
@@ -88,10 +88,11 @@ played in, so a modulation renumbers from its next bar. Degrees count
88
88
  from the key's tonic against the major scale, in every mode: in `key:
89
89
  Am`, Am is 1m and C is ♭3. Nashville keeps the chord's quality and
90
90
  superscript after the number (Bm7 in D is 6m⁷, D/F♯ is 1/3); Roman
91
- shows minor and diminished in lower case (ii, vii°, ♭VII). A bar with
92
- no key, note sets, N.C., `?` and `--` look as they always do, and a
93
- screen reader hears both: "bar 5: five, A seven". Numbered chords carry
94
- `data-numeral`. It's a view: the music and bar numbers don't change.
91
+ shows minor and diminished in lower case (ii, vii°, ♭VII). Both raise a
92
+ power chord's 5 into the superscript (D5 in D is 1⁵ and I⁵, never 15).
93
+ A bar with no key, note sets, N.C., `?` and `--` look as they always
94
+ do, and a screen reader hears both: "bar 5: five, A seven". Numbered
95
+ chords carry `data-numeral`. It's a view: the music and bar numbers don't change.
95
96
 
96
97
  ### Spoken names
97
98
 
package/dist/chord.d.ts CHANGED
@@ -17,7 +17,8 @@ export declare const NUMERALS: readonly Numerals[];
17
17
  /**
18
18
  * A chord as its degree in `key`: Nashville keeps the chord's quality and
19
19
  * superscript after the number; Roman shows minor and diminished in lower
20
- * case. A slash bass is a number in both. Null if the root has no degree.
20
+ * case. Both raise a power chord's 5 into the superscript (1⁵, I⁵). A
21
+ * slash bass is a number in both. Null if the root has no degree.
21
22
  */
22
23
  export declare function typesetNumeral(parts: ChordParts, key: Key, style: Numerals): ChordPieces | null;
23
24
  /** A note set's label (`E1`, `F#`) as name and octave. */
package/dist/chord.js CHANGED
@@ -27,21 +27,25 @@ const ROMAN_QUALITY = {
27
27
  m: "",
28
28
  dim: "°",
29
29
  aug: "+",
30
- "5": "5",
30
+ // Raised into the superscript with the other numerals (raisePower).
31
+ "5": "",
31
32
  };
33
+ /** A power chord's 5 goes up with the superscript: on the baseline it joins the number (1 and 5 read as 15). */
34
+ const raisePower = (p) => p.quality === "5" ? { ...p, quality: "", superscript: `5${p.superscript}` } : p;
32
35
  const accidentals = (alter) => (alter < 0 ? "b" : "#").repeat(Math.abs(alter));
33
36
  /** `{ degree: 7, alter: -1 }` → `♭7`. */
34
37
  const degreeText = (d) => glyphs(`${accidentals(d.alter)}${d.degree}`);
35
38
  /**
36
39
  * A chord as its degree in `key`: Nashville keeps the chord's quality and
37
40
  * superscript after the number; Roman shows minor and diminished in lower
38
- * case. A slash bass is a number in both. Null if the root has no degree.
41
+ * case. Both raise a power chord's 5 into the superscript (1⁵, I⁵). A
42
+ * slash bass is a number in both. Null if the root has no degree.
39
43
  */
40
44
  export function typesetNumeral(parts, key, style) {
41
45
  const degree = degreeOf(parts.root, key);
42
46
  if (!degree)
43
47
  return null;
44
- const pieces = typesetChord(parts);
48
+ const pieces = raisePower(typesetChord(parts));
45
49
  const bass = parts.bass ? degreeOf(parts.bass, key) : null;
46
50
  const withBass = { ...pieces, bass: bass ? degreeText(bass) : pieces.bass };
47
51
  if (style === "nashville")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@barmark/render",
3
- "version": "0.6.0",
3
+ "version": "0.7.1",
4
4
  "description": "Render barmark chord charts as a clean, accessible bar grid: HTML with Declarative Shadow DOM, or the <barmark-chart> web component.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -47,7 +47,7 @@
47
47
  "url": "https://github.com/kevinpeckham/barmark/issues"
48
48
  },
49
49
  "dependencies": {
50
- "barmark": "^0.6.0"
50
+ "barmark": "^0.8.0"
51
51
  },
52
52
  "scripts": {
53
53
  "build": "rm -rf dist && tsc -p tsconfig.build.json",