Helge Kruse <helge.kruse-nos...@gmx.net> 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


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

Reply via email to