[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Custom Markup Command
From: |
Leo Correia de Verdier |
Subject: |
Re: Custom Markup Command |
Date: |
Wed, 18 Sep 2019 13:21:56 +0200 |
You know there is a better way of writing chords, right?
Anyway, I think this does what you want:
\version "2.19.82"
#(define-markup-command (formatchord layout props text)
(markup?)
(interpret-markup layout props
#{
\markup {
\fontsize #-1
\override #'(font-name . "Georgia Bold")
#text }
#}))
chord = ^\markup \formatchord \etc
\relative c' {
c4 \chord "Am" d e f
}
> 18 sep. 2019 kl. 12:39 skrev <address@hidden> <address@hidden>:
>
> 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
>
> _______________________________________________
> lilypond-user mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/lilypond-user
- Custom Markup Command, sir.teddy.the.first, 2019/09/18
- Re: Custom Markup Command,
Leo Correia de Verdier <=