lilypond-user
[Top][All Lists]
Advanced

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

Move markup relative to parent from inside define-markup-command?


From: Nick Payne
Subject: Move markup relative to parent from inside define-markup-command?
Date: Fri, 23 Mar 2012 13:29:21 +1100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120310 Thunderbird/11.0

I'm using define-markup-command to simplify the indication of barring for a single chord, but what I have at the moment defaults to being centred on the note, and the vertical line indicating how many strings to cover is overlaid by the notehead unless the markup position is tweaked. Is it possible, if I have an additional numeric argument for the amount of shift needed, to apply that shift from inside the define-markup-command rather than having to use an external tweak? This is what I have at the moment:

\version "2.15.32"

#(define-markup-command (mbarre layout props fretnum vdrop) (markup? number?)
    (interpret-markup layout props
#{ \markup \small \bold { \concat { \postscript #(string-append "0.1 setlinewidth 0.7 -0.5 moveto 0 -" (number->string vdrop) " rlineto 0.5 0 rlineto stroke") $fretnum } } #}
    )
)

\relative c'' {
<e c>4^\markup { \mbarre "CV" #2.3 } <e c>-\tweak #'extra-offset #'(-1.5 . 0)^\markup { \mbarre "CV" #2.3 }
}

Nick

Attachment: test.png
Description: PNG image


reply via email to

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