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 19:00:39 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux)

Helge Kruse <address@hidden> writes:

> Am 29.01.2012 11:32, schrieb David Kastrup:
>>> 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' |
>>> }
>>>
>>> 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.
>>
>
> Thanks for reply.
>
> I tried to make minimal examples with this proposal. I am not
> experienced with Scheme, so I don't know why this does not work. I
> append the ly code snippets and Lilypond output at the end.
>
> Your help is very appreciated if there is a solution for this
> convenience approach. But if it is not possible with an appropriate
> effort I admit it's not that important since it's just an
> abbreviation.
>
> Thanks,
> Helge
>
>
> \version "2.15.27"
>
> (define-markup-function (layout props pedal) (markup-list?)
>   (interpret-markup layout props
>     #{ \markup \concat \vcenter #pedal }))
>
> {  a'_\markup \setlever { D\flat } b' c'' d'  }

Several typos.  Try

\version "2.15.27"

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

{  a'_\markup \setlever { D\flat } b' c'' d'  }

I actually am somewhat surprised it needs the braces around #pedal: I
thought I had catered for that in the parser.

> \version "2.15.27"
>
> setlever =
> #(define-event-function (parser location pedal) (markup-list?)
>   #{ _\markup \concat \vcenter #pedal })
>
> {  r4\setlever \markuplist { D\sharp } r4 c'' dis'  }

In a similar vein, a few typos here:

\version "2.15.27"

setlever =
#(define-event-function (parser location pedal) (markup-list?)
  #{ _\markup \concat \vcenter { #pedal } #})

{  r4\setlever \markuplist { D\sharp } r4 c'' dis'  }


I am somewhat disappointed that apparently no other, somewhat more
experienced user bothered trying this out and fixing the rather basic
typos with some experiment, instead relying on developers to spend even
more time for getting this right.

We have a long way to go before we have a working community, and the
recently more popular choice of blaming the developers for that is
myopic, as somebody needs to invest the time for developing LilyPond as
well if users are to profit from it.

-- 
David Kastrup




reply via email to

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