On Dec 10, 2012, at 6:37 PM, Thomas Morley <[email protected]> 
wrote:

> 2012/12/10 Paul Morris <[email protected]>:
>>> 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.

Hi Harm,  Oh no!  I winced when I read that...  My apologies and thank you for 
your patience with my rookie mistake(s).  I'm still getting used to typical 
scheme formatting (for closing brackets), and this is twice now that I've let 
editing code after pasting it into an email get the best of me (ironically, in 
an attempt to communicate more clearly).  So no more of that, and I will make 
sure to double check in the future.


> 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 { }
> }

Thanks for the tip on these other ways to get the same results.


> 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.

Well, I'm glad I haven't sounded a false alarm in my effort to help.  It did 
seem like a bug, although an obscure and probably not very consequential one.

Cheers,
-Paul


_______________________________________________
bug-lilypond mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-lilypond

Reply via email to