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 m...@apollinemike.com:
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
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to