Jan-Peter Voigt <jp.vo...@gmx.de> writes: > Am 06.10.2011 um 16:12 schrieb: > >> Vaughan McAlley <vaug...@mcalley.net.au> writes: >> >>> On 7 October 2011 00:12, Jan-Peter Voigt <jp.vo...@gmx.de> wrote: >>>> Hi Vaughan, >>>> >>>> I introduced the define-lyric-markup method a few mails ago, so it is no >>>> lilypond standard. >>>> Here I added methods to your file and used the recaps command, I introduced >>>> in a revious mail, to capsify markups recursively whatching out for >>>> \fromproperty. >> >>> Thank you! It worked first time! I hope it becomes part of standard >>> Lilypond... >> >> Personally, I think this is far too hackish for a user interface. It >> would make more sense to create a music function that just converts a >> markup list into lyric events, then use \lyricsto or \addlyrics for >> tacking the rhythm on. > > why do you think it is too hackish? If it gets lily-standard, all > visible to the user is something like this: > If he wants a non-pre-defined lyric-markup: > lyrcaps = #(define-lyric-markup (markup #:recaps #:fromproperty 'lyric:text)) > > and then \addlyrics/\lyricmode { sing \lyrcaps { sing sing sing } }
First he needs a special markup function recaps that recursively calls \caps and does nothing else. This is rather hard to define for a user. What if he wants italics instead? Then he needs to jiggle this together with some magic #:fromproperty markup, then it mixes with something else. I mean, get real: how would he ever manage to italize lyrics that way? > Most of the scheme stuff is to overcome the issue with caps and > fromproperty. It is a workaround to get the desired result in the > current stable version. "overcome the issue", "workaround". If that is not the definition of a hack... Now let's take a look at my approach. lyricize = #(define-music-function (parser location mlist) (markup?) (define (sig m) (if (string? m) m (and (proper-list? m) (= (length m) 2) (sig (cadr m))))) (make-sequential-music (map (lambda (m) (let ((s (sig m))) (cond ((equal? s "--") (make-music 'HyphenEvent 'origin location)) ((equal? s "__") (make-music 'ExtenderEvent 'origin location)) (else (make-music 'LyricEvent 'text (list (car mlist) (list m)) 'origin location 'duration (ly:make-duration 0 0)))))) (cadr mlist)))) \new Staff << \new Voice { c'2. d'4 e'2 c'2} \addlyrics \notemode {\lyricize \markup \italic {A- ve Ma- ter! }} \addlyrics \notemode {\lyricize \markup \caps {Et Pa- tr- ia! }} \addlyrics \notemode {\lyricize \markup \caps \fontsize #3 {A- "" men __ }} >> The user interface is still clunky due to deficiencies in the parser (I have not yet looked at lyricsmode), so the \notemode is a nuisance, and a few other ughs. But it requires far less specialized macros and stuff. Personally, I'd prefer it if lyricsmode just accepted \markuplines and spliced all its elements individually into a music list. But I can't do everything at once. -- David Kastrup _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user