2018-04-19 21:09 GMT+02:00 Partitura Organum <partitura....@gmail.com>: > > > 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 }
The function expects `text' to be a string. So (1) use wordwrap-string (2) without {} > #}) > > 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 > Cheers, Harm _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user