vexflow 5.5.0 → 5.6.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.
Files changed (92) hide show
  1. package/build/cjs/vexflow-bravura.js +2 -2
  2. package/build/cjs/vexflow-bravura.js.map +1 -1
  3. package/build/cjs/vexflow-core.js +2 -2
  4. package/build/cjs/vexflow-core.js.map +1 -1
  5. package/build/cjs/vexflow-debug-with-tests.js +692 -309
  6. package/build/cjs/vexflow-debug-with-tests.js.map +1 -1
  7. package/build/cjs/vexflow-debug.js +551 -253
  8. package/build/cjs/vexflow-debug.js.map +1 -1
  9. package/build/cjs/vexflow.js +2 -2
  10. package/build/cjs/vexflow.js.map +1 -1
  11. package/build/esm/src/annotation.js +2 -1
  12. package/build/esm/src/continuouslayout.js +107 -16
  13. package/build/esm/src/continuousspan.js +6 -1
  14. package/build/esm/src/easyscore/composition.js +83 -18
  15. package/build/esm/src/factory.js +2 -9
  16. package/build/esm/src/formatter.js +1 -1
  17. package/build/esm/src/fretdiagram.js +6 -2
  18. package/build/esm/src/gracenotegroup.js +4 -3
  19. package/build/esm/src/guitarmodifiers.js +4 -1
  20. package/build/esm/src/metrics.js +24 -5
  21. package/build/esm/src/note.js +1 -0
  22. package/build/esm/src/notehead.js +21 -10
  23. package/build/esm/src/phraselayout.js +13 -5
  24. package/build/esm/src/publicationview.js +3 -2
  25. package/build/esm/src/stave.js +4 -2
  26. package/build/esm/src/stavenote.js +56 -13
  27. package/build/esm/src/stavesection.js +15 -10
  28. package/build/esm/src/stavetie.js +3 -2
  29. package/build/esm/src/strokes.js +1 -1
  30. package/build/esm/src/svgcontext.js +11 -3
  31. package/build/esm/src/tabnote.js +6 -8
  32. package/build/esm/src/tabtie.js +3 -0
  33. package/build/esm/src/version.js +3 -3
  34. package/build/esm/tests/chordsymbol_tests.js +4 -1
  35. package/build/esm/tests/demo_repertoire_tests.js +1 -1
  36. package/build/esm/tests/demos/electric.js +1 -3
  37. package/build/esm/tests/demos/greensleeves.js +1 -2
  38. package/build/esm/tests/demos/kesh.js +2 -3
  39. package/build/esm/tests/demos/saints.js +17 -5
  40. package/build/esm/tests/engraving/continuous-studies.mjs +24 -0
  41. package/build/esm/tests/engraving/publication-studies.mjs +30 -0
  42. package/build/esm/tests/font_tests.js +8 -0
  43. package/build/esm/tests/gracetabnote_tests.js +19 -3
  44. package/build/esm/tests/node/chord-kerning-tests.mjs +2 -2
  45. package/build/esm/tests/node/continuous-score-tests.mjs +157 -2
  46. package/build/esm/tests/node/easyscore-tests.mjs +38 -0
  47. package/build/esm/tests/node/engraving-layout-tests.mjs +33 -0
  48. package/build/esm/tests/node/instrument-profile-tests.mjs +40 -0
  49. package/build/esm/tests/node/local-engraving-tests.mjs +58 -0
  50. package/build/esm/tests/node/metrics-tests.mjs +2 -0
  51. package/build/esm/tests/node/phrase-layout-tests.mjs +58 -5
  52. package/build/esm/tests/node/publication-tests.mjs +146 -4
  53. package/build/esm/tests/node/svg-export-tests.mjs +50 -21
  54. package/build/esm/tests/scores/electric.js +3 -4
  55. package/build/esm/tests/scores/kesh.js +1 -1
  56. package/build/esm/tests/scores/saints.js +10 -8
  57. package/build/esm/tests/scores/sumer.js +3 -1
  58. package/build/esm/tests/tabnote_tests.js +43 -0
  59. package/build/esm/tests/vexflow_test_helpers.js +1 -0
  60. package/build/esm/tools/explorer/catalog/expression.mjs +16 -6
  61. package/build/esm/tools/explorer/catalog/guitar.mjs +2 -2
  62. package/build/types/src/continuouslayout.d.ts +4 -0
  63. package/build/types/src/continuousspan.d.ts +8 -2
  64. package/build/types/src/easyscore/composition.d.ts +19 -0
  65. package/build/types/src/fretdiagram.d.ts +2 -0
  66. package/build/types/src/instrumentprofile.d.ts +4 -0
  67. package/build/types/src/note.d.ts +2 -0
  68. package/build/types/src/notehead.d.ts +2 -0
  69. package/build/types/src/stave.d.ts +4 -2
  70. package/build/types/src/stavenote.d.ts +10 -0
  71. package/build/types/src/stavesection.d.ts +3 -0
  72. package/build/types/src/svgcontext.d.ts +2 -0
  73. package/build/types/src/typeguard.d.ts +1 -0
  74. package/changelog/CHANGELOG.md +8 -0
  75. package/package.json +1 -1
  76. package/tests/demos/electric.ts +1 -3
  77. package/tests/demos/electric.webp +0 -0
  78. package/tests/demos/greensleeves.ts +1 -3
  79. package/tests/demos/greensleeves.webp +0 -0
  80. package/tests/demos/kesh.ts +2 -4
  81. package/tests/demos/kesh.webp +0 -0
  82. package/tests/demos/saints.ts +20 -7
  83. package/tests/demos/saints.webp +0 -0
  84. package/tests/scores/electric.js +6 -4
  85. package/tests/scores/electric.webp +0 -0
  86. package/tests/scores/falseta.webp +0 -0
  87. package/tests/scores/kesh.js +1 -2
  88. package/tests/scores/kesh.webp +0 -0
  89. package/tests/scores/saints.js +11 -8
  90. package/tests/scores/saints.webp +0 -0
  91. package/tests/scores/sumer.js +8 -3
  92. package/tests/scores/sumer.webp +0 -0
