lilypond-user
[Top][All Lists]
Advanced

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

Custom Markup Command


From: sir.teddy.the.first
Subject: Custom Markup Command
Date: Wed, 18 Sep 2019 12:39:17 +0200

Hi all,

I’m trying to create a custom markup command to display text (in my case a chord name, but it could be any text) over a note.

This is what I have so far:

 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\version "2.19.83"

 

#(define-markup-command (chord layout props text)

   (markup?)

   (interpret-markup layout props

     #{

        \markup {

        \fontsize #-1

        \override #'(font-name . "Georgia Bold")

        #text }

     #}))

 

\relative c' {

    c4^\markup \chord "Am" d e f

}

 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 

And it’s working as expected, but my question is: Is it possible to shorten this command any further?

I’d like to be able to call it with a single command (\chord “Am”) instead of “ \markup \chord ‘Am’ “ .

Is this possible?

 

Thanks

 


reply via email to

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