lilypond-user
[Top][All Lists]
Advanced

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

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


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

On 23/03/12 14:23, David Nalesnik wrote:
Hi Nick,

On Thu, Mar 22, 2012 at 9:29 PM, Nick Payne <address@hidden> wrote:
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? 

Do you mean something like the following (which duplicates the image you've uploaded)?

 \version "2.15.32"

#(define-markup-command (mbarre layout props fretnum vdrop offset) (markup? number? number?)
   (interpret-markup layout props
   #{ 
      \markup \translate #(cons offset 0) \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 "V" #2.3 #0 } <e c>^\markup { \mbarre "V" #2.3 #-1.5 }
}

Thanks. That's exactly what I was after.

Nick

reply via email to

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