On Nov 24, 2011, at 3:05 PM, Jan-Peter Voigt wrote:
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" }
}