lilypond-user
[Top][All Lists]
Advanced

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

Re: columns in lyrics


From: Jan-Peter Voigt
Subject: Re: columns in lyrics
Date: Thu, 24 Nov 2011 15:05:59 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.23) Gecko/20110921 Lightning/1.0b2 Thunderbird/3.1.15

Hey Mike,

here's one, that splits up strings to columns. So its the other way round than your bonus point part. But it should save typing, because

\markup \column { foo bar } \markup \column { who what } \markup \column { hello world }

turns to

\cols { "foo bar" "who what" "hello world" }

--snip--
\version "2.14.2"

#(define-public cols (define-music-function (parser location lyrics) (ly:music?)
    (music-map
      (lambda (m)
              (begin
                ;; catch every Lyric Event
                (if (equal? (ly:music-property m 'name) 'LyricEvent)
                    ;; set text to column markup using string-split (and markup->string for safety)
                    (let ((syl (string-split (markup->string (ly:music-property m 'text)) #\ )))
                         (ly:music-set-property! m 'text (make-center-column-markup syl)) ; you might want to use another one like make-column-markup
                ))
                m))
      lyrics)))


\relative c'' {
  c2 b a
} \addlyrics {
  \cols { "foo bar" "who what" "hello world" }
}
--snip--

Am 23.11.2011 15:17, schrieb address@hidden:
hey all,

i have a lot of lyrics in a row where i need them to appear as :

\markup \column { foo bar } \markup \column { who what } \markup \column { hello world }

To avoid typing the markup command every time, I'd like to do:

\command #"foo" #"bar" \command #"who" #"what" \command #"hello" #"world"

I'm having trouble figuring out how to implement this as a music function that'll work in the Lyric context - any suggestions?

For bonus points, what I'd love is:

\command #"foo who hello" #"bar what world" that'd automatically split out n lyrics in column form, each containing 2 lyrics a piece (n being 3 in this example).

Why not just use
  <<
    \new Lyrics \lyricmode { foo who hello }
    \new Lyrics \lyricmode { bar what world }
  >>
Well, I'm sure, you have good reason.

HTH and cheers,
Jan-Peter


Cheers,
MS
_______________________________________________ lilypond-user mailing list address@hidden https://lists.gnu.org/mailman/listinfo/lilypond-user


reply via email to

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