Hello,

I've got a problem: I'm typesetting a Brahms lied where some melismata are only for one stanza and not for the other. Now look at the following example (output attached):

\version "2.19.3"


<< \new Staff <<

\new Voice = "one" { \voiceOne c'4 c' c'8 c' c'4 }

\new Voice = "two" { \voiceTwo s4 s c' s }

>>

\new Lyrics \lyricsto "one" {

foo \set associatedVoice = "two"

foo \set associatedVoice = "one"

bar

bar

}

>>


The associated voice has to be set one syllable early, which I did, only the lyrics "come back" to voice "one" one note early: it should be for the last quaver and not for the second crotchet. It seems to me that the roots of this problem lie very deep. An optimal fix would of course be to make the effect of \set associatedVoice enter immediately rather than one syllable later, but this is probably far away.
Can anyone think of a workaround?


In case someone might ask why this is necessary, I attach what I already have of the entire lied also. The \makeOctaves function is from LSR 445 <http://lsr.di.unimi.it/LSR/Snippet?id=445> and I added it to scm/music-functions.scm or a similar one in order to always have it at hand.


Best regards,

Simon


Attachment: associatedVoice problem.pdf
Description: Adobe PDF document

\version "2.19.3"
\language "deutsch"

#(set-global-staff-size 18)

%{ \satzspiegel definiert das Seiten-
   verhältnis des Satzspiegels 
   (Zeilenlänge:Satzspiegelhöhe).
   % topMarginFactor ist das Verhältnis
   oberer Rand:Papierhöhe.
   % Es wird so berechnet, dass:
   %%% die oberen Ecken des Satz-
   spiegels auf den Diagonalen 
   gedachter Doppelseiten
   %%% und die unteren Ecken auf 
   den Diagonalen der Einzelseite liegen.
   % Daraus folgt bei DIN-Papier-
   formaten, dass das Satzspiegelseiten-
   verhältnis Zeilenlänge:Satzspiegel-
   höhe größer als 1:1,414… (Wurzel
   aus 2) sein muss, und zwar je breiter
   die Seitenränder, desto mehr. %}
satzspiegel = #'(2 . 3)
% Standard 2/3
% Varianten: kleiner sind 5/8 und 3/5
topMarginFactor = #( /
                     (- (cdr satzspiegel) 
                       (* (car satzspiegel) (sqrt 2)))
                     (- (* 4 (cdr satzspiegel)) 
                       (* 3 (car satzspiegel) (sqrt 2))) )

\paper  {
  #(set-paper-size  "a4")
  two-sided = ##f
  top-margin = #(*
                 paper-height
                 topMarginFactor)
  % In den folgenden Verhältnissen
  % steckt wohl die Qualität 
  % dieser Konstruktionsweise…
  bottom-margin = #(* top-margin 2)
  left-margin = #(* top-margin (sqrt 2))
  right-margin = #(* top-margin (sqrt 2))
  fonts = #(make-pango-font-tree
            "Linux Libertine O"
            "Linux Biolinum O"
            "Ubuntu Mono"
            (/ (* staff-height pt) 2.5))
  
}

\header {
  title = "Es wohnet ein Fiedler"
  composer = "Johannes Brahms (1833–1897)"
  piece = "Original in a"
  opus = "WoO 33, Nr. 36"
}

\layout {
  \context {
    \Score
    \remove "Bar_number_engraver"
  }
  \context {
    \Voice
    \override TextScript.whiteout = ##t
    \override TextScript.layer = 5
    \consists "Melody_engraver"
    \override Stem #'neutral-direction = #'()
  }
}

ru = #(define-music-function
       (parser location num mus)
       (number? ly:music?)
       #{ \repeat unfold $num $mus #} )
leftLyr = \once\override LyricText.self-alignment-X = #LEFT

diff = #(define-music-function
         (parser location mus1 mus2)
         (ly:music? ly:music?)
         #{ << { \voiceOne $mus1 \oneVoice }
               \context Voice = "aux" { \voiceTwo $mus2 } >> #} )

alt = #(define-music-function
        (parser location lyr)
        (ly:music?)
        #{ \set associatedVoice = "aux"
           $lyr
           \set associatedVoice = "voice" #} )

global = {
  \key c \major
  \time 4/4
  \partial 4
  \tempo "Lebhaft, doch nicht zu rasch"
}

voice = \transpose a fis \relative c'' {
  \global
  \autoBeamOff
  \repeat volta 2 {
    e,4
    a gis8 gis a4 h8 h
    c4 h8 a h4 r8 e,
    a4 gis8 gis a4 h8 h
    c4 \diff { h8[ a] } { h8 a } h4 e,8 g
    c4 \diff { c8 c } { c4 } g4 r8 e'
    e[ d] \diff { d[ c] } { d c } h4 r8 h |
    c4 \diff { h8[ a] } { h a } gis4 r8 e |
    \diff { a gis a h c[ h] a } { a[ gis] a[ h] c[ h a] } d |
    c8[ h] a gis }
  \alternative {
    { a4 r | r2 r4 }
    { a4 r } }
  R1 r2 r4 \bar ".|:-||"
  
  %\pageBreak
  
}

