lilypond-user
[Top][All Lists]
Advanced

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

Re: [issue 1482] \caps \fromproperty and markup->string


From: Vaughan McAlley
Subject: Re: [issue 1482] \caps \fromproperty and markup->string
Date: Fri, 7 Oct 2011 12:07:19 +1100

On 7 October 2011 04:39, David Kastrup <address@hidden> wrote:
> Jan-Peter Voigt <address@hidden> writes:
>
>> Am 06.10.2011 um 16:12 schrieb:
>>
>>> Vaughan McAlley <address@hidden> writes:
>>>
>>>> On 7 October 2011 00:12, Jan-Peter Voigt <address@hidden> 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
> address@hidden
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>
>

I can’t comment on the elegance or hackishness of the approaches, but
from an end user point of view if I can write

 \lyrcaps { Et Pa- tr- ia! __  }\

or

\lyricize \markup \caps {Et Pa- tr- ia! }

...I don’t really care what’s buried somewhere in the scm directory.
Ideally lyric markup would work the same as any other markup, but
looking at all that Scheme, it’s obviously a non-trivial problem.

At the moment I’m just happy to have caps displaying without having to
\markup \caps every syllable separately.

Cheers,
Vaughan



reply via email to

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