lilypond-user
[Top][All Lists]
Advanced

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

Re: Abbreviation for markup?


From: David Kastrup
Subject: Re: Abbreviation for markup?
Date: Sun, 29 Jan 2012 11:32:49 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux)

Helge Kruse <address@hidden> writes:

> Is there a way with a music-function or something similar to define an
> abbreviation?
>
> {
>
>   r4_\markup \concat \vcenter { D\sharp } r4 c'' dis' |
>
>   a'_\markup \concat \vcenter { D\flat } b' c'' d' |
>
> }
>
>
> Each to time I add the harp lever (or pedal) instruction I write much
> more levers than music. I would like to do it somehow like this:
>
> {
>   r2\setlever{ D\sharp } r4 c'' dis' |
>
>   a'\setlever{ D\flat } b' c'' d' |
>
> }

You have the crossing of two domains here: music and markup.  Having a
markup command argument is only possible inside of markup, so there are
two possibilities of syntax:

r2\setlever \markuplist { D\sharp }

(note that the application of concat and vcenter suggests a markup list
being in use here).

r2_\markup \setlever { D\sharp }

and actually, since the namespace of markup functions and music
functions is separate, you could support _both_ at the same time, one
with music (event) function, one with a markup function.  This would be
something like
setlever =
#(define-event-function (parser location pedal) (markup-list?)
  #{ _\markup \concat \vcenter #pedal })

for the event variant (#1), and

(define-markup-function (layout props pedal) (markup-list?)
  (interpret-markup layout props
    #{ \markup \concat \vcenter #pedal }))

for the markup function variant (#2).

So you can't avoid switching into markup mode either for your command
itself, or at least for its argument explicitly.

-- 
David Kastrup




reply via email to

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