auxVoice = \relative {
  \autoBeamOff
  \repeat volta 2 { s4 s1*8 s2 }
  \alternative { { s4*5 } { s2 } }
  s4*7
  % st. 3+4
  %\repeat volta 2 { s4 s1*9 }
  %\alternative { { s4*3 } { s4*3 } }
}

verseOne = \lyricmode {
  \set stanza = "1."
  Es woh -- net ein Fied -- ler zu Frank -- furt am Main,
  der keh -- ret von lus -- ti -- ger Ze -- che heim,
  und er trat auf den Markt,
  was schaut er dort,
  was schaut er dort?
  Der schö -- nen Frau -- en schmaus -- ten gar viel an dem Ort.
  \skip 1
}

verseTwo = \lyricmode {
  \set stanza = "2."
  Du buck -- lich -- ter Fied -- ler, nun fied -- le uns auf,
  wir wol -- len dir zah -- len des \alt { Loh -- nes } voll -- auf!
  Ei -- nen \alt { fei -- } nen Tanz,
  \alt { be -- hen -- de } ge -- geigt,
  be -- \alt { hen -- de } ge -- geigt,
  Wal -- pur -- gis Nacht __ wir heu -- er ge -- \skip 1 feir’t.
}

right = \transpose a fis \relative c'' {
  \global
  \dynamicDown
  \clef alto
  \repeat volta 2 {
    e,4-. 
    << { r8 a r gis r a r h
         r c r a r gis4.
         r8 a r gis r a r h
         r c r a r gis r  c
         r g4.~ g4 r8  e'
         r g, r c r h4.
         r8 e, r a r gis4. }
       { s8 e s e s e s f
         s a s e s e4.
         s8 e s e s e s f
         s a s e s e s e
         s e4.~ e4 s8 c'
         s e, s g s g4.
         s8 c, s e s e4. }
       { s8 c s h s c s d
         s e s c s h4.
         s8 c s h s c s d
         s e s c s h s c
         s c4.~ c4 s8 e
         s g, s c s d4.
         s8 e, s a s h4. }
    >>
    <d a'>4.  ( <f h>8) << { c'4( a8) } \\ { e4. } >> <f d a>8-. |
    <e c a>-. r <gis e d>-. r 
  }
  \alternative {
    { <a e c>4 \clef treble r8 <a' f a,>-.
      <e c a e>4-. <gis, e>-. r }
    { <a e c>8-. r <e' c~>4^( }
  }
  <fis c>4) <g h,>2-> <f d a>4 |
  <e~ a,>2->_( <e gis,>4)
}

dyn = \relative {
  \repeat volta 2 {
    s4\mf
    s1*3
    s2. s1\f
    s\p s s4
    s1\f s2 }
  \alternative { 
    { s4. s8\f | s2. }
    { s4 s-\markup { \dynamic f \italic { ben marcato } } }
  }
  s4*7
  % stanzas 3+4
  
}

left = \transpose a fis \relative c' {
  \global
  \repeat volta 2 {
    \ottava #-1
    \set Staff.ottavation = #"ad lib. col 8vb"
    e,,4-.
    a,-. e'-. a-. d,-.
    a-. c-. e2
    a,4-. e'-. a-. d,-.
    a-. c-. e-. \ottava #0 <c' g'>-. ->
    <c, g'>2.-> <c' g'>4
    \makeOctaves #-1 { c-. e-. g2
                       a,4-. c-. e2 }
    << { a2 a4. } \\ { f4.( d8) a4( c8) } >>
    \makeOctaves #-1 { h8-. |
                       e-. r e,-. r }
  }
  \alternative {
    { <a a,>4 r8 <d d,>-. |
      <e e,>4-. <e h' d> r }
    { <a, a,>8-. r \clef alto <e''' a,>4-> }
  }
  <a, d,>-> <d, g,>2-> <a' d,>4-> |
  <e h e,> \clef bass e,,2
}

\score {
  <<
    \new Staff << 
      \new Voice = "voice" \voice
      \new Voice = "aux" \auxVoice
    >>
    \new Lyrics \lyricsto "voice" \verseOne
    \new Lyrics \lyricsto "voice" \verseTwo
    \new PianoStaff <<
      \new Staff = "right" \right
      \new Dynamics \dyn
      \new Staff = "left" { \clef bass \left }
    >>
  >>
  \layout { }
}
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to