bug-lilypond
[Top][All Lists]
Advanced

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

Re: NoteHead X-offset, conflict with ly:grob-relative-coordinate


From: Colin Hall
Subject: Re: NoteHead X-offset, conflict with ly:grob-relative-coordinate
Date: Tue, 11 Dec 2012 01:40:03 +0000
User-agent: Mutt/1.5.21 (2010-09-15)

On Tue, Dec 11, 2012 at 12:37:01AM +0100, Thomas Morley wrote:
> 2012/12/10 Paul Morris <address@hidden>:
> >> I'm not top posting.
> >
> > % All the notes should be moved to the right-hand
> > % side of the stem by overriding their X-offset
> > % property, but something about the "rel-coord"
> > % variable that is set by "ly:grob-relative-coordinate"
> > % prevents this from working as it should.  After
> > % removing that variable it works fine. Setting
> > % X-extent also does not work (this is commented
> > % out below).
> >
> > \version "2.16.1"
> >
> > CustomNoteHeads =
> > #(lambda (grob)
> >   (let* (
> >     (notecol (ly:grob-parent grob 0))
> >     (rel-coord (ly:grob-relative-coordinate grob notecol 0)))
> >     (set! (ly:grob-property grob 'X-offset) 1.251178 )
> >
> >     ;; (set! (ly:grob-property grob 'X-extent) '(0 . 4) ))
> > )
> >
> > \score {
> >   \new Staff
> >     \with {
> >       \override NoteHead #'before-line-breaking = \CustomNoteHeads
> >     }
> >     { c' d' e' f' }
> >   \layout { }
> > }
> 
> Hi Paul,
> 
> please be very careful with the code you post.
> You commented a _needed_ closing bracket.
> 
> Nevertheless, I can't explain why your code doesn't work.
> Speculating, I'd say 'X-offset and 'X-extent are the wrong properties
> with 'before-line-breaking.
> Using 'extra-spacing-width and ly:grob-translate-axis! for offset in
> X-axis seems to work:
> 
> \version "2.16.1"
> 
> CustomNoteHeads =
> #(lambda (grob)
>   (let* (
>     (notecol (ly:grob-parent grob X))
>     (rel-coord (ly:grob-relative-coordinate grob notecol 0)))
> 
>   (ly:grob-set-property! grob 'extra-spacing-width  '(-1 . 1))
>   (ly:grob-translate-axis! grob 1.251178  X)))
> 
> \score {
>   \new Staff
>     \with {
>       \override NoteHead #'before-line-breaking = \CustomNoteHeads
>     }
>     { c' d' e' f' }
>   \layout { }
> }
> 
> 
> But there _is_ something strange with 'X-offset in chords.
> In the examples below _none_ of the tweaks work. But if you uncomment
> the tweak for the _first_ written note of the chord they work _all_.
> 
> \version "2.16.1"
> 
> \relative c' {
>         <
>          %\tweak  #'X-offset #1
>          f
>          \tweak  #'X-offset #2
>          a
>          \tweak  #'X-offset #3
>          c
>         >
>         <
>          %\tweak  #'X-offset #2
>          a
>          \tweak  #'X-offset #1
>          f
>          \tweak  #'X-offset #3
>          c'
>         >
> }
> 
> 
> No idea why.
> 
> 
> Cheers,
>   Harm
>

Thanks for the original report, Paul, and to you also Thomas for
investigating it further.

I'm going to post a link to this on the dev forum and see if we can
identify what the bug is, and then I can create a tracker.

Cheers,
Colin.

-- 

Colin Hall



reply via email to

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