lilypond-user
[Top][All Lists]
Advanced

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

Re: Extending Lilypond's chord vocabulary PLUS Help on command definitio


From: Carl Sorensen
Subject: Re: Extending Lilypond's chord vocabulary PLUS Help on command definition
Date: Wed, 9 Nov 2011 17:21:32 +0000
User-agent: Microsoft-MacOutlook/14.13.0.110805


On 11/9/11 9:49 AM, "Tim McNamara" <address@hidden> wrote:

>
>On Nov 9, 2011, at 8:45 AM, Robert Schmaus wrote:
>
>> Hi Jim & everyone,
>> 
>> I'm currently preparing a macro file "jazz-chords.ily" which contains
>>(my version of) common jazz chord notation. I will share that file as
>>soon as it is in a usable state.
>> 
>> However, right now, I just worked out how to define the markups of each
>>chord by defining the markup explicitly. I would like to do that more
>>elegantly by defining markup commands.
>> If, e.g., I would like to create a command \jcRaise such that the
>>expression
>> 
>> \markup{ \raise #1.5 {\tiny "Maj9"} }
>> 
>> would just become
>> \jcRaise{ "Maj9" }
>> 
>> or possibly
>> \markup\jcRaise{ "Maj9" }
>> 
>> how do I define the markup command for this? I checked the manual here
>> 
>>http://lilypond.org/doc/v2.12/Documentation/user/lilypond/Markup-construc
>>tion-in-Scheme#Markup-construction-in-Scheme
>> 
>> and tried to build such a function accordingly, but didn't really get
>>anywhere. I guess I would need to start somewhere more basic.
>
>Would the #(define-music-function work for this?

jcRaise = 
#(define-markup-function (props layout myMarkup) (ly:markup?)

   (interpret-markup layout props
   #{
      \markup \raise #1.5 {\tiny $myMarkup}
    #}))

I haven't tested it, but it should work.  See

http://lilypond.org/doc/v2.14/Documentation/extending/new-markup-command-de
finition


For more information.

HTH,

Carl




reply via email to

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