[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
AW: Custom Markup Command
From: |
Aron Hanowski |
Subject: |
AW: Custom Markup Command |
Date: |
Wed, 18 Sep 2019 13:27:42 +0200 |
Yeah, I know that there is a better way.
I added the chords to the melody with the "normal" method, but I need this if I
just want to add one single chord to another instrument, without the need to
set up a new chordstaff.
But thanks, that is what I was looking for.
> -----Ursprüngliche Nachricht-----
> Von: Leo Correia de Verdier <address@hidden>
> Gesendet: Mittwoch, 18. September 2019 13:22
> An: address@hidden
> Cc: lilypond-user <address@hidden>
> Betreff: Re: Custom Markup Command
>
> 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