lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Stanzas over staves


From: Partitura Organum
Subject: Re: Stanzas over staves
Date: Thu, 19 Apr 2018 21:09:15 +0200
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0



On 19-4-2018 00:30, Simon Albrecht wrote:
You have to quote line-width because it’s a symbol, not a variable. That can also be done in a verbose or in a practical way:
\override #(cons 'line-width dim)
or
\override #(cons (quote line-width) dim).
The two are exactly equivalent.

The second is new for me, nice to learn. The first form I did try (after having found out about cons). It does compile, but it does not work. Somehow, inside a scheme function the 'line-width argument does not point to the actual line-width property of the markup being constructed.

I.e. this does work as intended:

scoreAUpperHarpI = \relative c'' {
    \once\override TextScript.extra-spacing-width = #'(0 . 0)
    s1^\markup
     \with-dimensions #'(0 . 22) #'(0 . 0)
     \whiteout \override #'(line-width . 20)
     \translate #'(0 . 0)
     \wordwrap   { Ah, how oft we read or hear of  Boys we almost stand in fear of!  For example, take these stories
   }
}

scoreALowerHarpI = \relative c' { s1  }

scoreAHarpIPart = \new PianoStaff \with {
  instrumentName = "Harfe I"
} <<
  \new Staff = "upper" \scoreAUpperHarpI
  \new Staff = "lower" { \clef bass \scoreALowerHarpI }
>>

\score {
  <<
    \scoreAHarpIPart
  >>
  \layout { }
}


However, when transforming this into a scheme function the line-width and wordwrap do not work as intended:

narrator=#(define-music-function
  (parser location dim text) (number? string?)

   #{
      \override TextScript.extra-spacing-width = #'(0 . -0.50)
     s1^\markup
      \with-dimensions #(cons 0 dim) #'(0 . 0)
      \whiteout
      \override #(cons (quote line-width) dim)
      \translate #'(0 . -1.5)
      \wordwrap {  #text }
   #})

scoreAUpperHarpII = \relative c'' {
  \narrator#30 "Of named Max and Moritz, Who, instead of early turning etcetc"
 }

scoreALowerHarpII= \relative c' { s1  }

scoreAHarpIIPart = \new PianoStaff \with {
  instrumentName = "Harfe II"
} <<
  \new Staff = "upper" \scoreAUpperHarpII
  \new Staff = "lower" { \clef bass \scoreALowerHarpII }
>>

\score {
  <<
    \scoreAHarpIIPart
  >>
  \layout { }
}

How should the function be constructued toi make this work an intended?

Regards,
Auke




reply via email to

[Prev in Thread] Current Thread [Next in Thread]