@@ -34,6 +34,7 @@ export declare class FrettedInstrument {
34
34
  offset: Fraction;
35
35
  note: {
36
36
  notation: NotationIdentity[];
37
+ restLine?: number;
37
38
  musicFont?: string;
38
39
  engraving?: import("./engravingprofile").EngravingProfile;
39
40
  stemDirection?: number;
@@ -52,6 +53,7 @@ export declare class FrettedInstrument {
52
53
  tab: {
53
54
  notation: NotationIdentity[];
54
55
  positions: import("./tabnote").TabNotePosition[];
56
+ restLine?: number;
55
57
  musicFont?: string;
56
58
  engraving?: import("./engravingprofile").EngravingProfile;
57
59
  stemDirection?: number;
@@ -75,6 +77,7 @@ export declare class FrettedInstrument {
75
77
  }[], duration: string, spec: TimedStringBend): {
76
78
  note: {
77
79
  notation: NotationIdentity[];
80
+ restLine?: number;
78
81
  musicFont?: string;
79
82
  engraving?: import("./engravingprofile").EngravingProfile;
80
83
  stemDirection?: number;
@@ -93,6 +96,7 @@ export declare class FrettedInstrument {
93
96
  tab: {
94
97
  notation: NotationIdentity[];
95
98
  positions: import("./tabnote").TabNotePosition[];
99
+ restLine?: number;
96
100
  musicFont?: string;
97
101
  engraving?: import("./engravingprofile").EngravingProfile;
98
102
  stemDirection?: number;
@@ -95,6 +95,8 @@ export declare abstract class Note extends Tickable {
95
95
  protected static parseNoteStruct(noteStruct: NoteStruct): ParsedNote | undefined;
96
96
  /** Source identities survive native drawing, Canvas inspection and print export. */
97
97
  readonly notation: readonly NotationIdentity[];
98
+ /** Augmentation dots in the written duration, independent of tick overrides or modifiers. */
99
+ readonly writtenDots: number;
98
100
  glyphProps: GlyphProps;
99
101
  keys: string[];
100
102
  keyProps: KeyProps[];
@@ -34,6 +34,8 @@ export declare class NoteHead extends Note {
34
34
  protected slashed: boolean;
35
35
  protected ledger: Record<string, string>;
36
36
  constructor(noteStruct: NoteHeadStruct);
37
+ /** Select the supporting ledger at the actual note position, preserving custom head glyphs. */
38
+ private updateRestGlyph;
37
39
  /** Get the width of the notehead. */
38
40
  getWidth(): number;
39
41
  /** Determine if the notehead is displaced. */
@@ -34,8 +34,10 @@ export declare class Stave extends Element {
34
34
  protected endClef?: string;
35
35
  protected formatted: boolean;
36
36
  private boundaryModifiers;
37
- /** Replace only the derived row-start and courtesy signs on a responsive sheet. */
38
- setBoundaryModifiers(modifiers: StaveModifier[]): void;
37
+ /** Space after the row-start signs for a continuation arriving at the first note. */
38
+ private boundaryNotePadding;
39
+ /** Replace the derived row-start and courtesy signs and their note clearance. */
40
+ setBoundaryModifiers(modifiers: StaveModifier[], notePadding?: number): void;
39
41
  protected measure: number;
40
42
  protected bounds: Bounds;
41
43
  protected readonly modifiers: StaveModifier[];
@@ -33,6 +33,8 @@ export interface StaveNoteFormatSettings {
33
33
  note: StaveNote;
34
34
  }
35
35
  export interface StaveNoteStruct extends NoteStruct {
36
+ /** Fixed rest position in key-line coordinates. On a five-line stave, 1 is the bottom line. */
37
+ restLine?: number;
36
38
  /** Override the music glyph family for this note, its heads and its flag. */
37
39
  musicFont?: string;
38
40
  engraving?: EngravingProfile;
@@ -55,6 +57,8 @@ export declare class StaveNote extends StemmableNote {
55
57
  maxLine: number;
56
58
  protected readonly clef: string;
57
59
  protected readonly octaveShift?: number;
60
+ /** Preserve the previous line so releasing an explicit position restores automatic placement. */
61
+ private lineBeforeRestPin?;
58
62
  protected displaced: boolean;
59
63
  protected dotShiftY: number;
60
64
  protected useDefaultHeadX: boolean;
@@ -86,6 +90,8 @@ export declare class StaveNote extends StemmableNote {
86
90
  isChord(): boolean;
87
91
  hasStem(): boolean;
88
92
  hasFlag(): boolean;
93
+ /** Use explicit font metadata first, then the bundled anchors for Bravura rhythm slashes. */
94
+ private stemAnchor;
89
95
  getStemX(): number;
90
96
  getYForTopText(textLine: number): number;
91
97
  getYForBottomText(textLine: number): number;
@@ -111,6 +117,10 @@ export declare class StaveNote extends StemmableNote {
111
117
  /** Get the glyph width. */
112
118
  getGlyphWidth(): number;
113
119
  setKeyStyle(index: number, style: ElementStyle): this;
120
+ /** The explicit key line, or undefined when rest placement is automatic. */
121
+ get restLine(): number | undefined;
122
+ /** Pin this rest to a line. Passing undefined releases it for automatic placement. */
123
+ setRestLine(line: number | undefined): this;
114
124
  setKeyLine(index: number, line: number): this;
115
125
  getKeyLine(index: number): number;
116
126
  getVoiceShiftWidth(): number;
@@ -1,8 +1,11 @@
1
+ import { BoundingBox } from './boundingbox';
1
2
  import { StaveModifier } from './stavemodifier';
2
3
  export declare class StaveSection extends StaveModifier {
3
4
  static get CATEGORY(): string;
4
5
  protected drawRect: boolean;
5
6
  constructor(section: string, x?: number, yShift?: number, drawRect?: boolean);
6
7
  setDrawRect(drawRect: boolean): this;
8
+ /** Report the same ink and padding before drawing as after a stave has moved. */
9
+ getBoundingBox(): BoundingBox;
7
10
  draw(): void;
8
11
  }
@@ -12,6 +12,8 @@ export type Attributes = {
12
12
  scaleY?: number;
13
13
  };
14
14
  export interface State {
15
+ /** Font shorthand returned by getFont() at the matching save(). */
16
+ font?: string;
15
17
  state: Attributes;
16
18
  attributes: Attributes;
17
19
  }
@@ -46,6 +46,7 @@ export declare const enum Category {
46
46
  Element = "Element",
47
47
  Flag = "Flag",
48
48
  Fraction = "Fraction",
49
+ FretDiagram = "FretDiagram",
49
50
  FretHandFinger = "FretHandFinger",
50
51
  GhostNote = "GhostNote",
51
52
  Glyph = "Glyph",
@@ -1,3 +1,11 @@
1
+ # 5.6.0
2
+
3
+ - Chord roots use 14 pt Academico, lyrics use 12 pt, and tab frets use 11 pt. Grace frets, stroke arrows, and technique labels have room around two-digit frets. See both arrow conventions in [Patio al alba](https://github.com/vexflow/vexflow/blob/5.6.0/tests/scores/falseta.js).
4
+ - EasyScore can tie a fret on a specific string across a system break and carry repeat endings into an extracted guitar part. Structured notes and rhythmic tab now engrave their written augmentation dots.
5
+ - Lead sheets preserve authored barlines and time-signature visibility in print. Rest ledger lines follow explicit rest positions, and rhythm slashes use Bravura’s stem anchors.
6
+ - Explore the [user guide](https://vexflow.com/guide/), [notation Explorer](https://vexflow.com/explorer/), [test gallery](https://vexflow.com/tests/), and [PDF score library](https://vexflow.com/pdfs/).
7
+ - See the [illustrated AI 2026 report](https://vexflow.com/reports/ai2026/) and the [5.6.0 code quality report](https://vexflow.com/reports/5.6.0/).
8
+
1
9
  # 5.5.0
2
10
 
3
11
  - Preserve EasyScore note decorations in printed scores, parts, and cues with `PublicationOptions.noteHooks`. Invisible pointer targets no longer affect page breaks.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vexflow",
3
- "version": "5.5.0",
3
+ "version": "5.6.0",
4
4
  "description": "A JavaScript library for rendering music notation and guitar tablature.",
5
5
  "exports": {
6
6
  ".": {
@@ -33,9 +33,7 @@ export function electric(options: TestOptions): void {
33
33
  if (i === 0) stave.addTimeSignature('4/4').setTempo({ duration: 'q', bpm: 96 }, -8);
34
34
  if (i === 3) stave.setEndBarType(BarlineType.END);
35
35
  const legato = (start: number, label: string) =>
36
- score.make
37
- .tabTie({ firstNote: notes[start], lastNote: notes[start + 1] }, label)
38
- .setFont('Arial, Helvetica, sans-serif', 9, 'bold');
36
+ score.make.tabTie({ firstNote: notes[start], lastNote: notes[start + 1] }, label);
39
37
  if (i === 0) {
40
38
  score.beam(notes.slice(1, 3));
41
39
  legato(1, 'H');
Binary file
@@ -28,8 +28,6 @@ const positions: Record<string, [number, number]> = {
28
28
  export function greensleeves(options: TestOptions): void {
29
29
  const f = VexFlowTests.makeFactory(options, 900, 486);
30
30
  const score = f.EasyScore({ throwOnError: true });
31
- // Upright sans-serif chord names sit above the melody, including the slash bass in Dm/F.
32
- const chordFont = { fontFamily: 'Arial, Helvetica, sans-serif', fontSize: 12 };
33
31
  const bars = [
34
32
  ['', 'A4/q'],
35
33
  ['Am', 'A3+E4+A4+C5/h D5/q'],
@@ -56,7 +54,7 @@ export function greensleeves(options: TestOptions): void {
56
54
  return `${chord}/${duration}`;
57
55
  });
58
56
  const notes = score.notes(music.join(', '));
59
- if (chordName) notes[0].addModifier(score.make.chordSymbol(chordFont).addText(chordName));
57
+ if (chordName) notes[0].addModifier(score.make.chordSymbol().addText(chordName));
60
58
  const tab = events.map(({ pitches, duration }) =>
61
59
  score.make.tabNote({
62
60
  positions: pitches.map((pitch) => {
Binary file
@@ -11,8 +11,6 @@ export function kesh(options: TestOptions): void {
11
11
  const f = VexFlowTests.makeFactory(options, 900, 580);
12
12
  const score = f.EasyScore({ throwOnError: true });
13
13
  score.set({ time: '6/8' });
14
- // Use the same upright lettering for a change on either beat of the bar.
15
- const chordFont = { fontFamily: 'Arial, Helvetica, sans-serif', fontSize: 12 };
16
14
  // The McNeela chart suggests two changes within some bars and different pickups at the repeats.
17
15
  const strains: JigBar[][] = [
18
16
  [
@@ -54,8 +52,8 @@ export function kesh(options: TestOptions): void {
54
52
  for (const beat of beats) {
55
53
  if (beat.length === 3) score.beam(beat);
56
54
  }
57
- if (chord) beats[0][0].addModifier(score.make.chordSymbol(chordFont).addText(chord));
58
- if (nextChord) beats[1][0].addModifier(score.make.chordSymbol(chordFont).addText(nextChord));
55
+ if (chord) beats[0][0].addModifier(score.make.chordSymbol().addText(chord));
56
+ if (nextChord) beats[1][0].addModifier(score.make.chordSymbol().addText(nextChord));
59
57
  if (i === 0 || i === 4) {
60
58
  const grace = score.make.graceNote({ keys: [part ? 'd/5' : 'b/4'], duration: '8', slash: true });
61
59
  notes[1].addModifier(score.make.graceNoteGroup({ notes: [grace], slur: true }));
Binary file
@@ -3,10 +3,19 @@ import { TestOptions, VexFlowTests } from '../vexflow_test_helpers';
3
3
 
4
4
  import { BarlineType, ChordSymbol, StemmableNote } from '../../src/index';
5
5
 
6
+ import { Metrics } from '../../src/metrics';
7
+
6
8
  /** Render a compact, sixteen-bar setting of the traditional refrain, with its three-note pickup. */
7
9
  export function saints(options: TestOptions): void {
8
10
  const factory = VexFlowTests.makeFactory(options, 900, 540);
9
11
  const score = factory.EasyScore({ throwOnError: true });
12
+ const lyricFont = Metrics.getFontInfo('Annotation.lyric');
13
+ // Use the same baseline throughout each row, below the pickup's low C.
14
+ const word = (text: string, rowY: number) =>
15
+ factory
16
+ .Annotation({ text, font: lyricFont, vJustify: 'bottom' })
17
+ .setTextBaseline(rowY + 116)
18
+ .setConnectorPadding(2);
10
19
  const bars = [
11
20
  ['G4/w', 'saints', 'C:6/9'],
12
21
  ['B4/q/r, C4/q, E4, F4', '|go|march-|ing', 'Am:7'],
@@ -28,27 +37,30 @@ export function saints(options: TestOptions): void {
28
37
  // The first system includes a short anacrusis before its four complete measures.
29
38
  const pickup = score.notes('C4/q, E4, F4');
30
39
  const pickupLabels = ['Oh', 'when', 'the'];
31
- pickup.forEach((note, i) =>
32
- note.addModifier(factory.Annotation({ text: pickupLabels[i], vJustify: 'bottom' }).setTextBaseline(123))
33
- );
40
+ pickup.forEach((note, i) => note.addModifier(word(pickupLabels[i], 16)));
41
+ const pickupWidth = 210;
34
42
  factory
35
- .System({ x: 10, y: 16, width: 180 })
43
+ .System({ x: 10, y: 16, width: pickupWidth })
36
44
  .addStave({ voices: [score.voice(pickup, { time: '3/4' })] })
37
45
  .addClef('treble')
38
46
  .addTimeSignature('4/4');
39
47
 
48
+ // The first row shares space between the pickup, two single-word bars and two busier bars.
49
+ const openingWidths = [120, 212, 122, 212];
50
+ let x = 10 + pickupWidth;
40
51
  let sustained: StemmableNote | undefined;
41
52
  bars.forEach(([music, words, harmony], i) => {
42
53
  const row = Math.floor(i / 4);
43
54
  const column = i % 4;
44
55
  const y = 16 + row * 130;
45
- const width = row === 0 ? 174 : 219;
56
+ if (column === 0 && row > 0) x = 10;
57
+ const width = row === 0 ? openingWidths[column] : 219;
46
58
  const notes = score.notes(music);
47
59
  // Carry the sustained D and the final tonic across the barline without repeating a syllable.
48
60
  if (i === 5 || i === 14) sustained = notes[0];
49
61
  if ((i === 6 || i === 15) && sustained) score.make.tie({ from: sustained, to: notes[0] });
50
62
  words.split('|').forEach((text, n) => {
51
- if (text) notes[n].addModifier(factory.Annotation({ text, vJustify: 'bottom' }).setTextBaseline(y + 107));
63
+ if (text) notes[n].addModifier(word(text, y));
52
64
  });
53
65
  // Split the chord into root and extension so Petaluma supplies proper accidental glyphs.
54
66
  if (harmony) {
@@ -60,8 +72,9 @@ export function saints(options: TestOptions): void {
60
72
  notes[0].addModifier(chord);
61
73
  }
62
74
  const stave = factory
63
- .System({ x: (row === 0 ? 190 : 10) + column * width, y, width })
75
+ .System({ x, y, width })
64
76
  .addStave({ voices: [score.voice(notes, { time: i === 15 ? '1/4' : '4/4' })] });
77
+ x += width;
65
78
  if (column === 0 && row > 0) stave.addClef('treble');
66
79
  if (i === bars.length - 1) stave.setEndBarType(BarlineType.END);
67
80
  });
Binary file
@@ -74,14 +74,16 @@
74
74
  ])
75
75
  upper(m, i).addModifier(score.make.fingering({ number, position: 'left' }));
76
76
  const tap = (i) => c.getNote('tab-7-0-' + i);
77
- tap(1).addModifier(score.make.annotation({ text: 'T', vJustify: 'top' }).setFont('Arial', 10, 'bold'));
77
+ // The tapped attack appears on both staves. Only the tab uses the sans-serif technique alphabet.
78
+ upper(7, 1).addModifier(
79
+ score.make.annotation({ text: 'T', vJustify: 'top', font: { size: 11, weight: 'bold' } })
80
+ );
81
+ tap(1).addModifier(score.make.annotation({ text: 'T', vJustify: 'top' }).setFont('Arial', 11, 'bold'));
78
82
  for (const [i, text] of [
79
83
  [1, 'P'],
80
84
  [2, 'H'],
81
85
  ])
82
- score.make
83
- .tabTie({ firstNote: tap(i), lastNote: tap(i + 1), firstIndexes: [0], lastIndexes: [0] }, text)
84
- .setFont('Arial', 10, 'bold');
86
+ score.make.tabTie({ firstNote: tap(i), lastNote: tap(i + 1), firstIndexes: [0], lastIndexes: [0] }, text);
85
87
  tap(3).addModifier(score.make.vibrato());
86
88
  },
87
89
  };
Binary file
Binary file
@@ -36,8 +36,7 @@
36
36
  /** Build the native marks in the factory that owns this particular score or cue. */
37
37
  function fiddleMarks({ chord, cut }, note, builder) {
38
38
  const f = builder.getFactory();
39
- if (chord)
40
- note.addModifier(f.ChordSymbol({ fontFamily: 'Arial, Helvetica, sans-serif', fontSize: 12 }).addText(chord));
39
+ if (chord) note.addModifier(f.ChordSymbol().addText(chord));
41
40
  if (cut) {
42
41
  const grace = f.GraceNote({ keys: [cut], duration: '8', slash: true });
43
42
  note.addModifier(f.GraceNoteGroup({ notes: [grace], slur: true }));
Binary file
@@ -7,7 +7,7 @@
7
7
  const choices = ['Reharmonized', 'Traditional'];
8
8
  const control = 'Harmony';
9
9
  const focus = 'v6-0';
10
- const fonts = ['Petaluma', 'Petaluma Script'];
10
+ const fonts = ['Petaluma', 'Academico'];
11
11
 
12
12
  // The opening pickup and final quarter together complete a bar.
13
13
  const bars = [
@@ -17,7 +17,7 @@
17
17
  ['G4/w', 'in', 'C', 'Dm:11'],
18
18
  ['B4/q/r, C4/q, E4, F4', '_ Oh when the', 'C', 'G:13'],
19
19
  ['G4/q, E4, C4, E4', 'saints go march- ing', 'C', 'C:maj9'],
20
- ['D4/w', '', 'G:7', 'Am:11'],
20
+ ['D4/w', 'in', 'G:7', 'Am:11'],
21
21
  ['D4/w', '', 'G:7', 'D:9'],
22
22
  ['B4/q/r, E4/q, E4, D4', '_ Oh Lord I', 'G:7', 'G:13'],
23
23
  ['C4/h, C4/q, E4', 'want to be', 'C', 'Gm:13'],
@@ -26,12 +26,11 @@
26
26
  ['B4/q/r, C4/q, E4, F4', '_ Oh when the', 'F', 'Fm:maj7'],
27
27
  ['G4/h, E4/q, C4', 'saints go march-', 'C', 'Em:7'],
28
28
  ['D4/w', 'ing', 'G:7', 'Db:7b9'],
29
- ['C4/w', '', 'C', 'C:6/9'],
29
+ ['C4/w', 'in', 'C', 'C:6/9'],
30
30
  ['C4/q', '', '', ''],
31
31
  ];
32
32
 
33
33
  function create(VF, score, choice) {
34
- const lyricSize = 15;
35
34
  const measures = bars.map(([music], m) => ({
36
35
  span: m === 0 ? '3/4' : m === 16 ? '1/4' : undefined,
37
36
  voices: [
@@ -43,13 +42,14 @@
43
42
  },
44
43
  ],
45
44
  }));
46
- const spans = [6, 15].flatMap((m) =>
45
+ const heldBars = [6, 15];
46
+ const spans = heldBars.flatMap((m) =>
47
47
  ['lyric', 'tie'].map((kind) => ({
48
48
  id: kind + m,
49
49
  kind,
50
50
  from: 'v' + m + '-0',
51
51
  to: 'v' + (m + 1) + '-0',
52
- ...(kind === 'lyric' ? { text: 'in', labelFontSize: lyricSize } : {}),
52
+ ...(kind === 'lyric' ? { syllableId: 'held-in-' + m } : {}),
53
53
  }))
54
54
  );
55
55
  return {
@@ -70,8 +70,11 @@
70
70
  text && text !== '_' ? [{ text, note: composition.getNote('v' + m + '-' + i) }] : []
71
71
  );
72
72
  if (syllables.length) {
73
- const verse = composition.systems[m].getPhraseLayout().addVerse(composition.staves[m][0], syllables);
74
- for (const syllable of verse) syllable.setFontSize(lyricSize);
73
+ // A single verse line sits below the lowest pickup. Hold the vowel across the next bar.
74
+ const words = composition.systems[m].getPhraseLayout().addVerse(composition.staves[m][0], syllables, {
75
+ baselineSpaces: 7.5,
76
+ });
77
+ if (heldBars.includes(m)) words[0].setAttribute('id', 'held-in-' + m);
75
78
  }
76
79
  });
77
80
  },
Binary file
@@ -121,10 +121,15 @@
121
121
  note(23).addModifier(score.make.articulation({ type: 'a@a', position: 'above' }));
122
122
  }
123
123
  for (const { m, staff, syllables } of verses) {
124
- c.systems[m].getPhraseLayout().addVerse(
125
- c.staves[m][staff],
126
- syllables.map(([id, text]) => ({ note: c.getNote(id), text }))
124
+ // Keep each singer’s line level through the lowest stems, including in the extracted part.
125
+ const stave = c.staves[m][staff];
126
+ const words = c.systems[m].getPhraseLayout().addVerse(
127
+ stave,
128
+ syllables.map(([id, text]) => ({ note: c.getNote(id), text })),
129
+ { baselineSpaces: 7.75 }
127
130
  );
131
+ // Give the short syllables on consecutive eighth notes room to read as separate words.
132
+ words.forEach((word) => word.setConnectorPadding(stave.space(0.2)));
128
133
  }
129
134
  },
130
135
  };
Binary file