Hallo,
hier mein Versuch "Gloria Patri" zu setzen.
Meine 'foo'-Funktion (kann man ja umbenennen) erstellt einen Akkord mit via X-offset verschobenen Notenköpfen.
Solange ich kein Beispiel habe warum das nicht funktionieren soll, komm' ich immer wieder darauf zurück.

So kann man auch ein anderes Ergebnis für \foo { c d } und \foo { d c } bekommen.
Natürlich ergibt sich das Problem das man den Text angemessen ausrichten muß.
Um den Text zentriert unter einen solchen "ausgefranzten" Akkord, genauer die NoteColumn, zu bekommen, setze ich:
\override LyricText.X-align-on-main-noteheads = ##f
Allerdings ist das nicht immer gewollt. Um das parent für den Text auf die erste (getippte) Note zu bekommen setze ich dann:
\alignOnFirstNote
vor die entsprechnede Silbe.
Hier der komplette Code. PNG im Anhang.
\version "2.19.22"
#(set-default-paper-size "a5")
foo =
#(define-music-function (p l music)(ly:music?)
"Return an event-chord with offsetted NoteHeads"
(let* ((ev-notes (event-chord-notes music)))
(make-event-chord
(map
(lambda (ecn val) #{ \tweak X-offset $val $ecn #})
ev-notes (iota (length ev-notes) 0 1.4)))))
setOtherParent =
#(define-music-function (parser location which-note-head)(integer?)
"
Set parent of LyricText to @var{which-note-head} specified by a number.
The NoteHeads are numbered 1 2 3 ... as typed.
not 0 1 2 ...
"
#{
\once \override LyricText.before-line-breaking =
#(lambda (grob)
(let* ((note-column (ly:grob-parent grob X))
(note-heads-list
(ly:grob-array->list
(ly:grob-object note-column 'note-heads)))
(count-note-heads (length note-heads-list)))
(if (> which-note-head count-note-heads)
(ly:warning "Can't find specified note-head - ignoring")
(set! (ly:grob-parent grob X)
(list-ref note-heads-list (- which-note-head 1))))))
#})
alignOnFirstNote = \once \setOtherParent #1
%% c/p from gregorian.ly
divisioMinima = {
\once \override BreathingSign.stencil = #ly:breathing-sign::divisio-minima
% Workaround: add padding. Correct fix would be spacing engine handle this.
\once \override BreathingSign.minimum-X-extent = #'(-1.0 . 0.0)
\once \override BreathingSign.minimum-Y-extent = #'(-2.5 . 2.5)
\breathe
}
\paper {
indent = 0
ragged-last = ##t
}
\layout {
\omit Stem
\context {
\Score
defaultBarType = #""
\omit TimeSignature
\override SpacingSpanner.base-shortest-duration = #(ly:make-moment 1/16)
\remove "Bar_number_engraver"
}
\context {
\Lyrics
\override LyricText.X-align-on-main-noteheads = ##f
\override LyricText.font-size = #-1
}
}
\header {
piece = \markup\override-lines #'(baseline-skip . 1) {
\column {
\line { "EHRE SEI DEM VATER" \italic "(Gloria Patri)" }
\draw-hline
\vspace #1
}
}
opus = "(EGB 26,38)"
}
chant = \relative c'' {
\key f\major
\foo { c c } a bes c c d c \foo { c c } \divisioMinima
c a \foo { bes bes } g g \foo { f f } \divisioMinima
\bar ""
\break
c' c f, bes \foo { a g } \foo { a a } \divisioMinima
c c d d \foo { c c } \divisioMinima
c c bes a g \bar "" \break
a \foo { bes a } g \foo { a a } \divisioMinima
\foo { c a f bes a g f g f } \foo { f, f }
\bar "||"
}
verba = \lyricmode {
\set stanza = "G/Ch:"
Ehr sei dem Va -- ter und dem Sohn
und dem Hei -- li -- gen Geist,
wie es war im An -- fang,
jetzt und im -- mer -- dar
und von E -- wig -- keit zu \alignOnFirstNote E -- wig -- keit.
\alignOnFirstNote
A -- men.
}
\score {
<<
\new Voice = "melody" \chant
\new Lyrics \lyricsto "melody" \verba
>>
}
Sollte sowohl mit \relative, \absolute als auch mit \transpose funktionieren.
Man braucht allerdings eine neuere devel-Version.
HTH,
Harm