[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: NoteHead X-offset, conflict with ly:grob-relative-coordinate
From: |
Paul Morris |
Subject: |
Re: NoteHead X-offset, conflict with ly:grob-relative-coordinate |
Date: |
Mon, 10 Dec 2012 20:46:04 -0500 |
On Dec 10, 2012, at 6:37 PM, Thomas Morley <address@hidden> 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.
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
- NoteHead X-offset, conflict with ly:grob-relative-coordinate, Paul Morris, 2012/12/09
- Re: NoteHead X-offset, conflict with ly:grob-relative-coordinate, Thomas Morley, 2012/12/10
- Re: NoteHead X-offset, conflict with ly:grob-relative-coordinate, Colin Hall, 2012/12/10
- Re: NoteHead X-offset, conflict with ly:grob-relative-coordinate, Keith OHara, 2012/12/10
- Re: NoteHead X-offset, conflict with ly:grob-relative-coordinate, Colin Hall, 2012/12/11
- Re: NoteHead X-offset, conflict with ly:grob-relative-coordinate, Paul Morris, 2012/12/11
- Re: NoteHead X-offset, conflict with ly:grob-relative-coordinate, Thomas Morley, 2012/12/11
- Re: NoteHead X-offset, conflict with ly:grob-relative-coordinate, Paul Morris, 2012/12/11
- Re: NoteHead X-offset, conflict with ly:grob-relative-coordinate, Colin Hall, 2012/12/14
Re: NoteHead X-offset, conflict with ly:grob-relative-coordinate,
Paul Morris <=